import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { ProximityPlacementGroups } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { ComputeManagementClient } from "../computeManagementClient" ; import { ProximityPlacementGroup , ProximityPlacementGroupsListBySubscriptionNextOptionalParams , ProximityPlacementGroupsListBySubscriptionOptionalParams , ProximityPlacementGroupsListByResourceGroupNextOptionalParams , ProximityPlacementGroupsListByResourceGroupOptionalParams , ProximityPlacementGroupsCreateOrUpdateOptionalParams , ProximityPlacementGroupsCreateOrUpdateResponse , ProximityPlacementGroupUpdate , ProximityPlacementGroupsUpdateOptionalParams , ProximityPlacementGroupsUpdateResponse , ProximityPlacementGroupsDeleteOptionalParams , ProximityPlacementGroupsGetOptionalParams , ProximityPlacementGroupsGetResponse , ProximityPlacementGroupsListBySubscriptionResponse , ProximityPlacementGroupsListByResourceGroupResponse , ProximityPlacementGroupsListBySubscriptionNextResponse , ProximityPlacementGroupsListByResourceGroupNextResponse } from "../models" ; /** Class containing ProximityPlacementGroups operations. */ export class ProximityPlacementGroupsImpl implements ProximityPlacementGroups { private readonly client : ComputeManagementClient ; param client constructor ( client ) { this . client = client ; } param options public listBySubscription ( options ? ) { const iter = this . listBySubscriptionPagingAll ( options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listBySubscriptionPagingPage ( options ) ; } } ; } private async * listBySubscriptionPagingPage ( options ? ) { let result = await this . _listBySubscription ( options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listBySubscriptionNext ( continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listBySubscriptionPagingAll ( options ? ) { for await ( const page of this . listBySubscriptionPagingPage ( 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 proximityPlacementGroupName param parameters param options createOrUpdate ( resourceGroupName , proximityPlacementGroupName , parameters , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , proximityPlacementGroupName , parameters , options } , createOrUpdateOperationSpec ) ; } param resourceGroupName param proximityPlacementGroupName param parameters param options update ( resourceGroupName , proximityPlacementGroupName , parameters , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , proximityPlacementGroupName , parameters , options } , updateOperationSpec ) ; } param resourceGroupName param proximityPlacementGroupName param options delete ( resourceGroupName , proximityPlacementGroupName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , proximityPlacementGroupName , options } , deleteOperationSpec ) ; } param resourceGroupName param proximityPlacementGroupName param options get ( resourceGroupName , proximityPlacementGroupName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , proximityPlacementGroupName , options } , getOperationSpec ) ; } param options private _listBySubscription ( options ? ) { return this . client . sendOperationRequest ( { options } , listBySubscriptionOperationSpec ) ; } param resourceGroupName param options private _listByResourceGroup ( resourceGroupName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , options } , listByResourceGroupOperationSpec ) ; } param nextLink param options private _listBySubscriptionNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , listBySubscriptionNextOperationSpec ) ; } param resourceGroupName param nextLink param options private _listByResourceGroupNext ( resourceGroupName , nextLink , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , nextLink , options } , listByResourceGroupNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const createOrUpdateOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" , httpMethod : "PUT" , responses : { 200 : { bodyMapper : Mappers . ProximityPlacementGroup } , 201 : { bodyMapper : Mappers . ProximityPlacementGroup } } , requestBody : Parameters . parameters2 , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . proximityPlacementGroupName ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const updateOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" , httpMethod : "PATCH" , responses : { 200 : { bodyMapper : Mappers . ProximityPlacementGroup } } , requestBody : Parameters . parameters3 , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . proximityPlacementGroupName ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const deleteOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" , httpMethod : "DELETE" , responses : { 200 : { } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . proximityPlacementGroupName ] , serializer } ; const getOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ProximityPlacementGroup } } , queryParameters : [ Parameters . apiVersion , Parameters . includeColocationStatus ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . proximityPlacementGroupName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listBySubscriptionOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ProximityPlacementGroupListResult } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listByResourceGroupOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ProximityPlacementGroupListResult } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listBySubscriptionNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ProximityPlacementGroupListResult } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ; const listByResourceGroupNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ProximityPlacementGroupListResult } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ;