import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { SignedInUser } 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 , SignedInUserListOwnedObjectsNextOptionalParams , SignedInUserListOwnedObjectsOptionalParams , SignedInUserGetOptionalParams , SignedInUserGetResponse , SignedInUserListOwnedObjectsResponse , SignedInUserListOwnedObjectsNextResponse } from "../models" ; /** Class containing SignedInUser operations. */ export class SignedInUserImpl implements SignedInUser { private readonly client : GraphRbacManagementClient ; param client constructor ( client ) { this . client = client ; } param options public listOwnedObjects ( options ? ) { const iter = this . listOwnedObjectsPagingAll ( options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listOwnedObjectsPagingPage ( options ) ; } } ; } private async * listOwnedObjectsPagingPage ( options ? ) { let result = await this . _listOwnedObjects ( options ) ; yield result . value || [ ] ; let continuationToken = result . odataNextLink ; while ( continuationToken ) { result = await this . _listOwnedObjectsNext ( continuationToken , options ) ; continuationToken = result . odataNextLink ; yield result . value || [ ] ; } } private async * listOwnedObjectsPagingAll ( options ? ) { for await ( const page of this . listOwnedObjectsPagingPage ( options ) ) { yield * page ; } } param nextLink param options public listOwnedObjectsNext ( nextLink , options ? ) { const iter = this . listOwnedObjectsNextPagingAll ( nextLink , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listOwnedObjectsNextPagingPage ( nextLink , options ) ; } } ; } private async * listOwnedObjectsNextPagingPage ( nextLink , options ? ) { let result = await this . _listOwnedObjectsNext ( nextLink , options ) ; yield result . value || [ ] ; let continuationToken = result . odataNextLink ; while ( continuationToken ) { result = await this . _listOwnedObjectsNext ( continuationToken , options ) ; continuationToken = result . odataNextLink ; yield result . value || [ ] ; } } private async * listOwnedObjectsNextPagingAll ( nextLink , options ? ) { for await ( const page of this . listOwnedObjectsNextPagingPage ( nextLink , options ) ) { yield * page ; } } param options get ( options ? ) { return this . client . sendOperationRequest ( { options } , getOperationSpec ) ; } param options private _listOwnedObjects ( options ? ) { return this . client . sendOperationRequest ( { options } , listOwnedObjectsOperationSpec ) ; } param nextLink param options private _listOwnedObjectsNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , listOwnedObjectsNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const getOperationSpec = { path : "/{tenantID}/me" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . User } , default : { bodyMapper : Mappers . GraphError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . tenantID ] , headerParameters : [ Parameters . accept ] , serializer } ; const listOwnedObjectsOperationSpec = { path : "/{tenantID}/me/ownedObjects" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DirectoryObjectListResult } , default : { bodyMapper : Mappers . GraphError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . tenantID ] , headerParameters : [ Parameters . accept ] , serializer } ; const listOwnedObjectsNextOperationSpec = { path : "/{tenantID}/{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DirectoryObjectListResult } , default : { bodyMapper : Mappers . GraphError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . tenantID , Parameters . nextLink ] , headerParameters : [ Parameters . accept ] , serializer } ;