diff --git a/lib/services/datafactoryManagement/lib/models/index.d.ts b/lib/services/datafactoryManagement/lib/models/index.d.ts index d03df4d3d4..1032615f59 100644 --- a/lib/services/datafactoryManagement/lib/models/index.d.ts +++ b/lib/services/datafactoryManagement/lib/models/index.d.ts @@ -258,18 +258,13 @@ export interface IntegrationRuntimeReference { * integration runtime belong to. * @member {string} [state] The state of integration runtime. Possible values * include: 'Initial', 'Stopped', 'Started', 'Starting', 'Stopping', - * 'NeedRegistration', 'Online', 'Limited', 'Offline' + * 'NeedRegistration', 'Online', 'Limited', 'Offline', 'AccessDenied' * @member {string} type Polymorphic Discriminator */ export interface IntegrationRuntimeStatus { readonly dataFactoryName?: string; readonly state?: string; type: string; - /** - * @property Describes unknown properties. The value of an unknown property - * can be of "any" type. - */ - [property: string]: any; } /** @@ -284,7 +279,8 @@ export interface IntegrationRuntimeStatus { * the integration runtime belong to. * @member {string} [properties.state] The state of integration runtime. * Possible values include: 'Initial', 'Stopped', 'Started', 'Starting', - * 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline' + * 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline', + * 'AccessDenied' * @member {string} [properties.type] Polymorphic Discriminator */ export interface IntegrationRuntimeStatusResponse { @@ -340,6 +336,34 @@ export interface UpdateIntegrationRuntimeNodeRequest { concurrentJobsLimit?: number; } +/** + * @class + * Initializes a new instance of the IntegrationRuntimePermissionRequest class. + * @constructor + * Grant or revoke access to integration runtime request. + * + * @member {string} [factoryName] The data factory name. + * @member {string} factoryIdentity The data factory identity. + */ +export interface IntegrationRuntimePermissionRequest { + factoryName?: string; + factoryIdentity: string; +} + +/** + * @class + * Initializes a new instance of the IntegrationRuntimePermissionResponse class. + * @constructor + * The response of granting/revoking integration runtime permission operation. + * + * @member {number} [sharedIntegrationRuntimeCount] The number of the + * integration runtimes to which the given data factory has been granted + * access. + */ +export interface IntegrationRuntimePermissionResponse { + sharedIntegrationRuntimeCount?: number; +} + /** * @class * Initializes a new instance of the ParameterSpecification class. @@ -1537,7 +1561,7 @@ export interface ShopifyLinkedService extends LinkedService { * ServiceNow server linked service. * * @member {object} endpoint The endpoint of the ServiceNow server. (i.e. - * ServiceNowData.com) + * .service-now.com) * @member {string} authenticationType The authentication type to use. Possible * values include: 'Basic', 'OAuth2' * @member {object} [username] The user name used to connect to the ServiceNow @@ -1582,10 +1606,13 @@ export interface ServiceNowLinkedService extends LinkedService { * quickbooks.api.intuit.com) * @member {object} companyId The company ID of the QuickBooks company to * authorize. - * @member {object} [accessToken] The access token for OAuth 1.0 + * @member {object} consumerKey The consumer key for OAuth 1.0 authentication. + * @member {object} consumerSecret The consumer secret for OAuth 1.0 * authentication. + * @member {string} [consumerSecret.type] Polymorphic Discriminator + * @member {object} accessToken The access token for OAuth 1.0 authentication. * @member {string} [accessToken.type] Polymorphic Discriminator - * @member {object} [accessTokenSecret] The access token secret for OAuth 1.0 + * @member {object} accessTokenSecret The access token secret for OAuth 1.0 * authentication. * @member {string} [accessTokenSecret.type] Polymorphic Discriminator * @member {object} [useEncryptedEndpoints] Specifies whether the data source @@ -1597,8 +1624,10 @@ export interface ServiceNowLinkedService extends LinkedService { export interface QuickBooksLinkedService extends LinkedService { endpoint: any; companyId: any; - accessToken?: SecretBase; - accessTokenSecret?: SecretBase; + consumerKey: any; + consumerSecret: SecretBase; + accessToken: SecretBase; + accessTokenSecret: SecretBase; useEncryptedEndpoints?: any; encryptedCredential?: any; } @@ -6030,11 +6059,17 @@ export interface CopyTranslator { * @constructor * A copy activity tabular translator. * - * @member {object} [columnMappings] Column mappings. Type: string (or - * Expression with resultType string). + * @member {object} [columnMappings] Column mappings. Example: "UserId: + * MyUserId, Group: MyGroup, Name: MyName" Type: string (or Expression with + * resultType string). + * @member {object} [schemaMapping] The schema mapping to map between tabular + * data and hierarchical data. Example: {"Column1": "$.Column1", "Column2": + * "$.Column2.Property1", "Column3": "$.Column2.Property2"}. Type: object (or + * Expression with resultType object). */ export interface TabularTranslator extends CopyTranslator { columnMappings?: any; + schemaMapping?: any; } /** @@ -6645,6 +6680,8 @@ export interface SelfHostedIntegrationRuntimeNode { * @constructor * Self-hosted integration runtime status. * + * @member {object} [additionalProperties] Unmatched properties from the + * message are deserialized this collection * @member {date} [createTime] The time at which the integration runtime was * created, in ISO8601 format. * @member {string} [taskQueueId] The task queue id of the integration runtime. @@ -6668,8 +6705,14 @@ export interface SelfHostedIntegrationRuntimeNode { * @member {string} [versionStatus] Status of the integration runtime version. * @member {array} [links] The list of linked integration runtimes that are * created to share with this integration runtime. + * @member {array} [sharedWithFactories] The MSI-s of the data factories to + * which the integration runtime is shared. + * @member {string} [pushedVersion] The version that the integration runtime is + * going to update to. + * @member {string} [latestVersion] The latest version on download center. */ export interface SelfHostedIntegrationRuntimeStatus extends IntegrationRuntimeStatus { + additionalProperties?: { [propertyName: string]: any }; readonly createTime?: Date; readonly taskQueueId?: string; readonly internalChannelEncryption?: string; @@ -6683,6 +6726,9 @@ export interface SelfHostedIntegrationRuntimeStatus extends IntegrationRuntimeSt readonly autoUpdate?: string; readonly versionStatus?: string; links?: LinkedIntegrationRuntime[]; + readonly sharedWithFactories?: string[]; + readonly pushedVersion?: string; + readonly latestVersion?: string; } /** @@ -6764,6 +6810,8 @@ export interface ManagedIntegrationRuntimeNode { * @constructor * Managed integration runtime status. * + * @member {object} [additionalProperties] Unmatched properties from the + * message are deserialized this collection * @member {date} [createTime] The time at which the integration runtime was * created, in ISO8601 format. * @member {array} [nodes] The list of nodes for managed integration runtime. @@ -6782,6 +6830,7 @@ export interface ManagedIntegrationRuntimeNode { * operation request. */ export interface ManagedIntegrationRuntimeStatus extends IntegrationRuntimeStatus { + additionalProperties?: { [propertyName: string]: any }; readonly createTime?: Date; readonly nodes?: ManagedIntegrationRuntimeNode[]; readonly otherErrors?: ManagedIntegrationRuntimeError[]; @@ -6792,7 +6841,7 @@ export interface ManagedIntegrationRuntimeStatus extends IntegrationRuntimeStatu * @class * Initializes a new instance of the LinkedIntegrationRuntimeProperties class. * @constructor - * The base definition of a secret type. + * The base definition of a linked integration runtime properties. * * @member {string} authorizationType Polymorphic Discriminator */ @@ -6804,10 +6853,10 @@ export interface LinkedIntegrationRuntimeProperties { * @class * Initializes a new instance of the LinkedIntegrationRuntimeRbac class. * @constructor - * The base definition of a secret type. + * The role based access control (RBAC) authorization type. * - * @member {string} resourceId The resource ID of the integration runtime to be - * shared. + * @member {string} resourceId The resource identifier of the integration + * runtime to be shared. */ export interface LinkedIntegrationRuntimeRbac extends LinkedIntegrationRuntimeProperties { resourceId: string; @@ -6817,9 +6866,9 @@ export interface LinkedIntegrationRuntimeRbac extends LinkedIntegrationRuntimePr * @class * Initializes a new instance of the LinkedIntegrationRuntimeKey class. * @constructor - * The base definition of a secret type. + * The key authorization type. * - * @member {object} key Type of the secret. + * @member {object} key The key used for authorization. * @member {string} [key.value] Value of secure string. */ export interface LinkedIntegrationRuntimeKey extends LinkedIntegrationRuntimeProperties { @@ -6995,7 +7044,7 @@ export interface IntegrationRuntimeComputeProperties { * @member {string} [state] Integration runtime state, only valid for managed * dedicated integration runtime. Possible values include: 'Initial', * 'Stopped', 'Started', 'Starting', 'Stopping', 'NeedRegistration', 'Online', - * 'Limited', 'Offline' + * 'Limited', 'Offline', 'AccessDenied' * @member {object} [computeProperties] The compute resource for managed * integration runtime. * @member {string} [computeProperties.location] The location for managed diff --git a/lib/services/datafactoryManagement/lib/models/index.js b/lib/services/datafactoryManagement/lib/models/index.js index 882ff4944f..d32bdfac2f 100644 --- a/lib/services/datafactoryManagement/lib/models/index.js +++ b/lib/services/datafactoryManagement/lib/models/index.js @@ -36,6 +36,8 @@ exports.IntegrationRuntimeStatusResponse = require('./integrationRuntimeStatusRe exports.IntegrationRuntimeStatusListResponse = require('./integrationRuntimeStatusListResponse'); exports.UpdateIntegrationRuntimeRequest = require('./updateIntegrationRuntimeRequest'); exports.UpdateIntegrationRuntimeNodeRequest = require('./updateIntegrationRuntimeNodeRequest'); +exports.IntegrationRuntimePermissionRequest = require('./integrationRuntimePermissionRequest'); +exports.IntegrationRuntimePermissionResponse = require('./integrationRuntimePermissionResponse'); exports.ParameterSpecification = require('./parameterSpecification'); exports.LinkedService = require('./linkedService'); exports.LinkedServiceResource = require('./linkedServiceResource'); diff --git a/lib/services/datafactoryManagement/lib/models/integrationRuntimeComputeProperties.js b/lib/services/datafactoryManagement/lib/models/integrationRuntimeComputeProperties.js index cc5d6142e1..123bf8b39b 100644 --- a/lib/services/datafactoryManagement/lib/models/integrationRuntimeComputeProperties.js +++ b/lib/services/datafactoryManagement/lib/models/integrationRuntimeComputeProperties.js @@ -92,7 +92,6 @@ class IntegrationRuntimeComputeProperties { required: false, serializedName: 'maxParallelExecutionsPerNode', constraints: { - InclusiveMaximum: 8, InclusiveMinimum: 1 }, type: { diff --git a/lib/services/datafactoryManagement/lib/models/integrationRuntimePermissionRequest.js b/lib/services/datafactoryManagement/lib/models/integrationRuntimePermissionRequest.js new file mode 100644 index 0000000000..e27affc846 --- /dev/null +++ b/lib/services/datafactoryManagement/lib/models/integrationRuntimePermissionRequest.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Grant or revoke access to integration runtime request. + * + */ +class IntegrationRuntimePermissionRequest { + /** + * Create a IntegrationRuntimePermissionRequest. + * @member {string} [factoryName] The data factory name. + * @member {string} factoryIdentity The data factory identity. + */ + constructor() { + } + + /** + * Defines the metadata of IntegrationRuntimePermissionRequest + * + * @returns {object} metadata of IntegrationRuntimePermissionRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'IntegrationRuntimePermissionRequest', + type: { + name: 'Composite', + className: 'IntegrationRuntimePermissionRequest', + modelProperties: { + factoryName: { + required: false, + serializedName: 'factoryName', + type: { + name: 'String' + } + }, + factoryIdentity: { + required: true, + serializedName: 'factoryIdentity', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = IntegrationRuntimePermissionRequest; diff --git a/lib/services/datafactoryManagement/lib/models/integrationRuntimePermissionResponse.js b/lib/services/datafactoryManagement/lib/models/integrationRuntimePermissionResponse.js new file mode 100644 index 0000000000..3a9f81b234 --- /dev/null +++ b/lib/services/datafactoryManagement/lib/models/integrationRuntimePermissionResponse.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The response of granting/revoking integration runtime permission operation. + * + */ +class IntegrationRuntimePermissionResponse { + /** + * Create a IntegrationRuntimePermissionResponse. + * @member {number} [sharedIntegrationRuntimeCount] The number of the + * integration runtimes to which the given data factory has been granted + * access. + */ + constructor() { + } + + /** + * Defines the metadata of IntegrationRuntimePermissionResponse + * + * @returns {object} metadata of IntegrationRuntimePermissionResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'IntegrationRuntimePermissionResponse', + type: { + name: 'Composite', + className: 'IntegrationRuntimePermissionResponse', + modelProperties: { + sharedIntegrationRuntimeCount: { + required: false, + serializedName: 'sharedIntegrationRuntimeCount', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = IntegrationRuntimePermissionResponse; diff --git a/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatus.js b/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatus.js index d6fa960a23..248022ab6f 100644 --- a/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatus.js +++ b/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatus.js @@ -21,7 +21,7 @@ class IntegrationRuntimeStatus { * integration runtime belong to. * @member {string} [state] The state of integration runtime. Possible values * include: 'Initial', 'Stopped', 'Started', 'Starting', 'Stopping', - * 'NeedRegistration', 'Online', 'Limited', 'Offline' + * 'NeedRegistration', 'Online', 'Limited', 'Offline', 'AccessDenied' * @member {string} type Polymorphic Discriminator */ constructor() { @@ -39,18 +39,6 @@ class IntegrationRuntimeStatus { serializedName: 'IntegrationRuntimeStatus', type: { name: 'Composite', - additionalProperties: { - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'ObjectElementType', - type: { - name: 'Object' - } - } - } - }, polymorphicDiscriminator: { serializedName: 'type', clientName: 'type' diff --git a/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatusResponse.js b/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatusResponse.js index f52765aefa..52335d772f 100644 --- a/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatusResponse.js +++ b/lib/services/datafactoryManagement/lib/models/integrationRuntimeStatusResponse.js @@ -25,7 +25,8 @@ class IntegrationRuntimeStatusResponse { * the integration runtime belong to. * @member {string} [properties.state] The state of integration runtime. * Possible values include: 'Initial', 'Stopped', 'Started', 'Starting', - * 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline' + * 'Stopping', 'NeedRegistration', 'Online', 'Limited', 'Offline', + * 'AccessDenied' * @member {string} [properties.type] Polymorphic Discriminator */ constructor() { @@ -58,18 +59,6 @@ class IntegrationRuntimeStatusResponse { serializedName: 'properties', type: { name: 'Composite', - additionalProperties: { - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'ObjectElementType', - type: { - name: 'Object' - } - } - } - }, polymorphicDiscriminator: { serializedName: 'type', clientName: 'type' diff --git a/lib/services/datafactoryManagement/lib/models/linkedIntegrationRuntimeKey.js b/lib/services/datafactoryManagement/lib/models/linkedIntegrationRuntimeKey.js index 5d4e0ccce8..895c7503ae 100644 --- a/lib/services/datafactoryManagement/lib/models/linkedIntegrationRuntimeKey.js +++ b/lib/services/datafactoryManagement/lib/models/linkedIntegrationRuntimeKey.js @@ -13,14 +13,14 @@ const models = require('./index'); /** - * The base definition of a secret type. + * The key authorization type. * * @extends models['LinkedIntegrationRuntimeProperties'] */ class LinkedIntegrationRuntimeKey extends models['LinkedIntegrationRuntimeProperties'] { /** * Create a LinkedIntegrationRuntimeKey. - * @member {object} key Type of the secret. + * @member {object} key The key used for authorization. * @member {string} [key.value] Value of secure string. */ constructor() { diff --git a/lib/services/datafactoryManagement/lib/models/linkedIntegrationRuntimeProperties.js b/lib/services/datafactoryManagement/lib/models/linkedIntegrationRuntimeProperties.js index 5e9d9d3444..b9cb6afc50 100644 --- a/lib/services/datafactoryManagement/lib/models/linkedIntegrationRuntimeProperties.js +++ b/lib/services/datafactoryManagement/lib/models/linkedIntegrationRuntimeProperties.js @@ -11,7 +11,7 @@ 'use strict'; /** - * The base definition of a secret type. + * The base definition of a linked integration runtime properties. * */ class LinkedIntegrationRuntimeProperties { diff --git a/lib/services/datafactoryManagement/lib/models/linkedIntegrationRuntimeRbac.js b/lib/services/datafactoryManagement/lib/models/linkedIntegrationRuntimeRbac.js index 2393b48d1d..0bd6a452b6 100644 --- a/lib/services/datafactoryManagement/lib/models/linkedIntegrationRuntimeRbac.js +++ b/lib/services/datafactoryManagement/lib/models/linkedIntegrationRuntimeRbac.js @@ -13,15 +13,15 @@ const models = require('./index'); /** - * The base definition of a secret type. + * The role based access control (RBAC) authorization type. * * @extends models['LinkedIntegrationRuntimeProperties'] */ class LinkedIntegrationRuntimeRbac extends models['LinkedIntegrationRuntimeProperties'] { /** * Create a LinkedIntegrationRuntimeRbac. - * @member {string} resourceId The resource ID of the integration runtime to - * be shared. + * @member {string} resourceId The resource identifier of the integration + * runtime to be shared. */ constructor() { super(); diff --git a/lib/services/datafactoryManagement/lib/models/managedIntegrationRuntime.js b/lib/services/datafactoryManagement/lib/models/managedIntegrationRuntime.js index 6ebe822d53..ab054421a2 100644 --- a/lib/services/datafactoryManagement/lib/models/managedIntegrationRuntime.js +++ b/lib/services/datafactoryManagement/lib/models/managedIntegrationRuntime.js @@ -24,7 +24,7 @@ class ManagedIntegrationRuntime extends models['IntegrationRuntime'] { * @member {string} [state] Integration runtime state, only valid for managed * dedicated integration runtime. Possible values include: 'Initial', * 'Stopped', 'Started', 'Starting', 'Stopping', 'NeedRegistration', - * 'Online', 'Limited', 'Offline' + * 'Online', 'Limited', 'Offline', 'AccessDenied' * @member {object} [computeProperties] The compute resource for managed * integration runtime. * @member {string} [computeProperties.location] The location for managed diff --git a/lib/services/datafactoryManagement/lib/models/managedIntegrationRuntimeStatus.js b/lib/services/datafactoryManagement/lib/models/managedIntegrationRuntimeStatus.js index 19f3aa9717..1de97da7b0 100644 --- a/lib/services/datafactoryManagement/lib/models/managedIntegrationRuntimeStatus.js +++ b/lib/services/datafactoryManagement/lib/models/managedIntegrationRuntimeStatus.js @@ -20,6 +20,8 @@ const models = require('./index'); class ManagedIntegrationRuntimeStatus extends models['IntegrationRuntimeStatus'] { /** * Create a ManagedIntegrationRuntimeStatus. + * @member {object} [additionalProperties] Unmatched properties from the + * message are deserialized this collection * @member {date} [createTime] The time at which the integration runtime was * created, in ISO8601 format. * @member {array} [nodes] The list of nodes for managed integration runtime. @@ -84,6 +86,20 @@ class ManagedIntegrationRuntimeStatus extends models['IntegrationRuntimeStatus'] name: 'String' } }, + additionalProperties: { + required: false, + serializedName: 'typeProperties.', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, createTime: { required: false, readOnly: true, diff --git a/lib/services/datafactoryManagement/lib/models/quickBooksLinkedService.js b/lib/services/datafactoryManagement/lib/models/quickBooksLinkedService.js index 9d5703d391..848db2d54d 100644 --- a/lib/services/datafactoryManagement/lib/models/quickBooksLinkedService.js +++ b/lib/services/datafactoryManagement/lib/models/quickBooksLinkedService.js @@ -24,10 +24,15 @@ class QuickBooksLinkedService extends models['LinkedService'] { * quickbooks.api.intuit.com) * @member {object} companyId The company ID of the QuickBooks company to * authorize. - * @member {object} [accessToken] The access token for OAuth 1.0 + * @member {object} consumerKey The consumer key for OAuth 1.0 + * authentication. + * @member {object} consumerSecret The consumer secret for OAuth 1.0 + * authentication. + * @member {string} [consumerSecret.type] Polymorphic Discriminator + * @member {object} accessToken The access token for OAuth 1.0 * authentication. * @member {string} [accessToken.type] Polymorphic Discriminator - * @member {object} [accessTokenSecret] The access token secret for OAuth 1.0 + * @member {object} accessTokenSecret The access token secret for OAuth 1.0 * authentication. * @member {string} [accessTokenSecret.type] Polymorphic Discriminator * @member {object} [useEncryptedEndpoints] Specifies whether the data source @@ -125,8 +130,28 @@ class QuickBooksLinkedService extends models['LinkedService'] { name: 'Object' } }, + consumerKey: { + required: true, + serializedName: 'typeProperties.consumerKey', + type: { + name: 'Object' + } + }, + consumerSecret: { + required: true, + serializedName: 'typeProperties.consumerSecret', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'SecretBase', + className: 'SecretBase' + } + }, accessToken: { - required: false, + required: true, serializedName: 'typeProperties.accessToken', type: { name: 'Composite', @@ -139,7 +164,7 @@ class QuickBooksLinkedService extends models['LinkedService'] { } }, accessTokenSecret: { - required: false, + required: true, serializedName: 'typeProperties.accessTokenSecret', type: { name: 'Composite', diff --git a/lib/services/datafactoryManagement/lib/models/selfHostedIntegrationRuntimeStatus.js b/lib/services/datafactoryManagement/lib/models/selfHostedIntegrationRuntimeStatus.js index 558acd3d64..5bb567db28 100644 --- a/lib/services/datafactoryManagement/lib/models/selfHostedIntegrationRuntimeStatus.js +++ b/lib/services/datafactoryManagement/lib/models/selfHostedIntegrationRuntimeStatus.js @@ -20,6 +20,8 @@ const models = require('./index'); class SelfHostedIntegrationRuntimeStatus extends models['IntegrationRuntimeStatus'] { /** * Create a SelfHostedIntegrationRuntimeStatus. + * @member {object} [additionalProperties] Unmatched properties from the + * message are deserialized this collection * @member {date} [createTime] The time at which the integration runtime was * created, in ISO8601 format. * @member {string} [taskQueueId] The task queue id of the integration @@ -46,6 +48,11 @@ class SelfHostedIntegrationRuntimeStatus extends models['IntegrationRuntimeStatu * version. * @member {array} [links] The list of linked integration runtimes that are * created to share with this integration runtime. + * @member {array} [sharedWithFactories] The MSI-s of the data factories to + * which the integration runtime is shared. + * @member {string} [pushedVersion] The version that the integration runtime + * is going to update to. + * @member {string} [latestVersion] The latest version on download center. */ constructor() { super(); @@ -94,6 +101,20 @@ class SelfHostedIntegrationRuntimeStatus extends models['IntegrationRuntimeStatu name: 'String' } }, + additionalProperties: { + required: false, + serializedName: 'typeProperties.', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, createTime: { required: false, readOnly: true, @@ -237,6 +258,37 @@ class SelfHostedIntegrationRuntimeStatus extends models['IntegrationRuntimeStatu } } } + }, + sharedWithFactories: { + required: false, + readOnly: true, + serializedName: 'typeProperties.sharedWithFactories', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + pushedVersion: { + required: false, + readOnly: true, + serializedName: 'typeProperties.pushedVersion', + type: { + name: 'String' + } + }, + latestVersion: { + required: false, + readOnly: true, + serializedName: 'typeProperties.latestVersion', + type: { + name: 'String' + } } } } diff --git a/lib/services/datafactoryManagement/lib/models/serviceNowLinkedService.js b/lib/services/datafactoryManagement/lib/models/serviceNowLinkedService.js index 8dea5adcfb..51dce7e1ef 100644 --- a/lib/services/datafactoryManagement/lib/models/serviceNowLinkedService.js +++ b/lib/services/datafactoryManagement/lib/models/serviceNowLinkedService.js @@ -21,7 +21,7 @@ class ServiceNowLinkedService extends models['LinkedService'] { /** * Create a ServiceNowLinkedService. * @member {object} endpoint The endpoint of the ServiceNow server. (i.e. - * ServiceNowData.com) + * .service-now.com) * @member {string} authenticationType The authentication type to use. * Possible values include: 'Basic', 'OAuth2' * @member {object} [username] The user name used to connect to the diff --git a/lib/services/datafactoryManagement/lib/models/tabularTranslator.js b/lib/services/datafactoryManagement/lib/models/tabularTranslator.js index f04240d241..468a76db2e 100644 --- a/lib/services/datafactoryManagement/lib/models/tabularTranslator.js +++ b/lib/services/datafactoryManagement/lib/models/tabularTranslator.js @@ -20,8 +20,13 @@ const models = require('./index'); class TabularTranslator extends models['CopyTranslator'] { /** * Create a TabularTranslator. - * @member {object} [columnMappings] Column mappings. Type: string (or - * Expression with resultType string). + * @member {object} [columnMappings] Column mappings. Example: "UserId: + * MyUserId, Group: MyGroup, Name: MyName" Type: string (or Expression with + * resultType string). + * @member {object} [schemaMapping] The schema mapping to map between tabular + * data and hierarchical data. Example: {"Column1": "$.Column1", "Column2": + * "$.Column2.Property1", "Column3": "$.Column2.Property2"}. Type: object (or + * Expression with resultType object). */ constructor() { super(); @@ -60,6 +65,13 @@ class TabularTranslator extends models['CopyTranslator'] { type: { name: 'Object' } + }, + schemaMapping: { + required: false, + serializedName: 'schemaMapping', + type: { + name: 'Object' + } } } } diff --git a/lib/services/datafactoryManagement/lib/operations/factories.js b/lib/services/datafactoryManagement/lib/operations/factories.js index ae06a221cb..f0ca9a8de0 100644 --- a/lib/services/datafactoryManagement/lib/operations/factories.js +++ b/lib/services/datafactoryManagement/lib/operations/factories.js @@ -1248,14 +1248,12 @@ function _deleteMethod(resourceGroupName, factoryName, options, callback) { } /** - * Cancel a pipeline run by its run ID. + * List data factories which the given data factory has access. * * @param {string} resourceGroupName The resource group name. * * @param {string} factoryName The factory name. * - * @param {string} runId The pipeline run identifier. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1267,13 +1265,14 @@ function _deleteMethod(resourceGroupName, factoryName, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FactoryListResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _cancelPipelineRun(resourceGroupName, factoryName, runId, options, callback) { +function _listSharedFactories(resourceGroupName, factoryName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1322,9 +1321,6 @@ function _cancelPipelineRun(resourceGroupName, factoryName, runId, options, call throw new Error('"factoryName" should satisfy the constraint - "Pattern": /^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/'); } } - if (runId === null || runId === undefined || typeof runId.valueOf() !== 'string') { - throw new Error('runId cannot be null or undefined and it must be of type string.'); - } if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } @@ -1337,11 +1333,10 @@ function _cancelPipelineRun(resourceGroupName, factoryName, runId, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/cancelpipelinerun/{runId}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/listSharedFactories'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{factoryName}', encodeURIComponent(factoryName)); - requestUrl = requestUrl.replace('{runId}', encodeURIComponent(runId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { @@ -1404,19 +1399,40 @@ function _cancelPipelineRun(resourceGroupName, factoryName, runId, options, call // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FactoryListResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * Lists factories under the specified subscription. + * List integration runtimes which the given data factory has access. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.dataFactoryResourceId] The factory resource + * identifier. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1427,13 +1443,14 @@ function _cancelPipelineRun(resourceGroupName, factoryName, runId, options, call * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FactoryListResponse} for more information. + * See {@link IntegrationRuntimeListResponse} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listNext(nextPageLink, options, callback) { +function _listSharedIntegrationRuntimes(resourceGroupName, factoryName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1443,10 +1460,51 @@ function _listNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let dataFactoryResourceId = (options && options.dataFactoryResourceId !== undefined) ? options.dataFactoryResourceId : undefined; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (factoryName === null || factoryName === undefined || typeof factoryName.valueOf() !== 'string') { + throw new Error('factoryName cannot be null or undefined and it must be of type string.'); + } + if (factoryName !== null && factoryName !== undefined) { + if (factoryName.length > 63) + { + throw new Error('"factoryName" should satisfy the constraint - "MaxLength": 63'); + } + if (factoryName.length < 3) + { + throw new Error('"factoryName" should satisfy the constraint - "MinLength": 3'); + } + if (factoryName.match(/^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/) === null) + { + throw new Error('"factoryName" should satisfy the constraint - "Pattern": /^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/'); + } + } + if (dataFactoryResourceId !== null && dataFactoryResourceId !== undefined && typeof dataFactoryResourceId.valueOf() !== 'string') { + throw new Error('dataFactoryResourceId must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -1456,12 +1514,23 @@ function _listNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/listSharedIntegrationRuntimes'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{factoryName}', encodeURIComponent(factoryName)); + let queryParameters = []; + if (dataFactoryResourceId !== null && dataFactoryResourceId !== undefined) { + queryParameters.push('dataFactoryResourceId=' + encodeURIComponent(dataFactoryResourceId)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1522,7 +1591,7 @@ function _listNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FactoryListResponse']().mapper(); + let resultMapper = new client.models['IntegrationRuntimeListResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1538,10 +1607,13 @@ function _listNext(nextPageLink, options, callback) { } /** - * Lists factories. + * Cancel a pipeline run by its run ID. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} runId The pipeline run identifier. * * @param {object} [options] Optional Parameters. * @@ -1554,14 +1626,13 @@ function _listNext(nextPageLink, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FactoryListResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByResourceGroupNext(nextPageLink, options, callback) { +function _cancelPipelineRun(resourceGroupName, factoryName, runId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1573,8 +1644,48 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { } // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (factoryName === null || factoryName === undefined || typeof factoryName.valueOf() !== 'string') { + throw new Error('factoryName cannot be null or undefined and it must be of type string.'); + } + if (factoryName !== null && factoryName !== undefined) { + if (factoryName.length > 63) + { + throw new Error('"factoryName" should satisfy the constraint - "MaxLength": 63'); + } + if (factoryName.length < 3) + { + throw new Error('"factoryName" should satisfy the constraint - "MinLength": 3'); + } + if (factoryName.match(/^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/) === null) + { + throw new Error('"factoryName" should satisfy the constraint - "Pattern": /^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/'); + } + } + if (runId === null || runId === undefined || typeof runId.valueOf() !== 'string') { + throw new Error('runId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -1584,12 +1695,21 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/cancelpipelinerun/{runId}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{factoryName}', encodeURIComponent(factoryName)); + requestUrl = requestUrl.replace('{runId}', encodeURIComponent(runId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1643,67 +1763,905 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FactoryListResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } -/** Class representing a Factories. */ -class Factories { - /** - * Create a Factories. - * @param {DataFactoryManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._configureFactoryRepo = _configureFactoryRepo; - this._listByResourceGroup = _listByResourceGroup; - this._createOrUpdate = _createOrUpdate; - this._update = _update; - this._get = _get; - this._deleteMethod = _deleteMethod; - this._cancelPipelineRun = _cancelPipelineRun; - this._listNext = _listNext; - this._listByResourceGroupNext = _listByResourceGroupNext; +/** + * Lists factories under the specified subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FactoryListResponse} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); } - /** - * Lists factories under the specified subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FactoryListResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists factories. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FactoryListResponse} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FactoryListResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List data factories which the given data factory has access. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FactoryListResponse} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listSharedFactoriesNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FactoryListResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List integration runtimes which the given data factory has access. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link IntegrationRuntimeListResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listSharedIntegrationRuntimesNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['IntegrationRuntimeListResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Factories. */ +class Factories { + /** + * Create a Factories. + * @param {DataFactoryManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._configureFactoryRepo = _configureFactoryRepo; + this._listByResourceGroup = _listByResourceGroup; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._listSharedFactories = _listSharedFactories; + this._listSharedIntegrationRuntimes = _listSharedIntegrationRuntimes; + this._cancelPipelineRun = _cancelPipelineRun; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listSharedFactoriesNext = _listSharedFactoriesNext; + this._listSharedIntegrationRuntimesNext = _listSharedIntegrationRuntimesNext; + } + + /** + * Lists factories under the specified subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists factories under the specified subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FactoryListResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FactoryListResponse} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * Updates a factory's repo information. + * + * @param {string} locationId The location identifier. + * + * @param {object} factoryRepoUpdate Update factory repo request definition. + * + * @param {string} [factoryRepoUpdate.factoryResourceId] The factory resource + * id. + * + * @param {string} [factoryRepoUpdate.resourceGroupName] The resource group + * name. + * + * @param {object} [factoryRepoUpdate.vstsConfiguration] VSTS repo information + * of the factory. + * + * @param {string} [factoryRepoUpdate.vstsConfiguration.accountName] VSTS + * account name. + * + * @param {string} [factoryRepoUpdate.vstsConfiguration.projectName] VSTS + * project name. + * + * @param {string} [factoryRepoUpdate.vstsConfiguration.repositoryName] VSTS + * repository name. + * + * @param {string} [factoryRepoUpdate.vstsConfiguration.collaborationBranch] + * VSTS collaboration branch. + * + * @param {string} [factoryRepoUpdate.vstsConfiguration.rootFolder] VSTS root + * folder. + * + * @param {string} [factoryRepoUpdate.vstsConfiguration.lastCommitId] VSTS last + * commit id. + * + * @param {string} [factoryRepoUpdate.vstsConfiguration.tenantId] VSTS tenant + * id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + configureFactoryRepoWithHttpOperationResponse(locationId, factoryRepoUpdate, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._configureFactoryRepo(locationId, factoryRepoUpdate, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a factory's repo information. + * + * @param {string} locationId The location identifier. + * + * @param {object} factoryRepoUpdate Update factory repo request definition. + * + * @param {string} [factoryRepoUpdate.factoryResourceId] The factory resource + * id. + * + * @param {string} [factoryRepoUpdate.resourceGroupName] The resource group + * name. + * + * @param {object} [factoryRepoUpdate.vstsConfiguration] VSTS repo information + * of the factory. + * + * @param {string} [factoryRepoUpdate.vstsConfiguration.accountName] VSTS + * account name. + * + * @param {string} [factoryRepoUpdate.vstsConfiguration.projectName] VSTS + * project name. + * + * @param {string} [factoryRepoUpdate.vstsConfiguration.repositoryName] VSTS + * repository name. + * + * @param {string} [factoryRepoUpdate.vstsConfiguration.collaborationBranch] + * VSTS collaboration branch. + * + * @param {string} [factoryRepoUpdate.vstsConfiguration.rootFolder] VSTS root + * folder. + * + * @param {string} [factoryRepoUpdate.vstsConfiguration.lastCommitId] VSTS last + * commit id. + * + * @param {string} [factoryRepoUpdate.vstsConfiguration.tenantId] VSTS tenant + * id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Factory} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Factory} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + configureFactoryRepo(locationId, factoryRepoUpdate, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._configureFactoryRepo(locationId, factoryRepoUpdate, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._configureFactoryRepo(locationId, factoryRepoUpdate, options, optionalCallback); + } + } + + /** + * Lists factories. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists factories. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {FactoryListResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FactoryListResponse} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Creates or updates a factory. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {object} factory Factory resource definition. + * + * @param {object} [factory.identity] Managed service identity of the factory. + * + * @param {object} [factory.vstsConfiguration] VSTS repo information of the + * factory. + * + * @param {string} [factory.vstsConfiguration.accountName] VSTS account name. + * + * @param {string} [factory.vstsConfiguration.projectName] VSTS project name. + * + * @param {string} [factory.vstsConfiguration.repositoryName] VSTS repository + * name. + * + * @param {string} [factory.vstsConfiguration.collaborationBranch] VSTS + * collaboration branch. + * + * @param {string} [factory.vstsConfiguration.rootFolder] VSTS root folder. + * + * @param {string} [factory.vstsConfiguration.lastCommitId] VSTS last commit + * id. + * + * @param {string} [factory.vstsConfiguration.tenantId] VSTS tenant id. + * + * @param {string} [factory.location] The resource location. + * + * @param {object} [factory.tags] The resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listWithHttpOperationResponse(options) { + createOrUpdateWithHttpOperationResponse(resourceGroupName, factoryName, factory, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, factoryName, factory, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1714,7 +2672,39 @@ class Factories { } /** - * Lists factories under the specified subscription. + * Creates or updates a factory. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {object} factory Factory resource definition. + * + * @param {object} [factory.identity] Managed service identity of the factory. + * + * @param {object} [factory.vstsConfiguration] VSTS repo information of the + * factory. + * + * @param {string} [factory.vstsConfiguration.accountName] VSTS account name. + * + * @param {string} [factory.vstsConfiguration.projectName] VSTS project name. + * + * @param {string} [factory.vstsConfiguration.repositoryName] VSTS repository + * name. + * + * @param {string} [factory.vstsConfiguration.collaborationBranch] VSTS + * collaboration branch. + * + * @param {string} [factory.vstsConfiguration.rootFolder] VSTS root folder. + * + * @param {string} [factory.vstsConfiguration.lastCommitId] VSTS last commit + * id. + * + * @param {string} [factory.vstsConfiguration.tenantId] VSTS tenant id. + * + * @param {string} [factory.location] The resource location. + * + * @param {object} [factory.tags] The resource tags. * * @param {object} [options] Optional Parameters. * @@ -1728,7 +2718,7 @@ class Factories { * * {Promise} A promise is returned * - * @resolve {FactoryListResponse} - The deserialized result object. + * @resolve {Factory} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1737,13 +2727,13 @@ class Factories { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FactoryListResponse} for more information. + * See {@link Factory} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - list(options, optionalCallback) { + createOrUpdate(resourceGroupName, factoryName, factory, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1752,54 +2742,32 @@ class Factories { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, factoryName, factory, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._list(options, optionalCallback); + return self._createOrUpdate(resourceGroupName, factoryName, factory, options, optionalCallback); } } /** - * Updates a factory's repo information. + * Updates a factory. * - * @param {string} locationId The location identifier. + * @param {string} resourceGroupName The resource group name. * - * @param {object} factoryRepoUpdate Update factory repo request definition. + * @param {string} factoryName The factory name. * - * @param {string} [factoryRepoUpdate.factoryResourceId] The factory resource - * id. + * @param {object} factoryUpdateParameters The parameters for updating a + * factory. * - * @param {string} [factoryRepoUpdate.resourceGroupName] The resource group - * name. + * @param {object} [factoryUpdateParameters.tags] The resource tags. * - * @param {object} [factoryRepoUpdate.vstsConfiguration] VSTS repo information + * @param {object} [factoryUpdateParameters.identity] Managed service identity * of the factory. * - * @param {string} [factoryRepoUpdate.vstsConfiguration.accountName] VSTS - * account name. - * - * @param {string} [factoryRepoUpdate.vstsConfiguration.projectName] VSTS - * project name. - * - * @param {string} [factoryRepoUpdate.vstsConfiguration.repositoryName] VSTS - * repository name. - * - * @param {string} [factoryRepoUpdate.vstsConfiguration.collaborationBranch] - * VSTS collaboration branch. - * - * @param {string} [factoryRepoUpdate.vstsConfiguration.rootFolder] VSTS root - * folder. - * - * @param {string} [factoryRepoUpdate.vstsConfiguration.lastCommitId] VSTS last - * commit id. - * - * @param {string} [factoryRepoUpdate.vstsConfiguration.tenantId] VSTS tenant - * id. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1811,11 +2779,11 @@ class Factories { * * @reject {Error} - The error object. */ - configureFactoryRepoWithHttpOperationResponse(locationId, factoryRepoUpdate, options) { + updateWithHttpOperationResponse(resourceGroupName, factoryName, factoryUpdateParameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._configureFactoryRepo(locationId, factoryRepoUpdate, options, (err, result, request, response) => { + self._update(resourceGroupName, factoryName, factoryUpdateParameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1826,41 +2794,105 @@ class Factories { } /** - * Updates a factory's repo information. + * Updates a factory. * - * @param {string} locationId The location identifier. + * @param {string} resourceGroupName The resource group name. * - * @param {object} factoryRepoUpdate Update factory repo request definition. + * @param {string} factoryName The factory name. * - * @param {string} [factoryRepoUpdate.factoryResourceId] The factory resource - * id. + * @param {object} factoryUpdateParameters The parameters for updating a + * factory. * - * @param {string} [factoryRepoUpdate.resourceGroupName] The resource group - * name. + * @param {object} [factoryUpdateParameters.tags] The resource tags. * - * @param {object} [factoryRepoUpdate.vstsConfiguration] VSTS repo information + * @param {object} [factoryUpdateParameters.identity] Managed service identity * of the factory. * - * @param {string} [factoryRepoUpdate.vstsConfiguration.accountName] VSTS - * account name. + * @param {object} [options] Optional Parameters. * - * @param {string} [factoryRepoUpdate.vstsConfiguration.projectName] VSTS - * project name. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [factoryRepoUpdate.vstsConfiguration.repositoryName] VSTS - * repository name. + * @param {function} [optionalCallback] - The optional callback. * - * @param {string} [factoryRepoUpdate.vstsConfiguration.collaborationBranch] - * VSTS collaboration branch. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {string} [factoryRepoUpdate.vstsConfiguration.rootFolder] VSTS root - * folder. + * {Promise} A promise is returned + * + * @resolve {Factory} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Factory} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, factoryName, factoryUpdateParameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, factoryName, factoryUpdateParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, factoryName, factoryUpdateParameters, options, optionalCallback); + } + } + + /** + * Gets a factory. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, factoryName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, factoryName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a factory. * - * @param {string} [factoryRepoUpdate.vstsConfiguration.lastCommitId] VSTS last - * commit id. + * @param {string} resourceGroupName The resource group name. * - * @param {string} [factoryRepoUpdate.vstsConfiguration.tenantId] VSTS tenant - * id. + * @param {string} factoryName The factory name. * * @param {object} [options] Optional Parameters. * @@ -1889,7 +2921,7 @@ class Factories { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - configureFactoryRepo(locationId, factoryRepoUpdate, options, optionalCallback) { + get(resourceGroupName, factoryName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1898,22 +2930,24 @@ class Factories { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._configureFactoryRepo(locationId, factoryRepoUpdate, options, (err, result, request, response) => { + self._get(resourceGroupName, factoryName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._configureFactoryRepo(locationId, factoryRepoUpdate, options, optionalCallback); + return self._get(resourceGroupName, factoryName, options, optionalCallback); } } /** - * Lists factories. + * Deletes a factory. * * @param {string} resourceGroupName The resource group name. * + * @param {string} factoryName The factory name. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1921,15 +2955,15 @@ class Factories { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + deleteMethodWithHttpOperationResponse(resourceGroupName, factoryName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, factoryName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1940,10 +2974,12 @@ class Factories { } /** - * Lists factories. + * Deletes a factory. * * @param {string} resourceGroupName The resource group name. * + * @param {string} factoryName The factory name. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1956,7 +2992,7 @@ class Factories { * * {Promise} A promise is returned * - * @resolve {FactoryListResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1964,14 +3000,13 @@ class Factories { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FactoryListResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroup(resourceGroupName, options, optionalCallback) { + deleteMethod(resourceGroupName, factoryName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1980,52 +3015,24 @@ class Factories { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, factoryName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + return self._deleteMethod(resourceGroupName, factoryName, options, optionalCallback); } } /** - * Creates or updates a factory. + * List data factories which the given data factory has access. * * @param {string} resourceGroupName The resource group name. * * @param {string} factoryName The factory name. * - * @param {object} factory Factory resource definition. - * - * @param {object} [factory.identity] Managed service identity of the factory. - * - * @param {object} [factory.vstsConfiguration] VSTS repo information of the - * factory. - * - * @param {string} [factory.vstsConfiguration.accountName] VSTS account name. - * - * @param {string} [factory.vstsConfiguration.projectName] VSTS project name. - * - * @param {string} [factory.vstsConfiguration.repositoryName] VSTS repository - * name. - * - * @param {string} [factory.vstsConfiguration.collaborationBranch] VSTS - * collaboration branch. - * - * @param {string} [factory.vstsConfiguration.rootFolder] VSTS root folder. - * - * @param {string} [factory.vstsConfiguration.lastCommitId] VSTS last commit - * id. - * - * @param {string} [factory.vstsConfiguration.tenantId] VSTS tenant id. - * - * @param {string} [factory.location] The resource location. - * - * @param {object} [factory.tags] The resource tags. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2033,15 +3040,15 @@ class Factories { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, factoryName, factory, options) { + listSharedFactoriesWithHttpOperationResponse(resourceGroupName, factoryName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, factoryName, factory, options, (err, result, request, response) => { + self._listSharedFactories(resourceGroupName, factoryName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2052,40 +3059,12 @@ class Factories { } /** - * Creates or updates a factory. + * List data factories which the given data factory has access. * * @param {string} resourceGroupName The resource group name. * * @param {string} factoryName The factory name. * - * @param {object} factory Factory resource definition. - * - * @param {object} [factory.identity] Managed service identity of the factory. - * - * @param {object} [factory.vstsConfiguration] VSTS repo information of the - * factory. - * - * @param {string} [factory.vstsConfiguration.accountName] VSTS account name. - * - * @param {string} [factory.vstsConfiguration.projectName] VSTS project name. - * - * @param {string} [factory.vstsConfiguration.repositoryName] VSTS repository - * name. - * - * @param {string} [factory.vstsConfiguration.collaborationBranch] VSTS - * collaboration branch. - * - * @param {string} [factory.vstsConfiguration.rootFolder] VSTS root folder. - * - * @param {string} [factory.vstsConfiguration.lastCommitId] VSTS last commit - * id. - * - * @param {string} [factory.vstsConfiguration.tenantId] VSTS tenant id. - * - * @param {string} [factory.location] The resource location. - * - * @param {object} [factory.tags] The resource tags. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2098,7 +3077,7 @@ class Factories { * * {Promise} A promise is returned * - * @resolve {Factory} - The deserialized result object. + * @resolve {FactoryListResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2107,13 +3086,13 @@ class Factories { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Factory} for more information. + * See {@link FactoryListResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, factoryName, factory, options, optionalCallback) { + listSharedFactories(resourceGroupName, factoryName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2122,48 +3101,43 @@ class Factories { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, factoryName, factory, options, (err, result, request, response) => { + self._listSharedFactories(resourceGroupName, factoryName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, factoryName, factory, options, optionalCallback); + return self._listSharedFactories(resourceGroupName, factoryName, options, optionalCallback); } } /** - * Updates a factory. + * List integration runtimes which the given data factory has access. * * @param {string} resourceGroupName The resource group name. * * @param {string} factoryName The factory name. * - * @param {object} factoryUpdateParameters The parameters for updating a - * factory. - * - * @param {object} [factoryUpdateParameters.tags] The resource tags. - * - * @param {object} [factoryUpdateParameters.identity] Managed service identity - * of the factory. - * * @param {object} [options] Optional Parameters. * + * @param {string} [options.dataFactoryResourceId] The factory resource + * identifier. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, factoryName, factoryUpdateParameters, options) { + listSharedIntegrationRuntimesWithHttpOperationResponse(resourceGroupName, factoryName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, factoryName, factoryUpdateParameters, options, (err, result, request, response) => { + self._listSharedIntegrationRuntimes(resourceGroupName, factoryName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2174,22 +3148,17 @@ class Factories { } /** - * Updates a factory. + * List integration runtimes which the given data factory has access. * * @param {string} resourceGroupName The resource group name. * * @param {string} factoryName The factory name. * - * @param {object} factoryUpdateParameters The parameters for updating a - * factory. - * - * @param {object} [factoryUpdateParameters.tags] The resource tags. - * - * @param {object} [factoryUpdateParameters.identity] Managed service identity - * of the factory. - * * @param {object} [options] Optional Parameters. * + * @param {string} [options.dataFactoryResourceId] The factory resource + * identifier. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -2200,7 +3169,7 @@ class Factories { * * {Promise} A promise is returned * - * @resolve {Factory} - The deserialized result object. + * @resolve {IntegrationRuntimeListResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2209,13 +3178,14 @@ class Factories { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Factory} for more information. + * See {@link IntegrationRuntimeListResponse} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, factoryName, factoryUpdateParameters, options, optionalCallback) { + listSharedIntegrationRuntimes(resourceGroupName, factoryName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2224,24 +3194,26 @@ class Factories { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, factoryName, factoryUpdateParameters, options, (err, result, request, response) => { + self._listSharedIntegrationRuntimes(resourceGroupName, factoryName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, factoryName, factoryUpdateParameters, options, optionalCallback); + return self._listSharedIntegrationRuntimes(resourceGroupName, factoryName, options, optionalCallback); } } /** - * Gets a factory. + * Cancel a pipeline run by its run ID. * * @param {string} resourceGroupName The resource group name. * * @param {string} factoryName The factory name. * + * @param {string} runId The pipeline run identifier. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2249,15 +3221,15 @@ class Factories { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, factoryName, options) { + cancelPipelineRunWithHttpOperationResponse(resourceGroupName, factoryName, runId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, factoryName, options, (err, result, request, response) => { + self._cancelPipelineRun(resourceGroupName, factoryName, runId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2268,12 +3240,14 @@ class Factories { } /** - * Gets a factory. + * Cancel a pipeline run by its run ID. * * @param {string} resourceGroupName The resource group name. * * @param {string} factoryName The factory name. * + * @param {string} runId The pipeline run identifier. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2286,7 +3260,7 @@ class Factories { * * {Promise} A promise is returned * - * @resolve {Factory} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2294,14 +3268,13 @@ class Factories { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Factory} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, factoryName, options, optionalCallback) { + cancelPipelineRun(resourceGroupName, factoryName, runId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2310,23 +3283,22 @@ class Factories { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, factoryName, options, (err, result, request, response) => { + self._cancelPipelineRun(resourceGroupName, factoryName, runId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, factoryName, options, optionalCallback); + return self._cancelPipelineRun(resourceGroupName, factoryName, runId, options, optionalCallback); } } /** - * Deletes a factory. - * - * @param {string} resourceGroupName The resource group name. + * Lists factories under the specified subscription. * - * @param {string} factoryName The factory name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2335,15 +3307,15 @@ class Factories { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, factoryName, options) { + listNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, factoryName, options, (err, result, request, response) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2354,11 +3326,10 @@ class Factories { } /** - * Deletes a factory. - * - * @param {string} resourceGroupName The resource group name. + * Lists factories under the specified subscription. * - * @param {string} factoryName The factory name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2372,7 +3343,7 @@ class Factories { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {FactoryListResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2380,13 +3351,14 @@ class Factories { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FactoryListResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, factoryName, options, optionalCallback) { + listNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2395,25 +3367,22 @@ class Factories { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, factoryName, options, (err, result, request, response) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, factoryName, options, optionalCallback); + return self._listNext(nextPageLink, options, optionalCallback); } } /** - * Cancel a pipeline run by its run ID. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} factoryName The factory name. + * Lists factories. * - * @param {string} runId The pipeline run identifier. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2422,15 +3391,15 @@ class Factories { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - cancelPipelineRunWithHttpOperationResponse(resourceGroupName, factoryName, runId, options) { + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._cancelPipelineRun(resourceGroupName, factoryName, runId, options, (err, result, request, response) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2441,13 +3410,10 @@ class Factories { } /** - * Cancel a pipeline run by its run ID. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} factoryName The factory name. + * Lists factories. * - * @param {string} runId The pipeline run identifier. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2461,7 +3427,7 @@ class Factories { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {FactoryListResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2469,13 +3435,14 @@ class Factories { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FactoryListResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - cancelPipelineRun(resourceGroupName, factoryName, runId, options, optionalCallback) { + listByResourceGroupNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2484,19 +3451,19 @@ class Factories { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._cancelPipelineRun(resourceGroupName, factoryName, runId, options, (err, result, request, response) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._cancelPipelineRun(resourceGroupName, factoryName, runId, options, optionalCallback); + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); } } /** - * Lists factories under the specified subscription. + * List data factories which the given data factory has access. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2512,11 +3479,11 @@ class Factories { * * @reject {Error} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink, options) { + listSharedFactoriesNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listNext(nextPageLink, options, (err, result, request, response) => { + self._listSharedFactoriesNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2527,7 +3494,7 @@ class Factories { } /** - * Lists factories under the specified subscription. + * List data factories which the given data factory has access. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2559,7 +3526,7 @@ class Factories { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink, options, optionalCallback) { + listSharedFactoriesNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2568,19 +3535,19 @@ class Factories { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listNext(nextPageLink, options, (err, result, request, response) => { + self._listSharedFactoriesNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listNext(nextPageLink, options, optionalCallback); + return self._listSharedFactoriesNext(nextPageLink, options, optionalCallback); } } /** - * Lists factories. + * List integration runtimes which the given data factory has access. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2592,15 +3559,15 @@ class Factories { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + listSharedIntegrationRuntimesNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + self._listSharedIntegrationRuntimesNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2611,7 +3578,7 @@ class Factories { } /** - * Lists factories. + * List integration runtimes which the given data factory has access. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2628,7 +3595,7 @@ class Factories { * * {Promise} A promise is returned * - * @resolve {FactoryListResponse} - The deserialized result object. + * @resolve {IntegrationRuntimeListResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2637,13 +3604,14 @@ class Factories { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FactoryListResponse} for more information. + * See {@link IntegrationRuntimeListResponse} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroupNext(nextPageLink, options, optionalCallback) { + listSharedIntegrationRuntimesNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2652,14 +3620,14 @@ class Factories { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + self._listSharedIntegrationRuntimesNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + return self._listSharedIntegrationRuntimesNext(nextPageLink, options, optionalCallback); } } diff --git a/lib/services/datafactoryManagement/lib/operations/index.d.ts b/lib/services/datafactoryManagement/lib/operations/index.d.ts index c8ff35b73d..e38c6ac697 100644 --- a/lib/services/datafactoryManagement/lib/operations/index.d.ts +++ b/lib/services/datafactoryManagement/lib/operations/index.d.ts @@ -613,6 +613,131 @@ export interface Factories { deleteMethod(resourceGroupName: string, factoryName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * List data factories which the given data factory has access. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSharedFactoriesWithHttpOperationResponse(resourceGroupName: string, factoryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List data factories which the given data factory has access. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FactoryListResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FactoryListResponse} [result] - The deserialized result object if an error did not occur. + * See {@link FactoryListResponse} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSharedFactories(resourceGroupName: string, factoryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSharedFactories(resourceGroupName: string, factoryName: string, callback: ServiceCallback): void; + listSharedFactories(resourceGroupName: string, factoryName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * List integration runtimes which the given data factory has access. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.dataFactoryResourceId] The factory resource + * identifier. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSharedIntegrationRuntimesWithHttpOperationResponse(resourceGroupName: string, factoryName: string, options?: { dataFactoryResourceId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List integration runtimes which the given data factory has access. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.dataFactoryResourceId] The factory resource + * identifier. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {IntegrationRuntimeListResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {IntegrationRuntimeListResponse} [result] - The deserialized result object if an error did not occur. + * See {@link IntegrationRuntimeListResponse} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSharedIntegrationRuntimes(resourceGroupName: string, factoryName: string, options?: { dataFactoryResourceId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listSharedIntegrationRuntimes(resourceGroupName: string, factoryName: string, callback: ServiceCallback): void; + listSharedIntegrationRuntimes(resourceGroupName: string, factoryName: string, options: { dataFactoryResourceId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Cancel a pipeline run by its run ID. * @@ -787,6 +912,121 @@ export interface Factories { listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * List data factories which the given data factory has access. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSharedFactoriesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List data factories which the given data factory has access. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FactoryListResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FactoryListResponse} [result] - The deserialized result object if an error did not occur. + * See {@link FactoryListResponse} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSharedFactoriesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSharedFactoriesNext(nextPageLink: string, callback: ServiceCallback): void; + listSharedFactoriesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * List integration runtimes which the given data factory has access. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSharedIntegrationRuntimesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List integration runtimes which the given data factory has access. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {IntegrationRuntimeListResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {IntegrationRuntimeListResponse} [result] - The deserialized result object if an error did not occur. + * See {@link IntegrationRuntimeListResponse} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSharedIntegrationRuntimesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSharedIntegrationRuntimesNext(nextPageLink: string, callback: ServiceCallback): void; + listSharedIntegrationRuntimesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** @@ -1834,6 +2074,170 @@ export interface IntegrationRuntimes { upgrade(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * Grant integration runtime access to other data factory. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {object} integrationRuntimePermissionRequest The data factory + * identity which will be granted the access to given integration runtime. + * + * @param {string} [integrationRuntimePermissionRequest.factoryName] The data + * factory name. + * + * @param {string} integrationRuntimePermissionRequest.factoryIdentity The data + * factory identity. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + addIdentityWithHttpOperationResponse(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, integrationRuntimePermissionRequest: models.IntegrationRuntimePermissionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Grant integration runtime access to other data factory. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {object} integrationRuntimePermissionRequest The data factory + * identity which will be granted the access to given integration runtime. + * + * @param {string} [integrationRuntimePermissionRequest.factoryName] The data + * factory name. + * + * @param {string} integrationRuntimePermissionRequest.factoryIdentity The data + * factory identity. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {IntegrationRuntimePermissionResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {IntegrationRuntimePermissionResponse} [result] - The deserialized result object if an error did not occur. + * See {@link IntegrationRuntimePermissionResponse} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + addIdentity(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, integrationRuntimePermissionRequest: models.IntegrationRuntimePermissionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + addIdentity(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, integrationRuntimePermissionRequest: models.IntegrationRuntimePermissionRequest, callback: ServiceCallback): void; + addIdentity(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, integrationRuntimePermissionRequest: models.IntegrationRuntimePermissionRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Revoke the integration runtime access from other data factory. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {object} integrationRuntimePermissionRequest The data factory + * identity which will be revoked the access to given integration runtime. + * + * @param {string} [integrationRuntimePermissionRequest.factoryName] The data + * factory name. + * + * @param {string} integrationRuntimePermissionRequest.factoryIdentity The data + * factory identity. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + removeIdentityWithHttpOperationResponse(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, integrationRuntimePermissionRequest: models.IntegrationRuntimePermissionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Revoke the integration runtime access from other data factory. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {object} integrationRuntimePermissionRequest The data factory + * identity which will be revoked the access to given integration runtime. + * + * @param {string} [integrationRuntimePermissionRequest.factoryName] The data + * factory name. + * + * @param {string} integrationRuntimePermissionRequest.factoryIdentity The data + * factory identity. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {IntegrationRuntimePermissionResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {IntegrationRuntimePermissionResponse} [result] - The deserialized result object if an error did not occur. + * See {@link IntegrationRuntimePermissionResponse} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + removeIdentity(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, integrationRuntimePermissionRequest: models.IntegrationRuntimePermissionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + removeIdentity(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, integrationRuntimePermissionRequest: models.IntegrationRuntimePermissionRequest, callback: ServiceCallback): void; + removeIdentity(resourceGroupName: string, factoryName: string, integrationRuntimeName: string, integrationRuntimePermissionRequest: models.IntegrationRuntimePermissionRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Starts a ManagedReserved type integration runtime. * diff --git a/lib/services/datafactoryManagement/lib/operations/integrationRuntimes.js b/lib/services/datafactoryManagement/lib/operations/integrationRuntimes.js index fa6dc63e2f..52400218b1 100644 --- a/lib/services/datafactoryManagement/lib/operations/integrationRuntimes.js +++ b/lib/services/datafactoryManagement/lib/operations/integrationRuntimes.js @@ -2719,6 +2719,448 @@ function _upgrade(resourceGroupName, factoryName, integrationRuntimeName, option }); } +/** + * Grant integration runtime access to other data factory. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {object} integrationRuntimePermissionRequest The data factory + * identity which will be granted the access to given integration runtime. + * + * @param {string} [integrationRuntimePermissionRequest.factoryName] The data + * factory name. + * + * @param {string} integrationRuntimePermissionRequest.factoryIdentity The data + * factory identity. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link IntegrationRuntimePermissionResponse} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _addIdentity(resourceGroupName, factoryName, integrationRuntimeName, integrationRuntimePermissionRequest, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (factoryName === null || factoryName === undefined || typeof factoryName.valueOf() !== 'string') { + throw new Error('factoryName cannot be null or undefined and it must be of type string.'); + } + if (factoryName !== null && factoryName !== undefined) { + if (factoryName.length > 63) + { + throw new Error('"factoryName" should satisfy the constraint - "MaxLength": 63'); + } + if (factoryName.length < 3) + { + throw new Error('"factoryName" should satisfy the constraint - "MinLength": 3'); + } + if (factoryName.match(/^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/) === null) + { + throw new Error('"factoryName" should satisfy the constraint - "Pattern": /^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/'); + } + } + if (integrationRuntimeName === null || integrationRuntimeName === undefined || typeof integrationRuntimeName.valueOf() !== 'string') { + throw new Error('integrationRuntimeName cannot be null or undefined and it must be of type string.'); + } + if (integrationRuntimeName !== null && integrationRuntimeName !== undefined) { + if (integrationRuntimeName.length > 63) + { + throw new Error('"integrationRuntimeName" should satisfy the constraint - "MaxLength": 63'); + } + if (integrationRuntimeName.length < 3) + { + throw new Error('"integrationRuntimeName" should satisfy the constraint - "MinLength": 3'); + } + if (integrationRuntimeName.match(/^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/) === null) + { + throw new Error('"integrationRuntimeName" should satisfy the constraint - "Pattern": /^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (integrationRuntimePermissionRequest === null || integrationRuntimePermissionRequest === undefined) { + throw new Error('integrationRuntimePermissionRequest cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/addIdentity'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{factoryName}', encodeURIComponent(factoryName)); + requestUrl = requestUrl.replace('{integrationRuntimeName}', encodeURIComponent(integrationRuntimeName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (integrationRuntimePermissionRequest !== null && integrationRuntimePermissionRequest !== undefined) { + let requestModelMapper = new client.models['IntegrationRuntimePermissionRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, integrationRuntimePermissionRequest, 'integrationRuntimePermissionRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(integrationRuntimePermissionRequest, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['IntegrationRuntimePermissionResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Revoke the integration runtime access from other data factory. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {object} integrationRuntimePermissionRequest The data factory + * identity which will be revoked the access to given integration runtime. + * + * @param {string} [integrationRuntimePermissionRequest.factoryName] The data + * factory name. + * + * @param {string} integrationRuntimePermissionRequest.factoryIdentity The data + * factory identity. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link IntegrationRuntimePermissionResponse} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _removeIdentity(resourceGroupName, factoryName, integrationRuntimeName, integrationRuntimePermissionRequest, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+$/'); + } + } + if (factoryName === null || factoryName === undefined || typeof factoryName.valueOf() !== 'string') { + throw new Error('factoryName cannot be null or undefined and it must be of type string.'); + } + if (factoryName !== null && factoryName !== undefined) { + if (factoryName.length > 63) + { + throw new Error('"factoryName" should satisfy the constraint - "MaxLength": 63'); + } + if (factoryName.length < 3) + { + throw new Error('"factoryName" should satisfy the constraint - "MinLength": 3'); + } + if (factoryName.match(/^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/) === null) + { + throw new Error('"factoryName" should satisfy the constraint - "Pattern": /^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/'); + } + } + if (integrationRuntimeName === null || integrationRuntimeName === undefined || typeof integrationRuntimeName.valueOf() !== 'string') { + throw new Error('integrationRuntimeName cannot be null or undefined and it must be of type string.'); + } + if (integrationRuntimeName !== null && integrationRuntimeName !== undefined) { + if (integrationRuntimeName.length > 63) + { + throw new Error('"integrationRuntimeName" should satisfy the constraint - "MaxLength": 63'); + } + if (integrationRuntimeName.length < 3) + { + throw new Error('"integrationRuntimeName" should satisfy the constraint - "MinLength": 3'); + } + if (integrationRuntimeName.match(/^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/) === null) + { + throw new Error('"integrationRuntimeName" should satisfy the constraint - "Pattern": /^[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$/'); + } + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (integrationRuntimePermissionRequest === null || integrationRuntimePermissionRequest === undefined) { + throw new Error('integrationRuntimePermissionRequest cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/integrationRuntimes/{integrationRuntimeName}/removeIdentity'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{factoryName}', encodeURIComponent(factoryName)); + requestUrl = requestUrl.replace('{integrationRuntimeName}', encodeURIComponent(integrationRuntimeName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (integrationRuntimePermissionRequest !== null && integrationRuntimePermissionRequest !== undefined) { + let requestModelMapper = new client.models['IntegrationRuntimePermissionRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, integrationRuntimePermissionRequest, 'integrationRuntimePermissionRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(integrationRuntimePermissionRequest, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['IntegrationRuntimePermissionResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + /** * Starts a ManagedReserved type integration runtime. * @@ -3242,6 +3684,8 @@ class IntegrationRuntimes { this._syncCredentials = _syncCredentials; this._getMonitoringData = _getMonitoringData; this._upgrade = _upgrade; + this._addIdentity = _addIdentity; + this._removeIdentity = _removeIdentity; this._beginStart = _beginStart; this._beginStop = _beginStop; this._listByFactoryNext = _listByFactoryNext; @@ -4688,6 +5132,224 @@ class IntegrationRuntimes { } } + /** + * Grant integration runtime access to other data factory. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {object} integrationRuntimePermissionRequest The data factory + * identity which will be granted the access to given integration runtime. + * + * @param {string} [integrationRuntimePermissionRequest.factoryName] The data + * factory name. + * + * @param {string} integrationRuntimePermissionRequest.factoryIdentity The data + * factory identity. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + addIdentityWithHttpOperationResponse(resourceGroupName, factoryName, integrationRuntimeName, integrationRuntimePermissionRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._addIdentity(resourceGroupName, factoryName, integrationRuntimeName, integrationRuntimePermissionRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Grant integration runtime access to other data factory. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {object} integrationRuntimePermissionRequest The data factory + * identity which will be granted the access to given integration runtime. + * + * @param {string} [integrationRuntimePermissionRequest.factoryName] The data + * factory name. + * + * @param {string} integrationRuntimePermissionRequest.factoryIdentity The data + * factory identity. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {IntegrationRuntimePermissionResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link IntegrationRuntimePermissionResponse} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + addIdentity(resourceGroupName, factoryName, integrationRuntimeName, integrationRuntimePermissionRequest, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._addIdentity(resourceGroupName, factoryName, integrationRuntimeName, integrationRuntimePermissionRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._addIdentity(resourceGroupName, factoryName, integrationRuntimeName, integrationRuntimePermissionRequest, options, optionalCallback); + } + } + + /** + * Revoke the integration runtime access from other data factory. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {object} integrationRuntimePermissionRequest The data factory + * identity which will be revoked the access to given integration runtime. + * + * @param {string} [integrationRuntimePermissionRequest.factoryName] The data + * factory name. + * + * @param {string} integrationRuntimePermissionRequest.factoryIdentity The data + * factory identity. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + removeIdentityWithHttpOperationResponse(resourceGroupName, factoryName, integrationRuntimeName, integrationRuntimePermissionRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._removeIdentity(resourceGroupName, factoryName, integrationRuntimeName, integrationRuntimePermissionRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Revoke the integration runtime access from other data factory. + * + * @param {string} resourceGroupName The resource group name. + * + * @param {string} factoryName The factory name. + * + * @param {string} integrationRuntimeName The integration runtime name. + * + * @param {object} integrationRuntimePermissionRequest The data factory + * identity which will be revoked the access to given integration runtime. + * + * @param {string} [integrationRuntimePermissionRequest.factoryName] The data + * factory name. + * + * @param {string} integrationRuntimePermissionRequest.factoryIdentity The data + * factory identity. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {IntegrationRuntimePermissionResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link IntegrationRuntimePermissionResponse} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + removeIdentity(resourceGroupName, factoryName, integrationRuntimeName, integrationRuntimePermissionRequest, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._removeIdentity(resourceGroupName, factoryName, integrationRuntimeName, integrationRuntimePermissionRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._removeIdentity(resourceGroupName, factoryName, integrationRuntimeName, integrationRuntimePermissionRequest, options, optionalCallback); + } + } + /** * Starts a ManagedReserved type integration runtime. *