import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { ResourceHealthMetadataOperations } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { WebSiteManagementClient } from "../webSiteManagementClient" ; import { ResourceHealthMetadata , ResourceHealthMetadataListNextOptionalParams , ResourceHealthMetadataListOptionalParams , ResourceHealthMetadataListByResourceGroupNextOptionalParams , ResourceHealthMetadataListByResourceGroupOptionalParams , ResourceHealthMetadataListBySiteNextOptionalParams , ResourceHealthMetadataListBySiteOptionalParams , ResourceHealthMetadataListBySiteSlotNextOptionalParams , ResourceHealthMetadataListBySiteSlotOptionalParams , ResourceHealthMetadataListResponse , ResourceHealthMetadataListByResourceGroupResponse , ResourceHealthMetadataListBySiteResponse , ResourceHealthMetadataGetBySiteOptionalParams , ResourceHealthMetadataGetBySiteResponse , ResourceHealthMetadataListBySiteSlotResponse , ResourceHealthMetadataGetBySiteSlotOptionalParams , ResourceHealthMetadataGetBySiteSlotResponse , ResourceHealthMetadataListNextResponse , ResourceHealthMetadataListByResourceGroupNextResponse , ResourceHealthMetadataListBySiteNextResponse , ResourceHealthMetadataListBySiteSlotNextResponse } from "../models" ; /** Class containing ResourceHealthMetadataOperations operations. */ export class ResourceHealthMetadataOperationsImpl implements ResourceHealthMetadataOperations { private readonly client : WebSiteManagementClient ; param client constructor ( client ) { this . client = client ; } param options public list ( options ? ) { const iter = this . listPagingAll ( options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listPagingPage ( options ) ; } } ; } private async * listPagingPage ( options ? ) { let result = await this . _list ( options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listNext ( continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listPagingAll ( options ? ) { for await ( const page of this . listPagingPage ( options ) ) { yield * page ; } } param resourceGroupName param options public listByResourceGroup ( resourceGroupName , options ? ) { const iter = this . listByResourceGroupPagingAll ( resourceGroupName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listByResourceGroupPagingPage ( resourceGroupName , options ) ; } } ; } private async * listByResourceGroupPagingPage ( resourceGroupName , options ? ) { let result = await this . _listByResourceGroup ( resourceGroupName , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listByResourceGroupNext ( resourceGroupName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listByResourceGroupPagingAll ( resourceGroupName , options ? ) { for await ( const page of this . listByResourceGroupPagingPage ( resourceGroupName , options ) ) { yield * page ; } } param resourceGroupName param name param options public listBySite ( resourceGroupName , name , options ? ) { const iter = this . listBySitePagingAll ( resourceGroupName , name , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listBySitePagingPage ( resourceGroupName , name , options ) ; } } ; } private async * listBySitePagingPage ( resourceGroupName , name , options ? ) { let result = await this . _listBySite ( resourceGroupName , name , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listBySiteNext ( resourceGroupName , name , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listBySitePagingAll ( resourceGroupName , name , options ? ) { for await ( const page of this . listBySitePagingPage ( resourceGroupName , name , options ) ) { yield * page ; } } param resourceGroupName param name param slot param options public listBySiteSlot ( resourceGroupName , name , slot , options ? ) { const iter = this . listBySiteSlotPagingAll ( resourceGroupName , name , slot , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listBySiteSlotPagingPage ( resourceGroupName , name , slot , options ) ; } } ; } private async * listBySiteSlotPagingPage ( resourceGroupName , name , slot , options ? ) { let result = await this . _listBySiteSlot ( resourceGroupName , name , slot , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listBySiteSlotNext ( resourceGroupName , name , slot , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listBySiteSlotPagingAll ( resourceGroupName , name , slot , options ? ) { for await ( const page of this . listBySiteSlotPagingPage ( resourceGroupName , name , slot , options ) ) { yield * page ; } } param options private _list ( options ? ) { return this . client . sendOperationRequest ( { options } , listOperationSpec ) ; } param resourceGroupName param options private _listByResourceGroup ( resourceGroupName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , options } , listByResourceGroupOperationSpec ) ; } param resourceGroupName param name param options private _listBySite ( resourceGroupName , name , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , name , options } , listBySiteOperationSpec ) ; } param resourceGroupName param name param options getBySite ( resourceGroupName , name , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , name , options } , getBySiteOperationSpec ) ; } param resourceGroupName param name param slot param options private _listBySiteSlot ( resourceGroupName , name , slot , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , name , slot , options } , listBySiteSlotOperationSpec ) ; } param resourceGroupName param name param slot param options getBySiteSlot ( resourceGroupName , name , slot , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , name , slot , options } , getBySiteSlotOperationSpec ) ; } param nextLink param options private _listNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , listNextOperationSpec ) ; } param resourceGroupName param nextLink param options private _listByResourceGroupNext ( resourceGroupName , nextLink , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , nextLink , options } , listByResourceGroupNextOperationSpec ) ; } param resourceGroupName param name param nextLink param options private _listBySiteNext ( resourceGroupName , name , nextLink , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , name , nextLink , options } , listBySiteNextOperationSpec ) ; } param resourceGroupName param name param slot param nextLink param options private _listBySiteSlotNext ( resourceGroupName , name , slot , nextLink , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , name , slot , nextLink , options } , listBySiteSlotNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const listOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Web/resourceHealthMetadata" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ResourceHealthMetadataCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listByResourceGroupOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/resourceHealthMetadata" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ResourceHealthMetadataCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listBySiteOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ResourceHealthMetadataCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . name ] , headerParameters : [ Parameters . accept ] , serializer } ; const getBySiteOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata/default" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ResourceHealthMetadata } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . name ] , headerParameters : [ Parameters . accept ] , serializer } ; const listBySiteSlotOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ResourceHealthMetadataCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . name , Parameters . slot ] , headerParameters : [ Parameters . accept ] , serializer } ; const getBySiteSlotOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata/default" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ResourceHealthMetadata } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . name , Parameters . slot ] , headerParameters : [ Parameters . accept ] , serializer } ; const listNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ResourceHealthMetadataCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ; const listByResourceGroupNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ResourceHealthMetadataCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ; const listBySiteNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ResourceHealthMetadataCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . name , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ; const listBySiteSlotNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ResourceHealthMetadataCollection } , default : { bodyMapper : Mappers . DefaultErrorResponse } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . name , Parameters . nextLink , Parameters . slot ] , headerParameters : [ Parameters . accept ] , serializer } ;