diff --git a/lib/services/datafactoryManagement/lib/dataFactoryManagementClient.d.ts b/lib/services/datafactoryManagement/lib/dataFactoryManagementClient.d.ts index 47c001b466..66b2f03941 100644 --- a/lib/services/datafactoryManagement/lib/dataFactoryManagementClient.d.ts +++ b/lib/services/datafactoryManagement/lib/dataFactoryManagementClient.d.ts @@ -58,6 +58,7 @@ export default class DataFactoryManagementClient extends AzureServiceClient { // Operation groups operations: operations.Operations; factories: operations.Factories; + exposureControl: operations.ExposureControl; integrationRuntimes: operations.IntegrationRuntimes; integrationRuntimeObjectMetadata: operations.IntegrationRuntimeObjectMetadata; integrationRuntimeNodes: operations.IntegrationRuntimeNodes; diff --git a/lib/services/datafactoryManagement/lib/dataFactoryManagementClient.js b/lib/services/datafactoryManagement/lib/dataFactoryManagementClient.js index 07a3c7e228..58cfcb48c2 100644 --- a/lib/services/datafactoryManagement/lib/dataFactoryManagementClient.js +++ b/lib/services/datafactoryManagement/lib/dataFactoryManagementClient.js @@ -74,6 +74,7 @@ class DataFactoryManagementClient extends ServiceClient { } this.operations = new operations.Operations(this); this.factories = new operations.Factories(this); + this.exposureControl = new operations.ExposureControl(this); this.integrationRuntimes = new operations.IntegrationRuntimes(this); this.integrationRuntimeObjectMetadata = new operations.IntegrationRuntimeObjectMetadata(this); this.integrationRuntimeNodes = new operations.IntegrationRuntimeNodes(this); diff --git a/lib/services/datafactoryManagement/lib/models/executeSSISPackageActivity.js b/lib/services/datafactoryManagement/lib/models/executeSSISPackageActivity.js index 9112696be5..ad07c82752 100644 --- a/lib/services/datafactoryManagement/lib/models/executeSSISPackageActivity.js +++ b/lib/services/datafactoryManagement/lib/models/executeSSISPackageActivity.js @@ -31,6 +31,14 @@ class ExecuteSSISPackageActivity extends models['ExecutionActivity'] { * @property {object} [environmentPath] The environment path to execute the * SSIS package. Type: string (or Expression with resultType string). * @property {object} [executionCredential] The package execution credential. + * @property {object} [executionCredential.domain] Domain for windows + * authentication. + * @property {object} [executionCredential.userName] UseName for windows + * authentication. + * @property {object} [executionCredential.password] Password for windows + * authentication. + * @property {string} [executionCredential.password.value] Value of secure + * string. * @property {object} connectVia The integration runtime reference. * @property {string} [connectVia.referenceName] Reference integration * runtime name. @@ -195,15 +203,8 @@ class ExecuteSSISPackageActivity extends models['ExecutionActivity'] { required: false, serializedName: 'typeProperties.executionCredential', type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'SSISExecutionCredentialElementType', - type: { - name: 'Composite', - className: 'SSISExecutionCredential' - } - } + name: 'Composite', + className: 'SSISExecutionCredential' } }, connectVia: { diff --git a/lib/services/datafactoryManagement/lib/models/exposureControlRequest.js b/lib/services/datafactoryManagement/lib/models/exposureControlRequest.js new file mode 100644 index 0000000000..c322977b08 --- /dev/null +++ b/lib/services/datafactoryManagement/lib/models/exposureControlRequest.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'; + +/** + * The exposure control request. + * + */ +class ExposureControlRequest { + /** + * Create a ExposureControlRequest. + * @property {string} [featureName] The feature name. + * @property {string} [featureType] The feature type. + */ + constructor() { + } + + /** + * Defines the metadata of ExposureControlRequest + * + * @returns {object} metadata of ExposureControlRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'ExposureControlRequest', + type: { + name: 'Composite', + className: 'ExposureControlRequest', + modelProperties: { + featureName: { + required: false, + serializedName: 'featureName', + type: { + name: 'String' + } + }, + featureType: { + required: false, + serializedName: 'featureType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExposureControlRequest; diff --git a/lib/services/datafactoryManagement/lib/models/exposureControlResponse.js b/lib/services/datafactoryManagement/lib/models/exposureControlResponse.js new file mode 100644 index 0000000000..98ff340842 --- /dev/null +++ b/lib/services/datafactoryManagement/lib/models/exposureControlResponse.js @@ -0,0 +1,62 @@ +/* + * 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 exposure control response. + * + */ +class ExposureControlResponse { + /** + * Create a ExposureControlResponse. + * @property {string} [featureName] The feature name. + * @property {string} [value] The feature value. + */ + constructor() { + } + + /** + * Defines the metadata of ExposureControlResponse + * + * @returns {object} metadata of ExposureControlResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'ExposureControlResponse', + type: { + name: 'Composite', + className: 'ExposureControlResponse', + modelProperties: { + featureName: { + required: false, + readOnly: true, + serializedName: 'featureName', + type: { + name: 'String' + } + }, + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ExposureControlResponse; diff --git a/lib/services/datafactoryManagement/lib/models/index.d.ts b/lib/services/datafactoryManagement/lib/models/index.d.ts index 25d4be54f8..6cc7f6e13c 100644 --- a/lib/services/datafactoryManagement/lib/models/index.d.ts +++ b/lib/services/datafactoryManagement/lib/models/index.d.ts @@ -1343,6 +1343,34 @@ export interface SsisObjectMetadataStatusResponse { error?: string; } +/** + * The exposure control request. + */ +export interface ExposureControlRequest { + /** + * The feature name. + */ + featureName?: string; + /** + * The feature type. + */ + featureType?: string; +} + +/** + * The exposure control response. + */ +export interface ExposureControlResponse { + /** + * The feature name. + */ + readonly featureName?: string; + /** + * The feature value. + */ + readonly value?: string; +} + /** * Referenced dependency. */ @@ -6326,7 +6354,7 @@ export interface ExecuteSSISPackageActivity extends ExecutionActivity { /** * The package execution credential. */ - executionCredential?: { [propertyName: string]: SSISExecutionCredential }; + executionCredential?: SSISExecutionCredential; /** * The integration runtime reference. */ diff --git a/lib/services/datafactoryManagement/lib/models/index.js b/lib/services/datafactoryManagement/lib/models/index.js index d86a66cb28..b39fcd467a 100644 --- a/lib/services/datafactoryManagement/lib/models/index.js +++ b/lib/services/datafactoryManagement/lib/models/index.js @@ -86,6 +86,8 @@ exports.OperationServiceSpecification = require('./operationServiceSpecification exports.Operation = require('./operation'); exports.GetSsisObjectMetadataRequest = require('./getSsisObjectMetadataRequest'); exports.SsisObjectMetadataStatusResponse = require('./ssisObjectMetadataStatusResponse'); +exports.ExposureControlRequest = require('./exposureControlRequest'); +exports.ExposureControlResponse = require('./exposureControlResponse'); exports.DependencyReference = require('./dependencyReference'); exports.SelfDependencyTumblingWindowTriggerReference = require('./selfDependencyTumblingWindowTriggerReference'); exports.TriggerReference = require('./triggerReference'); diff --git a/lib/services/datafactoryManagement/lib/operations/exposureControl.js b/lib/services/datafactoryManagement/lib/operations/exposureControl.js new file mode 100644 index 0000000000..ecb22e7eac --- /dev/null +++ b/lib/services/datafactoryManagement/lib/operations/exposureControl.js @@ -0,0 +1,288 @@ +/* + * 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'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Get exposure control feature for specific location. + * + * @param {string} locationId The location identifier. + * + * @param {object} exposureControlRequest The exposure control request. + * + * @param {string} [exposureControlRequest.featureName] The feature name. + * + * @param {string} [exposureControlRequest.featureType] The feature type. + * + * @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 ExposureControlResponse} 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 _getFeatureValue(locationId, exposureControlRequest, 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 (locationId === null || locationId === undefined || typeof locationId.valueOf() !== 'string') { + throw new Error('locationId 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 (exposureControlRequest === null || exposureControlRequest === undefined) { + throw new Error('exposureControlRequest 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}/providers/Microsoft.DataFactory/locations/{locationId}/getFeatureValue'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{locationId}', encodeURIComponent(locationId)); + 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 (exposureControlRequest !== null && exposureControlRequest !== undefined) { + let requestModelMapper = new client.models['ExposureControlRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, exposureControlRequest, 'exposureControlRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(exposureControlRequest, 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().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['ExposureControlResponse']().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 ExposureControl. */ +class ExposureControl { + /** + * Create a ExposureControl. + * @param {DataFactoryManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._getFeatureValue = _getFeatureValue; + } + + /** + * Get exposure control feature for specific location. + * + * @param {string} locationId The location identifier. + * + * @param {object} exposureControlRequest The exposure control request. + * + * @param {string} [exposureControlRequest.featureName] The feature name. + * + * @param {string} [exposureControlRequest.featureType] The feature type. + * + * @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. + */ + getFeatureValueWithHttpOperationResponse(locationId, exposureControlRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getFeatureValue(locationId, exposureControlRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get exposure control feature for specific location. + * + * @param {string} locationId The location identifier. + * + * @param {object} exposureControlRequest The exposure control request. + * + * @param {string} [exposureControlRequest.featureName] The feature name. + * + * @param {string} [exposureControlRequest.featureType] The feature type. + * + * @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 {ExposureControlResponse} - 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 ExposureControlResponse} 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. + */ + getFeatureValue(locationId, exposureControlRequest, 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._getFeatureValue(locationId, exposureControlRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getFeatureValue(locationId, exposureControlRequest, options, optionalCallback); + } + } + +} + +module.exports = ExposureControl; diff --git a/lib/services/datafactoryManagement/lib/operations/index.d.ts b/lib/services/datafactoryManagement/lib/operations/index.d.ts index c13557eb52..a394d6a27e 100644 --- a/lib/services/datafactoryManagement/lib/operations/index.d.ts +++ b/lib/services/datafactoryManagement/lib/operations/index.d.ts @@ -959,6 +959,83 @@ export interface Factories { listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * ExposureControl + * __NOTE__: An instance of this class is automatically created for an + * instance of the DataFactoryManagementClient. + */ +export interface ExposureControl { + + + /** + * Get exposure control feature for specific location. + * + * @param {string} locationId The location identifier. + * + * @param {object} exposureControlRequest The exposure control request. + * + * @param {string} [exposureControlRequest.featureName] The feature name. + * + * @param {string} [exposureControlRequest.featureType] The feature type. + * + * @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. + */ + getFeatureValueWithHttpOperationResponse(locationId: string, exposureControlRequest: models.ExposureControlRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get exposure control feature for specific location. + * + * @param {string} locationId The location identifier. + * + * @param {object} exposureControlRequest The exposure control request. + * + * @param {string} [exposureControlRequest.featureName] The feature name. + * + * @param {string} [exposureControlRequest.featureType] The feature type. + * + * @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 {ExposureControlResponse} - 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. + * + * {ExposureControlResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ExposureControlResponse} 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. + */ + getFeatureValue(locationId: string, exposureControlRequest: models.ExposureControlRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getFeatureValue(locationId: string, exposureControlRequest: models.ExposureControlRequest, callback: ServiceCallback): void; + getFeatureValue(locationId: string, exposureControlRequest: models.ExposureControlRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * IntegrationRuntimes diff --git a/lib/services/datafactoryManagement/lib/operations/index.js b/lib/services/datafactoryManagement/lib/operations/index.js index 58b7e02414..862eb91a7a 100644 --- a/lib/services/datafactoryManagement/lib/operations/index.js +++ b/lib/services/datafactoryManagement/lib/operations/index.js @@ -16,6 +16,7 @@ exports.Operations = require('./operations'); exports.Factories = require('./factories'); +exports.ExposureControl = require('./exposureControl'); exports.IntegrationRuntimes = require('./integrationRuntimes'); exports.IntegrationRuntimeObjectMetadata = require('./integrationRuntimeObjectMetadata'); exports.IntegrationRuntimeNodes = require('./integrationRuntimeNodes');