import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { Objects } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { GraphRbacManagementClient } from "../graphRbacManagementClient" ; import { DirectoryObjectUnion , ObjectsGetObjectsByObjectIdsNextOptionalParams , GetObjectsParameters , ObjectsGetObjectsByObjectIdsOptionalParams , ObjectsGetObjectsByObjectIdsResponse , ObjectsGetObjectsByObjectIdsNextResponse } from "../models" ; /** Class containing Objects operations. */ export class ObjectsImpl implements Objects { private readonly client : GraphRbacManagementClient ; param client constructor ( client ) { this . client = client ; } param parameters param options public listObjectsByObjectIds ( parameters , options ? ) { const iter = this . getObjectsByObjectIdsPagingAll ( parameters , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . getObjectsByObjectIdsPagingPage ( parameters , options ) ; } } ; } private async * getObjectsByObjectIdsPagingPage ( parameters , options ? ) { let result = await this . _getObjectsByObjectIds ( parameters , options ) ; yield result . value || [ ] ; let continuationToken = result . odataNextLink ; while ( continuationToken ) { result = await this . _getObjectsByObjectIdsNext ( continuationToken , options ) ; continuationToken = result . odataNextLink ; yield result . value || [ ] ; } } private async * getObjectsByObjectIdsPagingAll ( parameters , options ? ) { for await ( const page of this . getObjectsByObjectIdsPagingPage ( parameters , options ) ) { yield * page ; } } param nextLink param options public listObjectsByObjectIdsNext ( nextLink , options ? ) { const iter = this . getObjectsByObjectIdsNextPagingAll ( nextLink , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . getObjectsByObjectIdsNextPagingPage ( nextLink , options ) ; } } ; } private async * getObjectsByObjectIdsNextPagingPage ( nextLink , options ? ) { let result = await this . _getObjectsByObjectIdsNext ( nextLink , options ) ; yield result . value || [ ] ; let continuationToken = result . odataNextLink ; while ( continuationToken ) { result = await this . _getObjectsByObjectIdsNext ( continuationToken , options ) ; continuationToken = result . odataNextLink ; yield result . value || [ ] ; } } private async * getObjectsByObjectIdsNextPagingAll ( nextLink , options ? ) { for await ( const page of this . getObjectsByObjectIdsNextPagingPage ( nextLink , options ) ) { yield * page ; } } param parameters param options private _getObjectsByObjectIds ( parameters , options ? ) { return this . client . sendOperationRequest ( { parameters , options } , getObjectsByObjectIdsOperationSpec ) ; } param nextLink param options private _getObjectsByObjectIdsNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , getObjectsByObjectIdsNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const getObjectsByObjectIdsOperationSpec = { path : "/{tenantID}/getObjectsByObjectIds" , httpMethod : "POST" , responses : { 200 : { bodyMapper : Mappers . DirectoryObjectListResult } } , requestBody : Parameters . parameters14 , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . tenantID ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getObjectsByObjectIdsNextOperationSpec = { path : "/{tenantID}/{nextLink}" , httpMethod : "POST" , responses : { 200 : { bodyMapper : Mappers . DirectoryObjectListResult } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . tenantID , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ;