import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { UserAssignedIdentities } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { ManagedServiceIdentityClient } from "../managedServiceIdentityClient" ; import { Identity , UserAssignedIdentitiesListBySubscriptionNextOptionalParams , UserAssignedIdentitiesListBySubscriptionOptionalParams , UserAssignedIdentitiesListByResourceGroupNextOptionalParams , UserAssignedIdentitiesListByResourceGroupOptionalParams , UserAssignedIdentitiesListBySubscriptionResponse , UserAssignedIdentitiesListByResourceGroupResponse , UserAssignedIdentitiesCreateOrUpdateOptionalParams , UserAssignedIdentitiesCreateOrUpdateResponse , IdentityUpdate , UserAssignedIdentitiesUpdateOptionalParams , UserAssignedIdentitiesUpdateResponse , UserAssignedIdentitiesGetOptionalParams , UserAssignedIdentitiesGetResponse , UserAssignedIdentitiesDeleteOptionalParams , UserAssignedIdentitiesListBySubscriptionNextResponse , UserAssignedIdentitiesListByResourceGroupNextResponse } from "../models" ; /** Class containing UserAssignedIdentities operations. */ export class UserAssignedIdentitiesImpl implements UserAssignedIdentities { private readonly client : ManagedServiceIdentityClient ; 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 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 resourceGroupName param resourceName param parameters param options createOrUpdate ( resourceGroupName , resourceName , parameters , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , resourceName , parameters , options } , createOrUpdateOperationSpec ) ; } param resourceGroupName param resourceName param parameters param options update ( resourceGroupName , resourceName , parameters , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , resourceName , parameters , options } , updateOperationSpec ) ; } param resourceGroupName param resourceName param options get ( resourceGroupName , resourceName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , resourceName , options } , getOperationSpec ) ; } param resourceGroupName param resourceName param options delete ( resourceGroupName , resourceName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , resourceName , options } , deleteOperationSpec ) ; } 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 listBySubscriptionOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.ManagedIdentity/userAssignedIdentities" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . UserAssignedIdentitiesListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listByResourceGroupOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . UserAssignedIdentitiesListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName ] , headerParameters : [ Parameters . accept ] , serializer } ; const createOrUpdateOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName}" , httpMethod : "PUT" , responses : { 200 : { bodyMapper : Mappers . Identity } , 201 : { bodyMapper : Mappers . Identity } , default : { bodyMapper : Mappers . CloudError } } , requestBody : Parameters . parameters , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . resourceName ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const updateOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName}" , httpMethod : "PATCH" , responses : { 200 : { bodyMapper : Mappers . Identity } , default : { bodyMapper : Mappers . CloudError } } , requestBody : Parameters . parameters1 , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . resourceName ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . Identity } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . resourceName ] , headerParameters : [ Parameters . accept ] , serializer } ; const deleteOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName}" , httpMethod : "DELETE" , responses : { 200 : { } , 204 : { } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . resourceName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listBySubscriptionNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . UserAssignedIdentitiesListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . nextLink , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listByResourceGroupNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . UserAssignedIdentitiesListResult } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . nextLink , Parameters . subscriptionId , Parameters . resourceGroupName ] , headerParameters : [ Parameters . accept ] , serializer } ;