import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { DeploymentOperations } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { ResourceManagementClient } from "../resourceManagementClient" ; import { DeploymentOperation , DeploymentOperationsListAtScopeNextOptionalParams , DeploymentOperationsListAtScopeOptionalParams , DeploymentOperationsListAtTenantScopeNextOptionalParams , DeploymentOperationsListAtTenantScopeOptionalParams , DeploymentOperationsListAtManagementGroupScopeNextOptionalParams , DeploymentOperationsListAtManagementGroupScopeOptionalParams , DeploymentOperationsListAtSubscriptionScopeNextOptionalParams , DeploymentOperationsListAtSubscriptionScopeOptionalParams , DeploymentOperationsListNextOptionalParams , DeploymentOperationsListOptionalParams , DeploymentOperationsGetAtScopeOptionalParams , DeploymentOperationsGetAtScopeResponse , DeploymentOperationsListAtScopeResponse , DeploymentOperationsGetAtTenantScopeOptionalParams , DeploymentOperationsGetAtTenantScopeResponse , DeploymentOperationsListAtTenantScopeResponse , DeploymentOperationsGetAtManagementGroupScopeOptionalParams , DeploymentOperationsGetAtManagementGroupScopeResponse , DeploymentOperationsListAtManagementGroupScopeResponse , DeploymentOperationsGetAtSubscriptionScopeOptionalParams , DeploymentOperationsGetAtSubscriptionScopeResponse , DeploymentOperationsListAtSubscriptionScopeResponse , DeploymentOperationsGetOptionalParams , DeploymentOperationsGetResponse , DeploymentOperationsListResponse , DeploymentOperationsListAtScopeNextResponse , DeploymentOperationsListAtTenantScopeNextResponse , DeploymentOperationsListAtManagementGroupScopeNextResponse , DeploymentOperationsListAtSubscriptionScopeNextResponse , DeploymentOperationsListNextResponse } from "../models" ; /** Class containing DeploymentOperations operations. */ export class DeploymentOperationsImpl implements DeploymentOperations { private readonly client : ResourceManagementClient ; param client constructor ( client ) { this . client = client ; } param scope param deploymentName param options public listAtScope ( scope , deploymentName , options ? ) { const iter = this . listAtScopePagingAll ( scope , deploymentName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listAtScopePagingPage ( scope , deploymentName , options ) ; } } ; } private async * listAtScopePagingPage ( scope , deploymentName , options ? ) { let result = await this . _listAtScope ( scope , deploymentName , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listAtScopeNext ( scope , deploymentName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listAtScopePagingAll ( scope , deploymentName , options ? ) { for await ( const page of this . listAtScopePagingPage ( scope , deploymentName , options ) ) { yield * page ; } } param deploymentName param options public listAtTenantScope ( deploymentName , options ? ) { const iter = this . listAtTenantScopePagingAll ( deploymentName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listAtTenantScopePagingPage ( deploymentName , options ) ; } } ; } private async * listAtTenantScopePagingPage ( deploymentName , options ? ) { let result = await this . _listAtTenantScope ( deploymentName , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listAtTenantScopeNext ( deploymentName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listAtTenantScopePagingAll ( deploymentName , options ? ) { for await ( const page of this . listAtTenantScopePagingPage ( deploymentName , options ) ) { yield * page ; } } param groupId param deploymentName param options public listAtManagementGroupScope ( groupId , deploymentName , options ? ) { const iter = this . listAtManagementGroupScopePagingAll ( groupId , deploymentName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listAtManagementGroupScopePagingPage ( groupId , deploymentName , options ) ; } } ; } private async * listAtManagementGroupScopePagingPage ( groupId , deploymentName , options ? ) { let result = await this . _listAtManagementGroupScope ( groupId , deploymentName , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listAtManagementGroupScopeNext ( groupId , deploymentName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listAtManagementGroupScopePagingAll ( groupId , deploymentName , options ? ) { for await ( const page of this . listAtManagementGroupScopePagingPage ( groupId , deploymentName , options ) ) { yield * page ; } } param deploymentName param options public listAtSubscriptionScope ( deploymentName , options ? ) { const iter = this . listAtSubscriptionScopePagingAll ( deploymentName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listAtSubscriptionScopePagingPage ( deploymentName , options ) ; } } ; } private async * listAtSubscriptionScopePagingPage ( deploymentName , options ? ) { let result = await this . _listAtSubscriptionScope ( deploymentName , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listAtSubscriptionScopeNext ( deploymentName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listAtSubscriptionScopePagingAll ( deploymentName , options ? ) { for await ( const page of this . listAtSubscriptionScopePagingPage ( deploymentName , options ) ) { yield * page ; } } param resourceGroupName param deploymentName param options public list ( resourceGroupName , deploymentName , options ? ) { const iter = this . listPagingAll ( resourceGroupName , deploymentName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listPagingPage ( resourceGroupName , deploymentName , options ) ; } } ; } private async * listPagingPage ( resourceGroupName , deploymentName , options ? ) { let result = await this . _list ( resourceGroupName , deploymentName , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listNext ( resourceGroupName , deploymentName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listPagingAll ( resourceGroupName , deploymentName , options ? ) { for await ( const page of this . listPagingPage ( resourceGroupName , deploymentName , options ) ) { yield * page ; } } param scope param deploymentName param operationId param options getAtScope ( scope , deploymentName , operationId , options ? ) { return this . client . sendOperationRequest ( { scope , deploymentName , operationId , options } , getAtScopeOperationSpec ) ; } param scope param deploymentName param options private _listAtScope ( scope , deploymentName , options ? ) { return this . client . sendOperationRequest ( { scope , deploymentName , options } , listAtScopeOperationSpec ) ; } param deploymentName param operationId param options getAtTenantScope ( deploymentName , operationId , options ? ) { return this . client . sendOperationRequest ( { deploymentName , operationId , options } , getAtTenantScopeOperationSpec ) ; } param deploymentName param options private _listAtTenantScope ( deploymentName , options ? ) { return this . client . sendOperationRequest ( { deploymentName , options } , listAtTenantScopeOperationSpec ) ; } param groupId param deploymentName param operationId param options getAtManagementGroupScope ( groupId , deploymentName , operationId , options ? ) { return this . client . sendOperationRequest ( { groupId , deploymentName , operationId , options } , getAtManagementGroupScopeOperationSpec ) ; } param groupId param deploymentName param options private _listAtManagementGroupScope ( groupId , deploymentName , options ? ) { return this . client . sendOperationRequest ( { groupId , deploymentName , options } , listAtManagementGroupScopeOperationSpec ) ; } param deploymentName param operationId param options getAtSubscriptionScope ( deploymentName , operationId , options ? ) { return this . client . sendOperationRequest ( { deploymentName , operationId , options } , getAtSubscriptionScopeOperationSpec ) ; } param deploymentName param options private _listAtSubscriptionScope ( deploymentName , options ? ) { return this . client . sendOperationRequest ( { deploymentName , options } , listAtSubscriptionScopeOperationSpec ) ; } param resourceGroupName param deploymentName param operationId param options get ( resourceGroupName , deploymentName , operationId , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , deploymentName , operationId , options } , getOperationSpec ) ; } param resourceGroupName param deploymentName param options private _list ( resourceGroupName , deploymentName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , deploymentName , options } , listOperationSpec ) ; } param scope param deploymentName param nextLink param options private _listAtScopeNext ( scope , deploymentName , nextLink , options ? ) { return this . client . sendOperationRequest ( { scope , deploymentName , nextLink , options } , listAtScopeNextOperationSpec ) ; } param deploymentName param nextLink param options private _listAtTenantScopeNext ( deploymentName , nextLink , options ? ) { return this . client . sendOperationRequest ( { deploymentName , nextLink , options } , listAtTenantScopeNextOperationSpec ) ; } param groupId param deploymentName param nextLink param options private _listAtManagementGroupScopeNext ( groupId , deploymentName , nextLink , options ? ) { return this . client . sendOperationRequest ( { groupId , deploymentName , nextLink , options } , listAtManagementGroupScopeNextOperationSpec ) ; } param deploymentName param nextLink param options private _listAtSubscriptionScopeNext ( deploymentName , nextLink , options ? ) { return this . client . sendOperationRequest ( { deploymentName , nextLink , options } , listAtSubscriptionScopeNextOperationSpec ) ; } param resourceGroupName param deploymentName param nextLink param options private _listNext ( resourceGroupName , deploymentName , nextLink , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , deploymentName , nextLink , options } , listNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const getAtScopeOperationSpec = { path : "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeploymentOperation } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . scope , Parameters . deploymentName , Parameters . operationId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listAtScopeOperationSpec = { path : "/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/operations" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeploymentOperationsListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion , Parameters . top ] , urlParameters : [ Parameters . $host , Parameters . scope , Parameters . deploymentName ] , headerParameters : [ Parameters . accept ] , serializer } ; const getAtTenantScopeOperationSpec = { path : "/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeploymentOperation } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . deploymentName , Parameters . operationId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listAtTenantScopeOperationSpec = { path : "/providers/Microsoft.Resources/deployments/{deploymentName}/operations" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeploymentOperationsListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion , Parameters . top ] , urlParameters : [ Parameters . $host , Parameters . deploymentName ] , headerParameters : [ Parameters . accept ] , serializer } ; const getAtManagementGroupScopeOperationSpec = { path : "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeploymentOperation } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . deploymentName , Parameters . groupId , Parameters . operationId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listAtManagementGroupScopeOperationSpec = { path : "/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeploymentOperationsListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion , Parameters . top ] , urlParameters : [ Parameters . $host , Parameters . deploymentName , Parameters . groupId ] , headerParameters : [ Parameters . accept ] , serializer } ; const getAtSubscriptionScopeOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations/{operationId}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeploymentOperation } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . deploymentName , Parameters . subscriptionId , Parameters . operationId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listAtSubscriptionScopeOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/operations" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeploymentOperationsListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion , Parameters . top ] , urlParameters : [ Parameters . $host , Parameters . deploymentName , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const getOperationSpec = { path : "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeploymentOperation } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . deploymentName , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . operationId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listOperationSpec = { path : "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeploymentOperationsListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion , Parameters . top ] , urlParameters : [ Parameters . $host , Parameters . deploymentName , Parameters . subscriptionId , Parameters . resourceGroupName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listAtScopeNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeploymentOperationsListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion , Parameters . top ] , urlParameters : [ Parameters . $host , Parameters . nextLink , Parameters . scope , Parameters . deploymentName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listAtTenantScopeNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeploymentOperationsListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion , Parameters . top ] , urlParameters : [ Parameters . $host , Parameters . nextLink , Parameters . deploymentName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listAtManagementGroupScopeNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeploymentOperationsListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion , Parameters . top ] , urlParameters : [ Parameters . $host , Parameters . nextLink , Parameters . deploymentName , Parameters . groupId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listAtSubscriptionScopeNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeploymentOperationsListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion , Parameters . top ] , urlParameters : [ Parameters . $host , Parameters . nextLink , Parameters . deploymentName , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DeploymentOperationsListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion , Parameters . top ] , urlParameters : [ Parameters . $host , Parameters . nextLink , Parameters . deploymentName , Parameters . subscriptionId , Parameters . resourceGroupName ] , headerParameters : [ Parameters . accept ] , serializer } ;