From a6e5698c444604f89670a3f6e4eba51559399c86 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 10 Jan 2019 12:56:41 -0800 Subject: [PATCH] [AutoPR datafactory/resource-manager] [Datafactory] Add Webhook Activity to Azure Data Factory (#4523) * Generated from 30ce8a5d068ff6b375d77746ce44810802593ade remove timeout as required * Generated from 0d3bebe04c8ee34399f725a3581ba55cebff214f combine and update web auth definitions * Generated from dafb0014942f618644438753c10df85ea504ccfa revert auth type enum change --- .../lib/models/index.d.ts | 33 +++ .../datafactoryManagement/lib/models/index.js | 2 + .../lib/models/webHookActivity.js | 190 ++++++++++++++++++ .../models/webHookActivityAuthentication.js | 102 ++++++++++ 4 files changed, 327 insertions(+) create mode 100644 lib/services/datafactoryManagement/lib/models/webHookActivity.js create mode 100644 lib/services/datafactoryManagement/lib/models/webHookActivityAuthentication.js diff --git a/lib/services/datafactoryManagement/lib/models/index.d.ts b/lib/services/datafactoryManagement/lib/models/index.d.ts index 66a7c6c24d..dc72fca136 100644 --- a/lib/services/datafactoryManagement/lib/models/index.d.ts +++ b/lib/services/datafactoryManagement/lib/models/index.d.ts @@ -7053,6 +7053,39 @@ export interface IfConditionActivity extends ControlActivity { ifFalseActivities?: Activity[]; } +/** + * WebHook activity. + */ +export interface WebHookActivity extends ControlActivity { + /** + * WebHook activity target endpoint and path. Type: string (or Expression with resultType + * string). + */ + url: any; + /** + * Specifies the timeout within which the webhook should be called back. If there is no value + * specified, it takes the value of TimeSpan.FromMinutes(10) which is 10 minutes as default. + * Type: string (or Expression with resultType string), pattern: + * ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + */ + timeout?: any; + /** + * Represents the headers that will be sent to the request. For example, to set the language and + * type on a request: "headers" : { "Accept-Language": "en-us", "Content-Type": + * "application/json" }. Type: string (or Expression with resultType string). + */ + headers?: any; + /** + * Represents the payload that will be sent to the endpoint. Required for POST/PUT method, not + * allowed for GET method Type: string (or Expression with resultType string). + */ + body?: any; + /** + * Authentication method used for calling the endpoint. + */ + authentication?: WebActivityAuthentication; +} + /** * Execute pipeline activity. */ diff --git a/lib/services/datafactoryManagement/lib/models/index.js b/lib/services/datafactoryManagement/lib/models/index.js index 4791d5793b..24bef5faf1 100644 --- a/lib/services/datafactoryManagement/lib/models/index.js +++ b/lib/services/datafactoryManagement/lib/models/index.js @@ -351,6 +351,7 @@ exports.UntilActivity = require('./untilActivity'); exports.WaitActivity = require('./waitActivity'); exports.ForEachActivity = require('./forEachActivity'); exports.IfConditionActivity = require('./ifConditionActivity'); +exports.WebHookActivity = require('./webHookActivity'); exports.ExecutePipelineActivity = require('./executePipelineActivity'); exports.LinkedIntegrationRuntime = require('./linkedIntegrationRuntime'); exports.SelfHostedIntegrationRuntimeNode = require('./selfHostedIntegrationRuntimeNode'); @@ -643,6 +644,7 @@ exports.discriminators = { 'Activity.Wait' : exports.WaitActivity, 'Activity.ForEach' : exports.ForEachActivity, 'Activity.IfCondition' : exports.IfConditionActivity, + 'Activity.WebHook' : exports.WebHookActivity, 'Activity.ExecutePipeline' : exports.ExecutePipelineActivity, 'Activity.Container' : exports.ControlActivity, 'IntegrationRuntimeStatus.SelfHosted' : exports.SelfHostedIntegrationRuntimeStatus, diff --git a/lib/services/datafactoryManagement/lib/models/webHookActivity.js b/lib/services/datafactoryManagement/lib/models/webHookActivity.js new file mode 100644 index 0000000000..2723ec00e6 --- /dev/null +++ b/lib/services/datafactoryManagement/lib/models/webHookActivity.js @@ -0,0 +1,190 @@ +/* + * 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 models = require('./index'); + +/** + * WebHook activity. + * + * @extends models['ControlActivity'] + */ +class WebHookActivity extends models['ControlActivity'] { + /** + * Create a WebHookActivity. + * @property {object} url WebHook activity target endpoint and path. Type: + * string (or Expression with resultType string). + * @property {object} [timeout] Specifies the timeout within which the + * webhook should be called back. If there is no value specified, it takes + * the value of TimeSpan.FromMinutes(10) which is 10 minutes as default. + * Type: string (or Expression with resultType string), pattern: + * ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + * @property {object} [headers] Represents the headers that will be sent to + * the request. For example, to set the language and type on a request: + * "headers" : { "Accept-Language": "en-us", "Content-Type": + * "application/json" }. Type: string (or Expression with resultType string). + * @property {object} [body] Represents the payload that will be sent to the + * endpoint. Required for POST/PUT method, not allowed for GET method Type: + * string (or Expression with resultType string). + * @property {object} [authentication] Authentication method used for calling + * the endpoint. + * @property {string} [authentication.type] Web activity authentication + * (Basic/ClientCertificate/MSI) + * @property {object} [authentication.pfx] Base64-encoded contents of a PFX + * file. + * @property {string} [authentication.pfx.value] Value of secure string. + * @property {string} [authentication.username] Web activity authentication + * user name for basic authentication. + * @property {object} [authentication.password] Password for the PFX file or + * basic authentication. + * @property {string} [authentication.password.value] Value of secure string. + * @property {string} [authentication.resource] Resource for which Azure Auth + * token will be requested when using MSI Authentication. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of WebHookActivity + * + * @returns {object} metadata of WebHookActivity + * + */ + mapper() { + return { + required: false, + serializedName: 'WebHook', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'Activity', + className: 'WebHookActivity', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + }, + dependsOn: { + required: false, + serializedName: 'dependsOn', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ActivityDependencyElementType', + type: { + name: 'Composite', + additionalProperties: { + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + }, + className: 'ActivityDependency' + } + } + } + }, + userProperties: { + required: false, + serializedName: 'userProperties', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'UserPropertyElementType', + type: { + name: 'Composite', + className: 'UserProperty' + } + } + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + method: { + required: true, + isConstant: true, + serializedName: 'typeProperties.method', + defaultValue: 'POST', + type: { + name: 'String' + } + }, + url: { + required: true, + serializedName: 'typeProperties.url', + type: { + name: 'Object' + } + }, + timeout: { + required: false, + serializedName: 'typeProperties.timeout', + type: { + name: 'Object' + } + }, + headers: { + required: false, + serializedName: 'typeProperties.headers', + type: { + name: 'Object' + } + }, + body: { + required: false, + serializedName: 'typeProperties.body', + type: { + name: 'Object' + } + }, + authentication: { + required: false, + serializedName: 'typeProperties.authentication', + type: { + name: 'Composite', + className: 'WebActivityAuthentication' + } + } + } + } + }; + } +} + +module.exports = WebHookActivity; diff --git a/lib/services/datafactoryManagement/lib/models/webHookActivityAuthentication.js b/lib/services/datafactoryManagement/lib/models/webHookActivityAuthentication.js new file mode 100644 index 0000000000..b965b4b1ad --- /dev/null +++ b/lib/services/datafactoryManagement/lib/models/webHookActivityAuthentication.js @@ -0,0 +1,102 @@ +/* + * 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'; + +/** + * WebHook activity authentication properties. + * + */ +class WebHookActivityAuthentication { + /** + * Create a WebHookActivityAuthentication. + * @property {string} type WebHook activity authentication + * (Basic/ClientCertificate/MSI) + * @property {object} [pfx] Base64-encoded contents of a PFX file. + * @property {string} [pfx.value] Value of secure string. + * @property {string} [username] WebHook activity authentication user name + * for basic authentication. + * @property {object} [password] Password for the PFX file or basic + * authentication. + * @property {string} [password.value] Value of secure string. + * @property {string} [resource] Resource for which Azure Auth token will be + * requested when using MSI Authentication. + */ + constructor() { + } + + /** + * Defines the metadata of WebHookActivityAuthentication + * + * @returns {object} metadata of WebHookActivityAuthentication + * + */ + mapper() { + return { + required: false, + serializedName: 'WebHookActivityAuthentication', + type: { + name: 'Composite', + className: 'WebHookActivityAuthentication', + modelProperties: { + type: { + required: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + pfx: { + required: false, + serializedName: 'pfx', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'SecretBase', + className: 'SecureString' + } + }, + username: { + required: false, + serializedName: 'username', + type: { + name: 'String' + } + }, + password: { + required: false, + serializedName: 'password', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'SecretBase', + className: 'SecureString' + } + }, + resource: { + required: false, + serializedName: 'resource', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = WebHookActivityAuthentication;