import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { FhirDestinations } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { HealthCareApisClient } from "../healthCareApisClient" ; import { IotFhirDestination , FhirDestinationsListByIotConnectorNextOptionalParams , FhirDestinationsListByIotConnectorOptionalParams , FhirDestinationsListByIotConnectorResponse , FhirDestinationsListByIotConnectorNextResponse } from "../models" ; /** Class containing FhirDestinations operations. */ export class FhirDestinationsImpl implements FhirDestinations { private readonly client : HealthCareApisClient ; param client constructor ( client ) { this . client = client ; } param resourceGroupName param workspaceName param iotConnectorName param options public listByIotConnector ( resourceGroupName , workspaceName , iotConnectorName , options ? ) { const iter = this . listByIotConnectorPagingAll ( resourceGroupName , workspaceName , iotConnectorName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listByIotConnectorPagingPage ( resourceGroupName , workspaceName , iotConnectorName , options ) ; } } ; } private async * listByIotConnectorPagingPage ( resourceGroupName , workspaceName , iotConnectorName , options ? ) { let result = await this . _listByIotConnector ( resourceGroupName , workspaceName , iotConnectorName , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listByIotConnectorNext ( resourceGroupName , workspaceName , iotConnectorName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listByIotConnectorPagingAll ( resourceGroupName , workspaceName , iotConnectorName , options ? ) { for await ( const page of this . listByIotConnectorPagingPage ( resourceGroupName , workspaceName , iotConnectorName , options ) ) { yield * page ; } } param resourceGroupName param workspaceName param iotConnectorName param options private _listByIotConnector ( resourceGroupName , workspaceName , iotConnectorName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , workspaceName , iotConnectorName , options } , listByIotConnectorOperationSpec ) ; } param resourceGroupName param workspaceName param iotConnectorName param nextLink param options private _listByIotConnectorNext ( resourceGroupName , workspaceName , iotConnectorName , nextLink , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , workspaceName , iotConnectorName , nextLink , options } , listByIotConnectorNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const listByIotConnectorOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthcareApis/workspaces/{workspaceName}/iotconnectors/{iotConnectorName}/fhirdestinations" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . IotFhirDestinationCollection } , default : { bodyMapper : Mappers . ErrorDetails } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . workspaceName , Parameters . iotConnectorName ] , headerParameters : [ Parameters . accept ] , serializer } ; const listByIotConnectorNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . IotFhirDestinationCollection } , default : { bodyMapper : Mappers . ErrorDetails } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . nextLink , Parameters . workspaceName , Parameters . iotConnectorName ] , headerParameters : [ Parameters . accept ] , serializer } ;