import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { ManagementLocks } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { ManagementLockClient } from "../managementLockClient" ; import { ManagementLockObject , ManagementLocksListAtResourceGroupLevelNextOptionalParams , ManagementLocksListAtResourceGroupLevelOptionalParams , ManagementLocksListAtResourceLevelNextOptionalParams , ManagementLocksListAtResourceLevelOptionalParams , ManagementLocksListAtSubscriptionLevelNextOptionalParams , ManagementLocksListAtSubscriptionLevelOptionalParams , ManagementLocksListByScopeNextOptionalParams , ManagementLocksListByScopeOptionalParams , ManagementLocksCreateOrUpdateAtResourceGroupLevelOptionalParams , ManagementLocksCreateOrUpdateAtResourceGroupLevelResponse , ManagementLocksDeleteAtResourceGroupLevelOptionalParams , ManagementLocksGetAtResourceGroupLevelOptionalParams , ManagementLocksGetAtResourceGroupLevelResponse , ManagementLocksCreateOrUpdateByScopeOptionalParams , ManagementLocksCreateOrUpdateByScopeResponse , ManagementLocksDeleteByScopeOptionalParams , ManagementLocksGetByScopeOptionalParams , ManagementLocksGetByScopeResponse , ManagementLocksCreateOrUpdateAtResourceLevelOptionalParams , ManagementLocksCreateOrUpdateAtResourceLevelResponse , ManagementLocksDeleteAtResourceLevelOptionalParams , ManagementLocksGetAtResourceLevelOptionalParams , ManagementLocksGetAtResourceLevelResponse , ManagementLocksCreateOrUpdateAtSubscriptionLevelOptionalParams , ManagementLocksCreateOrUpdateAtSubscriptionLevelResponse , ManagementLocksDeleteAtSubscriptionLevelOptionalParams , ManagementLocksGetAtSubscriptionLevelOptionalParams , ManagementLocksGetAtSubscriptionLevelResponse , ManagementLocksListAtResourceGroupLevelResponse , ManagementLocksListAtResourceLevelResponse , ManagementLocksListAtSubscriptionLevelResponse , ManagementLocksListByScopeResponse , ManagementLocksListAtResourceGroupLevelNextResponse , ManagementLocksListAtResourceLevelNextResponse , ManagementLocksListAtSubscriptionLevelNextResponse , ManagementLocksListByScopeNextResponse } from "../models" ; /** Class containing ManagementLocks operations. */ export class ManagementLocksImpl implements ManagementLocks { private readonly client : ManagementLockClient ; param client constructor ( client ) { this . client = client ; } param resourceGroupName param options public listAtResourceGroupLevel ( resourceGroupName , options ? ) { const iter = this . listAtResourceGroupLevelPagingAll ( resourceGroupName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listAtResourceGroupLevelPagingPage ( resourceGroupName , options ) ; } } ; } private async * listAtResourceGroupLevelPagingPage ( resourceGroupName , options ? ) { let result = await this . _listAtResourceGroupLevel ( resourceGroupName , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listAtResourceGroupLevelNext ( resourceGroupName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listAtResourceGroupLevelPagingAll ( resourceGroupName , options ? ) { for await ( const page of this . listAtResourceGroupLevelPagingPage ( resourceGroupName , options ) ) { yield * page ; } } param resourceGroupName param resourceProviderNamespace param parentResourcePath param resourceType param resourceName param options public listAtResourceLevel ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , options ? ) { const iter = this . listAtResourceLevelPagingAll ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listAtResourceLevelPagingPage ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , options ) ; } } ; } private async * listAtResourceLevelPagingPage ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , options ? ) { let result = await this . _listAtResourceLevel ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listAtResourceLevelNext ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listAtResourceLevelPagingAll ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , options ? ) { for await ( const page of this . listAtResourceLevelPagingPage ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , options ) ) { yield * page ; } } param options public listAtSubscriptionLevel ( options ? ) { const iter = this . listAtSubscriptionLevelPagingAll ( options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listAtSubscriptionLevelPagingPage ( options ) ; } } ; } private async * listAtSubscriptionLevelPagingPage ( options ? ) { let result = await this . _listAtSubscriptionLevel ( options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listAtSubscriptionLevelNext ( continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listAtSubscriptionLevelPagingAll ( options ? ) { for await ( const page of this . listAtSubscriptionLevelPagingPage ( options ) ) { yield * page ; } } param scope param options public listByScope ( scope , options ? ) { const iter = this . listByScopePagingAll ( scope , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listByScopePagingPage ( scope , options ) ; } } ; } private async * listByScopePagingPage ( scope , options ? ) { let result = await this . _listByScope ( scope , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listByScopeNext ( scope , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listByScopePagingAll ( scope , options ? ) { for await ( const page of this . listByScopePagingPage ( scope , options ) ) { yield * page ; } } param resourceGroupName param lockName param parameters param options createOrUpdateAtResourceGroupLevel ( resourceGroupName , lockName , parameters , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , lockName , parameters , options } , createOrUpdateAtResourceGroupLevelOperationSpec ) ; } param resourceGroupName param lockName param options deleteAtResourceGroupLevel ( resourceGroupName , lockName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , lockName , options } , deleteAtResourceGroupLevelOperationSpec ) ; } param resourceGroupName param lockName param options getAtResourceGroupLevel ( resourceGroupName , lockName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , lockName , options } , getAtResourceGroupLevelOperationSpec ) ; } param scope param lockName param parameters param options createOrUpdateByScope ( scope , lockName , parameters , options ? ) { return this . client . sendOperationRequest ( { scope , lockName , parameters , options } , createOrUpdateByScopeOperationSpec ) ; } param scope param lockName param options deleteByScope ( scope , lockName , options ? ) { return this . client . sendOperationRequest ( { scope , lockName , options } , deleteByScopeOperationSpec ) ; } param scope param lockName param options getByScope ( scope , lockName , options ? ) { return this . client . sendOperationRequest ( { scope , lockName , options } , getByScopeOperationSpec ) ; } param resourceGroupName param resourceProviderNamespace param parentResourcePath param resourceType param resourceName param lockName param parameters param options createOrUpdateAtResourceLevel ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , lockName , parameters , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , lockName , parameters , options } , createOrUpdateAtResourceLevelOperationSpec ) ; } param resourceGroupName param resourceProviderNamespace param parentResourcePath param resourceType param resourceName param lockName param options deleteAtResourceLevel ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , lockName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , lockName , options } , deleteAtResourceLevelOperationSpec ) ; } param resourceGroupName param resourceProviderNamespace param parentResourcePath param resourceType param resourceName param lockName param options getAtResourceLevel ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , lockName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , lockName , options } , getAtResourceLevelOperationSpec ) ; } param lockName param parameters param options createOrUpdateAtSubscriptionLevel ( lockName , parameters , options ? ) { return this . client . sendOperationRequest ( { lockName , parameters , options } , createOrUpdateAtSubscriptionLevelOperationSpec ) ; } param lockName param options deleteAtSubscriptionLevel ( lockName , options ? ) { return this . client . sendOperationRequest ( { lockName , options } , deleteAtSubscriptionLevelOperationSpec ) ; } param lockName param options getAtSubscriptionLevel ( lockName , options ? ) { return this . client . sendOperationRequest ( { lockName , options } , getAtSubscriptionLevelOperationSpec ) ; } param resourceGroupName param options private _listAtResourceGroupLevel ( resourceGroupName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , options } , listAtResourceGroupLevelOperationSpec ) ; } param resourceGroupName param resourceProviderNamespace param parentResourcePath param resourceType param resourceName param options private _listAtResourceLevel ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , options } , listAtResourceLevelOperationSpec ) ; } param options private _listAtSubscriptionLevel ( options ? ) { return this . client . sendOperationRequest ( { options } , listAtSubscriptionLevelOperationSpec ) ; } param scope param options private _listByScope ( scope , options ? ) { return this . client . sendOperationRequest ( { scope , options } , listByScopeOperationSpec ) ; } param resourceGroupName param nextLink param options private _listAtResourceGroupLevelNext ( resourceGroupName , nextLink , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , nextLink , options } , listAtResourceGroupLevelNextOperationSpec ) ; } param resourceGroupName param resourceProviderNamespace param parentResourcePath param resourceType param resourceName param nextLink param options private _listAtResourceLevelNext ( resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , nextLink , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , resourceProviderNamespace , parentResourcePath , resourceType , resourceName , nextLink , options } , listAtResourceLevelNextOperationSpec ) ; } param nextLink param options private _listAtSubscriptionLevelNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , listAtSubscriptionLevelNextOperationSpec ) ; } param scope param nextLink param options private _listByScopeNext ( scope , nextLink , options ? ) { return this . client . sendOperationRequest ( { scope , nextLink , options } , listByScopeNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const createOrUpdateAtResourceGroupLevelOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}" , httpMethod : "PUT" , responses : { 200 : { bodyMapper : Mappers . ManagementLockObject } , 201 : { bodyMapper : Mappers . ManagementLockObject } } , requestBody : Parameters . parameters , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . lockName , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const deleteAtResourceGroupLevelOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}" , httpMethod : "DELETE" , responses : { 200 : { } , 204 : { } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . lockName , Parameters . subscriptionId ] , serializer } ; const getAtResourceGroupLevelOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks/{lockName}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ManagementLockObject } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . lockName , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const createOrUpdateByScopeOperationSpec = { path : "/{scope}/providers/Microsoft.Authorization/locks/{lockName}" , httpMethod : "PUT" , responses : { 200 : { bodyMapper : Mappers . ManagementLockObject } , 201 : { bodyMapper : Mappers . ManagementLockObject } } , requestBody : Parameters . parameters , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . lockName , Parameters . scope ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const deleteByScopeOperationSpec = { path : "/{scope}/providers/Microsoft.Authorization/locks/{lockName}" , httpMethod : "DELETE" , responses : { 200 : { } , 204 : { } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . lockName , Parameters . scope ] , serializer } ; const getByScopeOperationSpec = { path : "/{scope}/providers/Microsoft.Authorization/locks/{lockName}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ManagementLockObject } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . lockName , Parameters . scope ] , headerParameters : [ Parameters . accept ] , serializer } ; const createOrUpdateAtResourceLevelOperationSpec = { path : "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}" , httpMethod : "PUT" , responses : { 200 : { bodyMapper : Mappers . ManagementLockObject } , 201 : { bodyMapper : Mappers . ManagementLockObject } } , requestBody : Parameters . parameters , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . lockName , Parameters . subscriptionId , Parameters . resourceProviderNamespace , Parameters . parentResourcePath , Parameters . resourceType , Parameters . resourceName ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const deleteAtResourceLevelOperationSpec = { path : "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}" , httpMethod : "DELETE" , responses : { 200 : { } , 204 : { } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . lockName , Parameters . subscriptionId , Parameters . resourceProviderNamespace , Parameters . parentResourcePath , Parameters . resourceType , Parameters . resourceName ] , serializer } ; const getAtResourceLevelOperationSpec = { path : "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks/{lockName}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ManagementLockObject } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . lockName , Parameters . subscriptionId , Parameters . resourceProviderNamespace , Parameters . parentResourcePath , Parameters . resourceType , Parameters . resourceName ] , headerParameters : [ Parameters . accept ] , serializer } ; const createOrUpdateAtSubscriptionLevelOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}" , httpMethod : "PUT" , responses : { 200 : { bodyMapper : Mappers . ManagementLockObject } , 201 : { bodyMapper : Mappers . ManagementLockObject } } , requestBody : Parameters . parameters , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . lockName , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const deleteAtSubscriptionLevelOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}" , httpMethod : "DELETE" , responses : { 200 : { } , 204 : { } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . lockName , Parameters . subscriptionId ] , serializer } ; const getAtSubscriptionLevelOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks/{lockName}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ManagementLockObject } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . lockName , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listAtResourceGroupLevelOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/locks" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ManagementLockListResult } } , queryParameters : [ Parameters . apiVersion , Parameters . filter ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listAtResourceLevelOperationSpec = { path : "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/locks" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ManagementLockListResult } } , queryParameters : [ Parameters . apiVersion , Parameters . filter ] , urlParameters : [ Parameters . $host , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . resourceProviderNamespace , Parameters . parentResourcePath , Parameters . resourceType , Parameters . resourceName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listAtSubscriptionLevelOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/locks" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ManagementLockListResult } } , queryParameters : [ Parameters . apiVersion , Parameters . filter ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listByScopeOperationSpec = { path : "/{scope}/providers/Microsoft.Authorization/locks" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ManagementLockListResult } } , queryParameters : [ Parameters . apiVersion , Parameters . filter ] , urlParameters : [ Parameters . $host , Parameters . scope ] , headerParameters : [ Parameters . accept ] , serializer } ; const listAtResourceGroupLevelNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ManagementLockListResult } } , queryParameters : [ Parameters . apiVersion , Parameters . filter ] , urlParameters : [ Parameters . $host , Parameters . nextLink , Parameters . resourceGroupName , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listAtResourceLevelNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ManagementLockListResult } } , queryParameters : [ Parameters . apiVersion , Parameters . filter ] , urlParameters : [ Parameters . $host , Parameters . nextLink , Parameters . resourceGroupName , Parameters . subscriptionId , Parameters . resourceProviderNamespace , Parameters . parentResourcePath , Parameters . resourceType , Parameters . resourceName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listAtSubscriptionLevelNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ManagementLockListResult } } , queryParameters : [ Parameters . apiVersion , Parameters . filter ] , urlParameters : [ Parameters . $host , Parameters . nextLink , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listByScopeNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . ManagementLockListResult } } , queryParameters : [ Parameters . apiVersion , Parameters . filter ] , urlParameters : [ Parameters . $host , Parameters . nextLink , Parameters . scope ] , headerParameters : [ Parameters . accept ] , serializer } ;