import { IntegrationRuntimeObjectMetadata } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { DataFactoryClient } from "../dataFactoryClient" ; import { PollerLike , PollOperationState , LroEngine } from "@azure/core-lro" ; import { LroImpl } from "../lroImpl" ; import { IntegrationRuntimeObjectMetadataRefreshOptionalParams , IntegrationRuntimeObjectMetadataRefreshResponse , IntegrationRuntimeObjectMetadataGetOptionalParams , IntegrationRuntimeObjectMetadataGetResponse } from "../models" ; /** Class containing IntegrationRuntimeObjectMetadata operations. */ export class IntegrationRuntimeObjectMetadataImpl implements IntegrationRuntimeObjectMetadata { private readonly client : DataFactoryClient ; param client constructor ( client ) { this . client = client ; } param resourceGroupName param factoryName param integrationRuntimeName param options async beginRefresh ( resourceGroupName , factoryName , integrationRuntimeName , options ? ) { const directSendOperation = async ( args , spec ) : Promise < IntegrationRuntimeObjectMetadataRefreshResponse > => { return this . client . sendOperationRequest ( args , spec ) ; } ; const sendOperation = async ( args , spec ) => { let currentRawResponse = undefined ; const providedCallback = args . options ?. onResponse ; const callback = ( rawResponse , flatResponse ) => { currentRawResponse = rawResponse ; providedCallback ?. ( rawResponse , flatResponse ) ; } ; const updatedArgs = { ... args , options : { ... args . options , onResponse : callback } } ; const flatResponse = await directSendOperation ( updatedArgs , spec ) ; return { flatResponse , rawResponse : { statusCode : currentRawResponse ! . status , body : currentRawResponse ! . parsedBody , headers : currentRawResponse ! . headers . toJSON ( ) } } ; } ; const lro = new LroImpl ( sendOperation , { resourceGroupName , factoryName , integrationRuntimeName , options } , refreshOperationSpec ) ; return new LroEngine ( lro , { resumeFrom : options ?. resumeFrom , intervalInMs : options ?. updateIntervalInMs } ) ; } param resourceGroupName param factoryName param integrationRuntimeName param options async beginRefreshAndWait ( resourceGroupName , factoryName , integrationRuntimeName , options ? ) { const poller = await this . beginRefresh ( resourceGroupName , factoryName , integrationRuntimeName , options ) ; return poller . pollUntilDone ( ) ; } param resourceGroupName param factoryName param integrationRuntimeName param options get ( resourceGroupName , factoryName , integrationRuntimeName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , factoryName , integrationRuntimeName , options } , getOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const refreshOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/refreshObjectMetadata" , httpMethod : "POST" , responses : { 200 : { bodyMapper : Mappers . SsisObjectMetadataStatusResponse } , 201 : { bodyMapper : Mappers . SsisObjectMetadataStatusResponse } , 202 : { bodyMapper : Mappers . SsisObjectMetadataStatusResponse } , 204 : { bodyMapper : Mappers . SsisObjectMetadataStatusResponse } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . factoryName , Parameters . integrationRuntimeName ] , headerParameters : [ Parameters . accept ] , serializer } ; const getOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/getObjectMetadata" , httpMethod : "POST" , responses : { 200 : { bodyMapper : Mappers . SsisObjectMetadataListResponse } , default : { bodyMapper : Mappers . CloudError } } , requestBody : Parameters . getMetadataRequest , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . factoryName , Parameters . integrationRuntimeName ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ;