From b3debd00a773f0cb32c99a4aff2dee99d4261a2a Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 27 Jul 2018 02:51:03 +0000 Subject: [PATCH 1/3] Generated from ad7bf3880ae0b76dfcfee25f43902bb1cb39cfa3 Created specs for python 2 packages --- .../lib/automationClient.d.ts | 1 + .../lib/automationClient.js | 1 + .../lib/operations/index.d.ts | 484 +++++ .../lib/operations/index.js | 1 + .../lib/operations/python2Package.js | 1701 +++++++++++++++++ 5 files changed, 2188 insertions(+) create mode 100644 lib/services/automationManagement/lib/operations/python2Package.js diff --git a/lib/services/automationManagement/lib/automationClient.d.ts b/lib/services/automationManagement/lib/automationClient.d.ts index 821580ecd2..3d6a02acb3 100644 --- a/lib/services/automationManagement/lib/automationClient.d.ts +++ b/lib/services/automationManagement/lib/automationClient.d.ts @@ -75,6 +75,7 @@ export default class AutomationClient extends AzureServiceClient { moduleOperations: operations.ModuleOperations; objectDataTypes: operations.ObjectDataTypes; fields: operations.Fields; + python2Package: operations.Python2Package; runbookDraftOperations: operations.RunbookDraftOperations; runbookOperations: operations.RunbookOperations; testJobStreams: operations.TestJobStreams; diff --git a/lib/services/automationManagement/lib/automationClient.js b/lib/services/automationManagement/lib/automationClient.js index 62706fd455..df5f9019d5 100644 --- a/lib/services/automationManagement/lib/automationClient.js +++ b/lib/services/automationManagement/lib/automationClient.js @@ -93,6 +93,7 @@ class AutomationClient extends ServiceClient { this.moduleOperations = new operations.ModuleOperations(this); this.objectDataTypes = new operations.ObjectDataTypes(this); this.fields = new operations.Fields(this); + this.python2Package = new operations.Python2Package(this); this.runbookDraftOperations = new operations.RunbookDraftOperations(this); this.runbookOperations = new operations.RunbookOperations(this); this.testJobStreams = new operations.TestJobStreams(this); diff --git a/lib/services/automationManagement/lib/operations/index.d.ts b/lib/services/automationManagement/lib/operations/index.d.ts index bce9979388..efd7550759 100644 --- a/lib/services/automationManagement/lib/operations/index.d.ts +++ b/lib/services/automationManagement/lib/operations/index.d.ts @@ -4760,6 +4760,490 @@ export interface Fields { listByType(resourceGroupName: string, automationAccountName: string, moduleName: string, typeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * Python2Package + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface Python2Package { + + + /** + * Delete the python 2 package by name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The python package 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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, packageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Delete the python 2 package by name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The python package 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 {null} - 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. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {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. + */ + deleteMethod(resourceGroupName: string, automationAccountName: string, packageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, automationAccountName: string, packageName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, automationAccountName: string, packageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieve the python 2 package identified by package name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The python package 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. + */ + getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, packageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve the python 2 package identified by package name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The python package 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 {Module} - 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. + * + * {Module} [result] - The deserialized result object if an error did not occur. + * See {@link Module} 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. + */ + get(resourceGroupName: string, automationAccountName: string, packageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, automationAccountName: string, packageName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, automationAccountName: string, packageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Create or Update the python 2 package identified by package name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The name of python package. + * + * @param {object} parameters The create or update parameters for python + * package. + * + * @param {object} parameters.contentLink Gets or sets the module content link. + * + * @param {string} [parameters.contentLink.uri] Gets or sets the uri of the + * runbook content. + * + * @param {object} [parameters.contentLink.contentHash] Gets or sets the hash. + * + * @param {string} parameters.contentLink.contentHash.algorithm Gets or sets + * the content hash algorithm used to hash the content. + * + * @param {string} parameters.contentLink.contentHash.value Gets or sets + * expected hash value of the content. + * + * @param {string} [parameters.contentLink.version] Gets or sets the version of + * the content. + * + * @param {string} [parameters.name] Gets or sets name of the resource. + * + * @param {string} [parameters.location] Gets or sets the location of the + * resource. + * + * @param {object} [parameters.tags] Gets or sets the tags attached to the + * resource. + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, packageName: string, parameters: models.ModuleCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create or Update the python 2 package identified by package name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The name of python package. + * + * @param {object} parameters The create or update parameters for python + * package. + * + * @param {object} parameters.contentLink Gets or sets the module content link. + * + * @param {string} [parameters.contentLink.uri] Gets or sets the uri of the + * runbook content. + * + * @param {object} [parameters.contentLink.contentHash] Gets or sets the hash. + * + * @param {string} parameters.contentLink.contentHash.algorithm Gets or sets + * the content hash algorithm used to hash the content. + * + * @param {string} parameters.contentLink.contentHash.value Gets or sets + * expected hash value of the content. + * + * @param {string} [parameters.contentLink.version] Gets or sets the version of + * the content. + * + * @param {string} [parameters.name] Gets or sets name of the resource. + * + * @param {string} [parameters.location] Gets or sets the location of the + * resource. + * + * @param {object} [parameters.tags] Gets or sets the tags attached to the + * resource. + * + * @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 {Module} - 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. + * + * {Module} [result] - The deserialized result object if an error did not occur. + * See {@link Module} 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. + */ + createOrUpdate(resourceGroupName: string, automationAccountName: string, packageName: string, parameters: models.ModuleCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, automationAccountName: string, packageName: string, parameters: models.ModuleCreateOrUpdateParameters, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, automationAccountName: string, packageName: string, parameters: models.ModuleCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Update the python 2 package identified by package name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The name of python package. + * + * @param {object} parameters The update parameters for python package. + * + * @param {object} [parameters.contentLink] Gets or sets the module content + * link. + * + * @param {string} [parameters.contentLink.uri] Gets or sets the uri of the + * runbook content. + * + * @param {object} [parameters.contentLink.contentHash] Gets or sets the hash. + * + * @param {string} parameters.contentLink.contentHash.algorithm Gets or sets + * the content hash algorithm used to hash the content. + * + * @param {string} parameters.contentLink.contentHash.value Gets or sets + * expected hash value of the content. + * + * @param {string} [parameters.contentLink.version] Gets or sets the version of + * the content. + * + * @param {string} [parameters.name] Gets or sets name of the resource. + * + * @param {string} [parameters.location] Gets or sets the location of the + * resource. + * + * @param {object} [parameters.tags] Gets or sets the tags attached to the + * resource. + * + * @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. + */ + updateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, packageName: string, parameters: models.ModuleUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Update the python 2 package identified by package name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The name of python package. + * + * @param {object} parameters The update parameters for python package. + * + * @param {object} [parameters.contentLink] Gets or sets the module content + * link. + * + * @param {string} [parameters.contentLink.uri] Gets or sets the uri of the + * runbook content. + * + * @param {object} [parameters.contentLink.contentHash] Gets or sets the hash. + * + * @param {string} parameters.contentLink.contentHash.algorithm Gets or sets + * the content hash algorithm used to hash the content. + * + * @param {string} parameters.contentLink.contentHash.value Gets or sets + * expected hash value of the content. + * + * @param {string} [parameters.contentLink.version] Gets or sets the version of + * the content. + * + * @param {string} [parameters.name] Gets or sets name of the resource. + * + * @param {string} [parameters.location] Gets or sets the location of the + * resource. + * + * @param {object} [parameters.tags] Gets or sets the tags attached to the + * resource. + * + * @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 {Module} - 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. + * + * {Module} [result] - The deserialized result object if an error did not occur. + * See {@link Module} 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. + */ + update(resourceGroupName: string, automationAccountName: string, packageName: string, parameters: models.ModuleUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, automationAccountName: string, packageName: string, parameters: models.ModuleUpdateParameters, callback: ServiceCallback): void; + update(resourceGroupName: string, automationAccountName: string, packageName: string, parameters: models.ModuleUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieve a list of python 2 packages. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @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. + */ + listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve a list of python 2 packages. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @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 {ModuleListResult} - 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. + * + * {ModuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ModuleListResult} 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. + */ + listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(resourceGroupName: string, automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieve a list of python 2 packages. + * + * @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. + */ + listByAutomationAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve a list of python 2 packages. + * + * @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 {ModuleListResult} - 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. + * + * {ModuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ModuleListResult} 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. + */ + listByAutomationAccountNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccountNext(nextPageLink: string, callback: ServiceCallback): void; + listByAutomationAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * RunbookDraftOperations diff --git a/lib/services/automationManagement/lib/operations/index.js b/lib/services/automationManagement/lib/operations/index.js index d0a423140c..4435ea409c 100644 --- a/lib/services/automationManagement/lib/operations/index.js +++ b/lib/services/automationManagement/lib/operations/index.js @@ -31,6 +31,7 @@ exports.ActivityOperations = require('./activityOperations'); exports.ModuleOperations = require('./moduleOperations'); exports.ObjectDataTypes = require('./objectDataTypes'); exports.Fields = require('./fields'); +exports.Python2Package = require('./python2Package'); exports.RunbookDraftOperations = require('./runbookDraftOperations'); exports.RunbookOperations = require('./runbookOperations'); exports.TestJobStreams = require('./testJobStreams'); diff --git a/lib/services/automationManagement/lib/operations/python2Package.js b/lib/services/automationManagement/lib/operations/python2Package.js new file mode 100644 index 0000000000..de0ed7a9df --- /dev/null +++ b/lib/services/automationManagement/lib/operations/python2Package.js @@ -0,0 +1,1701 @@ +/* + * 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; + +/** + * Delete the python 2 package by name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The python package name. + * + * @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. + * + * {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 _deleteMethod(resourceGroupName, automationAccountName, packageName, 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.'); + } + let apiVersion = '2018-06-30'; + // Validate + try { + 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 (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { + throw new Error('automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (packageName === null || packageName === undefined || typeof packageName.valueOf() !== 'string') { + throw new Error('packageName 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 (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.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{packageName}', encodeURIComponent(packageName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Retrieve the python 2 package identified by package name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The python package name. + * + * @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 Module} 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 _get(resourceGroupName, automationAccountName, packageName, 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.'); + } + let apiVersion = '2018-06-30'; + // Validate + try { + 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 (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { + throw new Error('automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (packageName === null || packageName === undefined || typeof packageName.valueOf() !== 'string') { + throw new Error('packageName 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 (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.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{packageName}', encodeURIComponent(packageName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // 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['Module']().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); + }); +} + +/** + * Create or Update the python 2 package identified by package name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The name of python package. + * + * @param {object} parameters The create or update parameters for python + * package. + * + * @param {object} parameters.contentLink Gets or sets the module content link. + * + * @param {string} [parameters.contentLink.uri] Gets or sets the uri of the + * runbook content. + * + * @param {object} [parameters.contentLink.contentHash] Gets or sets the hash. + * + * @param {string} parameters.contentLink.contentHash.algorithm Gets or sets + * the content hash algorithm used to hash the content. + * + * @param {string} parameters.contentLink.contentHash.value Gets or sets + * expected hash value of the content. + * + * @param {string} [parameters.contentLink.version] Gets or sets the version of + * the content. + * + * @param {string} [parameters.name] Gets or sets name of the resource. + * + * @param {string} [parameters.location] Gets or sets the location of the + * resource. + * + * @param {object} [parameters.tags] Gets or sets the tags attached to the + * resource. + * + * @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 Module} 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 _createOrUpdate(resourceGroupName, automationAccountName, packageName, parameters, 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.'); + } + let apiVersion = '2018-06-30'; + // Validate + try { + 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 (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { + throw new Error('automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (packageName === null || packageName === undefined || typeof packageName.valueOf() !== 'string') { + throw new Error('packageName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + 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 (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.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{packageName}', encodeURIComponent(packageName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ModuleCreateOrUpdateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, 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 && statusCode !== 201) { + 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['Module']().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); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Module']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Update the python 2 package identified by package name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The name of python package. + * + * @param {object} parameters The update parameters for python package. + * + * @param {object} [parameters.contentLink] Gets or sets the module content + * link. + * + * @param {string} [parameters.contentLink.uri] Gets or sets the uri of the + * runbook content. + * + * @param {object} [parameters.contentLink.contentHash] Gets or sets the hash. + * + * @param {string} parameters.contentLink.contentHash.algorithm Gets or sets + * the content hash algorithm used to hash the content. + * + * @param {string} parameters.contentLink.contentHash.value Gets or sets + * expected hash value of the content. + * + * @param {string} [parameters.contentLink.version] Gets or sets the version of + * the content. + * + * @param {string} [parameters.name] Gets or sets name of the resource. + * + * @param {string} [parameters.location] Gets or sets the location of the + * resource. + * + * @param {object} [parameters.tags] Gets or sets the tags attached to the + * resource. + * + * @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 Module} 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 _update(resourceGroupName, automationAccountName, packageName, parameters, 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.'); + } + let apiVersion = '2018-06-30'; + // Validate + try { + 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 (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { + throw new Error('automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (packageName === null || packageName === undefined || typeof packageName.valueOf() !== 'string') { + throw new Error('packageName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + 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 (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.Automation/automationAccounts/{automationAccountName}/python2Packages/{packageName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{packageName}', encodeURIComponent(packageName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + 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 (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ModuleUpdateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, 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['Module']().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); + }); +} + +/** + * Retrieve a list of python 2 packages. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @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 ModuleListResult} 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 _listByAutomationAccount(resourceGroupName, automationAccountName, 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.'); + } + let apiVersion = '2018-06-30'; + // Validate + try { + 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 (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { + throw new Error('automationAccountName 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 (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.Automation/automationAccounts/{automationAccountName}/python2Packages'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // 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['ModuleListResult']().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); + }); +} + +/** + * Retrieve a list of python 2 packages. + * + * @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 ModuleListResult} 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 _listByAutomationAccountNext(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['ModuleListResult']().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 Python2Package. */ +class Python2Package { + /** + * Create a Python2Package. + * @param {AutomationClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._listByAutomationAccount = _listByAutomationAccount; + this._listByAutomationAccountNext = _listByAutomationAccountNext; + } + + /** + * Delete the python 2 package by name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The python package 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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, packageName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, automationAccountName, packageName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Delete the python 2 package by name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The python package 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 {null} - 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. + * + * {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. + */ + deleteMethod(resourceGroupName, automationAccountName, packageName, 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._deleteMethod(resourceGroupName, automationAccountName, packageName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, automationAccountName, packageName, options, optionalCallback); + } + } + + /** + * Retrieve the python 2 package identified by package name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The python package 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, automationAccountName, packageName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, automationAccountName, packageName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieve the python 2 package identified by package name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The python package 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 {Module} - 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 Module} 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. + */ + get(resourceGroupName, automationAccountName, packageName, 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._get(resourceGroupName, automationAccountName, packageName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, automationAccountName, packageName, options, optionalCallback); + } + } + + /** + * Create or Update the python 2 package identified by package name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The name of python package. + * + * @param {object} parameters The create or update parameters for python + * package. + * + * @param {object} parameters.contentLink Gets or sets the module content link. + * + * @param {string} [parameters.contentLink.uri] Gets or sets the uri of the + * runbook content. + * + * @param {object} [parameters.contentLink.contentHash] Gets or sets the hash. + * + * @param {string} parameters.contentLink.contentHash.algorithm Gets or sets + * the content hash algorithm used to hash the content. + * + * @param {string} parameters.contentLink.contentHash.value Gets or sets + * expected hash value of the content. + * + * @param {string} [parameters.contentLink.version] Gets or sets the version of + * the content. + * + * @param {string} [parameters.name] Gets or sets name of the resource. + * + * @param {string} [parameters.location] Gets or sets the location of the + * resource. + * + * @param {object} [parameters.tags] Gets or sets the tags attached to the + * resource. + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, automationAccountName, packageName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, automationAccountName, packageName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Create or Update the python 2 package identified by package name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The name of python package. + * + * @param {object} parameters The create or update parameters for python + * package. + * + * @param {object} parameters.contentLink Gets or sets the module content link. + * + * @param {string} [parameters.contentLink.uri] Gets or sets the uri of the + * runbook content. + * + * @param {object} [parameters.contentLink.contentHash] Gets or sets the hash. + * + * @param {string} parameters.contentLink.contentHash.algorithm Gets or sets + * the content hash algorithm used to hash the content. + * + * @param {string} parameters.contentLink.contentHash.value Gets or sets + * expected hash value of the content. + * + * @param {string} [parameters.contentLink.version] Gets or sets the version of + * the content. + * + * @param {string} [parameters.name] Gets or sets name of the resource. + * + * @param {string} [parameters.location] Gets or sets the location of the + * resource. + * + * @param {object} [parameters.tags] Gets or sets the tags attached to the + * resource. + * + * @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 {Module} - 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 Module} 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, automationAccountName, packageName, parameters, 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._createOrUpdate(resourceGroupName, automationAccountName, packageName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, automationAccountName, packageName, parameters, options, optionalCallback); + } + } + + /** + * Update the python 2 package identified by package name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The name of python package. + * + * @param {object} parameters The update parameters for python package. + * + * @param {object} [parameters.contentLink] Gets or sets the module content + * link. + * + * @param {string} [parameters.contentLink.uri] Gets or sets the uri of the + * runbook content. + * + * @param {object} [parameters.contentLink.contentHash] Gets or sets the hash. + * + * @param {string} parameters.contentLink.contentHash.algorithm Gets or sets + * the content hash algorithm used to hash the content. + * + * @param {string} parameters.contentLink.contentHash.value Gets or sets + * expected hash value of the content. + * + * @param {string} [parameters.contentLink.version] Gets or sets the version of + * the content. + * + * @param {string} [parameters.name] Gets or sets name of the resource. + * + * @param {string} [parameters.location] Gets or sets the location of the + * resource. + * + * @param {object} [parameters.tags] Gets or sets the tags attached to the + * resource. + * + * @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. + */ + updateWithHttpOperationResponse(resourceGroupName, automationAccountName, packageName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, automationAccountName, packageName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Update the python 2 package identified by package name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} packageName The name of python package. + * + * @param {object} parameters The update parameters for python package. + * + * @param {object} [parameters.contentLink] Gets or sets the module content + * link. + * + * @param {string} [parameters.contentLink.uri] Gets or sets the uri of the + * runbook content. + * + * @param {object} [parameters.contentLink.contentHash] Gets or sets the hash. + * + * @param {string} parameters.contentLink.contentHash.algorithm Gets or sets + * the content hash algorithm used to hash the content. + * + * @param {string} parameters.contentLink.contentHash.value Gets or sets + * expected hash value of the content. + * + * @param {string} [parameters.contentLink.version] Gets or sets the version of + * the content. + * + * @param {string} [parameters.name] Gets or sets name of the resource. + * + * @param {string} [parameters.location] Gets or sets the location of the + * resource. + * + * @param {object} [parameters.tags] Gets or sets the tags attached to the + * resource. + * + * @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 {Module} - 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 Module} 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, automationAccountName, packageName, parameters, 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, automationAccountName, packageName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, automationAccountName, packageName, parameters, options, optionalCallback); + } + } + + /** + * Retrieve a list of python 2 packages. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @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. + */ + listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieve a list of python 2 packages. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @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 {ModuleListResult} - 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 ModuleListResult} 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. + */ + listByAutomationAccount(resourceGroupName, automationAccountName, 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._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + } + } + + /** + * Retrieve a list of python 2 packages. + * + * @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} - The error object. + */ + listByAutomationAccountNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByAutomationAccountNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieve a list of python 2 packages. + * + * @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} [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 {ModuleListResult} - 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 ModuleListResult} 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. + */ + listByAutomationAccountNext(nextPageLink, 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._listByAutomationAccountNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByAutomationAccountNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Python2Package; From 2804a7c0968eb2ce05f45f8df06b47e8291ade0b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 2 Aug 2018 20:14:17 +0000 Subject: [PATCH 2/3] Generated from 1a11c87ee5039a2b795d276e17112cb657661f07 add new package to Go SDK build --- .../automationManagement/lib/automationClient.d.ts | 6 +++--- lib/services/automationManagement/lib/automationClient.js | 6 +++--- lib/services/automationManagement/lib/models/activity.js | 2 ++ .../automationManagement/lib/models/automationAccount.js | 2 ++ .../automationManagement/lib/models/certificate.js | 4 ++++ .../lib/models/certificateCreateOrUpdateParameters.js | 1 + .../automationManagement/lib/models/connection.js | 2 ++ .../automationManagement/lib/models/connectionType.js | 2 ++ .../automationManagement/lib/models/credential.js | 2 ++ .../automationManagement/lib/models/dscCompilationJob.js | 6 ++++++ .../automationManagement/lib/models/dscConfiguration.js | 3 +++ lib/services/automationManagement/lib/models/dscNode.js | 2 ++ .../lib/models/dscNodeConfiguration.js | 2 ++ .../automationManagement/lib/models/dscNodeReport.js | 3 +++ .../automationManagement/lib/models/dscReportResource.js | 1 + .../lib/models/hybridRunbookWorker.js | 2 ++ lib/services/automationManagement/lib/models/job.js | 6 ++++++ .../automationManagement/lib/models/jobCollectionItem.js | 5 +++++ lib/services/automationManagement/lib/models/jobStream.js | 1 + lib/services/automationManagement/lib/models/module.js | 2 ++ lib/services/automationManagement/lib/models/runbook.js | 2 ++ .../automationManagement/lib/models/runbookDraft.js | 2 ++ lib/services/automationManagement/lib/models/schedule.js | 8 ++++++++ .../lib/models/scheduleCreateOrUpdateParameters.js | 2 ++ .../automationManagement/lib/models/scheduleProperties.js | 8 ++++++++ .../lib/models/softwareUpdateConfiguration.js | 2 ++ .../models/softwareUpdateConfigurationCollectionItem.js | 4 ++++ .../lib/models/softwareUpdateConfigurationMachineRun.js | 4 ++++ .../lib/models/softwareUpdateConfigurationRun.js | 4 ++++ .../automationManagement/lib/models/sourceControl.js | 2 ++ .../lib/models/sourceControlSyncJob.js | 3 +++ .../lib/models/sourceControlSyncJobById.js | 3 +++ .../lib/models/sourceControlSyncJobStream.js | 1 + .../lib/models/sourceControlSyncJobStreamById.js | 1 + .../automationManagement/lib/models/statistics.js | 2 ++ lib/services/automationManagement/lib/models/testJob.js | 5 +++++ lib/services/automationManagement/lib/models/variable.js | 3 +++ lib/services/automationManagement/lib/models/watcher.js | 2 ++ lib/services/automationManagement/lib/models/webhook.js | 4 ++++ .../lib/models/webhookCreateOrUpdateParameters.js | 1 + lib/services/automationManagement/package.json | 6 +++--- 41 files changed, 120 insertions(+), 9 deletions(-) diff --git a/lib/services/automationManagement/lib/automationClient.d.ts b/lib/services/automationManagement/lib/automationClient.d.ts index 3d6a02acb3..351dc241c0 100644 --- a/lib/services/automationManagement/lib/automationClient.d.ts +++ b/lib/services/automationManagement/lib/automationClient.d.ts @@ -36,11 +36,11 @@ export default class AutomationClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, countType1: string, baseUri?: string, options?: AzureServiceClientOptions); diff --git a/lib/services/automationManagement/lib/automationClient.js b/lib/services/automationManagement/lib/automationClient.js index df5f9019d5..4ce8c81c06 100644 --- a/lib/services/automationManagement/lib/automationClient.js +++ b/lib/services/automationManagement/lib/automationClient.js @@ -35,9 +35,9 @@ class AutomationClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, countType1, baseUri, options) { if (credentials === null || credentials === undefined) { diff --git a/lib/services/automationManagement/lib/models/activity.js b/lib/services/automationManagement/lib/models/activity.js index 414141b051..22d085cead 100644 --- a/lib/services/automationManagement/lib/models/activity.js +++ b/lib/services/automationManagement/lib/models/activity.js @@ -101,6 +101,7 @@ class Activity { }, creationTime: { required: false, + nullable: false, serializedName: 'properties.creationTime', type: { name: 'DateTime' @@ -108,6 +109,7 @@ class Activity { }, lastModifiedTime: { required: false, + nullable: false, serializedName: 'properties.lastModifiedTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/automationAccount.js b/lib/services/automationManagement/lib/models/automationAccount.js index 41d7d1ecf3..313d9375a5 100644 --- a/lib/services/automationManagement/lib/models/automationAccount.js +++ b/lib/services/automationManagement/lib/models/automationAccount.js @@ -121,6 +121,7 @@ class AutomationAccount extends models['TrackedResource'] { }, creationTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.creationTime', type: { @@ -129,6 +130,7 @@ class AutomationAccount extends models['TrackedResource'] { }, lastModifiedTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.lastModifiedTime', type: { diff --git a/lib/services/automationManagement/lib/models/certificate.js b/lib/services/automationManagement/lib/models/certificate.js index 040fb31a01..7f9a8e4b35 100644 --- a/lib/services/automationManagement/lib/models/certificate.js +++ b/lib/services/automationManagement/lib/models/certificate.js @@ -80,6 +80,7 @@ class Certificate extends models['ProxyResource'] { }, expiryTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.expiryTime', type: { @@ -88,6 +89,7 @@ class Certificate extends models['ProxyResource'] { }, isExportable: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.isExportable', type: { @@ -96,6 +98,7 @@ class Certificate extends models['ProxyResource'] { }, creationTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.creationTime', type: { @@ -104,6 +107,7 @@ class Certificate extends models['ProxyResource'] { }, lastModifiedTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.lastModifiedTime', type: { diff --git a/lib/services/automationManagement/lib/models/certificateCreateOrUpdateParameters.js b/lib/services/automationManagement/lib/models/certificateCreateOrUpdateParameters.js index e3106d82f4..6a3253661e 100644 --- a/lib/services/automationManagement/lib/models/certificateCreateOrUpdateParameters.js +++ b/lib/services/automationManagement/lib/models/certificateCreateOrUpdateParameters.js @@ -75,6 +75,7 @@ class CertificateCreateOrUpdateParameters { }, isExportable: { required: false, + nullable: false, serializedName: 'properties.isExportable', type: { name: 'Boolean' diff --git a/lib/services/automationManagement/lib/models/connection.js b/lib/services/automationManagement/lib/models/connection.js index 3a41e356d4..2c9b489543 100644 --- a/lib/services/automationManagement/lib/models/connection.js +++ b/lib/services/automationManagement/lib/models/connection.js @@ -97,6 +97,7 @@ class Connection extends models['ProxyResource'] { }, creationTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.creationTime', type: { @@ -105,6 +106,7 @@ class Connection extends models['ProxyResource'] { }, lastModifiedTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.lastModifiedTime', type: { diff --git a/lib/services/automationManagement/lib/models/connectionType.js b/lib/services/automationManagement/lib/models/connectionType.js index d5d7e8848d..c0b4da0a84 100644 --- a/lib/services/automationManagement/lib/models/connectionType.js +++ b/lib/services/automationManagement/lib/models/connectionType.js @@ -96,6 +96,7 @@ class ConnectionType { }, creationTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.creationTime', type: { @@ -104,6 +105,7 @@ class ConnectionType { }, lastModifiedTime: { required: false, + nullable: false, serializedName: 'properties.lastModifiedTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/credential.js b/lib/services/automationManagement/lib/models/credential.js index a84920edca..be3ce5d08f 100644 --- a/lib/services/automationManagement/lib/models/credential.js +++ b/lib/services/automationManagement/lib/models/credential.js @@ -77,6 +77,7 @@ class Credential extends models['ProxyResource'] { }, creationTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.creationTime', type: { @@ -85,6 +86,7 @@ class Credential extends models['ProxyResource'] { }, lastModifiedTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.lastModifiedTime', type: { diff --git a/lib/services/automationManagement/lib/models/dscCompilationJob.js b/lib/services/automationManagement/lib/models/dscCompilationJob.js index bbe31f6259..901163d47c 100644 --- a/lib/services/automationManagement/lib/models/dscCompilationJob.js +++ b/lib/services/automationManagement/lib/models/dscCompilationJob.js @@ -105,6 +105,7 @@ class DscCompilationJob extends models['ProxyResource'] { }, jobId: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.jobId', type: { @@ -113,6 +114,7 @@ class DscCompilationJob extends models['ProxyResource'] { }, creationTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.creationTime', type: { @@ -149,6 +151,7 @@ class DscCompilationJob extends models['ProxyResource'] { }, startTime: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.startTime', type: { @@ -157,6 +160,7 @@ class DscCompilationJob extends models['ProxyResource'] { }, endTime: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.endTime', type: { @@ -173,6 +177,7 @@ class DscCompilationJob extends models['ProxyResource'] { }, lastModifiedTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.lastModifiedTime', type: { @@ -181,6 +186,7 @@ class DscCompilationJob extends models['ProxyResource'] { }, lastStatusModifiedTime: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.lastStatusModifiedTime', type: { diff --git a/lib/services/automationManagement/lib/models/dscConfiguration.js b/lib/services/automationManagement/lib/models/dscConfiguration.js index 90a122164d..d901c0b33e 100644 --- a/lib/services/automationManagement/lib/models/dscConfiguration.js +++ b/lib/services/automationManagement/lib/models/dscConfiguration.js @@ -163,6 +163,7 @@ class DscConfiguration extends models['TrackedResource'] { }, creationTime: { required: false, + nullable: false, serializedName: 'properties.creationTime', type: { name: 'DateTime' @@ -170,6 +171,7 @@ class DscConfiguration extends models['TrackedResource'] { }, lastModifiedTime: { required: false, + nullable: false, serializedName: 'properties.lastModifiedTime', type: { name: 'DateTime' @@ -177,6 +179,7 @@ class DscConfiguration extends models['TrackedResource'] { }, nodeConfigurationCount: { required: false, + nullable: false, serializedName: 'properties.nodeConfigurationCount', type: { name: 'Number' diff --git a/lib/services/automationManagement/lib/models/dscNode.js b/lib/services/automationManagement/lib/models/dscNode.js index a93a8bd213..0f9e4e5f52 100644 --- a/lib/services/automationManagement/lib/models/dscNode.js +++ b/lib/services/automationManagement/lib/models/dscNode.js @@ -79,6 +79,7 @@ class DscNode extends models['ProxyResource'] { }, lastSeen: { required: false, + nullable: false, serializedName: 'properties.lastSeen', type: { name: 'DateTime' @@ -86,6 +87,7 @@ class DscNode extends models['ProxyResource'] { }, registrationTime: { required: false, + nullable: false, serializedName: 'properties.registrationTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/dscNodeConfiguration.js b/lib/services/automationManagement/lib/models/dscNodeConfiguration.js index 82ce02c8ec..282c4c88fd 100644 --- a/lib/services/automationManagement/lib/models/dscNodeConfiguration.js +++ b/lib/services/automationManagement/lib/models/dscNodeConfiguration.js @@ -76,6 +76,7 @@ class DscNodeConfiguration extends models['ProxyResource'] { }, lastModifiedTime: { required: false, + nullable: false, serializedName: 'properties.lastModifiedTime', type: { name: 'DateTime' @@ -83,6 +84,7 @@ class DscNodeConfiguration extends models['ProxyResource'] { }, creationTime: { required: false, + nullable: false, serializedName: 'properties.creationTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/dscNodeReport.js b/lib/services/automationManagement/lib/models/dscNodeReport.js index b60522bf39..f4243dd9a2 100644 --- a/lib/services/automationManagement/lib/models/dscNodeReport.js +++ b/lib/services/automationManagement/lib/models/dscNodeReport.js @@ -84,6 +84,7 @@ class DscNodeReport { modelProperties: { endTime: { required: false, + nullable: true, serializedName: 'endTime', type: { name: 'DateTime' @@ -91,6 +92,7 @@ class DscNodeReport { }, lastModifiedTime: { required: false, + nullable: false, serializedName: 'lastModifiedTime', type: { name: 'DateTime' @@ -98,6 +100,7 @@ class DscNodeReport { }, startTime: { required: false, + nullable: true, serializedName: 'startTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/dscReportResource.js b/lib/services/automationManagement/lib/models/dscReportResource.js index 8d2c7b7f14..bebb6c2111 100644 --- a/lib/services/automationManagement/lib/models/dscReportResource.js +++ b/lib/services/automationManagement/lib/models/dscReportResource.js @@ -125,6 +125,7 @@ class DscReportResource { }, startDate: { required: false, + nullable: false, serializedName: 'startDate', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/hybridRunbookWorker.js b/lib/services/automationManagement/lib/models/hybridRunbookWorker.js index 50696da888..b7a683d36b 100644 --- a/lib/services/automationManagement/lib/models/hybridRunbookWorker.js +++ b/lib/services/automationManagement/lib/models/hybridRunbookWorker.js @@ -56,6 +56,7 @@ class HybridRunbookWorker { }, registrationTime: { required: false, + nullable: false, serializedName: 'registrationTime', type: { name: 'DateTime' @@ -63,6 +64,7 @@ class HybridRunbookWorker { }, lastSeenDateTime: { required: false, + nullable: false, serializedName: 'lastSeenDateTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/job.js b/lib/services/automationManagement/lib/models/job.js index d3d2383b14..582d9d4be5 100644 --- a/lib/services/automationManagement/lib/models/job.js +++ b/lib/services/automationManagement/lib/models/job.js @@ -111,6 +111,7 @@ class Job extends models['ProxyResource'] { }, jobId: { required: false, + nullable: false, serializedName: 'properties.jobId', type: { name: 'String' @@ -118,6 +119,7 @@ class Job extends models['ProxyResource'] { }, creationTime: { required: false, + nullable: false, serializedName: 'properties.creationTime', type: { name: 'DateTime' @@ -139,6 +141,7 @@ class Job extends models['ProxyResource'] { }, startTime: { required: false, + nullable: true, serializedName: 'properties.startTime', type: { name: 'DateTime' @@ -146,6 +149,7 @@ class Job extends models['ProxyResource'] { }, endTime: { required: false, + nullable: true, serializedName: 'properties.endTime', type: { name: 'DateTime' @@ -160,6 +164,7 @@ class Job extends models['ProxyResource'] { }, lastModifiedTime: { required: false, + nullable: true, serializedName: 'properties.lastModifiedTime', type: { name: 'DateTime' @@ -167,6 +172,7 @@ class Job extends models['ProxyResource'] { }, lastStatusModifiedTime: { required: false, + nullable: true, serializedName: 'properties.lastStatusModifiedTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/jobCollectionItem.js b/lib/services/automationManagement/lib/models/jobCollectionItem.js index 2bf941a299..00cc9d0439 100644 --- a/lib/services/automationManagement/lib/models/jobCollectionItem.js +++ b/lib/services/automationManagement/lib/models/jobCollectionItem.js @@ -88,6 +88,7 @@ class JobCollectionItem extends models['ProxyResource'] { }, jobId: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.jobId', type: { @@ -96,6 +97,7 @@ class JobCollectionItem extends models['ProxyResource'] { }, creationTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.creationTime', type: { @@ -112,6 +114,7 @@ class JobCollectionItem extends models['ProxyResource'] { }, startTime: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.startTime', type: { @@ -120,6 +123,7 @@ class JobCollectionItem extends models['ProxyResource'] { }, endTime: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.endTime', type: { @@ -128,6 +132,7 @@ class JobCollectionItem extends models['ProxyResource'] { }, lastModifiedTime: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.lastModifiedTime', type: { diff --git a/lib/services/automationManagement/lib/models/jobStream.js b/lib/services/automationManagement/lib/models/jobStream.js index 84fe18c918..5df84568e2 100644 --- a/lib/services/automationManagement/lib/models/jobStream.js +++ b/lib/services/automationManagement/lib/models/jobStream.js @@ -60,6 +60,7 @@ class JobStream { }, time: { required: false, + nullable: false, serializedName: 'properties.time', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/module.js b/lib/services/automationManagement/lib/models/module.js index 49fcc6178b..58c7323629 100644 --- a/lib/services/automationManagement/lib/models/module.js +++ b/lib/services/automationManagement/lib/models/module.js @@ -170,6 +170,7 @@ class Module extends models['TrackedResource'] { }, creationTime: { required: false, + nullable: false, serializedName: 'properties.creationTime', type: { name: 'DateTime' @@ -177,6 +178,7 @@ class Module extends models['TrackedResource'] { }, lastModifiedTime: { required: false, + nullable: false, serializedName: 'properties.lastModifiedTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/runbook.js b/lib/services/automationManagement/lib/models/runbook.js index 234b38d12d..00090a51e5 100644 --- a/lib/services/automationManagement/lib/models/runbook.js +++ b/lib/services/automationManagement/lib/models/runbook.js @@ -240,6 +240,7 @@ class Runbook extends models['TrackedResource'] { }, creationTime: { required: false, + nullable: false, serializedName: 'properties.creationTime', type: { name: 'DateTime' @@ -247,6 +248,7 @@ class Runbook extends models['TrackedResource'] { }, lastModifiedTime: { required: false, + nullable: false, serializedName: 'properties.lastModifiedTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/runbookDraft.js b/lib/services/automationManagement/lib/models/runbookDraft.js index 66c9744325..7cc6d43f0e 100644 --- a/lib/services/automationManagement/lib/models/runbookDraft.js +++ b/lib/services/automationManagement/lib/models/runbookDraft.js @@ -71,6 +71,7 @@ class RunbookDraft { }, creationTime: { required: false, + nullable: false, serializedName: 'creationTime', type: { name: 'DateTime' @@ -78,6 +79,7 @@ class RunbookDraft { }, lastModifiedTime: { required: false, + nullable: false, serializedName: 'lastModifiedTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/schedule.js b/lib/services/automationManagement/lib/models/schedule.js index 3bca6b1bf9..83e19eb77a 100644 --- a/lib/services/automationManagement/lib/models/schedule.js +++ b/lib/services/automationManagement/lib/models/schedule.js @@ -90,6 +90,7 @@ class Schedule extends models['ProxyResource'] { }, startTime: { required: false, + nullable: false, serializedName: 'properties.startTime', type: { name: 'DateTime' @@ -97,6 +98,7 @@ class Schedule extends models['ProxyResource'] { }, startTimeOffsetMinutes: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.startTimeOffsetMinutes', type: { @@ -105,6 +107,7 @@ class Schedule extends models['ProxyResource'] { }, expiryTime: { required: false, + nullable: true, serializedName: 'properties.expiryTime', type: { name: 'DateTime' @@ -112,6 +115,7 @@ class Schedule extends models['ProxyResource'] { }, expiryTimeOffsetMinutes: { required: false, + nullable: false, serializedName: 'properties.expiryTimeOffsetMinutes', type: { name: 'Number' @@ -127,6 +131,7 @@ class Schedule extends models['ProxyResource'] { }, nextRun: { required: false, + nullable: true, serializedName: 'properties.nextRun', type: { name: 'DateTime' @@ -134,6 +139,7 @@ class Schedule extends models['ProxyResource'] { }, nextRunOffsetMinutes: { required: false, + nullable: false, serializedName: 'properties.nextRunOffsetMinutes', type: { name: 'Number' @@ -170,6 +176,7 @@ class Schedule extends models['ProxyResource'] { }, creationTime: { required: false, + nullable: false, serializedName: 'properties.creationTime', type: { name: 'DateTime' @@ -177,6 +184,7 @@ class Schedule extends models['ProxyResource'] { }, lastModifiedTime: { required: false, + nullable: false, serializedName: 'properties.lastModifiedTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/scheduleCreateOrUpdateParameters.js b/lib/services/automationManagement/lib/models/scheduleCreateOrUpdateParameters.js index dc6652e40b..6dc9a654f1 100644 --- a/lib/services/automationManagement/lib/models/scheduleCreateOrUpdateParameters.js +++ b/lib/services/automationManagement/lib/models/scheduleCreateOrUpdateParameters.js @@ -69,6 +69,7 @@ class ScheduleCreateOrUpdateParameters { }, startTime: { required: true, + nullable: false, serializedName: 'properties.startTime', type: { name: 'DateTime' @@ -76,6 +77,7 @@ class ScheduleCreateOrUpdateParameters { }, expiryTime: { required: false, + nullable: true, serializedName: 'properties.expiryTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/scheduleProperties.js b/lib/services/automationManagement/lib/models/scheduleProperties.js index 8a0efe82d1..1795e7c9b1 100644 --- a/lib/services/automationManagement/lib/models/scheduleProperties.js +++ b/lib/services/automationManagement/lib/models/scheduleProperties.js @@ -64,6 +64,7 @@ class ScheduleProperties { modelProperties: { startTime: { required: false, + nullable: false, serializedName: 'startTime', type: { name: 'DateTime' @@ -71,6 +72,7 @@ class ScheduleProperties { }, startTimeOffsetMinutes: { required: false, + nullable: false, readOnly: true, serializedName: 'startTimeOffsetMinutes', type: { @@ -79,6 +81,7 @@ class ScheduleProperties { }, expiryTime: { required: false, + nullable: true, serializedName: 'expiryTime', type: { name: 'DateTime' @@ -86,6 +89,7 @@ class ScheduleProperties { }, expiryTimeOffsetMinutes: { required: false, + nullable: false, serializedName: 'expiryTimeOffsetMinutes', type: { name: 'Number' @@ -101,6 +105,7 @@ class ScheduleProperties { }, nextRun: { required: false, + nullable: true, serializedName: 'nextRun', type: { name: 'DateTime' @@ -108,6 +113,7 @@ class ScheduleProperties { }, nextRunOffsetMinutes: { required: false, + nullable: false, serializedName: 'nextRunOffsetMinutes', type: { name: 'Number' @@ -144,6 +150,7 @@ class ScheduleProperties { }, creationTime: { required: false, + nullable: false, serializedName: 'creationTime', type: { name: 'DateTime' @@ -151,6 +158,7 @@ class ScheduleProperties { }, lastModifiedTime: { required: false, + nullable: false, serializedName: 'lastModifiedTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/softwareUpdateConfiguration.js b/lib/services/automationManagement/lib/models/softwareUpdateConfiguration.js index 527abe3dc8..47ee95120a 100644 --- a/lib/services/automationManagement/lib/models/softwareUpdateConfiguration.js +++ b/lib/services/automationManagement/lib/models/softwareUpdateConfiguration.js @@ -187,6 +187,7 @@ class SoftwareUpdateConfiguration extends models['BaseResource'] { }, creationTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.creationTime', type: { @@ -203,6 +204,7 @@ class SoftwareUpdateConfiguration extends models['BaseResource'] { }, lastModifiedTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.lastModifiedTime', type: { diff --git a/lib/services/automationManagement/lib/models/softwareUpdateConfigurationCollectionItem.js b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationCollectionItem.js index 3feed65506..e5d5ded094 100644 --- a/lib/services/automationManagement/lib/models/softwareUpdateConfigurationCollectionItem.js +++ b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationCollectionItem.js @@ -91,6 +91,7 @@ class SoftwareUpdateConfigurationCollectionItem { }, startTime: { required: false, + nullable: false, serializedName: 'properties.startTime', type: { name: 'DateTime' @@ -98,6 +99,7 @@ class SoftwareUpdateConfigurationCollectionItem { }, creationTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.creationTime', type: { @@ -106,6 +108,7 @@ class SoftwareUpdateConfigurationCollectionItem { }, lastModifiedTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.lastModifiedTime', type: { @@ -122,6 +125,7 @@ class SoftwareUpdateConfigurationCollectionItem { }, nextRun: { required: false, + nullable: true, serializedName: 'properties.nextRun', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/softwareUpdateConfigurationMachineRun.js b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationMachineRun.js index 0220b60692..7160b1314d 100644 --- a/lib/services/automationManagement/lib/models/softwareUpdateConfigurationMachineRun.js +++ b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationMachineRun.js @@ -147,6 +147,7 @@ class SoftwareUpdateConfigurationMachineRun { }, startTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.startTime', type: { @@ -155,6 +156,7 @@ class SoftwareUpdateConfigurationMachineRun { }, endTime: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.endTime', type: { @@ -179,6 +181,7 @@ class SoftwareUpdateConfigurationMachineRun { }, creationTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.creationTime', type: { @@ -195,6 +198,7 @@ class SoftwareUpdateConfigurationMachineRun { }, lastModifiedTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.lastModifiedTime', type: { diff --git a/lib/services/automationManagement/lib/models/softwareUpdateConfigurationRun.js b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationRun.js index d7c603ce40..c4a762fec8 100644 --- a/lib/services/automationManagement/lib/models/softwareUpdateConfigurationRun.js +++ b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationRun.js @@ -113,6 +113,7 @@ class SoftwareUpdateConfigurationRun { }, startTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.startTime', type: { @@ -121,6 +122,7 @@ class SoftwareUpdateConfigurationRun { }, endTime: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.endTime', type: { @@ -145,6 +147,7 @@ class SoftwareUpdateConfigurationRun { }, creationTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.creationTime', type: { @@ -161,6 +164,7 @@ class SoftwareUpdateConfigurationRun { }, lastModifiedTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.lastModifiedTime', type: { diff --git a/lib/services/automationManagement/lib/models/sourceControl.js b/lib/services/automationManagement/lib/models/sourceControl.js index eeedff4348..65d21d0307 100644 --- a/lib/services/automationManagement/lib/models/sourceControl.js +++ b/lib/services/automationManagement/lib/models/sourceControl.js @@ -129,6 +129,7 @@ class SourceControl extends models['ProxyResource'] { }, creationTime: { required: false, + nullable: false, serializedName: 'properties.creationTime', type: { name: 'DateTime' @@ -136,6 +137,7 @@ class SourceControl extends models['ProxyResource'] { }, lastModifiedTime: { required: false, + nullable: false, serializedName: 'properties.lastModifiedTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJob.js b/lib/services/automationManagement/lib/models/sourceControlSyncJob.js index c6f4813bc5..91ef7d3416 100644 --- a/lib/services/automationManagement/lib/models/sourceControlSyncJob.js +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJob.js @@ -79,6 +79,7 @@ class SourceControlSyncJob { }, creationTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.creationTime', type: { @@ -94,6 +95,7 @@ class SourceControlSyncJob { }, startTime: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.startTime', type: { @@ -102,6 +104,7 @@ class SourceControlSyncJob { }, endTime: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.endTime', type: { diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJobById.js b/lib/services/automationManagement/lib/models/sourceControlSyncJobById.js index b5399aa84d..243b063ca4 100644 --- a/lib/services/automationManagement/lib/models/sourceControlSyncJobById.js +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobById.js @@ -62,6 +62,7 @@ class SourceControlSyncJobById { }, creationTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.creationTime', type: { @@ -77,6 +78,7 @@ class SourceControlSyncJobById { }, startTime: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.startTime', type: { @@ -85,6 +87,7 @@ class SourceControlSyncJobById { }, endTime: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.endTime', type: { diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJobStream.js b/lib/services/automationManagement/lib/models/sourceControlSyncJobStream.js index 24c9541ca9..2c7605db40 100644 --- a/lib/services/automationManagement/lib/models/sourceControlSyncJobStream.js +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobStream.js @@ -65,6 +65,7 @@ class SourceControlSyncJobStream { }, time: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.time', type: { diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamById.js b/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamById.js index 7899451a0a..82cd2f7782 100644 --- a/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamById.js +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamById.js @@ -67,6 +67,7 @@ class SourceControlSyncJobStreamById { }, time: { required: false, + nullable: true, readOnly: true, serializedName: 'properties.time', type: { diff --git a/lib/services/automationManagement/lib/models/statistics.js b/lib/services/automationManagement/lib/models/statistics.js index dd6db0ec7e..4c7629aff5 100644 --- a/lib/services/automationManagement/lib/models/statistics.js +++ b/lib/services/automationManagement/lib/models/statistics.js @@ -59,6 +59,7 @@ class Statistics { }, startTime: { required: false, + nullable: false, readOnly: true, serializedName: 'startTime', type: { @@ -67,6 +68,7 @@ class Statistics { }, endTime: { required: false, + nullable: true, readOnly: true, serializedName: 'endTime', type: { diff --git a/lib/services/automationManagement/lib/models/testJob.js b/lib/services/automationManagement/lib/models/testJob.js index 5dfc6c310a..870be9a287 100644 --- a/lib/services/automationManagement/lib/models/testJob.js +++ b/lib/services/automationManagement/lib/models/testJob.js @@ -54,6 +54,7 @@ class TestJob { modelProperties: { creationTime: { required: false, + nullable: false, serializedName: 'creationTime', type: { name: 'DateTime' @@ -82,6 +83,7 @@ class TestJob { }, startTime: { required: false, + nullable: true, serializedName: 'startTime', type: { name: 'DateTime' @@ -89,6 +91,7 @@ class TestJob { }, endTime: { required: false, + nullable: true, serializedName: 'endTime', type: { name: 'DateTime' @@ -103,6 +106,7 @@ class TestJob { }, lastModifiedTime: { required: false, + nullable: false, serializedName: 'lastModifiedTime', type: { name: 'DateTime' @@ -110,6 +114,7 @@ class TestJob { }, lastStatusModifiedTime: { required: false, + nullable: true, serializedName: 'lastStatusModifiedTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/variable.js b/lib/services/automationManagement/lib/models/variable.js index 96a65bf066..02610dc34d 100644 --- a/lib/services/automationManagement/lib/models/variable.js +++ b/lib/services/automationManagement/lib/models/variable.js @@ -78,6 +78,7 @@ class Variable extends models['ProxyResource'] { }, isEncrypted: { required: false, + nullable: true, serializedName: 'properties.isEncrypted', type: { name: 'Boolean' @@ -85,6 +86,7 @@ class Variable extends models['ProxyResource'] { }, creationTime: { required: false, + nullable: false, serializedName: 'properties.creationTime', type: { name: 'DateTime' @@ -92,6 +94,7 @@ class Variable extends models['ProxyResource'] { }, lastModifiedTime: { required: false, + nullable: false, serializedName: 'properties.lastModifiedTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/watcher.js b/lib/services/automationManagement/lib/models/watcher.js index 39671ec978..439460fad1 100644 --- a/lib/services/automationManagement/lib/models/watcher.js +++ b/lib/services/automationManagement/lib/models/watcher.js @@ -144,6 +144,7 @@ class Watcher extends models['TrackedResource'] { }, creationTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.creationTime', type: { @@ -152,6 +153,7 @@ class Watcher extends models['TrackedResource'] { }, lastModifiedTime: { required: false, + nullable: false, readOnly: true, serializedName: 'properties.lastModifiedTime', type: { diff --git a/lib/services/automationManagement/lib/models/webhook.js b/lib/services/automationManagement/lib/models/webhook.js index 73320d131d..f611e89501 100644 --- a/lib/services/automationManagement/lib/models/webhook.js +++ b/lib/services/automationManagement/lib/models/webhook.js @@ -97,6 +97,7 @@ class Webhook extends models['ProxyResource'] { }, expiryTime: { required: false, + nullable: false, serializedName: 'properties.expiryTime', type: { name: 'DateTime' @@ -104,6 +105,7 @@ class Webhook extends models['ProxyResource'] { }, lastInvokedTime: { required: false, + nullable: true, serializedName: 'properties.lastInvokedTime', type: { name: 'DateTime' @@ -140,6 +142,7 @@ class Webhook extends models['ProxyResource'] { }, creationTime: { required: false, + nullable: false, serializedName: 'properties.creationTime', type: { name: 'DateTime' @@ -147,6 +150,7 @@ class Webhook extends models['ProxyResource'] { }, lastModifiedTime: { required: false, + nullable: false, serializedName: 'properties.lastModifiedTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/lib/models/webhookCreateOrUpdateParameters.js b/lib/services/automationManagement/lib/models/webhookCreateOrUpdateParameters.js index 0025643af8..02b7161375 100644 --- a/lib/services/automationManagement/lib/models/webhookCreateOrUpdateParameters.js +++ b/lib/services/automationManagement/lib/models/webhookCreateOrUpdateParameters.js @@ -70,6 +70,7 @@ class WebhookCreateOrUpdateParameters { }, expiryTime: { required: false, + nullable: false, serializedName: 'properties.expiryTime', type: { name: 'DateTime' diff --git a/lib/services/automationManagement/package.json b/lib/services/automationManagement/package.json index 97b4adff35..0066807941 100644 --- a/lib/services/automationManagement/package.json +++ b/lib/services/automationManagement/package.json @@ -2,7 +2,7 @@ "name": "azure-arm-automation", "author": "Microsoft Corporation", "description": "AutomationClient Library with typescript type definitions for node", - "version": "3.0.0-preview", + "version": "5.0.0-preview", "dependencies": { "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" @@ -14,12 +14,12 @@ "license": "MIT", "main": "./lib/automationClient.js", "types": "./lib/automationClient.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } } From 24ec1786555525ab56e6e7d1ce1ff0e44f3d8bf9 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 9 Aug 2018 15:17:45 +0000 Subject: [PATCH 3/3] Generated from 1a11c87ee5039a2b795d276e17112cb657661f07 add new package to Go SDK build --- .../lib/models/index.d.ts | 168 ++++++++------- .../automationManagement/lib/models/index.js | 1 + .../lib/models/sourceControl.js | 24 +-- .../sourceControlCreateOrUpdateParameters.js | 39 ++-- .../lib/models/sourceControlListResult.js | 2 +- .../sourceControlSecurityTokenProperties.js | 75 +++++++ .../lib/models/sourceControlSyncJob.js | 20 +- .../lib/models/sourceControlSyncJobById.js | 26 +-- .../sourceControlSyncJobCreateParameters.js | 9 +- .../models/sourceControlSyncJobListResult.js | 2 +- .../lib/models/sourceControlSyncJobStream.js | 10 +- .../models/sourceControlSyncJobStreamById.js | 23 +- ...ourceControlSyncJobStreamsListBySyncJob.js | 2 +- .../models/sourceControlUpdateParameters.js | 32 +-- .../lib/operations/index.d.ts | 140 ++++++++----- .../lib/operations/sourceControlOperations.js | 198 +++++++++++------- .../sourceControlSyncJobOperations.js | 12 +- 17 files changed, 484 insertions(+), 299 deletions(-) create mode 100644 lib/services/automationManagement/lib/models/sourceControlSecurityTokenProperties.js diff --git a/lib/services/automationManagement/lib/models/index.d.ts b/lib/services/automationManagement/lib/models/index.d.ts index 636ac5d545..6c78555b52 100644 --- a/lib/services/automationManagement/lib/models/index.d.ts +++ b/lib/services/automationManagement/lib/models/index.d.ts @@ -2347,20 +2347,19 @@ export interface SoftwareUpdateConfigurationMachineRunListResult { * @constructor * Definition of the source control. * - * @member {string} [repoUrl] Gets or sets the repo url of the source control. - * @member {string} [branch] Gets or sets the repo branch of the source - * control. Include branch as empty string for VsoTfvc. - * @member {string} [folderPath] Gets or sets the folder path of the source - * control. - * @member {boolean} [autoSync] Gets or sets auto async of the source control. - * Default is false. - * @member {boolean} [publishRunbook] Gets or sets the auto publish of the - * source control. Default is true. + * @member {string} [repoUrl] The repo url of the source control. + * @member {string} [branch] The repo branch of the source control. Include + * branch as empty string for VsoTfvc. + * @member {string} [folderPath] The folder path of the source control. + * @member {boolean} [autoSync] The auto sync of the source control. Default is + * false. + * @member {boolean} [publishRunbook] The auto publish of the source control. + * Default is true. * @member {string} [sourceType] The source type. Must be one of VsoGit, * VsoTfvc, GitHub. Possible values include: 'VsoGit', 'VsoTfvc', 'GitHub' - * @member {string} [description] Gets or sets the description. - * @member {date} [creationTime] Gets or sets the creation time. - * @member {date} [lastModifiedTime] Gets or sets the last modified time. + * @member {string} [description] The description. + * @member {date} [creationTime] The creation time. + * @member {date} [lastModifiedTime] The last modified time. */ export interface SourceControl extends ProxyResource { repoUrl?: string; @@ -2374,31 +2373,50 @@ export interface SourceControl extends ProxyResource { lastModifiedTime?: Date; } +/** + * @class + * Initializes a new instance of the SourceControlSecurityTokenProperties class. + * @constructor + * @member {string} [accessToken] The access token. + * @member {string} [refreshToken] The refresh token. + * @member {string} [tokenType] The token type. Must be either + * PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' + */ +export interface SourceControlSecurityTokenProperties { + accessToken?: string; + refreshToken?: string; + tokenType?: string; +} + /** * @class * Initializes a new instance of the SourceControlUpdateParameters class. * @constructor * The parameters supplied to the update source control operation. * - * @member {string} [branch] Gets or sets the repo branch of the source - * control. - * @member {string} [folderPath] Gets or sets the folder path of the source - * control. Path must be relative. - * @member {boolean} [autoSync] Gets or sets auto async of the source control. - * Default is false. - * @member {boolean} [publishRunbook] Gets or sets the auto publish of the - * source control. Default is true. - * @member {string} [securityToken] Gets or sets the authorization token for - * the repo of the source control. - * @member {string} [description] Gets or sets the user description of the + * @member {string} [branch] The repo branch of the source control. + * @member {string} [folderPath] The folder path of the source control. Path + * must be relative. + * @member {boolean} [autoSync] The auto sync of the source control. Default is + * false. + * @member {boolean} [publishRunbook] The auto publish of the source control. + * Default is true. + * @member {object} [securityToken] The authorization token for the repo of the * source control. + * @member {string} [securityToken.accessToken] The access token. + * @member {string} [securityToken.refreshToken] The refresh token. + * @member {string} [securityToken.tokenType] The token type. Must be either + * PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' + * @member {string} [description] The user description of the source control. */ export interface SourceControlUpdateParameters { branch?: string; folderPath?: string; autoSync?: boolean; publishRunbook?: boolean; - securityToken?: string; + securityToken?: SourceControlSecurityTokenProperties; description?: string; } @@ -2408,22 +2426,26 @@ export interface SourceControlUpdateParameters { * @constructor * The parameters supplied to the create or update source control operation. * - * @member {string} [repoUrl] Gets or sets the repo url of the source control. - * @member {string} [branch] Gets or sets the repo branch of the source - * control. Include branch as empty string for VsoTfvc. - * @member {string} [folderPath] Gets or sets the folder path of the source - * control. Path must be relative. - * @member {boolean} [autoSync] Gets or sets auto async of the source control. - * Default is false. - * @member {boolean} [publishRunbook] Gets or sets the auto publish of the - * source control. Default is true. + * @member {string} [repoUrl] The repo url of the source control. + * @member {string} [branch] The repo branch of the source control. Include + * branch as empty string for VsoTfvc. + * @member {string} [folderPath] The folder path of the source control. Path + * must be relative. + * @member {boolean} [autoSync] The auto async of the source control. Default + * is false. + * @member {boolean} [publishRunbook] The auto publish of the source control. + * Default is true. * @member {string} [sourceType] The source type. Must be one of VsoGit, * VsoTfvc, GitHub, case sensitive. Possible values include: 'VsoGit', * 'VsoTfvc', 'GitHub' - * @member {string} [securityToken] Gets or sets the authorization token for - * the repo of the source control. - * @member {string} [description] Gets or sets the user description of the + * @member {object} [securityToken] The authorization token for the repo of the * source control. + * @member {string} [securityToken.accessToken] The access token. + * @member {string} [securityToken.refreshToken] The refresh token. + * @member {string} [securityToken.tokenType] The token type. Must be either + * PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' + * @member {string} [description] The user description of the source control. */ export interface SourceControlCreateOrUpdateParameters { repoUrl?: string; @@ -2432,7 +2454,7 @@ export interface SourceControlCreateOrUpdateParameters { autoSync?: boolean; publishRunbook?: boolean; sourceType?: string; - securityToken?: string; + securityToken?: SourceControlSecurityTokenProperties; description?: string; } @@ -2445,20 +2467,20 @@ export interface SourceControlCreateOrUpdateParameters { * @member {string} [name] Resource name. * @member {string} [type] Resource type. * @member {string} [id] Resource id. - * @member {string} [syncJobId] Gets the source control sync job id. - * @member {date} [creationTime] Gets the creation time of the job. - * @member {string} [provisioningState] Gets the provisioning state of the job. + * @member {string} [sourceControlSyncJobId] The source control sync job id. + * @member {date} [creationTime] The creation time of the job. + * @member {string} [provisioningState] The provisioning state of the job. * Possible values include: 'Completed', 'Failed', 'Running' - * @member {date} [startTime] Gets the start time of the job. - * @member {date} [endTime] Gets the end time of the job. - * @member {string} [startType] Gets the type of start for the sync job. - * Possible values include: 'AutoSync', 'ManualSync' + * @member {date} [startTime] The start time of the job. + * @member {date} [endTime] The end time of the job. + * @member {string} [startType] The type of start for the sync job. Possible + * values include: 'AutoSync', 'ManualSync' */ export interface SourceControlSyncJob { readonly name?: string; readonly type?: string; readonly id?: string; - syncJobId?: string; + sourceControlSyncJobId?: string; readonly creationTime?: Date; provisioningState?: string; readonly startTime?: Date; @@ -2472,11 +2494,11 @@ export interface SourceControlSyncJob { * @constructor * The parameters supplied to the create source control sync job operation. * - * @member {string} [commitId] Sets the commit id of the source control sync - * job. + * @member {string} commitId The commit id of the source control sync job. If + * not syncing to a commitId, enter an empty string. */ export interface SourceControlSyncJobCreateParameters { - commitId?: string; + commitId: string; } /** @@ -2485,21 +2507,21 @@ export interface SourceControlSyncJobCreateParameters { * @constructor * Definition of the source control sync job. * - * @member {string} [id] Gets the id of the job. - * @member {string} [syncJobId] Gets the source control sync job id. - * @member {date} [creationTime] Gets the creation time of the job. - * @member {string} [provisioningState] Gets the provisioning state of the job. + * @member {string} [id] The id of the job. + * @member {string} [sourceControlSyncJobId] The source control sync job id. + * @member {date} [creationTime] The creation time of the job. + * @member {string} [provisioningState] The provisioning state of the job. * Possible values include: 'Completed', 'Failed', 'Running' - * @member {date} [startTime] Gets the start time of the job. - * @member {date} [endTime] Gets the end time of the job. - * @member {string} [startType] Gets the type of start for the sync job. - * Possible values include: 'AutoSync', 'ManualSync' - * @member {string} [exception] Gets the exceptions that occured while running - * the sync job. + * @member {date} [startTime] The start time of the job. + * @member {date} [endTime] The end time of the job. + * @member {string} [startType] The type of start for the sync job. Possible + * values include: 'AutoSync', 'ManualSync' + * @member {string} [exception] The exceptions that occured while running the + * sync job. */ export interface SourceControlSyncJobById { id?: string; - syncJobId?: string; + sourceControlSyncJobId?: string; readonly creationTime?: Date; provisioningState?: string; readonly startTime?: Date; @@ -2515,10 +2537,10 @@ export interface SourceControlSyncJobById { * Definition of the source control sync job stream. * * @member {string} [id] Resource id. - * @member {string} [syncJobStreamId] Gets the sync job stream id. - * @member {string} [summary] Gets the summary of the sync job stream. - * @member {date} [time] Gets the time of the sync job stream. - * @member {string} [streamType] Gets the type of the sync job stream. Possible + * @member {string} [syncJobStreamId] The sync job stream id. + * @member {string} [summary] The summary of the sync job stream. + * @member {date} [time] The time of the sync job stream. + * @member {string} [streamType] The type of the sync job stream. Possible * values include: 'Error', 'Output' */ export interface SourceControlSyncJobStream { @@ -2536,13 +2558,13 @@ export interface SourceControlSyncJobStream { * Definition of the source control sync job stream by id. * * @member {string} [id] Resource id. - * @member {string} [syncJobStreamId] Gets the sync job stream id. - * @member {string} [summary] Gets the summary of the sync job stream. - * @member {date} [time] Gets the time of the sync job stream. - * @member {string} [streamType] Gets the type of the sync job stream. Possible + * @member {string} [syncJobStreamId] The sync job stream id. + * @member {string} [summary] The summary of the sync job stream. + * @member {date} [time] The time of the sync job stream. + * @member {string} [streamType] The type of the sync job stream. Possible * values include: 'Error', 'Output' - * @member {string} [streamText] Gets the text of the sync job stream. - * @member {string} [value] Gets the value of the sync job stream. + * @member {string} [streamText] The text of the sync job stream. + * @member {object} [value] The values of the job stream. */ export interface SourceControlSyncJobStreamById { readonly id?: string; @@ -2551,7 +2573,7 @@ export interface SourceControlSyncJobStreamById { readonly time?: Date; streamType?: string; streamText?: string; - value?: string; + value?: { [propertyName: string]: any }; } /** @@ -3373,7 +3395,7 @@ export interface WatcherListResult extends Array { * @constructor * The response model for the list source controls operation. * - * @member {string} [nextLink] Gets or sets the next link. + * @member {string} [nextLink] The next link. */ export interface SourceControlListResult extends Array { nextLink?: string; @@ -3385,7 +3407,7 @@ export interface SourceControlListResult extends Array { * @constructor * The response model for the list source control sync jobs operation. * - * @member {string} [nextLink] Gets or sets the next link. + * @member {string} [nextLink] The next link. */ export interface SourceControlSyncJobListResult extends Array { nextLink?: string; @@ -3397,7 +3419,7 @@ export interface SourceControlSyncJobListResult extends Array { readonly nextLink?: string; diff --git a/lib/services/automationManagement/lib/models/index.js b/lib/services/automationManagement/lib/models/index.js index 450c7f4b5d..26f86dea74 100644 --- a/lib/services/automationManagement/lib/models/index.js +++ b/lib/services/automationManagement/lib/models/index.js @@ -111,6 +111,7 @@ exports.JobNavigation = require('./jobNavigation'); exports.SoftwareUpdateConfigurationMachineRun = require('./softwareUpdateConfigurationMachineRun'); exports.SoftwareUpdateConfigurationMachineRunListResult = require('./softwareUpdateConfigurationMachineRunListResult'); exports.SourceControl = require('./sourceControl'); +exports.SourceControlSecurityTokenProperties = require('./sourceControlSecurityTokenProperties'); exports.SourceControlUpdateParameters = require('./sourceControlUpdateParameters'); exports.SourceControlCreateOrUpdateParameters = require('./sourceControlCreateOrUpdateParameters'); exports.SourceControlSyncJob = require('./sourceControlSyncJob'); diff --git a/lib/services/automationManagement/lib/models/sourceControl.js b/lib/services/automationManagement/lib/models/sourceControl.js index 65d21d0307..f769dc0034 100644 --- a/lib/services/automationManagement/lib/models/sourceControl.js +++ b/lib/services/automationManagement/lib/models/sourceControl.js @@ -20,21 +20,19 @@ const models = require('./index'); class SourceControl extends models['ProxyResource'] { /** * Create a SourceControl. - * @member {string} [repoUrl] Gets or sets the repo url of the source - * control. - * @member {string} [branch] Gets or sets the repo branch of the source - * control. Include branch as empty string for VsoTfvc. - * @member {string} [folderPath] Gets or sets the folder path of the source - * control. - * @member {boolean} [autoSync] Gets or sets auto async of the source - * control. Default is false. - * @member {boolean} [publishRunbook] Gets or sets the auto publish of the - * source control. Default is true. + * @member {string} [repoUrl] The repo url of the source control. + * @member {string} [branch] The repo branch of the source control. Include + * branch as empty string for VsoTfvc. + * @member {string} [folderPath] The folder path of the source control. + * @member {boolean} [autoSync] The auto sync of the source control. Default + * is false. + * @member {boolean} [publishRunbook] The auto publish of the source control. + * Default is true. * @member {string} [sourceType] The source type. Must be one of VsoGit, * VsoTfvc, GitHub. Possible values include: 'VsoGit', 'VsoTfvc', 'GitHub' - * @member {string} [description] Gets or sets the description. - * @member {date} [creationTime] Gets or sets the creation time. - * @member {date} [lastModifiedTime] Gets or sets the last modified time. + * @member {string} [description] The description. + * @member {date} [creationTime] The creation time. + * @member {date} [lastModifiedTime] The last modified time. */ constructor() { super(); diff --git a/lib/services/automationManagement/lib/models/sourceControlCreateOrUpdateParameters.js b/lib/services/automationManagement/lib/models/sourceControlCreateOrUpdateParameters.js index ebed49622d..a76ea4af41 100644 --- a/lib/services/automationManagement/lib/models/sourceControlCreateOrUpdateParameters.js +++ b/lib/services/automationManagement/lib/models/sourceControlCreateOrUpdateParameters.js @@ -10,6 +10,8 @@ 'use strict'; +const models = require('./index'); + /** * The parameters supplied to the create or update source control operation. * @@ -17,23 +19,26 @@ class SourceControlCreateOrUpdateParameters { /** * Create a SourceControlCreateOrUpdateParameters. - * @member {string} [repoUrl] Gets or sets the repo url of the source - * control. - * @member {string} [branch] Gets or sets the repo branch of the source - * control. Include branch as empty string for VsoTfvc. - * @member {string} [folderPath] Gets or sets the folder path of the source - * control. Path must be relative. - * @member {boolean} [autoSync] Gets or sets auto async of the source - * control. Default is false. - * @member {boolean} [publishRunbook] Gets or sets the auto publish of the - * source control. Default is true. + * @member {string} [repoUrl] The repo url of the source control. + * @member {string} [branch] The repo branch of the source control. Include + * branch as empty string for VsoTfvc. + * @member {string} [folderPath] The folder path of the source control. Path + * must be relative. + * @member {boolean} [autoSync] The auto async of the source control. Default + * is false. + * @member {boolean} [publishRunbook] The auto publish of the source control. + * Default is true. * @member {string} [sourceType] The source type. Must be one of VsoGit, * VsoTfvc, GitHub, case sensitive. Possible values include: 'VsoGit', * 'VsoTfvc', 'GitHub' - * @member {string} [securityToken] Gets or sets the authorization token for - * the repo of the source control. - * @member {string} [description] Gets or sets the user description of the - * source control. + * @member {object} [securityToken] The authorization token for the repo of + * the source control. + * @member {string} [securityToken.accessToken] The access token. + * @member {string} [securityToken.refreshToken] The refresh token. + * @member {string} [securityToken.tokenType] The token type. Must be either + * PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' + * @member {string} [description] The user description of the source control. */ constructor() { } @@ -106,11 +111,9 @@ class SourceControlCreateOrUpdateParameters { securityToken: { required: false, serializedName: 'properties.securityToken', - constraints: { - MaxLength: 1024 - }, type: { - name: 'String' + name: 'Composite', + className: 'SourceControlSecurityTokenProperties' } }, description: { diff --git a/lib/services/automationManagement/lib/models/sourceControlListResult.js b/lib/services/automationManagement/lib/models/sourceControlListResult.js index 18028ab656..59a050c147 100644 --- a/lib/services/automationManagement/lib/models/sourceControlListResult.js +++ b/lib/services/automationManagement/lib/models/sourceControlListResult.js @@ -16,7 +16,7 @@ class SourceControlListResult extends Array { /** * Create a SourceControlListResult. - * @member {string} [nextLink] Gets or sets the next link. + * @member {string} [nextLink] The next link. */ constructor() { super(); diff --git a/lib/services/automationManagement/lib/models/sourceControlSecurityTokenProperties.js b/lib/services/automationManagement/lib/models/sourceControlSecurityTokenProperties.js new file mode 100644 index 0000000000..40a2ccc881 --- /dev/null +++ b/lib/services/automationManagement/lib/models/sourceControlSecurityTokenProperties.js @@ -0,0 +1,75 @@ +/* + * 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'; + +/** + * Class representing a SourceControlSecurityTokenProperties. + */ +class SourceControlSecurityTokenProperties { + /** + * Create a SourceControlSecurityTokenProperties. + * @member {string} [accessToken] The access token. + * @member {string} [refreshToken] The refresh token. + * @member {string} [tokenType] The token type. Must be either + * PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' + */ + constructor() { + } + + /** + * Defines the metadata of SourceControlSecurityTokenProperties + * + * @returns {object} metadata of SourceControlSecurityTokenProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceControlSecurityTokenProperties', + type: { + name: 'Composite', + className: 'SourceControlSecurityTokenProperties', + modelProperties: { + accessToken: { + required: false, + serializedName: 'accessToken', + constraints: { + MaxLength: 1024 + }, + type: { + name: 'String' + } + }, + refreshToken: { + required: false, + serializedName: 'refreshToken', + constraints: { + MaxLength: 1024 + }, + type: { + name: 'String' + } + }, + tokenType: { + required: false, + serializedName: 'tokenType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceControlSecurityTokenProperties; diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJob.js b/lib/services/automationManagement/lib/models/sourceControlSyncJob.js index 91ef7d3416..5338dff39e 100644 --- a/lib/services/automationManagement/lib/models/sourceControlSyncJob.js +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJob.js @@ -20,14 +20,14 @@ class SourceControlSyncJob { * @member {string} [name] Resource name. * @member {string} [type] Resource type. * @member {string} [id] Resource id. - * @member {string} [syncJobId] Gets the source control sync job id. - * @member {date} [creationTime] Gets the creation time of the job. - * @member {string} [provisioningState] Gets the provisioning state of the - * job. Possible values include: 'Completed', 'Failed', 'Running' - * @member {date} [startTime] Gets the start time of the job. - * @member {date} [endTime] Gets the end time of the job. - * @member {string} [startType] Gets the type of start for the sync job. - * Possible values include: 'AutoSync', 'ManualSync' + * @member {string} [sourceControlSyncJobId] The source control sync job id. + * @member {date} [creationTime] The creation time of the job. + * @member {string} [provisioningState] The provisioning state of the job. + * Possible values include: 'Completed', 'Failed', 'Running' + * @member {date} [startTime] The start time of the job. + * @member {date} [endTime] The end time of the job. + * @member {string} [startType] The type of start for the sync job. Possible + * values include: 'AutoSync', 'ManualSync' */ constructor() { } @@ -70,9 +70,9 @@ class SourceControlSyncJob { name: 'String' } }, - syncJobId: { + sourceControlSyncJobId: { required: false, - serializedName: 'properties.syncJobId', + serializedName: 'properties.sourceControlSyncJobId', type: { name: 'String' } diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJobById.js b/lib/services/automationManagement/lib/models/sourceControlSyncJobById.js index 243b063ca4..6e72c5031f 100644 --- a/lib/services/automationManagement/lib/models/sourceControlSyncJobById.js +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobById.js @@ -17,17 +17,17 @@ class SourceControlSyncJobById { /** * Create a SourceControlSyncJobById. - * @member {string} [id] Gets the id of the job. - * @member {string} [syncJobId] Gets the source control sync job id. - * @member {date} [creationTime] Gets the creation time of the job. - * @member {string} [provisioningState] Gets the provisioning state of the - * job. Possible values include: 'Completed', 'Failed', 'Running' - * @member {date} [startTime] Gets the start time of the job. - * @member {date} [endTime] Gets the end time of the job. - * @member {string} [startType] Gets the type of start for the sync job. - * Possible values include: 'AutoSync', 'ManualSync' - * @member {string} [exception] Gets the exceptions that occured while - * running the sync job. + * @member {string} [id] The id of the job. + * @member {string} [sourceControlSyncJobId] The source control sync job id. + * @member {date} [creationTime] The creation time of the job. + * @member {string} [provisioningState] The provisioning state of the job. + * Possible values include: 'Completed', 'Failed', 'Running' + * @member {date} [startTime] The start time of the job. + * @member {date} [endTime] The end time of the job. + * @member {string} [startType] The type of start for the sync job. Possible + * values include: 'AutoSync', 'ManualSync' + * @member {string} [exception] The exceptions that occured while running the + * sync job. */ constructor() { } @@ -53,9 +53,9 @@ class SourceControlSyncJobById { name: 'String' } }, - syncJobId: { + sourceControlSyncJobId: { required: false, - serializedName: 'properties.syncJobId', + serializedName: 'properties.sourceControlSyncJobId', type: { name: 'String' } diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJobCreateParameters.js b/lib/services/automationManagement/lib/models/sourceControlSyncJobCreateParameters.js index e2ec347211..d44097307b 100644 --- a/lib/services/automationManagement/lib/models/sourceControlSyncJobCreateParameters.js +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobCreateParameters.js @@ -17,8 +17,8 @@ class SourceControlSyncJobCreateParameters { /** * Create a SourceControlSyncJobCreateParameters. - * @member {string} [commitId] Sets the commit id of the source control sync - * job. + * @member {string} commitId The commit id of the source control sync job. If + * not syncing to a commitId, enter an empty string. */ constructor() { } @@ -38,8 +38,11 @@ class SourceControlSyncJobCreateParameters { className: 'SourceControlSyncJobCreateParameters', modelProperties: { commitId: { - required: false, + required: true, serializedName: 'properties.commitId', + constraints: { + MinLength: 0 + }, type: { name: 'String' } diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJobListResult.js b/lib/services/automationManagement/lib/models/sourceControlSyncJobListResult.js index 328361f520..d074cd67f9 100644 --- a/lib/services/automationManagement/lib/models/sourceControlSyncJobListResult.js +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobListResult.js @@ -16,7 +16,7 @@ class SourceControlSyncJobListResult extends Array { /** * Create a SourceControlSyncJobListResult. - * @member {string} [nextLink] Gets or sets the next link. + * @member {string} [nextLink] The next link. */ constructor() { super(); diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJobStream.js b/lib/services/automationManagement/lib/models/sourceControlSyncJobStream.js index 2c7605db40..15f6c001b0 100644 --- a/lib/services/automationManagement/lib/models/sourceControlSyncJobStream.js +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobStream.js @@ -18,11 +18,11 @@ class SourceControlSyncJobStream { /** * Create a SourceControlSyncJobStream. * @member {string} [id] Resource id. - * @member {string} [syncJobStreamId] Gets the sync job stream id. - * @member {string} [summary] Gets the summary of the sync job stream. - * @member {date} [time] Gets the time of the sync job stream. - * @member {string} [streamType] Gets the type of the sync job stream. - * Possible values include: 'Error', 'Output' + * @member {string} [syncJobStreamId] The sync job stream id. + * @member {string} [summary] The summary of the sync job stream. + * @member {date} [time] The time of the sync job stream. + * @member {string} [streamType] The type of the sync job stream. Possible + * values include: 'Error', 'Output' */ constructor() { } diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamById.js b/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamById.js index 82cd2f7782..879b66fc12 100644 --- a/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamById.js +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamById.js @@ -18,13 +18,13 @@ class SourceControlSyncJobStreamById { /** * Create a SourceControlSyncJobStreamById. * @member {string} [id] Resource id. - * @member {string} [syncJobStreamId] Gets the sync job stream id. - * @member {string} [summary] Gets the summary of the sync job stream. - * @member {date} [time] Gets the time of the sync job stream. - * @member {string} [streamType] Gets the type of the sync job stream. - * Possible values include: 'Error', 'Output' - * @member {string} [streamText] Gets the text of the sync job stream. - * @member {string} [value] Gets the value of the sync job stream. + * @member {string} [syncJobStreamId] The sync job stream id. + * @member {string} [summary] The summary of the sync job stream. + * @member {date} [time] The time of the sync job stream. + * @member {string} [streamType] The type of the sync job stream. Possible + * values include: 'Error', 'Output' + * @member {string} [streamText] The text of the sync job stream. + * @member {object} [value] The values of the job stream. */ constructor() { } @@ -92,7 +92,14 @@ class SourceControlSyncJobStreamById { required: false, serializedName: 'properties.value', type: { - name: 'String' + name: 'Dictionary', + value: { + required: false, + serializedName: 'ObjectElementType', + type: { + name: 'Object' + } + } } } } diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamsListBySyncJob.js b/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamsListBySyncJob.js index 1bd26279c6..51190d5576 100644 --- a/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamsListBySyncJob.js +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamsListBySyncJob.js @@ -16,7 +16,7 @@ class SourceControlSyncJobStreamsListBySyncJob extends Array { /** * Create a SourceControlSyncJobStreamsListBySyncJob. - * @member {string} [nextLink] Gets or sets the next link. + * @member {string} [nextLink] The next link. */ constructor() { super(); diff --git a/lib/services/automationManagement/lib/models/sourceControlUpdateParameters.js b/lib/services/automationManagement/lib/models/sourceControlUpdateParameters.js index bd0062ebd6..61f3394925 100644 --- a/lib/services/automationManagement/lib/models/sourceControlUpdateParameters.js +++ b/lib/services/automationManagement/lib/models/sourceControlUpdateParameters.js @@ -10,6 +10,8 @@ 'use strict'; +const models = require('./index'); + /** * The parameters supplied to the update source control operation. * @@ -17,18 +19,21 @@ class SourceControlUpdateParameters { /** * Create a SourceControlUpdateParameters. - * @member {string} [branch] Gets or sets the repo branch of the source - * control. - * @member {string} [folderPath] Gets or sets the folder path of the source - * control. Path must be relative. - * @member {boolean} [autoSync] Gets or sets auto async of the source - * control. Default is false. - * @member {boolean} [publishRunbook] Gets or sets the auto publish of the - * source control. Default is true. - * @member {string} [securityToken] Gets or sets the authorization token for - * the repo of the source control. - * @member {string} [description] Gets or sets the user description of the - * source control. + * @member {string} [branch] The repo branch of the source control. + * @member {string} [folderPath] The folder path of the source control. Path + * must be relative. + * @member {boolean} [autoSync] The auto sync of the source control. Default + * is false. + * @member {boolean} [publishRunbook] The auto publish of the source control. + * Default is true. + * @member {object} [securityToken] The authorization token for the repo of + * the source control. + * @member {string} [securityToken.accessToken] The access token. + * @member {string} [securityToken.refreshToken] The refresh token. + * @member {string} [securityToken.tokenType] The token type. Must be either + * PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' + * @member {string} [description] The user description of the source control. */ constructor() { } @@ -79,7 +84,8 @@ class SourceControlUpdateParameters { required: false, serializedName: 'properties.securityToken', type: { - name: 'String' + name: 'Composite', + className: 'SourceControlSecurityTokenProperties' } }, description: { diff --git a/lib/services/automationManagement/lib/operations/index.d.ts b/lib/services/automationManagement/lib/operations/index.d.ts index efd7550759..9852c44f3f 100644 --- a/lib/services/automationManagement/lib/operations/index.d.ts +++ b/lib/services/automationManagement/lib/operations/index.d.ts @@ -9702,30 +9702,37 @@ export interface SourceControlOperations { * @param {object} parameters The parameters supplied to the create or update * source control operation. * - * @param {string} [parameters.repoUrl] Gets or sets the repo url of the source - * control. + * @param {string} [parameters.repoUrl] The repo url of the source control. * - * @param {string} [parameters.branch] Gets or sets the repo branch of the - * source control. Include branch as empty string for VsoTfvc. + * @param {string} [parameters.branch] The repo branch of the source control. + * Include branch as empty string for VsoTfvc. * - * @param {string} [parameters.folderPath] Gets or sets the folder path of the - * source control. Path must be relative. + * @param {string} [parameters.folderPath] The folder path of the source + * control. Path must be relative. * - * @param {boolean} [parameters.autoSync] Gets or sets auto async of the source - * control. Default is false. + * @param {boolean} [parameters.autoSync] The auto async of the source control. + * Default is false. * - * @param {boolean} [parameters.publishRunbook] Gets or sets the auto publish - * of the source control. Default is true. + * @param {boolean} [parameters.publishRunbook] The auto publish of the source + * control. Default is true. * * @param {string} [parameters.sourceType] The source type. Must be one of * VsoGit, VsoTfvc, GitHub, case sensitive. Possible values include: 'VsoGit', * 'VsoTfvc', 'GitHub' * - * @param {string} [parameters.securityToken] Gets or sets the authorization - * token for the repo of the source control. + * @param {object} [parameters.securityToken] The authorization token for the + * repo of the source control. + * + * @param {string} [parameters.securityToken.accessToken] The access token. + * + * @param {string} [parameters.securityToken.refreshToken] The refresh token. * - * @param {string} [parameters.description] Gets or sets the user description - * of the source control. + * @param {string} [parameters.securityToken.tokenType] The token type. Must be + * either PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' + * + * @param {string} [parameters.description] The user description of the source + * control. * * @param {object} [options] Optional Parameters. * @@ -9752,30 +9759,37 @@ export interface SourceControlOperations { * @param {object} parameters The parameters supplied to the create or update * source control operation. * - * @param {string} [parameters.repoUrl] Gets or sets the repo url of the source - * control. + * @param {string} [parameters.repoUrl] The repo url of the source control. * - * @param {string} [parameters.branch] Gets or sets the repo branch of the - * source control. Include branch as empty string for VsoTfvc. + * @param {string} [parameters.branch] The repo branch of the source control. + * Include branch as empty string for VsoTfvc. * - * @param {string} [parameters.folderPath] Gets or sets the folder path of the - * source control. Path must be relative. + * @param {string} [parameters.folderPath] The folder path of the source + * control. Path must be relative. * - * @param {boolean} [parameters.autoSync] Gets or sets auto async of the source - * control. Default is false. + * @param {boolean} [parameters.autoSync] The auto async of the source control. + * Default is false. * - * @param {boolean} [parameters.publishRunbook] Gets or sets the auto publish - * of the source control. Default is true. + * @param {boolean} [parameters.publishRunbook] The auto publish of the source + * control. Default is true. * * @param {string} [parameters.sourceType] The source type. Must be one of * VsoGit, VsoTfvc, GitHub, case sensitive. Possible values include: 'VsoGit', * 'VsoTfvc', 'GitHub' * - * @param {string} [parameters.securityToken] Gets or sets the authorization - * token for the repo of the source control. + * @param {object} [parameters.securityToken] The authorization token for the + * repo of the source control. + * + * @param {string} [parameters.securityToken.accessToken] The access token. + * + * @param {string} [parameters.securityToken.refreshToken] The refresh token. + * + * @param {string} [parameters.securityToken.tokenType] The token type. Must be + * either PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' * - * @param {string} [parameters.description] Gets or sets the user description - * of the source control. + * @param {string} [parameters.description] The user description of the source + * control. * * @param {object} [options] Optional Parameters. * @@ -9821,23 +9835,30 @@ export interface SourceControlOperations { * @param {object} parameters The parameters supplied to the update source * control operation. * - * @param {string} [parameters.branch] Gets or sets the repo branch of the - * source control. + * @param {string} [parameters.branch] The repo branch of the source control. + * + * @param {string} [parameters.folderPath] The folder path of the source + * control. Path must be relative. + * + * @param {boolean} [parameters.autoSync] The auto sync of the source control. + * Default is false. * - * @param {string} [parameters.folderPath] Gets or sets the folder path of the - * source control. Path must be relative. + * @param {boolean} [parameters.publishRunbook] The auto publish of the source + * control. Default is true. * - * @param {boolean} [parameters.autoSync] Gets or sets auto async of the source - * control. Default is false. + * @param {object} [parameters.securityToken] The authorization token for the + * repo of the source control. * - * @param {boolean} [parameters.publishRunbook] Gets or sets the auto publish - * of the source control. Default is true. + * @param {string} [parameters.securityToken.accessToken] The access token. * - * @param {string} [parameters.securityToken] Gets or sets the authorization - * token for the repo of the source control. + * @param {string} [parameters.securityToken.refreshToken] The refresh token. * - * @param {string} [parameters.description] Gets or sets the user description - * of the source control. + * @param {string} [parameters.securityToken.tokenType] The token type. Must be + * either PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' + * + * @param {string} [parameters.description] The user description of the source + * control. * * @param {object} [options] Optional Parameters. * @@ -9864,23 +9885,30 @@ export interface SourceControlOperations { * @param {object} parameters The parameters supplied to the update source * control operation. * - * @param {string} [parameters.branch] Gets or sets the repo branch of the - * source control. + * @param {string} [parameters.branch] The repo branch of the source control. * - * @param {string} [parameters.folderPath] Gets or sets the folder path of the - * source control. Path must be relative. + * @param {string} [parameters.folderPath] The folder path of the source + * control. Path must be relative. * - * @param {boolean} [parameters.autoSync] Gets or sets auto async of the source - * control. Default is false. + * @param {boolean} [parameters.autoSync] The auto sync of the source control. + * Default is false. * - * @param {boolean} [parameters.publishRunbook] Gets or sets the auto publish - * of the source control. Default is true. + * @param {boolean} [parameters.publishRunbook] The auto publish of the source + * control. Default is true. * - * @param {string} [parameters.securityToken] Gets or sets the authorization - * token for the repo of the source control. + * @param {object} [parameters.securityToken] The authorization token for the + * repo of the source control. * - * @param {string} [parameters.description] Gets or sets the user description - * of the source control. + * @param {string} [parameters.securityToken.accessToken] The access token. + * + * @param {string} [parameters.securityToken.refreshToken] The refresh token. + * + * @param {string} [parameters.securityToken.tokenType] The token type. Must be + * either PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' + * + * @param {string} [parameters.description] The user description of the source + * control. * * @param {object} [options] Optional Parameters. * @@ -10184,8 +10212,8 @@ export interface SourceControlSyncJobOperations { * @param {object} parameters The parameters supplied to the create source * control sync job operation. * - * @param {string} [parameters.commitId] Sets the commit id of the source - * control sync job. + * @param {string} parameters.commitId The commit id of the source control sync + * job. If not syncing to a commitId, enter an empty string. * * @param {object} [options] Optional Parameters. * @@ -10214,8 +10242,8 @@ export interface SourceControlSyncJobOperations { * @param {object} parameters The parameters supplied to the create source * control sync job operation. * - * @param {string} [parameters.commitId] Sets the commit id of the source - * control sync job. + * @param {string} parameters.commitId The commit id of the source control sync + * job. If not syncing to a commitId, enter an empty string. * * @param {object} [options] Optional Parameters. * diff --git a/lib/services/automationManagement/lib/operations/sourceControlOperations.js b/lib/services/automationManagement/lib/operations/sourceControlOperations.js index 8e34846c2e..e61701cdea 100644 --- a/lib/services/automationManagement/lib/operations/sourceControlOperations.js +++ b/lib/services/automationManagement/lib/operations/sourceControlOperations.js @@ -26,30 +26,37 @@ const WebResource = msRest.WebResource; * @param {object} parameters The parameters supplied to the create or update * source control operation. * - * @param {string} [parameters.repoUrl] Gets or sets the repo url of the source - * control. + * @param {string} [parameters.repoUrl] The repo url of the source control. * - * @param {string} [parameters.branch] Gets or sets the repo branch of the - * source control. Include branch as empty string for VsoTfvc. + * @param {string} [parameters.branch] The repo branch of the source control. + * Include branch as empty string for VsoTfvc. * - * @param {string} [parameters.folderPath] Gets or sets the folder path of the - * source control. Path must be relative. + * @param {string} [parameters.folderPath] The folder path of the source + * control. Path must be relative. * - * @param {boolean} [parameters.autoSync] Gets or sets auto async of the source - * control. Default is false. + * @param {boolean} [parameters.autoSync] The auto async of the source control. + * Default is false. * - * @param {boolean} [parameters.publishRunbook] Gets or sets the auto publish - * of the source control. Default is true. + * @param {boolean} [parameters.publishRunbook] The auto publish of the source + * control. Default is true. * * @param {string} [parameters.sourceType] The source type. Must be one of * VsoGit, VsoTfvc, GitHub, case sensitive. Possible values include: 'VsoGit', * 'VsoTfvc', 'GitHub' * - * @param {string} [parameters.securityToken] Gets or sets the authorization - * token for the repo of the source control. + * @param {object} [parameters.securityToken] The authorization token for the + * repo of the source control. + * + * @param {string} [parameters.securityToken.accessToken] The access token. * - * @param {string} [parameters.description] Gets or sets the user description - * of the source control. + * @param {string} [parameters.securityToken.refreshToken] The refresh token. + * + * @param {string} [parameters.securityToken.tokenType] The token type. Must be + * either PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' + * + * @param {string} [parameters.description] The user description of the source + * control. * * @param {object} [options] Optional Parameters. * @@ -252,23 +259,30 @@ function _createOrUpdate(resourceGroupName, automationAccountName, sourceControl * @param {object} parameters The parameters supplied to the update source * control operation. * - * @param {string} [parameters.branch] Gets or sets the repo branch of the - * source control. + * @param {string} [parameters.branch] The repo branch of the source control. + * + * @param {string} [parameters.folderPath] The folder path of the source + * control. Path must be relative. + * + * @param {boolean} [parameters.autoSync] The auto sync of the source control. + * Default is false. * - * @param {string} [parameters.folderPath] Gets or sets the folder path of the - * source control. Path must be relative. + * @param {boolean} [parameters.publishRunbook] The auto publish of the source + * control. Default is true. * - * @param {boolean} [parameters.autoSync] Gets or sets auto async of the source - * control. Default is false. + * @param {object} [parameters.securityToken] The authorization token for the + * repo of the source control. * - * @param {boolean} [parameters.publishRunbook] Gets or sets the auto publish - * of the source control. Default is true. + * @param {string} [parameters.securityToken.accessToken] The access token. * - * @param {string} [parameters.securityToken] Gets or sets the authorization - * token for the repo of the source control. + * @param {string} [parameters.securityToken.refreshToken] The refresh token. * - * @param {string} [parameters.description] Gets or sets the user description - * of the source control. + * @param {string} [parameters.securityToken.tokenType] The token type. Must be + * either PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' + * + * @param {string} [parameters.description] The user description of the source + * control. * * @param {object} [options] Optional Parameters. * @@ -1077,30 +1091,37 @@ class SourceControlOperations { * @param {object} parameters The parameters supplied to the create or update * source control operation. * - * @param {string} [parameters.repoUrl] Gets or sets the repo url of the source - * control. + * @param {string} [parameters.repoUrl] The repo url of the source control. * - * @param {string} [parameters.branch] Gets or sets the repo branch of the - * source control. Include branch as empty string for VsoTfvc. + * @param {string} [parameters.branch] The repo branch of the source control. + * Include branch as empty string for VsoTfvc. * - * @param {string} [parameters.folderPath] Gets or sets the folder path of the - * source control. Path must be relative. + * @param {string} [parameters.folderPath] The folder path of the source + * control. Path must be relative. * - * @param {boolean} [parameters.autoSync] Gets or sets auto async of the source - * control. Default is false. + * @param {boolean} [parameters.autoSync] The auto async of the source control. + * Default is false. * - * @param {boolean} [parameters.publishRunbook] Gets or sets the auto publish - * of the source control. Default is true. + * @param {boolean} [parameters.publishRunbook] The auto publish of the source + * control. Default is true. * * @param {string} [parameters.sourceType] The source type. Must be one of * VsoGit, VsoTfvc, GitHub, case sensitive. Possible values include: 'VsoGit', * 'VsoTfvc', 'GitHub' * - * @param {string} [parameters.securityToken] Gets or sets the authorization - * token for the repo of the source control. + * @param {object} [parameters.securityToken] The authorization token for the + * repo of the source control. + * + * @param {string} [parameters.securityToken.accessToken] The access token. * - * @param {string} [parameters.description] Gets or sets the user description - * of the source control. + * @param {string} [parameters.securityToken.refreshToken] The refresh token. + * + * @param {string} [parameters.securityToken.tokenType] The token type. Must be + * either PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' + * + * @param {string} [parameters.description] The user description of the source + * control. * * @param {object} [options] Optional Parameters. * @@ -1139,30 +1160,37 @@ class SourceControlOperations { * @param {object} parameters The parameters supplied to the create or update * source control operation. * - * @param {string} [parameters.repoUrl] Gets or sets the repo url of the source - * control. + * @param {string} [parameters.repoUrl] The repo url of the source control. * - * @param {string} [parameters.branch] Gets or sets the repo branch of the - * source control. Include branch as empty string for VsoTfvc. + * @param {string} [parameters.branch] The repo branch of the source control. + * Include branch as empty string for VsoTfvc. * - * @param {string} [parameters.folderPath] Gets or sets the folder path of the - * source control. Path must be relative. + * @param {string} [parameters.folderPath] The folder path of the source + * control. Path must be relative. * - * @param {boolean} [parameters.autoSync] Gets or sets auto async of the source - * control. Default is false. + * @param {boolean} [parameters.autoSync] The auto async of the source control. + * Default is false. * - * @param {boolean} [parameters.publishRunbook] Gets or sets the auto publish - * of the source control. Default is true. + * @param {boolean} [parameters.publishRunbook] The auto publish of the source + * control. Default is true. * * @param {string} [parameters.sourceType] The source type. Must be one of * VsoGit, VsoTfvc, GitHub, case sensitive. Possible values include: 'VsoGit', * 'VsoTfvc', 'GitHub' * - * @param {string} [parameters.securityToken] Gets or sets the authorization - * token for the repo of the source control. + * @param {object} [parameters.securityToken] The authorization token for the + * repo of the source control. + * + * @param {string} [parameters.securityToken.accessToken] The access token. * - * @param {string} [parameters.description] Gets or sets the user description - * of the source control. + * @param {string} [parameters.securityToken.refreshToken] The refresh token. + * + * @param {string} [parameters.securityToken.tokenType] The token type. Must be + * either PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' + * + * @param {string} [parameters.description] The user description of the source + * control. * * @param {object} [options] Optional Parameters. * @@ -1223,23 +1251,30 @@ class SourceControlOperations { * @param {object} parameters The parameters supplied to the update source * control operation. * - * @param {string} [parameters.branch] Gets or sets the repo branch of the - * source control. + * @param {string} [parameters.branch] The repo branch of the source control. + * + * @param {string} [parameters.folderPath] The folder path of the source + * control. Path must be relative. + * + * @param {boolean} [parameters.autoSync] The auto sync of the source control. + * Default is false. * - * @param {string} [parameters.folderPath] Gets or sets the folder path of the - * source control. Path must be relative. + * @param {boolean} [parameters.publishRunbook] The auto publish of the source + * control. Default is true. * - * @param {boolean} [parameters.autoSync] Gets or sets auto async of the source - * control. Default is false. + * @param {object} [parameters.securityToken] The authorization token for the + * repo of the source control. * - * @param {boolean} [parameters.publishRunbook] Gets or sets the auto publish - * of the source control. Default is true. + * @param {string} [parameters.securityToken.accessToken] The access token. * - * @param {string} [parameters.securityToken] Gets or sets the authorization - * token for the repo of the source control. + * @param {string} [parameters.securityToken.refreshToken] The refresh token. * - * @param {string} [parameters.description] Gets or sets the user description - * of the source control. + * @param {string} [parameters.securityToken.tokenType] The token type. Must be + * either PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' + * + * @param {string} [parameters.description] The user description of the source + * control. * * @param {object} [options] Optional Parameters. * @@ -1278,23 +1313,30 @@ class SourceControlOperations { * @param {object} parameters The parameters supplied to the update source * control operation. * - * @param {string} [parameters.branch] Gets or sets the repo branch of the - * source control. + * @param {string} [parameters.branch] The repo branch of the source control. + * + * @param {string} [parameters.folderPath] The folder path of the source + * control. Path must be relative. * - * @param {string} [parameters.folderPath] Gets or sets the folder path of the - * source control. Path must be relative. + * @param {boolean} [parameters.autoSync] The auto sync of the source control. + * Default is false. * - * @param {boolean} [parameters.autoSync] Gets or sets auto async of the source - * control. Default is false. + * @param {boolean} [parameters.publishRunbook] The auto publish of the source + * control. Default is true. * - * @param {boolean} [parameters.publishRunbook] Gets or sets the auto publish - * of the source control. Default is true. + * @param {object} [parameters.securityToken] The authorization token for the + * repo of the source control. * - * @param {string} [parameters.securityToken] Gets or sets the authorization - * token for the repo of the source control. + * @param {string} [parameters.securityToken.accessToken] The access token. * - * @param {string} [parameters.description] Gets or sets the user description - * of the source control. + * @param {string} [parameters.securityToken.refreshToken] The refresh token. + * + * @param {string} [parameters.securityToken.tokenType] The token type. Must be + * either PersonalAccessToken or Oauth. Possible values include: + * 'PersonalAccessToken', 'Oauth' + * + * @param {string} [parameters.description] The user description of the source + * control. * * @param {object} [options] Optional Parameters. * diff --git a/lib/services/automationManagement/lib/operations/sourceControlSyncJobOperations.js b/lib/services/automationManagement/lib/operations/sourceControlSyncJobOperations.js index 991d33318c..a1d153c72a 100644 --- a/lib/services/automationManagement/lib/operations/sourceControlSyncJobOperations.js +++ b/lib/services/automationManagement/lib/operations/sourceControlSyncJobOperations.js @@ -28,8 +28,8 @@ const WebResource = msRest.WebResource; * @param {object} parameters The parameters supplied to the create source * control sync job operation. * - * @param {string} [parameters.commitId] Sets the commit id of the source - * control sync job. + * @param {string} parameters.commitId The commit id of the source control sync + * job. If not syncing to a commitId, enter an empty string. * * @param {object} [options] Optional Parameters. * @@ -709,8 +709,8 @@ class SourceControlSyncJobOperations { * @param {object} parameters The parameters supplied to the create source * control sync job operation. * - * @param {string} [parameters.commitId] Sets the commit id of the source - * control sync job. + * @param {string} parameters.commitId The commit id of the source control sync + * job. If not syncing to a commitId, enter an empty string. * * @param {object} [options] Optional Parameters. * @@ -751,8 +751,8 @@ class SourceControlSyncJobOperations { * @param {object} parameters The parameters supplied to the create source * control sync job operation. * - * @param {string} [parameters.commitId] Sets the commit id of the source - * control sync job. + * @param {string} parameters.commitId The commit id of the source control sync + * job. If not syncing to a commitId, enter an empty string. * * @param {object} [options] Optional Parameters. *