import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { Domains } 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 { Domain , DomainsListOptionalParams , DomainsListResponse , DomainsGetOptionalParams , DomainsGetResponse } from "../models" ; /** Class containing Domains operations. */ export class DomainsImpl implements Domains { private readonly client : GraphRbacManagementClient ; param client constructor ( client ) { this . client = client ; } param options public list ( options ? ) { const iter = this . listPagingAll ( options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listPagingPage ( options ) ; } } ; } private async * listPagingPage ( options ? ) { let result = await this . _list ( options ) ; yield result . value || [ ] ; } private async * listPagingAll ( options ? ) { for await ( const page of this . listPagingPage ( options ) ) { yield * page ; } } param options private _list ( options ? ) { return this . client . sendOperationRequest ( { options } , listOperationSpec ) ; } param domainName param options get ( domainName , options ? ) { return this . client . sendOperationRequest ( { domainName , options } , getOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const listOperationSpec = { path : "/{tenantID}/domains" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . DomainListResult } } , queryParameters : [ Parameters . apiVersion , Parameters . filter ] , urlParameters : [ Parameters . $host , Parameters . tenantID ] , headerParameters : [ Parameters . accept ] , serializer } ; const getOperationSpec = { path : "/{tenantID}/domains/{domainName}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . Domain } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . tenantID , Parameters . domainName ] , headerParameters : [ Parameters . accept ] , serializer } ;