import { PagedAsyncIterableIterator } from "@azure/core-paging" ; import { Factories } 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 { Factory , FactoriesListNextOptionalParams , FactoriesListOptionalParams , FactoriesListByResourceGroupNextOptionalParams , FactoriesListByResourceGroupOptionalParams , FactoriesListResponse , FactoryRepoUpdate , FactoriesConfigureFactoryRepoOptionalParams , FactoriesConfigureFactoryRepoResponse , FactoriesListByResourceGroupResponse , FactoriesCreateOrUpdateOptionalParams , FactoriesCreateOrUpdateResponse , FactoryUpdateParameters , FactoriesUpdateOptionalParams , FactoriesUpdateResponse , FactoriesGetOptionalParams , FactoriesGetResponse , FactoriesDeleteOptionalParams , GitHubAccessTokenRequest , FactoriesGetGitHubAccessTokenOptionalParams , FactoriesGetGitHubAccessTokenResponse , UserAccessPolicy , FactoriesGetDataPlaneAccessOptionalParams , FactoriesGetDataPlaneAccessResponse , FactoriesListNextResponse , FactoriesListByResourceGroupNextResponse } from "../models" ; /** Class containing Factories operations. */ export class FactoriesImpl implements Factories { private readonly client : DataFactoryClient ; 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 || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listNext ( continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listPagingAll ( options ? ) { for await ( const page of this . listPagingPage ( options ) ) { yield * page ; } } param resourceGroupName param options public listByResourceGroup ( resourceGroupName , options ? ) { const iter = this . listByResourceGroupPagingAll ( resourceGroupName , options ) ; return { next ( ) { return iter . next ( ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , byPage : ( ) => { return this . listByResourceGroupPagingPage ( resourceGroupName , options ) ; } } ; } private async * listByResourceGroupPagingPage ( resourceGroupName , options ? ) { let result = await this . _listByResourceGroup ( resourceGroupName , options ) ; yield result . value || [ ] ; let continuationToken = result . nextLink ; while ( continuationToken ) { result = await this . _listByResourceGroupNext ( resourceGroupName , continuationToken , options ) ; continuationToken = result . nextLink ; yield result . value || [ ] ; } } private async * listByResourceGroupPagingAll ( resourceGroupName , options ? ) { for await ( const page of this . listByResourceGroupPagingPage ( resourceGroupName , options ) ) { yield * page ; } } param options private _list ( options ? ) { return this . client . sendOperationRequest ( { options } , listOperationSpec ) ; } param locationId param factoryRepoUpdate param options configureFactoryRepo ( locationId , factoryRepoUpdate , options ? ) { return this . client . sendOperationRequest ( { locationId , factoryRepoUpdate , options } , configureFactoryRepoOperationSpec ) ; } param resourceGroupName param options private _listByResourceGroup ( resourceGroupName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , options } , listByResourceGroupOperationSpec ) ; } param resourceGroupName param factoryName param factory param options createOrUpdate ( resourceGroupName , factoryName , factory , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , factoryName , factory , options } , createOrUpdateOperationSpec ) ; } param resourceGroupName param factoryName param factoryUpdateParameters param options update ( resourceGroupName , factoryName , factoryUpdateParameters , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , factoryName , factoryUpdateParameters , options } , updateOperationSpec ) ; } param resourceGroupName param factoryName param options get ( resourceGroupName , factoryName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , factoryName , options } , getOperationSpec ) ; } param resourceGroupName param factoryName param options delete ( resourceGroupName , factoryName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , factoryName , options } , deleteOperationSpec ) ; } param resourceGroupName param factoryName param gitHubAccessTokenRequest param options getGitHubAccessToken ( resourceGroupName , factoryName , gitHubAccessTokenRequest , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , factoryName , gitHubAccessTokenRequest , options } , getGitHubAccessTokenOperationSpec ) ; } param resourceGroupName param factoryName param policy param options getDataPlaneAccess ( resourceGroupName , factoryName , policy , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , factoryName , policy , options } , getDataPlaneAccessOperationSpec ) ; } param nextLink param options private _listNext ( nextLink , options ? ) { return this . client . sendOperationRequest ( { nextLink , options } , listNextOperationSpec ) ; } param resourceGroupName param nextLink param options private _listByResourceGroupNext ( resourceGroupName , nextLink , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , nextLink , options } , listByResourceGroupNextOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const listOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.DataFactory/factories" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . FactoryListResponse } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const configureFactoryRepoOperationSpec = { path : "/subscriptions/{subscriptionId}/providers/Microsoft.DataFactory/locations/{locationId}/configureFactoryRepo" , httpMethod : "POST" , responses : { 200 : { bodyMapper : Mappers . Factory } , default : { bodyMapper : Mappers . CloudError } } , requestBody : Parameters . factoryRepoUpdate , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . locationId ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const listByResourceGroupOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . FactoryListResponse } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName ] , headerParameters : [ Parameters . accept ] , serializer } ; const createOrUpdateOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}" , httpMethod : "PUT" , responses : { 200 : { bodyMapper : Mappers . Factory } , default : { bodyMapper : Mappers . CloudError } } , requestBody : Parameters . factory , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . factoryName ] , headerParameters : [ Parameters . accept , Parameters . contentType , Parameters . ifMatch ] , mediaType : "json" , serializer } ; const updateOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}" , httpMethod : "PATCH" , responses : { 200 : { bodyMapper : Mappers . Factory } , default : { bodyMapper : Mappers . CloudError } } , requestBody : Parameters . factoryUpdateParameters , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . factoryName ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . Factory } , 304 : { } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . factoryName ] , headerParameters : [ Parameters . accept , Parameters . ifNoneMatch ] , serializer } ; const deleteOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}" , httpMethod : "DELETE" , responses : { 200 : { } , 204 : { } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . factoryName ] , headerParameters : [ Parameters . accept ] , serializer } ; const getGitHubAccessTokenOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/getGitHubAccessToken" , httpMethod : "POST" , responses : { 200 : { bodyMapper : Mappers . GitHubAccessTokenResponse } , default : { bodyMapper : Mappers . CloudError } } , requestBody : Parameters . gitHubAccessTokenRequest , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . factoryName ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const getDataPlaneAccessOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/getDataPlaneAccess" , httpMethod : "POST" , responses : { 200 : { bodyMapper : Mappers . AccessPolicyResponse } , default : { bodyMapper : Mappers . CloudError } } , requestBody : Parameters . policy , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . factoryName ] , headerParameters : [ Parameters . accept , Parameters . contentType ] , mediaType : "json" , serializer } ; const listNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . FactoryListResponse } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . nextLink , Parameters . subscriptionId ] , headerParameters : [ Parameters . accept ] , serializer } ; const listByResourceGroupNextOperationSpec = { path : "{nextLink}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . FactoryListResponse } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . nextLink , Parameters . subscriptionId , Parameters . resourceGroupName ] , headerParameters : [ Parameters . accept ] , serializer } ;