diff --git a/lib/services/automationManagement/lib/automationClient.d.ts b/lib/services/automationManagement/lib/automationClient.d.ts index f52b909b93..fc9ad09913 100644 --- a/lib/services/automationManagement/lib/automationClient.d.ts +++ b/lib/services/automationManagement/lib/automationClient.d.ts @@ -10,9 +10,32 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; -declare class AutomationClient extends AzureServiceClient { +/** + * AutomationClientOptions for AutomationClient. + */ +declare interface AutomationClientOptions extends AzureServiceClientOptions { + /** + * @property {string} [clientRequestId] - Identifies this specific client request. + */ + clientRequestId?: string; + /** + * @property {string} [acceptLanguage] - Gets or sets the preferred language for the response. + */ + acceptLanguage?: string; + /** + * @property {number} [longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + */ + longRunningOperationRetryTimeout?: number; + /** + * @property {boolean} [generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + */ + generateClientRequestId?: boolean; +} + +export default class AutomationClient extends AzureServiceClient { /** * Initializes a new instance of the AutomationClient class. * @constructor @@ -22,6 +45,10 @@ declare class AutomationClient extends AzureServiceClient { * * @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. * + * @param {string} resourceGroupName - The resource group name. + * + * @param {string} automationAccountName - The name of the automation account. + * * @param {string} [baseUri] - The base URI of the service. * * @param {object} [options] - The parameter options @@ -33,6 +60,8 @@ declare class AutomationClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * + * @param {string} [options.clientRequestId] - Identifies this specific client request. + * * @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. @@ -40,14 +69,18 @@ declare class AutomationClient extends AzureServiceClient { * @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. * */ - constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); + constructor(credentials: ServiceClientCredentials, subscriptionId: string, resourceGroupName: string, automationAccountName: string, baseUri?: string, options?: AutomationClientOptions); credentials: ServiceClientCredentials; - apiVersion: string; - subscriptionId: string; + resourceGroupName: string; + + clientRequestId: string; + + automationAccountName: string; + acceptLanguage: string; longRunningOperationRetryTimeout: number; @@ -64,15 +97,15 @@ declare class AutomationClient extends AzureServiceClient { connectionTypeOperations: operations.ConnectionTypeOperations; credentialOperations: operations.CredentialOperations; dscCompilationJobOperations: operations.DscCompilationJobOperations; + dscCompilationJobStream: operations.DscCompilationJobStream; dscConfigurationOperations: operations.DscConfigurationOperations; agentRegistrationInformation: operations.AgentRegistrationInformation; dscNodeOperations: operations.DscNodeOperations; nodeReports: operations.NodeReports; dscNodeConfigurationOperations: operations.DscNodeConfigurationOperations; hybridRunbookWorkerGroupOperations: operations.HybridRunbookWorkerGroupOperations; - jobOperations: operations.JobOperations; - jobStreamOperations: operations.JobStreamOperations; jobScheduleOperations: operations.JobScheduleOperations; + linkedWorkspaceOperations: operations.LinkedWorkspaceOperations; activityOperations: operations.ActivityOperations; moduleOperations: operations.ModuleOperations; objectDataTypes: operations.ObjectDataTypes; @@ -80,10 +113,17 @@ declare class AutomationClient extends AzureServiceClient { runbookDraftOperations: operations.RunbookDraftOperations; runbookOperations: operations.RunbookOperations; testJobStreams: operations.TestJobStreams; - testJobs: operations.TestJobs; + testJobOperations: operations.TestJobOperations; scheduleOperations: operations.ScheduleOperations; variableOperations: operations.VariableOperations; webhookOperations: operations.WebhookOperations; + softwareUpdateConfigurations: operations.SoftwareUpdateConfigurations; + softwareUpdateConfigurationRuns: operations.SoftwareUpdateConfigurationRuns; + softwareUpdateConfigurationMachineRuns: operations.SoftwareUpdateConfigurationMachineRuns; + sourceControlOperations: operations.SourceControlOperations; + sourceControlSyncJobOperations: operations.SourceControlSyncJobOperations; + jobOperations: operations.JobOperations; + jobStreamOperations: operations.JobStreamOperations; } -export = AutomationClient; +export { AutomationClient, models as AutomationModels }; diff --git a/lib/services/automationManagement/lib/automationClient.js b/lib/services/automationManagement/lib/automationClient.js index 123c18aca9..59eda98fcc 100644 --- a/lib/services/automationManagement/lib/automationClient.js +++ b/lib/services/automationManagement/lib/automationClient.js @@ -28,29 +28,37 @@ class AutomationClient extends ServiceClient { * Create a AutomationClient. * @param {credentials} credentials - Credentials needed for the client to connect to Azure. * @param {string} subscriptionId - Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * @param {string} resourceGroupName - The resource group name. + * @param {string} automationAccountName - The name of the automation account. * @param {string} [baseUri] - The base URI of the service. * @param {object} [options] - The parameter options * @param {Array} [options.filters] - Filters to be added to the request pipeline * @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.clientRequestId] - Identifies this specific client request. * @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. */ - constructor(credentials, subscriptionId, baseUri, options) { + constructor(credentials, subscriptionId, resourceGroupName, automationAccountName, baseUri, options) { if (credentials === null || credentials === undefined) { throw new Error('\'credentials\' cannot be null.'); } if (subscriptionId === null || subscriptionId === undefined) { throw new Error('\'subscriptionId\' cannot be null.'); } + if (resourceGroupName === null || resourceGroupName === undefined) { + throw new Error('\'resourceGroupName\' cannot be null.'); + } + if (automationAccountName === null || automationAccountName === undefined) { + throw new Error('\'automationAccountName\' cannot be null.'); + } if (!options) options = {}; super(credentials, options); - this.apiVersion = '2015-10-31'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -60,9 +68,14 @@ class AutomationClient extends ServiceClient { } this.credentials = credentials; this.subscriptionId = subscriptionId; + this.resourceGroupName = resourceGroupName; + this.automationAccountName = automationAccountName; let packageInfo = this.getPackageJsonInfo(__dirname); this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); + if(options.clientRequestId !== null && options.clientRequestId !== undefined) { + this.clientRequestId = options.clientRequestId; + } if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } @@ -81,15 +94,15 @@ class AutomationClient extends ServiceClient { this.connectionTypeOperations = new operations.ConnectionTypeOperations(this); this.credentialOperations = new operations.CredentialOperations(this); this.dscCompilationJobOperations = new operations.DscCompilationJobOperations(this); + this.dscCompilationJobStream = new operations.DscCompilationJobStream(this); this.dscConfigurationOperations = new operations.DscConfigurationOperations(this); this.agentRegistrationInformation = new operations.AgentRegistrationInformation(this); this.dscNodeOperations = new operations.DscNodeOperations(this); this.nodeReports = new operations.NodeReports(this); this.dscNodeConfigurationOperations = new operations.DscNodeConfigurationOperations(this); this.hybridRunbookWorkerGroupOperations = new operations.HybridRunbookWorkerGroupOperations(this); - this.jobOperations = new operations.JobOperations(this); - this.jobStreamOperations = new operations.JobStreamOperations(this); this.jobScheduleOperations = new operations.JobScheduleOperations(this); + this.linkedWorkspaceOperations = new operations.LinkedWorkspaceOperations(this); this.activityOperations = new operations.ActivityOperations(this); this.moduleOperations = new operations.ModuleOperations(this); this.objectDataTypes = new operations.ObjectDataTypes(this); @@ -97,10 +110,17 @@ class AutomationClient extends ServiceClient { this.runbookDraftOperations = new operations.RunbookDraftOperations(this); this.runbookOperations = new operations.RunbookOperations(this); this.testJobStreams = new operations.TestJobStreams(this); - this.testJobs = new operations.TestJobs(this); + this.testJobOperations = new operations.TestJobOperations(this); this.scheduleOperations = new operations.ScheduleOperations(this); this.variableOperations = new operations.VariableOperations(this); this.webhookOperations = new operations.WebhookOperations(this); + this.softwareUpdateConfigurations = new operations.SoftwareUpdateConfigurations(this); + this.softwareUpdateConfigurationRuns = new operations.SoftwareUpdateConfigurationRuns(this); + this.softwareUpdateConfigurationMachineRuns = new operations.SoftwareUpdateConfigurationMachineRuns(this); + this.sourceControlOperations = new operations.SourceControlOperations(this); + this.sourceControlSyncJobOperations = new operations.SourceControlSyncJobOperations(this); + this.jobOperations = new operations.JobOperations(this); + this.jobStreamOperations = new operations.JobStreamOperations(this); this.models = models; msRest.addSerializationMixin(this); } @@ -108,3 +128,6 @@ class AutomationClient extends ServiceClient { } module.exports = AutomationClient; +module.exports['default'] = AutomationClient; +module.exports.AutomationClient = AutomationClient; +module.exports.AutomationModels = models; diff --git a/lib/services/automationManagement/lib/models/agentRegistrationRegenerateKeyParameter.js b/lib/services/automationManagement/lib/models/agentRegistrationRegenerateKeyParameter.js index 43d8621cb9..4c7e0e4f9c 100644 --- a/lib/services/automationManagement/lib/models/agentRegistrationRegenerateKeyParameter.js +++ b/lib/services/automationManagement/lib/models/agentRegistrationRegenerateKeyParameter.js @@ -18,7 +18,7 @@ class AgentRegistrationRegenerateKeyParameter { /** * Create a AgentRegistrationRegenerateKeyParameter. * @member {string} keyName Gets or sets the agent registration key name - - * Primary or Secondary. Possible values include: 'Primary', 'Secondary' + * primary or secondary. Possible values include: 'primary', 'secondary' * @member {string} [name] Gets or sets the name of the resource. * @member {string} [location] Gets or sets the location of the resource. * @member {object} [tags] Gets or sets the tags attached to the resource. diff --git a/lib/services/automationManagement/lib/models/certificate.js b/lib/services/automationManagement/lib/models/certificate.js index 24571371bd..03b1cfbcf6 100644 --- a/lib/services/automationManagement/lib/models/certificate.js +++ b/lib/services/automationManagement/lib/models/certificate.js @@ -10,15 +10,19 @@ 'use strict'; +const models = require('./index'); + /** * Definition of the certificate. * + * @extends models['BaseResource'] */ -class Certificate { +class Certificate extends models['BaseResource'] { /** * Create a Certificate. * @member {string} [id] Gets the id of the resource. * @member {string} [name] Gets the name of the certificate. + * @member {string} [type] Resource type * @member {string} [thumbprint] Gets the thumbprint of the certificate. * @member {date} [expiryTime] Gets the expiry time of the certificate. * @member {boolean} [isExportable] Gets the is exportable flag of the @@ -28,6 +32,7 @@ class Certificate { * @member {string} [description] Gets or sets the description. */ constructor() { + super(); } /** @@ -60,6 +65,14 @@ class Certificate { name: 'String' } }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, thumbprint: { required: false, readOnly: true, diff --git a/lib/services/automationManagement/lib/models/certificateUpdateParameters.js b/lib/services/automationManagement/lib/models/certificateUpdateParameters.js index bc375f8fdc..11e6061763 100644 --- a/lib/services/automationManagement/lib/models/certificateUpdateParameters.js +++ b/lib/services/automationManagement/lib/models/certificateUpdateParameters.js @@ -17,7 +17,7 @@ class CertificateUpdateParameters { /** * Create a CertificateUpdateParameters. - * @member {string} name Gets or sets the name of the certificate. + * @member {string} [name] Gets or sets the name of the certificate. * @member {string} [description] Gets or sets the description of the * certificate. */ @@ -39,7 +39,7 @@ class CertificateUpdateParameters { className: 'CertificateUpdateParameters', modelProperties: { name: { - required: true, + required: false, serializedName: 'name', type: { name: 'String' diff --git a/lib/services/automationManagement/lib/models/collectionItemUpdateConfiguration.js b/lib/services/automationManagement/lib/models/collectionItemUpdateConfiguration.js new file mode 100644 index 0000000000..f74f815c18 --- /dev/null +++ b/lib/services/automationManagement/lib/models/collectionItemUpdateConfiguration.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * object returned when requesting a collection of software update + * configuration + * + */ +class CollectionItemUpdateConfiguration { + /** + * Create a CollectionItemUpdateConfiguration. + * @member {array} [azureVirtualMachines] List of azure resource Ids for + * azure virtual machines targeted by the software update configuration. + * @member {moment.duration} [duration] Maximum time allowed for the software + * update configuration run. Duration needs to be specified using the format + * PT[n]H[n]M[n]S as per ISO8601 + */ + constructor() { + } + + /** + * Defines the metadata of CollectionItemUpdateConfiguration + * + * @returns {object} metadata of CollectionItemUpdateConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'collectionItemUpdateConfiguration', + type: { + name: 'Composite', + className: 'CollectionItemUpdateConfiguration', + modelProperties: { + azureVirtualMachines: { + required: false, + serializedName: 'azureVirtualMachines', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + duration: { + required: false, + serializedName: 'duration', + type: { + name: 'TimeSpan' + } + } + } + } + }; + } +} + +module.exports = CollectionItemUpdateConfiguration; diff --git a/lib/services/automationManagement/lib/models/connection.js b/lib/services/automationManagement/lib/models/connection.js index 57a618e20d..4748007e65 100644 --- a/lib/services/automationManagement/lib/models/connection.js +++ b/lib/services/automationManagement/lib/models/connection.js @@ -15,12 +15,14 @@ const models = require('./index'); /** * Definition of the connection. * + * @extends models['BaseResource'] */ -class Connection { +class Connection extends models['BaseResource'] { /** * Create a Connection. * @member {string} [id] Gets the id of the resource. * @member {string} [name] Gets the name of the connection. + * @member {string} [type] Resource type * @member {object} [connectionType] Gets or sets the connectionType of the * connection. * @member {string} [connectionType.name] Gets or sets the name of the @@ -32,6 +34,7 @@ class Connection { * @member {string} [description] Gets or sets the description. */ constructor() { + super(); } /** @@ -64,6 +67,14 @@ class Connection { name: 'String' } }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, connectionType: { required: false, serializedName: 'properties.connectionType', diff --git a/lib/services/automationManagement/lib/models/connectionType.js b/lib/services/automationManagement/lib/models/connectionType.js index 42cf615909..d5d7e8848d 100644 --- a/lib/services/automationManagement/lib/models/connectionType.js +++ b/lib/services/automationManagement/lib/models/connectionType.js @@ -21,6 +21,7 @@ class ConnectionType { * Create a ConnectionType. * @member {string} [id] Gets the id of the resource. * @member {string} [name] Gets the name of the connection type. + * @member {string} [type] Resource type * @member {boolean} [isGlobal] Gets or sets a Boolean value to indicate if * the connection type is global. * @member {object} [fieldDefinitions] Gets the field definitions of the @@ -62,6 +63,14 @@ class ConnectionType { name: 'String' } }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, isGlobal: { required: false, serializedName: 'properties.isGlobal', diff --git a/lib/services/automationManagement/lib/models/credential.js b/lib/services/automationManagement/lib/models/credential.js index 0100729a6b..6dfa90c958 100644 --- a/lib/services/automationManagement/lib/models/credential.js +++ b/lib/services/automationManagement/lib/models/credential.js @@ -10,21 +10,26 @@ 'use strict'; +const models = require('./index'); + /** * Definition of the credential. * + * @extends models['BaseResource'] */ -class Credential { +class Credential extends models['BaseResource'] { /** * Create a Credential. * @member {string} [id] Gets the id of the resource. * @member {string} [name] Gets the name of the credential. + * @member {string} [type] Resource type * @member {string} [userName] Gets the user name of the credential. * @member {date} [creationTime] Gets the creation time. * @member {date} [lastModifiedTime] Gets the last modified time. * @member {string} [description] Gets or sets the description. */ constructor() { + super(); } /** @@ -51,11 +56,20 @@ class Credential { }, name: { required: false, + readOnly: true, serializedName: 'name', type: { name: 'String' } }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, userName: { required: false, readOnly: true, diff --git a/lib/services/automationManagement/lib/models/credentialUpdateParameters.js b/lib/services/automationManagement/lib/models/credentialUpdateParameters.js index a165812849..44760f420b 100644 --- a/lib/services/automationManagement/lib/models/credentialUpdateParameters.js +++ b/lib/services/automationManagement/lib/models/credentialUpdateParameters.js @@ -17,7 +17,7 @@ class CredentialUpdateParameters { /** * Create a CredentialUpdateParameters. - * @member {string} name Gets or sets the name of the credential. + * @member {string} [name] Gets or sets the name of the credential. * @member {string} [userName] Gets or sets the user name of the credential. * @member {string} [password] Gets or sets the password of the credential. * @member {string} [description] Gets or sets the description of the @@ -41,7 +41,7 @@ class CredentialUpdateParameters { className: 'CredentialUpdateParameters', modelProperties: { name: { - required: true, + required: false, serializedName: 'name', type: { name: 'String' diff --git a/lib/services/automationManagement/lib/models/dscCompilationJob.js b/lib/services/automationManagement/lib/models/dscCompilationJob.js index 856b9560b1..e33fe69c1f 100644 --- a/lib/services/automationManagement/lib/models/dscCompilationJob.js +++ b/lib/services/automationManagement/lib/models/dscCompilationJob.js @@ -15,17 +15,24 @@ const models = require('./index'); /** * Definition of the Dsc Compilation job. * + * @extends models['ProxyResource'] */ -class DscCompilationJob { +class DscCompilationJob extends models['ProxyResource'] { /** * Create a DscCompilationJob. - * @member {string} [id] Gets the id of the resource. * @member {object} [configuration] Gets or sets the configuration. * @member {string} [configuration.name] Gets or sets the name of the Dsc * configuration. * @member {string} [startedBy] Gets the compilation job started by. * @member {uuid} [jobId] Gets the id of the job. * @member {date} [creationTime] Gets the creation time of the job. + * @member {object} [provisioningState] The current provisioning state of the + * job. + * @member {string} [provisioningState.provisioningState] The provisioning + * state of the resource. Possible values include: 'Failed', 'Succeeded', + * 'Suspended', 'Processing' + * @member {string} [runOn] Gets or sets the runOn which specifies the group + * name where the job is to be executed. * @member {string} [status] Gets or sets the status of the job. Possible * values include: 'New', 'Activating', 'Running', 'Completed', 'Failed', * 'Stopped', 'Blocked', 'Suspended', 'Disconnected', 'Suspending', @@ -41,6 +48,7 @@ class DscCompilationJob { * @member {object} [parameters] Gets or sets the parameters of the job. */ constructor() { + super(); } /** @@ -65,6 +73,22 @@ class DscCompilationJob { name: 'String' } }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, configuration: { required: false, serializedName: 'properties.configuration', @@ -97,6 +121,21 @@ class DscCompilationJob { name: 'DateTime' } }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'Composite', + className: 'JobProvisioningStateProperty' + } + }, + runOn: { + required: false, + serializedName: 'properties.runOn', + type: { + name: 'String' + } + }, status: { required: false, serializedName: 'properties.status', diff --git a/lib/services/automationManagement/lib/models/dscCompilationJobCreateParameters.js b/lib/services/automationManagement/lib/models/dscCompilationJobCreateParameters.js index ec7660a646..364f2c99a6 100644 --- a/lib/services/automationManagement/lib/models/dscCompilationJobCreateParameters.js +++ b/lib/services/automationManagement/lib/models/dscCompilationJobCreateParameters.js @@ -23,6 +23,8 @@ class DscCompilationJobCreateParameters { * @member {string} [configuration.name] Gets or sets the name of the Dsc * configuration. * @member {object} [parameters] Gets or sets the parameters of the job. + * @member {boolean} [newNodeConfigurationBuildVersionRequired] If a new + * build version of NodeConfiguration is required. * @member {string} [name] Gets or sets name of the resource. * @member {string} [location] Gets or sets the location of the resource. * @member {object} [tags] Gets or sets the tags attached to the resource. @@ -66,6 +68,13 @@ class DscCompilationJobCreateParameters { } } }, + newNodeConfigurationBuildVersionRequired: { + required: false, + serializedName: 'properties.newNodeConfigurationBuildVersionRequired', + type: { + name: 'Boolean' + } + }, name: { required: false, serializedName: 'name', diff --git a/lib/services/automationManagement/lib/models/dscNode.js b/lib/services/automationManagement/lib/models/dscNode.js index 16f6bdfd47..eb6bc6417c 100644 --- a/lib/services/automationManagement/lib/models/dscNode.js +++ b/lib/services/automationManagement/lib/models/dscNode.js @@ -15,9 +15,9 @@ const models = require('./index'); /** * Definition of the dsc node type. * - * @extends models['Resource'] + * @extends models['ProxyResource'] */ -class DscNode extends models['Resource'] { +class DscNode extends models['ProxyResource'] { /** * Create a DscNode. * @member {date} [lastSeen] Gets or sets the last seen time of the node. @@ -32,6 +32,8 @@ class DscNode extends models['Resource'] { * @member {string} [status] Gets or sets the status of the node. * @member {string} [nodeId] Gets or sets the node id. * @member {string} [etag] Gets or sets the etag of the resource. + * @member {array} [extensionHandler] Gets or sets the list of + * extensionHandler properties for a Node. */ constructor() { super(); @@ -75,27 +77,6 @@ class DscNode extends models['Resource'] { name: 'String' } }, - location: { - required: true, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, lastSeen: { required: false, serializedName: 'lastSeen', @@ -152,6 +133,21 @@ class DscNode extends models['Resource'] { type: { name: 'String' } + }, + extensionHandler: { + required: false, + serializedName: 'extensionHandler', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DscNodeExtensionHandlerAssociationPropertyElementType', + type: { + name: 'Composite', + className: 'DscNodeExtensionHandlerAssociationProperty' + } + } + } } } } diff --git a/lib/services/automationManagement/lib/models/dscNodeConfiguration.js b/lib/services/automationManagement/lib/models/dscNodeConfiguration.js index bad654714c..766e78080e 100644 --- a/lib/services/automationManagement/lib/models/dscNodeConfiguration.js +++ b/lib/services/automationManagement/lib/models/dscNodeConfiguration.js @@ -15,20 +15,20 @@ const models = require('./index'); /** * Definition of the dsc node configuration. * + * @extends models['ProxyResource'] */ -class DscNodeConfiguration { +class DscNodeConfiguration extends models['ProxyResource'] { /** * Create a DscNodeConfiguration. - * @member {string} [name] Gets or sets the node configuration name. * @member {date} [lastModifiedTime] Gets or sets the last modified time. * @member {date} [creationTime] Gets or sets creation time. * @member {object} [configuration] Gets or sets the configuration of the * node. * @member {string} [configuration.name] Gets or sets the name of the Dsc * configuration. - * @member {string} [id] Gets or sets the id of the resource. */ constructor() { + super(); } /** @@ -45,13 +45,30 @@ class DscNodeConfiguration { name: 'Composite', className: 'DscNodeConfiguration', modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, name: { required: false, + readOnly: true, serializedName: 'name', type: { name: 'String' } }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, lastModifiedTime: { required: false, serializedName: 'lastModifiedTime', @@ -73,13 +90,6 @@ class DscNodeConfiguration { name: 'Composite', className: 'DscConfigurationAssociationProperty' } - }, - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } } } } diff --git a/lib/services/automationManagement/lib/models/dscNodeConfigurationCreateOrUpdateParameters.js b/lib/services/automationManagement/lib/models/dscNodeConfigurationCreateOrUpdateParameters.js index c16598b833..35c2d9a93e 100644 --- a/lib/services/automationManagement/lib/models/dscNodeConfigurationCreateOrUpdateParameters.js +++ b/lib/services/automationManagement/lib/models/dscNodeConfigurationCreateOrUpdateParameters.js @@ -35,6 +35,8 @@ class DscNodeConfigurationCreateOrUpdateParameters { * @member {object} configuration Gets or sets the configuration of the node. * @member {string} [configuration.name] Gets or sets the name of the Dsc * configuration. + * @member {boolean} [newNodeConfigurationBuildVersionRequired] If a new + * build version of NodeConfiguration is required. */ constructor() { } @@ -75,6 +77,13 @@ class DscNodeConfigurationCreateOrUpdateParameters { name: 'Composite', className: 'DscConfigurationAssociationProperty' } + }, + newNodeConfigurationBuildVersionRequired: { + required: false, + serializedName: 'newNodeConfigurationBuildVersionRequired', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/automationManagement/lib/models/dscNodeExtensionHandlerAssociationProperty.js b/lib/services/automationManagement/lib/models/dscNodeExtensionHandlerAssociationProperty.js new file mode 100644 index 0000000000..1f97fc4e80 --- /dev/null +++ b/lib/services/automationManagement/lib/models/dscNodeExtensionHandlerAssociationProperty.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The dsc extensionHandler property associated with the node + * + */ +class DscNodeExtensionHandlerAssociationProperty { + /** + * Create a DscNodeExtensionHandlerAssociationProperty. + * @member {string} [name] Gets or sets the name of the extension handler. + * @member {string} [version] Gets or sets the version of the extension + * handler. + */ + constructor() { + } + + /** + * Defines the metadata of DscNodeExtensionHandlerAssociationProperty + * + * @returns {object} metadata of DscNodeExtensionHandlerAssociationProperty + * + */ + mapper() { + return { + required: false, + serializedName: 'DscNodeExtensionHandlerAssociationProperty', + type: { + name: 'Composite', + className: 'DscNodeExtensionHandlerAssociationProperty', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + version: { + required: false, + serializedName: 'version', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DscNodeExtensionHandlerAssociationProperty; diff --git a/lib/services/automationManagement/lib/models/index.d.ts b/lib/services/automationManagement/lib/models/index.d.ts index acee0f8488..040e144b4d 100644 --- a/lib/services/automationManagement/lib/models/index.d.ts +++ b/lib/services/automationManagement/lib/models/index.d.ts @@ -340,48 +340,6 @@ export interface Module extends Resource { etag?: string; } -/** - * @class - * Initializes a new instance of the DscNodeConfigurationAssociationProperty class. - * @constructor - * The dsc nodeconfiguration property associated with the entity. - * - * @member {string} [name] Gets or sets the name of the dsc nodeconfiguration. - */ -export interface DscNodeConfigurationAssociationProperty { - name?: string; -} - -/** - * @class - * Initializes a new instance of the DscNode class. - * @constructor - * Definition of the dsc node type. - * - * @member {date} [lastSeen] Gets or sets the last seen time of the node. - * @member {date} [registrationTime] Gets or sets the registration time of the - * node. - * @member {string} [ip] Gets or sets the ip of the node. - * @member {string} [accountId] Gets or sets the account id of the node. - * @member {object} [nodeConfiguration] Gets or sets the configuration of the - * node. - * @member {string} [nodeConfiguration.name] Gets or sets the name of the dsc - * nodeconfiguration. - * @member {string} [status] Gets or sets the status of the node. - * @member {string} [nodeId] Gets or sets the node id. - * @member {string} [etag] Gets or sets the etag of the resource. - */ -export interface DscNode extends Resource { - lastSeen?: Date; - registrationTime?: Date; - ip?: string; - accountId?: string; - nodeConfiguration?: DscNodeConfigurationAssociationProperty; - status?: string; - nodeId?: string; - etag?: string; -} - /** * @class * Initializes a new instance of the ContentSource class. @@ -602,6 +560,7 @@ export interface AutomationAccountUpdateParameters { * * @member {string} [id] Gets the id of the resource. * @member {string} [name] Gets the name of the certificate. + * @member {string} [type] Resource type * @member {string} [thumbprint] Gets the thumbprint of the certificate. * @member {date} [expiryTime] Gets the expiry time of the certificate. * @member {boolean} [isExportable] Gets the is exportable flag of the @@ -610,9 +569,10 @@ export interface AutomationAccountUpdateParameters { * @member {date} [lastModifiedTime] Gets the last modified time. * @member {string} [description] Gets or sets the description. */ -export interface Certificate { +export interface Certificate extends BaseResource { readonly id?: string; readonly name?: string; + readonly type?: string; readonly thumbprint?: string; readonly expiryTime?: Date; readonly isExportable?: boolean; @@ -627,12 +587,12 @@ export interface Certificate { * @constructor * The parameters supplied to the update certificate operation. * - * @member {string} name Gets or sets the name of the certificate. + * @member {string} [name] Gets or sets the name of the certificate. * @member {string} [description] Gets or sets the description of the * certificate. */ export interface CertificateUpdateParameters { - name: string; + name?: string; description?: string; } @@ -681,6 +641,7 @@ export interface ConnectionTypeAssociationProperty { * * @member {string} [id] Gets the id of the resource. * @member {string} [name] Gets the name of the connection. + * @member {string} [type] Resource type * @member {object} [connectionType] Gets or sets the connectionType of the * connection. * @member {string} [connectionType.name] Gets or sets the name of the @@ -691,9 +652,10 @@ export interface ConnectionTypeAssociationProperty { * @member {date} [lastModifiedTime] Gets the last modified time. * @member {string} [description] Gets or sets the description. */ -export interface Connection { +export interface Connection extends BaseResource { readonly id?: string; readonly name?: string; + readonly type?: string; connectionType?: ConnectionTypeAssociationProperty; readonly fieldDefinitionValues?: { [propertyName: string]: string }; readonly creationTime?: Date; @@ -769,6 +731,7 @@ export interface FieldDefinition { * * @member {string} [id] Gets the id of the resource. * @member {string} [name] Gets the name of the connection type. + * @member {string} [type] Resource type * @member {boolean} [isGlobal] Gets or sets a Boolean value to indicate if the * connection type is global. * @member {object} [fieldDefinitions] Gets the field definitions of the @@ -780,6 +743,7 @@ export interface FieldDefinition { export interface ConnectionType { readonly id?: string; readonly name?: string; + readonly type?: string; isGlobal?: boolean; readonly fieldDefinitions?: { [propertyName: string]: FieldDefinition }; readonly creationTime?: Date; @@ -813,14 +777,16 @@ export interface ConnectionTypeCreateOrUpdateParameters { * * @member {string} [id] Gets the id of the resource. * @member {string} [name] Gets the name of the credential. + * @member {string} [type] Resource type * @member {string} [userName] Gets the user name of the credential. * @member {date} [creationTime] Gets the creation time. * @member {date} [lastModifiedTime] Gets the last modified time. * @member {string} [description] Gets or sets the description. */ -export interface Credential { +export interface Credential extends BaseResource { readonly id?: string; - name?: string; + readonly name?: string; + readonly type?: string; readonly userName?: string; readonly creationTime?: Date; readonly lastModifiedTime?: Date; @@ -833,14 +799,14 @@ export interface Credential { * @constructor * The parameters supplied to the Update credential operation. * - * @member {string} name Gets or sets the name of the credential. + * @member {string} [name] Gets or sets the name of the credential. * @member {string} [userName] Gets or sets the user name of the credential. * @member {string} [password] Gets or sets the password of the credential. * @member {string} [description] Gets or sets the description of the * credential. */ export interface CredentialUpdateParameters { - name: string; + name?: string; userName?: string; password?: string; description?: string; @@ -1040,7 +1006,7 @@ export interface AgentRegistration { * The parameters supplied to the regenerate keys operation. * * @member {string} keyName Gets or sets the agent registration key name - - * Primary or Secondary. Possible values include: 'Primary', 'Secondary' + * primary or secondary. Possible values include: 'primary', 'secondary' * @member {string} [name] Gets or sets the name of the resource. * @member {string} [location] Gets or sets the location of the resource. * @member {object} [tags] Gets or sets the tags attached to the resource. @@ -1074,6 +1040,8 @@ export interface DscConfigurationAssociationProperty { * @member {string} [configuration.name] Gets or sets the name of the Dsc * configuration. * @member {object} [parameters] Gets or sets the parameters of the job. + * @member {boolean} [newNodeConfigurationBuildVersionRequired] If a new build + * version of NodeConfiguration is required. * @member {string} [name] Gets or sets name of the resource. * @member {string} [location] Gets or sets the location of the resource. * @member {object} [tags] Gets or sets the tags attached to the resource. @@ -1081,24 +1049,60 @@ export interface DscConfigurationAssociationProperty { export interface DscCompilationJobCreateParameters { configuration: DscConfigurationAssociationProperty; parameters?: { [propertyName: string]: string }; + newNodeConfigurationBuildVersionRequired?: boolean; name?: string; location?: string; tags?: { [propertyName: string]: string }; } +/** + * @class + * Initializes a new instance of the JobProvisioningStateProperty class. + * @constructor + * The provisioning state property. + * + * @member {string} [provisioningState] The provisioning state of the resource. + * Possible values include: 'Failed', 'Succeeded', 'Suspended', 'Processing' + */ +export interface JobProvisioningStateProperty { + readonly provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the ProxyResource class. + * @constructor + * The Resource definition. + * + * @member {string} [id] Resource Id + * @member {string} [name] Resource name + * @member {string} [type] Resource type + */ +export interface ProxyResource extends BaseResource { + readonly id?: string; + readonly name?: string; + readonly type?: string; +} + /** * @class * Initializes a new instance of the DscCompilationJob class. * @constructor * Definition of the Dsc Compilation job. * - * @member {string} [id] Gets the id of the resource. * @member {object} [configuration] Gets or sets the configuration. * @member {string} [configuration.name] Gets or sets the name of the Dsc * configuration. * @member {string} [startedBy] Gets the compilation job started by. * @member {uuid} [jobId] Gets the id of the job. * @member {date} [creationTime] Gets the creation time of the job. + * @member {object} [provisioningState] The current provisioning state of the + * job. + * @member {string} [provisioningState.provisioningState] The provisioning + * state of the resource. Possible values include: 'Failed', 'Succeeded', + * 'Suspended', 'Processing' + * @member {string} [runOn] Gets or sets the runOn which specifies the group + * name where the job is to be executed. * @member {string} [status] Gets or sets the status of the job. Possible * values include: 'New', 'Activating', 'Running', 'Completed', 'Failed', * 'Stopped', 'Blocked', 'Suspended', 'Disconnected', 'Suspending', 'Stopping', @@ -1112,12 +1116,13 @@ export interface DscCompilationJobCreateParameters { * of the job. * @member {object} [parameters] Gets or sets the parameters of the job. */ -export interface DscCompilationJob { - readonly id?: string; +export interface DscCompilationJob extends ProxyResource { configuration?: DscConfigurationAssociationProperty; readonly startedBy?: string; readonly jobId?: string; readonly creationTime?: Date; + provisioningState?: JobProvisioningStateProperty; + runOn?: string; status?: string; statusDetails?: string; readonly startTime?: Date; @@ -1218,33 +1223,41 @@ export interface DscMetaConfiguration { * @member {object} configuration Gets or sets the configuration of the node. * @member {string} [configuration.name] Gets or sets the name of the Dsc * configuration. + * @member {boolean} [newNodeConfigurationBuildVersionRequired] If a new build + * version of NodeConfiguration is required. */ export interface DscNodeConfigurationCreateOrUpdateParameters { source: ContentSource; name: string; configuration: DscConfigurationAssociationProperty; + newNodeConfigurationBuildVersionRequired?: boolean; } /** * @class - * Initializes a new instance of the DscNodeConfiguration class. + * Initializes a new instance of the DscNodeConfigurationAssociationProperty class. * @constructor - * Definition of the dsc node configuration. + * The dsc nodeconfiguration property associated with the entity. * - * @member {string} [name] Gets or sets the node configuration name. - * @member {date} [lastModifiedTime] Gets or sets the last modified time. - * @member {date} [creationTime] Gets or sets creation time. - * @member {object} [configuration] Gets or sets the configuration of the node. - * @member {string} [configuration.name] Gets or sets the name of the Dsc - * configuration. - * @member {string} [id] Gets or sets the id of the resource. + * @member {string} [name] Gets or sets the name of the dsc nodeconfiguration. */ -export interface DscNodeConfiguration { +export interface DscNodeConfigurationAssociationProperty { name?: string; - lastModifiedTime?: Date; - creationTime?: Date; - configuration?: DscConfigurationAssociationProperty; - id?: string; +} + +/** + * @class + * Initializes a new instance of the DscNodeExtensionHandlerAssociationProperty class. + * @constructor + * The dsc extensionHandler property associated with the node + * + * @member {string} [name] Gets or sets the name of the extension handler. + * @member {string} [version] Gets or sets the version of the extension + * handler. + */ +export interface DscNodeExtensionHandlerAssociationProperty { + name?: string; + version?: string; } /** @@ -1486,7 +1499,6 @@ export interface RunbookAssociationProperty { * @constructor * Definition of the job. * - * @member {string} [id] Gets or sets the id of the resource. * @member {object} [runbook] Gets or sets the runbook. * @member {string} [runbook.name] Gets or sets the name of the runbook. * @member {string} [startedBy] Gets or sets the job started by. @@ -1507,9 +1519,12 @@ export interface RunbookAssociationProperty { * @member {date} [lastStatusModifiedTime] Gets or sets the last status * modified time of the job. * @member {object} [parameters] Gets or sets the parameters of the job. + * @member {object} [provisioningState] The provisioning state of a resource. + * @member {string} [provisioningState.provisioningState] The provisioning + * state of the resource. Possible values include: 'Failed', 'Succeeded', + * 'Suspended', 'Processing' */ -export interface Job { - id?: string; +export interface Job extends ProxyResource { runbook?: RunbookAssociationProperty; startedBy?: string; runOn?: string; @@ -1523,6 +1538,7 @@ export interface Job { lastModifiedTime?: Date; lastStatusModifiedTime?: Date; parameters?: { [propertyName: string]: string }; + provisioningState?: JobProvisioningStateProperty; } /** @@ -1536,17 +1552,25 @@ export interface Job { * @member {object} [parameters] Gets or sets the parameters of the job. * @member {string} [runOn] Gets or sets the runOn which specifies the group * name where the job is to be executed. - * @member {string} [name] Gets or sets name of the resource. - * @member {string} [location] Gets or sets the location of the resource. - * @member {object} [tags] Gets or sets the tags attached to the resource. */ export interface JobCreateParameters { runbook: RunbookAssociationProperty; parameters?: { [propertyName: string]: string }; runOn?: string; - name?: string; - location?: string; - tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the JobListResult class. + * @constructor + * The response model for the list job operation. + * + * @member {array} [value] Gets or sets a list of jobs. + * @member {string} [nextLink] Gets or sets the next link. + */ +export interface JobListResult { + value?: Job[]; + nextLink?: string; } /** @@ -1588,7 +1612,9 @@ export interface JobScheduleCreateParameters { * @constructor * Definition of the job schedule. * - * @member {string} [id] Gets or sets the id of the resource. + * @member {string} [id] Gets the id of the resource. + * @member {string} [name] Gets the name of the variable. + * @member {string} [type] Resource type * @member {string} [jobScheduleId] Gets or sets the id of job schedule. * @member {object} [schedule] Gets or sets the schedule. * @member {string} [schedule.name] Gets or sets the name of the schedule. @@ -1600,7 +1626,9 @@ export interface JobScheduleCreateParameters { * schedule. */ export interface JobSchedule { - id?: string; + readonly id?: string; + readonly name?: string; + readonly type?: string; jobScheduleId?: string; schedule?: ScheduleAssociationProperty; runbook?: RunbookAssociationProperty; @@ -1633,6 +1661,18 @@ export interface JobStream { value?: { [propertyName: string]: any }; } +/** + * @class + * Initializes a new instance of the LinkedWorkspace class. + * @constructor + * Definition of the linked workspace. + * + * @member {string} [id] Gets the id of the linked workspace. + */ +export interface LinkedWorkspace { + readonly id?: string; +} + /** * @class * Initializes a new instance of the ModuleCreateOrUpdateParameters class. @@ -1869,8 +1909,8 @@ export interface RunbookUpdateParameters { * @member {date} startTime Gets or sets the start time of the schedule. * @member {date} [expiryTime] Gets or sets the end time of the schedule. * @member {object} [interval] Gets or sets the interval of the schedule. - * @member {string} frequency Gets or sets the frequency of the schedule. - * Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + * @member {string} frequency Possible values include: 'OneTime', 'Day', + * 'Hour', 'Week', 'Month' * @member {string} [timeZone] Gets or sets the time zone of the schedule. * @member {object} [advancedSchedule] Gets or sets the AdvancedSchedule. * @member {array} [advancedSchedule.weekDays] Days of the week that the job @@ -1891,14 +1931,64 @@ export interface ScheduleCreateOrUpdateParameters { advancedSchedule?: AdvancedSchedule; } +/** + * @class + * Initializes a new instance of the ScheduleProperties class. + * @constructor + * Definition of schedule parameters. + * + * @member {date} [startTime] Gets or sets the start time of the schedule. + * @member {number} [startTimeOffsetMinutes] Gets the start time's offset in + * minutes. + * @member {date} [expiryTime] Gets or sets the end time of the schedule. + * @member {number} [expiryTimeOffsetMinutes] Gets or sets the expiry time's + * offset in minutes. + * @member {boolean} [isEnabled] Gets or sets a value indicating whether this + * schedule is enabled. Default value: false . + * @member {date} [nextRun] Gets or sets the next run time of the schedule. + * @member {number} [nextRunOffsetMinutes] Gets or sets the next run time's + * offset in minutes. + * @member {object} [interval] Gets or sets the interval of the schedule. + * @member {string} [frequency] Gets or sets the frequency of the schedule. + * Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + * @member {string} [timeZone] Gets or sets the time zone of the schedule. + * @member {object} [advancedSchedule] Gets or sets the advanced schedule. + * @member {array} [advancedSchedule.weekDays] Days of the week that the job + * should execute on. + * @member {array} [advancedSchedule.monthDays] Days of the month that the job + * should execute on. Must be between 1 and 31. + * @member {array} [advancedSchedule.monthlyOccurrences] Occurrences of days + * within a month. + * @member {date} [creationTime] Gets or sets the creation time. + * @member {date} [lastModifiedTime] Gets or sets the last modified time. + * @member {string} [description] Gets or sets the description. + */ +export interface ScheduleProperties { + startTime?: Date; + readonly startTimeOffsetMinutes?: number; + expiryTime?: Date; + expiryTimeOffsetMinutes?: number; + isEnabled?: boolean; + nextRun?: Date; + nextRunOffsetMinutes?: number; + interval?: any; + frequency?: string; + timeZone?: string; + advancedSchedule?: AdvancedSchedule; + creationTime?: Date; + lastModifiedTime?: Date; + description?: string; +} + /** * @class * Initializes a new instance of the Schedule class. * @constructor * Definition of the schedule. * - * @member {string} [id] Gets or sets the id of the resource. - * @member {string} [name] Gets or sets the name of the schedule. + * @member {string} [id] Gets the id of the resource. + * @member {string} [name] Gets name of the schedule. + * @member {string} [type] Resource type * @member {date} [startTime] Gets or sets the start time of the schedule. * @member {number} [startTimeOffsetMinutes] Gets the start time's offset in * minutes. @@ -1926,8 +2016,9 @@ export interface ScheduleCreateOrUpdateParameters { * @member {string} [description] Gets or sets the description. */ export interface Schedule { - id?: string; - name?: string; + readonly id?: string; + readonly name?: string; + readonly type?: string; startTime?: Date; readonly startTimeOffsetMinutes?: number; expiryTime?: Date; @@ -1950,13 +2041,13 @@ export interface Schedule { * @constructor * The parameters supplied to the update schedule operation. * - * @member {string} name Gets or sets the name of the schedule. + * @member {string} [name] Gets or sets the name of the schedule. * @member {string} [description] Gets or sets the description of the schedule. * @member {boolean} [isEnabled] Gets or sets a value indicating whether this * schedule is enabled. */ export interface ScheduleUpdateParameters { - name: string; + name?: string; description?: string; isEnabled?: boolean; } @@ -1979,13 +2070,11 @@ export interface SubResource extends BaseResource { * @constructor * The parameters supplied to the create test job operation. * - * @member {string} runbookName Gets or sets the runbook name. * @member {object} [parameters] Gets or sets the parameters of the test job. * @member {string} [runOn] Gets or sets the runOn which specifies the group * name where the job is to be executed. */ export interface TestJobCreateParameters { - runbookName: string; parameters?: { [propertyName: string]: string }; runOn?: string; } @@ -2011,6 +2100,8 @@ export interface TestJobCreateParameters { * @member {date} [lastStatusModifiedTime] Gets or sets the last status * modified time of the test job. * @member {object} [parameters] Gets or sets the parameters of the test job. + * @member {number} [logActivityTrace] The activity-level tracing options of + * the runbook. */ export interface TestJob { creationTime?: Date; @@ -2023,6 +2114,7 @@ export interface TestJob { lastModifiedTime?: Date; lastStatusModifiedTime?: Date; parameters?: { [propertyName: string]: string }; + logActivityTrace?: number; } /** @@ -2064,8 +2156,9 @@ export interface VariableCreateOrUpdateParameters { * @constructor * Definition of the varible. * - * @member {string} [id] Gets or sets the id of the resource. - * @member {string} [name] Gets or sets the name of the variable. + * @member {string} [id] Gets the id of the resource. + * @member {string} [name] Gets the name of the variable. + * @member {string} [type] Resource type * @member {string} [value] Gets or sets the value of the variable. * @member {boolean} [isEncrypted] Gets or sets the encrypted flag of the * variable. @@ -2073,9 +2166,10 @@ export interface VariableCreateOrUpdateParameters { * @member {date} [lastModifiedTime] Gets or sets the last modified time. * @member {string} [description] Gets or sets the description. */ -export interface Variable { - id?: string; - name?: string; +export interface Variable extends BaseResource { + readonly id?: string; + readonly name?: string; + readonly type?: string; value?: string; isEncrypted?: boolean; creationTime?: Date; @@ -2089,12 +2183,12 @@ export interface Variable { * @constructor * The parameters supplied to the update variable operation. * - * @member {string} name Gets or sets the name of the variable. + * @member {string} [name] Gets or sets the name of the variable. * @member {string} [value] Gets or sets the value of the variable. * @member {string} [description] Gets or sets the description of the variable. */ export interface VariableUpdateParameters { - name: string; + name?: string; value?: string; description?: string; } @@ -2132,8 +2226,9 @@ export interface WebhookCreateOrUpdateParameters { * @constructor * Definition of the webhook type. * - * @member {string} [id] Gets or sets the id of the resource. - * @member {string} [name] Gets or sets the name of the webhook. + * @member {string} [id] Gets the id of the resource. + * @member {string} [name] Gets the name of the webhook. + * @member {string} [type] Gets the type of the resource. * @member {boolean} [isEnabled] Gets or sets the value of the enabled flag of * the webhook. Default value: false . * @member {string} [uri] Gets or sets the webhook uri. @@ -2150,9 +2245,10 @@ export interface WebhookCreateOrUpdateParameters { * @member {date} [lastModifiedTime] Gets or sets the last modified time. * @member {string} [description] Gets or sets the description. */ -export interface Webhook { - id?: string; - name?: string; +export interface Webhook extends BaseResource { + readonly id?: string; + readonly name?: string; + readonly type?: string; isEnabled?: boolean; uri?: string; expiryTime?: Date; @@ -2171,7 +2267,7 @@ export interface Webhook { * @constructor * The parameters supplied to the update webhook operation. * - * @member {string} name Gets or sets the name of the webhook. + * @member {string} [name] Gets or sets the name of the webhook. * @member {boolean} [isEnabled] Gets or sets the value of the enabled flag of * webhook. * @member {string} [runOn] Gets or sets the name of the hybrid worker group @@ -2180,30 +2276,704 @@ export interface Webhook { * @member {string} [description] Gets or sets the description of the webhook. */ export interface WebhookUpdateParameters { - name: string; + name?: string; isEnabled?: boolean; runOn?: string; parameters?: { [propertyName: string]: string }; description?: string; } - /** * @class - * Initializes a new instance of the AutomationAccountListResult class. + * Initializes a new instance of the DscNode class. * @constructor - * The response model for the list account operation. + * Definition of the dsc node type. * - * @member {string} [nextLink] Gets or sets the next link. + * @member {date} [lastSeen] Gets or sets the last seen time of the node. + * @member {date} [registrationTime] Gets or sets the registration time of the + * node. + * @member {string} [ip] Gets or sets the ip of the node. + * @member {string} [accountId] Gets or sets the account id of the node. + * @member {object} [nodeConfiguration] Gets or sets the configuration of the + * node. + * @member {string} [nodeConfiguration.name] Gets or sets the name of the dsc + * nodeconfiguration. + * @member {string} [status] Gets or sets the status of the node. + * @member {string} [nodeId] Gets or sets the node id. + * @member {string} [etag] Gets or sets the etag of the resource. + * @member {array} [extensionHandler] Gets or sets the list of extensionHandler + * properties for a Node. */ -export interface AutomationAccountListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the OperationListResult class. - * @constructor +export interface DscNode extends ProxyResource { + lastSeen?: Date; + registrationTime?: Date; + ip?: string; + accountId?: string; + nodeConfiguration?: DscNodeConfigurationAssociationProperty; + status?: string; + nodeId?: string; + etag?: string; + extensionHandler?: DscNodeExtensionHandlerAssociationProperty[]; +} + +/** + * @class + * Initializes a new instance of the DscNodeConfiguration class. + * @constructor + * Definition of the dsc node configuration. + * + * @member {date} [lastModifiedTime] Gets or sets the last modified time. + * @member {date} [creationTime] Gets or sets creation time. + * @member {object} [configuration] Gets or sets the configuration of the node. + * @member {string} [configuration.name] Gets or sets the name of the Dsc + * configuration. + */ +export interface DscNodeConfiguration extends ProxyResource { + lastModifiedTime?: Date; + creationTime?: Date; + configuration?: DscConfigurationAssociationProperty; +} + +/** + * @class + * Initializes a new instance of the CollectionItemUpdateConfiguration class. + * @constructor + * object returned when requesting a collection of software update + * configuration + * + * @member {array} [azureVirtualMachines] List of azure resource Ids for azure + * virtual machines targeted by the software update configuration. + * @member {moment.duration} [duration] Maximum time allowed for the software + * update configuration run. Duration needs to be specified using the format + * PT[n]H[n]M[n]S as per ISO8601 + */ +export interface CollectionItemUpdateConfiguration { + azureVirtualMachines?: string[]; + duration?: moment.Duration; +} + +/** + * @class + * Initializes a new instance of the SoftwareUpdateConfigurationCollectionItem class. + * @constructor + * Software update configuration collection item properties. + * + * @member {string} [name] Name of the software update configuration. + * @member {string} [id] Resource Id of the software update configuration + * @member {object} [updateConfiguration] Update specific properties of the + * software update configuration. + * @member {array} [updateConfiguration.azureVirtualMachines] List of azure + * resource Ids for azure virtual machines targeted by the software update + * configuration. + * @member {moment.duration} [updateConfiguration.duration] Maximum time + * allowed for the software update configuration run. Duration needs to be + * specified using the format PT[n]H[n]M[n]S as per ISO8601 + * @member {string} [frequency] execution frequency of the schedule associated + * with the software update configuration. Possible values include: 'OneTime', + * 'Day', 'Hour', 'Week', 'Month' + * @member {date} [startTime] the start time of the update. + * @member {date} [creationTime] Creation time of the software update + * configuration, which only appears in the response. + * @member {date} [lastModifiedTime] Last time software update configuration + * was modified, which only appears in the response. + * @member {string} [provisioningState] Provisioning state for the software + * update configuration, which only appears in the response. + * @member {date} [nextRun] ext run time of the update. + */ +export interface SoftwareUpdateConfigurationCollectionItem { + readonly name?: string; + readonly id?: string; + updateConfiguration?: CollectionItemUpdateConfiguration; + frequency?: string; + startTime?: Date; + readonly creationTime?: Date; + readonly lastModifiedTime?: Date; + readonly provisioningState?: string; + nextRun?: Date; +} + +/** + * @class + * Initializes a new instance of the SoftwareUpdateConfigurationListResult class. + * @constructor + * result of listing all software update configuration + * + * @member {array} [value] outer object returned when listing all software + * update configurations + */ +export interface SoftwareUpdateConfigurationListResult { + value?: SoftwareUpdateConfigurationCollectionItem[]; +} + +/** + * @class + * Initializes a new instance of the LinuxProperties class. + * @constructor + * Linux specific update configuration. + * + * @member {string} [includedPackageClassifications] Update classifications + * included in the software update configuration. Possible values include: + * 'Unclassified', 'Critical', 'Security', 'Other' + * @member {array} [excludedPackageNameMasks] packages excluded from the + * software update configuration. + */ +export interface LinuxProperties { + includedPackageClassifications?: string; + excludedPackageNameMasks?: string[]; +} + +/** + * @class + * Initializes a new instance of the WindowsProperties class. + * @constructor + * Windows specific update configuration. + * + * @member {string} [includedUpdateClassifications] Update classification + * included in the software update configuration. A comma separated string with + * required values. Possible values include: 'Unclassified', 'Critical', + * 'Security', 'UpdateRollup', 'FeaturePack', 'ServicePack', 'Definition', + * 'Tools', 'Updates' + * @member {array} [excludedKbNumbers] KB numbers excluded from the software + * update configuration. + */ +export interface WindowsProperties { + includedUpdateClassifications?: string; + excludedKbNumbers?: string[]; +} + +/** + * @class + * Initializes a new instance of the UpdateConfiguration class. + * @constructor + * Update specifc properties of the software update configuration. + * + * @member {string} operatingSystem operating system of target machines. + * Possible values include: 'Windows', 'Linux' + * @member {object} [windows] Windows specific update configuration. + * @member {string} [windows.includedUpdateClassifications] Update + * classification included in the software update configuration. A comma + * separated string with required values. Possible values include: + * 'Unclassified', 'Critical', 'Security', 'UpdateRollup', 'FeaturePack', + * 'ServicePack', 'Definition', 'Tools', 'Updates' + * @member {array} [windows.excludedKbNumbers] KB numbers excluded from the + * software update configuration. + * @member {object} [linux] Linux specific update configuration. + * @member {string} [linux.includedPackageClassifications] Update + * classifications included in the software update configuration. Possible + * values include: 'Unclassified', 'Critical', 'Security', 'Other' + * @member {array} [linux.excludedPackageNameMasks] packages excluded from the + * software update configuration. + * @member {moment.duration} [duration] Maximum time allowed for the software + * update configuration run. Duration needs to be specified using the format + * PT[n]H[n]M[n]S as per ISO8601 + * @member {array} [azureVirtualMachines] List of azure resource Ids for azure + * virtual machines targeted by the software update configuration. + * @member {array} [nonAzureComputerNames] List of names of non-azure machines + * targeted by the software update configuration. + */ +export interface UpdateConfiguration { + operatingSystem: string; + windows?: WindowsProperties; + linux?: LinuxProperties; + duration?: moment.Duration; + azureVirtualMachines?: string[]; + nonAzureComputerNames?: string[]; +} + +/** + * @class + * Initializes a new instance of the SoftwareUpdateConfiguration class. + * @constructor + * Software update configuration properties. + * + * @member {string} [name] Resource name. + * @member {string} [id] Resource Id. + * @member {string} [type] Resource type + * @member {object} updateConfiguration update specific properties for the + * Software update configuration + * @member {string} [updateConfiguration.operatingSystem] operating system of + * target machines. Possible values include: 'Windows', 'Linux' + * @member {object} [updateConfiguration.windows] Windows specific update + * configuration. + * @member {string} [updateConfiguration.windows.includedUpdateClassifications] + * Update classification included in the software update configuration. A comma + * separated string with required values. Possible values include: + * 'Unclassified', 'Critical', 'Security', 'UpdateRollup', 'FeaturePack', + * 'ServicePack', 'Definition', 'Tools', 'Updates' + * @member {array} [updateConfiguration.windows.excludedKbNumbers] KB numbers + * excluded from the software update configuration. + * @member {object} [updateConfiguration.linux] Linux specific update + * configuration. + * @member {string} [updateConfiguration.linux.includedPackageClassifications] + * Update classifications included in the software update configuration. + * Possible values include: 'Unclassified', 'Critical', 'Security', 'Other' + * @member {array} [updateConfiguration.linux.excludedPackageNameMasks] + * packages excluded from the software update configuration. + * @member {moment.duration} [updateConfiguration.duration] Maximum time + * allowed for the software update configuration run. Duration needs to be + * specified using the format PT[n]H[n]M[n]S as per ISO8601 + * @member {array} [updateConfiguration.azureVirtualMachines] List of azure + * resource Ids for azure virtual machines targeted by the software update + * configuration. + * @member {array} [updateConfiguration.nonAzureComputerNames] List of names of + * non-azure machines targeted by the software update configuration. + * @member {object} scheduleInfo Schedule information for the Software update + * configuration + * @member {date} [scheduleInfo.startTime] Gets or sets the start time of the + * schedule. + * @member {number} [scheduleInfo.startTimeOffsetMinutes] Gets the start time's + * offset in minutes. + * @member {date} [scheduleInfo.expiryTime] Gets or sets the end time of the + * schedule. + * @member {number} [scheduleInfo.expiryTimeOffsetMinutes] Gets or sets the + * expiry time's offset in minutes. + * @member {boolean} [scheduleInfo.isEnabled] Gets or sets a value indicating + * whether this schedule is enabled. + * @member {date} [scheduleInfo.nextRun] Gets or sets the next run time of the + * schedule. + * @member {number} [scheduleInfo.nextRunOffsetMinutes] Gets or sets the next + * run time's offset in minutes. + * @member {object} [scheduleInfo.interval] Gets or sets the interval of the + * schedule. + * @member {string} [scheduleInfo.frequency] Gets or sets the frequency of the + * schedule. Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + * @member {string} [scheduleInfo.timeZone] Gets or sets the time zone of the + * schedule. + * @member {object} [scheduleInfo.advancedSchedule] Gets or sets the advanced + * schedule. + * @member {array} [scheduleInfo.advancedSchedule.weekDays] Days of the week + * that the job should execute on. + * @member {array} [scheduleInfo.advancedSchedule.monthDays] Days of the month + * that the job should execute on. Must be between 1 and 31. + * @member {array} [scheduleInfo.advancedSchedule.monthlyOccurrences] + * Occurrences of days within a month. + * @member {date} [scheduleInfo.creationTime] Gets or sets the creation time. + * @member {date} [scheduleInfo.lastModifiedTime] Gets or sets the last + * modified time. + * @member {string} [scheduleInfo.description] Gets or sets the description. + * @member {string} [provisioningState] Provisioning state for the software + * update configuration, which only appears in the response. + * @member {object} [error] detailes of provisioning error + * @member {string} [error.code] Error code + * @member {string} [error.message] Error message indicating why the operation + * failed. + * @member {date} [creationTime] Creation time of theresource, which only + * appears in the response. + * @member {string} [createdBy] createdBy property, which only appears in the + * response. + * @member {date} [lastModifiedTime] Last time resource was modified, which + * only appears in the response. + * @member {string} [lastModifiedBy] lastModifiedBy property, which only + * appears in the response. + */ +export interface SoftwareUpdateConfiguration extends BaseResource { + readonly name?: string; + readonly id?: string; + readonly type?: string; + updateConfiguration: UpdateConfiguration; + scheduleInfo: ScheduleProperties; + readonly provisioningState?: string; + error?: ErrorResponse; + readonly creationTime?: Date; + readonly createdBy?: string; + readonly lastModifiedTime?: Date; + readonly lastModifiedBy?: string; +} + +/** + * @class + * Initializes a new instance of the UpdateConfigurationNavigation class. + * @constructor + * Software update configuration Run Navigation model. + * + * @member {string} [name] Name of the software update configuration triggered + * the software update configuration run + */ +export interface UpdateConfigurationNavigation { + readonly name?: string; +} + +/** + * @class + * Initializes a new instance of the SoftwareUpdateConfigurationRun class. + * @constructor + * Software update configuration Run properties. + * + * @member {string} [name] Name of the software update configuration run. + * @member {string} [id] Resource Id of the software update configuration run + * @member {object} [softwareUpdateConfiguration] software update configuration + * triggered this run + * @member {string} [softwareUpdateConfiguration.name] Name of the software + * update configuration triggered the software update configuration run + * @member {string} [status] Status of the software update configuration run. + * @member {string} [configuredDuration] configured duration for the software + * update configuration run. + * @member {string} [osType] Operating system target of the software update + * configuration triggered this run + * @member {date} [startTime] Etart time of the software update configuration + * run. + * @member {date} [endTime] End time of the software update configuration run. + * @member {number} [computerCount] Number of computers in the software update + * configuration run. + * @member {number} [failedCount] Number of computers with failed status. + * @member {date} [creationTime] Creation time of theresource, which only + * appears in the response. + * @member {string} [createdBy] createdBy property, which only appears in the + * response. + * @member {date} [lastModifiedTime] Last time resource was modified, which + * only appears in the response. + * @member {string} [lastModifiedBy] lastModifiedBy property, which only + * appears in the response. + */ +export interface SoftwareUpdateConfigurationRun { + readonly name?: string; + readonly id?: string; + softwareUpdateConfiguration?: UpdateConfigurationNavigation; + readonly status?: string; + readonly configuredDuration?: string; + readonly osType?: string; + readonly startTime?: Date; + readonly endTime?: Date; + readonly computerCount?: number; + readonly failedCount?: number; + readonly creationTime?: Date; + readonly createdBy?: string; + readonly lastModifiedTime?: Date; + readonly lastModifiedBy?: string; +} + +/** + * @class + * Initializes a new instance of the SoftwareUpdateConfigurationRunListResult class. + * @constructor + * result of listing all software update configuration runs + * + * @member {array} [value] outer object returned when listing all software + * update configuration runs + * @member {string} [nextLink] link to next page of results. + */ +export interface SoftwareUpdateConfigurationRunListResult { + value?: SoftwareUpdateConfigurationRun[]; + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the JobNavigation class. + * @constructor + * Software update configuration machine run job navigation properties. + * + * @member {string} [id] Id of the job associated with the software update + * configuration run + */ +export interface JobNavigation { + readonly id?: string; +} + +/** + * @class + * Initializes a new instance of the SoftwareUpdateConfigurationMachineRun class. + * @constructor + * Software update configuration machine run model. + * + * @member {string} [name] Name of the software update configuration machine + * run + * @member {string} [id] Resource Id of the software update configuration + * machine run + * @member {string} [targetComputer] name of the updated computer + * @member {string} [targetComputerType] type of the updated computer. + * @member {object} [softwareUpdateConfiguration] software update configuration + * triggered this run + * @member {string} [softwareUpdateConfiguration.name] Name of the software + * update configuration triggered the software update configuration run + * @member {string} [status] Status of the software update configuration + * machine run. + * @member {string} [osType] Operating system target of the software update + * configuration triggered this run + * @member {uuid} [correlationId] correlation id of the software update + * configuration machine run + * @member {uuid} [sourceComputerId] source computer id of the software update + * configuration machine run + * @member {date} [startTime] Start time of the software update configuration + * machine run. + * @member {date} [endTime] End time of the software update configuration + * machine run. + * @member {string} [configuredDuration] configured duration for the software + * update configuration run. + * @member {object} [job] Job associated with the software update configuration + * machine run + * @member {string} [job.id] Id of the job associated with the software update + * configuration run + * @member {date} [creationTime] Creation time of theresource, which only + * appears in the response. + * @member {string} [createdBy] createdBy property, which only appears in the + * response. + * @member {date} [lastModifiedTime] Last time resource was modified, which + * only appears in the response. + * @member {string} [lastModifiedBy] lastModifiedBy property, which only + * appears in the response. + */ +export interface SoftwareUpdateConfigurationMachineRun { + readonly name?: string; + readonly id?: string; + readonly targetComputer?: string; + readonly targetComputerType?: string; + softwareUpdateConfiguration?: UpdateConfigurationNavigation; + readonly status?: string; + readonly osType?: string; + readonly correlationId?: string; + readonly sourceComputerId?: string; + readonly startTime?: Date; + readonly endTime?: Date; + readonly configuredDuration?: string; + job?: JobNavigation; + readonly creationTime?: Date; + readonly createdBy?: string; + readonly lastModifiedTime?: Date; + readonly lastModifiedBy?: string; +} + +/** + * @class + * Initializes a new instance of the SoftwareUpdateConfigurationMachineRunListResult class. + * @constructor + * result of listing all software update configuration machine runs + * + * @member {array} [value] outer object returned when listing all software + * update configuration machine runs + * @member {string} [nextLink] link to next page of results. + */ +export interface SoftwareUpdateConfigurationMachineRunListResult { + value?: SoftwareUpdateConfigurationMachineRun[]; + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the SourceControl class. + * @constructor + * Definition of the source control. + * + * @member {string} [name] Resource name. + * @member {string} [id] Resource Id. + * @member {string} [type] Resource type. + * @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} [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. + */ +export interface SourceControl extends BaseResource { + readonly name?: string; + readonly id?: string; + readonly type?: string; + repoUrl?: string; + branch?: string; + folderPath?: string; + autoSync?: boolean; + publishRunbook?: boolean; + sourceType?: string; + description?: string; + creationTime?: Date; + lastModifiedTime?: Date; +} + +/** + * @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 + * source control. + */ +export interface SourceControlUpdateParameters { + branch?: string; + folderPath?: string; + autoSync?: boolean; + publishRunbook?: boolean; + securityToken?: string; + description?: string; +} + +/** + * @class + * Initializes a new instance of the SourceControlCreateOrUpdateParameters class. + * @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} [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. + */ +export interface SourceControlCreateOrUpdateParameters { + repoUrl?: string; + branch?: string; + folderPath?: string; + autoSync?: boolean; + publishRunbook?: boolean; + sourceType?: string; + securityToken?: string; + description?: string; +} + +/** + * @class + * Initializes a new instance of the SourceControlSyncJob class. + * @constructor + * Definition of the source control sync job. + * + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + * @member {string} [id] Resource id. + * @member {string} [sourceControlSyncJobId] 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} [startedBy] Gets the user who started the sync job. + */ +export interface SourceControlSyncJob { + readonly name?: string; + readonly type?: string; + readonly id?: string; + sourceControlSyncJobId?: string; + readonly creationTime?: Date; + provisioningState?: string; + readonly startTime?: Date; + readonly endTime?: Date; + startedBy?: string; +} + +/** + * @class + * Initializes a new instance of the SourceControlSyncJobByIdErrors class. + * @constructor + * Error details of the source control sync job. + * + * @member {string} [code] Gets the error code for the job. + * @member {string} [message] Gets the error message for the job. + */ +export interface SourceControlSyncJobByIdErrors { + code?: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the SourceControlSyncJobById class. + * @constructor + * Definition of the source control sync job. + * + * @member {string} [id] Gets the id of the job. + * @member {string} [sourceControlSyncJobId] 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} [startedBy] Gets the user who started the sync job. + * @member {object} [errors] Error details of the source control sync job. + * @member {string} [errors.code] Gets the error code for the job. + * @member {string} [errors.message] Gets the error message for the job. + */ +export interface SourceControlSyncJobById { + id?: string; + sourceControlSyncJobId?: string; + readonly creationTime?: Date; + provisioningState?: string; + readonly startTime?: Date; + readonly endTime?: Date; + startedBy?: string; + errors?: SourceControlSyncJobByIdErrors; +} + +/** + * @class + * Initializes a new instance of the JobCollectionItem class. + * @constructor + * Job collection item properties. + * + * @member {object} [runbook] The runbook association. + * @member {string} [runbook.name] Gets or sets the name of the runbook. + * @member {uuid} [jobId] The id of the job. + * @member {date} [creationTime] The creation time of the job. + * @member {string} [status] The status of the job. Possible values include: + * 'New', 'Activating', 'Running', 'Completed', 'Failed', 'Stopped', 'Blocked', + * 'Suspended', 'Disconnected', 'Suspending', 'Stopping', 'Resuming', + * 'Removing' + * @member {date} [startTime] The start time of the job. + * @member {date} [endTime] The end time of the job. + * @member {date} [lastModifiedTime] The last modified time of the job. + * @member {object} [provisioningState] The current provisioning state of the + * job. + * @member {string} [provisioningState.provisioningState] The provisioning + * state of the resource. Possible values include: 'Failed', 'Succeeded', + * 'Suspended', 'Processing' + */ +export interface JobCollectionItem extends ProxyResource { + readonly runbook?: RunbookAssociationProperty; + readonly jobId?: string; + readonly creationTime?: Date; + readonly status?: string; + readonly startTime?: Date; + readonly endTime?: Date; + readonly lastModifiedTime?: Date; + provisioningState?: JobProvisioningStateProperty; +} + + +/** + * @class + * Initializes a new instance of the AutomationAccountListResult class. + * @constructor + * The response model for the list account operation. + * + * @member {string} [nextLink] Gets or sets the next link. + */ +export interface AutomationAccountListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the OperationListResult class. + * @constructor * The response model for the list of Automation operations * */ @@ -2350,30 +3120,6 @@ export interface HybridRunbookWorkerGroupsListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the JobStreamListResult class. - * @constructor - * The response model for the list job stream operation. - * - * @member {string} [nextLink] Gets or sets the next link. - */ -export interface JobStreamListResult extends Array { - nextLink?: string; -} - /** * @class * Initializes a new instance of the JobScheduleListResult class. @@ -2432,6 +3178,18 @@ export interface RunbookListResult extends Array { nextLink?: string; } +/** + * @class + * Initializes a new instance of the JobStreamListResult class. + * @constructor + * The response model for the list job stream operation. + * + * @member {string} [nextLink] Gets or sets the next link. + */ +export interface JobStreamListResult extends Array { + nextLink?: string; +} + /** * @class * Initializes a new instance of the ScheduleListResult class. @@ -2467,3 +3225,39 @@ export interface VariableListResult extends Array { export interface WebhookListResult extends Array { nextLink?: string; } + +/** + * @class + * Initializes a new instance of the SourceControlListResult class. + * @constructor + * The response model for the list source controls operation. + * + * @member {string} [nextLink] Gets or sets the next link. + */ +export interface SourceControlListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the SourceControlSyncJobListResult class. + * @constructor + * The response model for the list source control sync jobs operation. + * + * @member {string} [nextLink] Gets or sets the next link. + */ +export interface SourceControlSyncJobListResult extends Array { + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the JobListResultV2 class. + * @constructor + * The response model for the list job operation. + * + * @member {string} [nextLink] The link to the next page. + */ +export interface JobListResultV2 extends Array { + readonly nextLink?: string; +} diff --git a/lib/services/automationManagement/lib/models/index.js b/lib/services/automationManagement/lib/models/index.js index 8d66af1839..9f35001d96 100644 --- a/lib/services/automationManagement/lib/models/index.js +++ b/lib/services/automationManagement/lib/models/index.js @@ -30,8 +30,6 @@ exports.Resource = require('./resource'); exports.Runbook = require('./runbook'); exports.ModuleErrorInfo = require('./moduleErrorInfo'); exports.Module = require('./module'); -exports.DscNodeConfigurationAssociationProperty = require('./dscNodeConfigurationAssociationProperty'); -exports.DscNode = require('./dscNode'); exports.ContentSource = require('./contentSource'); exports.DscConfigurationParameter = require('./dscConfigurationParameter'); exports.DscConfiguration = require('./dscConfiguration'); @@ -65,11 +63,14 @@ exports.AgentRegistration = require('./agentRegistration'); exports.AgentRegistrationRegenerateKeyParameter = require('./agentRegistrationRegenerateKeyParameter'); exports.DscConfigurationAssociationProperty = require('./dscConfigurationAssociationProperty'); exports.DscCompilationJobCreateParameters = require('./dscCompilationJobCreateParameters'); +exports.JobProvisioningStateProperty = require('./jobProvisioningStateProperty'); +exports.ProxyResource = require('./proxyResource'); exports.DscCompilationJob = require('./dscCompilationJob'); exports.DscConfigurationCreateOrUpdateParameters = require('./dscConfigurationCreateOrUpdateParameters'); exports.DscMetaConfiguration = require('./dscMetaConfiguration'); exports.DscNodeConfigurationCreateOrUpdateParameters = require('./dscNodeConfigurationCreateOrUpdateParameters'); -exports.DscNodeConfiguration = require('./dscNodeConfiguration'); +exports.DscNodeConfigurationAssociationProperty = require('./dscNodeConfigurationAssociationProperty'); +exports.DscNodeExtensionHandlerAssociationProperty = require('./dscNodeExtensionHandlerAssociationProperty'); exports.DscNodeUpdateParameters = require('./dscNodeUpdateParameters'); exports.DscReportError = require('./dscReportError'); exports.DscReportResourceNavigation = require('./dscReportResourceNavigation'); @@ -82,10 +83,12 @@ exports.HybridRunbookWorkerGroupUpdateParameters = require('./hybridRunbookWorke exports.RunbookAssociationProperty = require('./runbookAssociationProperty'); exports.Job = require('./job'); exports.JobCreateParameters = require('./jobCreateParameters'); +exports.JobListResult = require('./jobListResult'); exports.ScheduleAssociationProperty = require('./scheduleAssociationProperty'); exports.JobScheduleCreateParameters = require('./jobScheduleCreateParameters'); exports.JobSchedule = require('./jobSchedule'); exports.JobStream = require('./jobStream'); +exports.LinkedWorkspace = require('./linkedWorkspace'); exports.ModuleCreateOrUpdateParameters = require('./moduleCreateOrUpdateParameters'); exports.ModuleUpdateParameters = require('./moduleUpdateParameters'); exports.RunbookDraftUndoEditResult = require('./runbookDraftUndoEditResult'); @@ -94,6 +97,7 @@ exports.RunbookCreateOrUpdateDraftProperties = require('./runbookCreateOrUpdateD exports.RunbookCreateOrUpdateDraftParameters = require('./runbookCreateOrUpdateDraftParameters'); exports.RunbookUpdateParameters = require('./runbookUpdateParameters'); exports.ScheduleCreateOrUpdateParameters = require('./scheduleCreateOrUpdateParameters'); +exports.ScheduleProperties = require('./scheduleProperties'); exports.Schedule = require('./schedule'); exports.ScheduleUpdateParameters = require('./scheduleUpdateParameters'); exports.SubResource = require('./subResource'); @@ -106,6 +110,28 @@ exports.VariableUpdateParameters = require('./variableUpdateParameters'); exports.WebhookCreateOrUpdateParameters = require('./webhookCreateOrUpdateParameters'); exports.Webhook = require('./webhook'); exports.WebhookUpdateParameters = require('./webhookUpdateParameters'); +exports.DscNode = require('./dscNode'); +exports.DscNodeConfiguration = require('./dscNodeConfiguration'); +exports.CollectionItemUpdateConfiguration = require('./collectionItemUpdateConfiguration'); +exports.SoftwareUpdateConfigurationCollectionItem = require('./softwareUpdateConfigurationCollectionItem'); +exports.SoftwareUpdateConfigurationListResult = require('./softwareUpdateConfigurationListResult'); +exports.LinuxProperties = require('./linuxProperties'); +exports.WindowsProperties = require('./windowsProperties'); +exports.UpdateConfiguration = require('./updateConfiguration'); +exports.SoftwareUpdateConfiguration = require('./softwareUpdateConfiguration'); +exports.UpdateConfigurationNavigation = require('./updateConfigurationNavigation'); +exports.SoftwareUpdateConfigurationRun = require('./softwareUpdateConfigurationRun'); +exports.SoftwareUpdateConfigurationRunListResult = require('./softwareUpdateConfigurationRunListResult'); +exports.JobNavigation = require('./jobNavigation'); +exports.SoftwareUpdateConfigurationMachineRun = require('./softwareUpdateConfigurationMachineRun'); +exports.SoftwareUpdateConfigurationMachineRunListResult = require('./softwareUpdateConfigurationMachineRunListResult'); +exports.SourceControl = require('./sourceControl'); +exports.SourceControlUpdateParameters = require('./sourceControlUpdateParameters'); +exports.SourceControlCreateOrUpdateParameters = require('./sourceControlCreateOrUpdateParameters'); +exports.SourceControlSyncJob = require('./sourceControlSyncJob'); +exports.SourceControlSyncJobByIdErrors = require('./sourceControlSyncJobByIdErrors'); +exports.SourceControlSyncJobById = require('./sourceControlSyncJobById'); +exports.JobCollectionItem = require('./jobCollectionItem'); exports.AutomationAccountListResult = require('./automationAccountListResult'); exports.OperationListResult = require('./operationListResult'); exports.StatisticsListResult = require('./statisticsListResult'); @@ -120,13 +146,15 @@ exports.DscNodeListResult = require('./dscNodeListResult'); exports.DscNodeReportListResult = require('./dscNodeReportListResult'); exports.DscNodeConfigurationListResult = require('./dscNodeConfigurationListResult'); exports.HybridRunbookWorkerGroupsListResult = require('./hybridRunbookWorkerGroupsListResult'); -exports.JobListResult = require('./jobListResult'); -exports.JobStreamListResult = require('./jobStreamListResult'); exports.JobScheduleListResult = require('./jobScheduleListResult'); exports.ActivityListResult = require('./activityListResult'); exports.ModuleListResult = require('./moduleListResult'); exports.TypeFieldListResult = require('./typeFieldListResult'); exports.RunbookListResult = require('./runbookListResult'); +exports.JobStreamListResult = require('./jobStreamListResult'); exports.ScheduleListResult = require('./scheduleListResult'); exports.VariableListResult = require('./variableListResult'); exports.WebhookListResult = require('./webhookListResult'); +exports.SourceControlListResult = require('./sourceControlListResult'); +exports.SourceControlSyncJobListResult = require('./sourceControlSyncJobListResult'); +exports.JobListResultV2 = require('./jobListResultV2'); diff --git a/lib/services/automationManagement/lib/models/job.js b/lib/services/automationManagement/lib/models/job.js index 55e6058256..b75467cfad 100644 --- a/lib/services/automationManagement/lib/models/job.js +++ b/lib/services/automationManagement/lib/models/job.js @@ -15,11 +15,11 @@ const models = require('./index'); /** * Definition of the job. * + * @extends models['ProxyResource'] */ -class Job { +class Job extends models['ProxyResource'] { /** * Create a Job. - * @member {string} [id] Gets or sets the id of the resource. * @member {object} [runbook] Gets or sets the runbook. * @member {string} [runbook.name] Gets or sets the name of the runbook. * @member {string} [startedBy] Gets or sets the job started by. @@ -41,8 +41,13 @@ class Job { * @member {date} [lastStatusModifiedTime] Gets or sets the last status * modified time of the job. * @member {object} [parameters] Gets or sets the parameters of the job. + * @member {object} [provisioningState] The provisioning state of a resource. + * @member {string} [provisioningState.provisioningState] The provisioning + * state of the resource. Possible values include: 'Failed', 'Succeeded', + * 'Suspended', 'Processing' */ constructor() { + super(); } /** @@ -61,11 +66,28 @@ class Job { modelProperties: { id: { required: false, + readOnly: true, serializedName: 'id', type: { name: 'String' } }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, runbook: { required: false, serializedName: 'properties.runbook', @@ -164,6 +186,14 @@ class Job { } } } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'Composite', + className: 'JobProvisioningStateProperty' + } } } } diff --git a/lib/services/automationManagement/lib/models/jobCollectionItem.js b/lib/services/automationManagement/lib/models/jobCollectionItem.js new file mode 100644 index 0000000000..221e327502 --- /dev/null +++ b/lib/services/automationManagement/lib/models/jobCollectionItem.js @@ -0,0 +1,153 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Job collection item properties. + * + * @extends models['ProxyResource'] + */ +class JobCollectionItem extends models['ProxyResource'] { + /** + * Create a JobCollectionItem. + * @member {object} [runbook] The runbook association. + * @member {string} [runbook.name] Gets or sets the name of the runbook. + * @member {uuid} [jobId] The id of the job. + * @member {date} [creationTime] The creation time of the job. + * @member {string} [status] The status of the job. Possible values include: + * 'New', 'Activating', 'Running', 'Completed', 'Failed', 'Stopped', + * 'Blocked', 'Suspended', 'Disconnected', 'Suspending', 'Stopping', + * 'Resuming', 'Removing' + * @member {date} [startTime] The start time of the job. + * @member {date} [endTime] The end time of the job. + * @member {date} [lastModifiedTime] The last modified time of the job. + * @member {object} [provisioningState] The current provisioning state of the + * job. + * @member {string} [provisioningState.provisioningState] The provisioning + * state of the resource. Possible values include: 'Failed', 'Succeeded', + * 'Suspended', 'Processing' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of JobCollectionItem + * + * @returns {object} metadata of JobCollectionItem + * + */ + mapper() { + return { + required: false, + serializedName: 'jobCollectionItem', + type: { + name: 'Composite', + className: 'JobCollectionItem', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + runbook: { + required: false, + readOnly: true, + serializedName: 'properties.runbook', + type: { + name: 'Composite', + className: 'RunbookAssociationProperty' + } + }, + jobId: { + required: false, + readOnly: true, + serializedName: 'properties.jobId', + type: { + name: 'String' + } + }, + creationTime: { + required: false, + readOnly: true, + serializedName: 'properties.creationTime', + type: { + name: 'DateTime' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + readOnly: true, + serializedName: 'properties.endTime', + type: { + name: 'DateTime' + } + }, + lastModifiedTime: { + required: false, + readOnly: true, + serializedName: 'properties.lastModifiedTime', + type: { + name: 'DateTime' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'Composite', + className: 'JobProvisioningStateProperty' + } + } + } + } + }; + } +} + +module.exports = JobCollectionItem; diff --git a/lib/services/automationManagement/lib/models/jobCreateParameters.js b/lib/services/automationManagement/lib/models/jobCreateParameters.js index c5d34416d0..b60f054efd 100644 --- a/lib/services/automationManagement/lib/models/jobCreateParameters.js +++ b/lib/services/automationManagement/lib/models/jobCreateParameters.js @@ -24,9 +24,6 @@ class JobCreateParameters { * @member {object} [parameters] Gets or sets the parameters of the job. * @member {string} [runOn] Gets or sets the runOn which specifies the group * name where the job is to be executed. - * @member {string} [name] Gets or sets name of the resource. - * @member {string} [location] Gets or sets the location of the resource. - * @member {object} [tags] Gets or sets the tags attached to the resource. */ constructor() { } @@ -73,34 +70,6 @@ class JobCreateParameters { type: { name: 'String' } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } } } } diff --git a/lib/services/automationManagement/lib/models/jobListResult.js b/lib/services/automationManagement/lib/models/jobListResult.js index 0e47b41d7c..227b185fd5 100644 --- a/lib/services/automationManagement/lib/models/jobListResult.js +++ b/lib/services/automationManagement/lib/models/jobListResult.js @@ -10,16 +10,19 @@ 'use strict'; +const models = require('./index'); + /** * The response model for the list job operation. + * */ -class JobListResult extends Array { +class JobListResult { /** * Create a JobListResult. + * @member {array} [value] Gets or sets a list of jobs. * @member {string} [nextLink] Gets or sets the next link. */ constructor() { - super(); } /** @@ -38,7 +41,7 @@ class JobListResult extends Array { modelProperties: { value: { required: false, - serializedName: '', + serializedName: 'value', type: { name: 'Sequence', element: { diff --git a/lib/services/automationManagement/lib/models/jobListResultV2.js b/lib/services/automationManagement/lib/models/jobListResultV2.js new file mode 100644 index 0000000000..7124a7c22b --- /dev/null +++ b/lib/services/automationManagement/lib/models/jobListResultV2.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The response model for the list job operation. + */ +class JobListResultV2 extends Array { + /** + * Create a JobListResultV2. + * @member {string} [nextLink] The link to the next page. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of JobListResultV2 + * + * @returns {object} metadata of JobListResultV2 + * + */ + mapper() { + return { + required: false, + serializedName: 'JobListResultV2', + type: { + name: 'Composite', + className: 'JobListResultV2', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'JobCollectionItemElementType', + type: { + name: 'Composite', + className: 'JobCollectionItem' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = JobListResultV2; diff --git a/lib/services/automationManagement/lib/models/jobNavigation.js b/lib/services/automationManagement/lib/models/jobNavigation.js new file mode 100644 index 0000000000..a2aba8b978 --- /dev/null +++ b/lib/services/automationManagement/lib/models/jobNavigation.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Software update configuration machine run job navigation properties. + * + */ +class JobNavigation { + /** + * Create a JobNavigation. + * @member {string} [id] Id of the job associated with the software update + * configuration run + */ + constructor() { + } + + /** + * Defines the metadata of JobNavigation + * + * @returns {object} metadata of JobNavigation + * + */ + mapper() { + return { + required: false, + serializedName: 'jobNavigation', + type: { + name: 'Composite', + className: 'JobNavigation', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = JobNavigation; diff --git a/lib/services/automationManagement/lib/models/jobProvisioningStateProperty.js b/lib/services/automationManagement/lib/models/jobProvisioningStateProperty.js new file mode 100644 index 0000000000..07d50308d4 --- /dev/null +++ b/lib/services/automationManagement/lib/models/jobProvisioningStateProperty.js @@ -0,0 +1,55 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The provisioning state property. + * + */ +class JobProvisioningStateProperty { + /** + * Create a JobProvisioningStateProperty. + * @member {string} [provisioningState] The provisioning state of the + * resource. Possible values include: 'Failed', 'Succeeded', 'Suspended', + * 'Processing' + */ + constructor() { + } + + /** + * Defines the metadata of JobProvisioningStateProperty + * + * @returns {object} metadata of JobProvisioningStateProperty + * + */ + mapper() { + return { + required: false, + serializedName: 'JobProvisioningStateProperty', + type: { + name: 'Composite', + className: 'JobProvisioningStateProperty', + modelProperties: { + provisioningState: { + required: false, + readOnly: true, + serializedName: 'provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = JobProvisioningStateProperty; diff --git a/lib/services/automationManagement/lib/models/jobSchedule.js b/lib/services/automationManagement/lib/models/jobSchedule.js index 791544f7da..f608fc5495 100644 --- a/lib/services/automationManagement/lib/models/jobSchedule.js +++ b/lib/services/automationManagement/lib/models/jobSchedule.js @@ -19,7 +19,9 @@ const models = require('./index'); class JobSchedule { /** * Create a JobSchedule. - * @member {string} [id] Gets or sets the id of the resource. + * @member {string} [id] Gets the id of the resource. + * @member {string} [name] Gets the name of the variable. + * @member {string} [type] Resource type * @member {string} [jobScheduleId] Gets or sets the id of job schedule. * @member {object} [schedule] Gets or sets the schedule. * @member {string} [schedule.name] Gets or sets the name of the schedule. @@ -49,11 +51,28 @@ class JobSchedule { modelProperties: { id: { required: false, + readOnly: true, serializedName: 'id', type: { name: 'String' } }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, jobScheduleId: { required: false, serializedName: 'properties.jobScheduleId', diff --git a/lib/services/automationManagement/lib/models/linkedWorkspace.js b/lib/services/automationManagement/lib/models/linkedWorkspace.js new file mode 100644 index 0000000000..5daf95ac28 --- /dev/null +++ b/lib/services/automationManagement/lib/models/linkedWorkspace.js @@ -0,0 +1,53 @@ +/* + * 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'; + +/** + * Definition of the linked workspace. + * + */ +class LinkedWorkspace { + /** + * Create a LinkedWorkspace. + * @member {string} [id] Gets the id of the linked workspace. + */ + constructor() { + } + + /** + * Defines the metadata of LinkedWorkspace + * + * @returns {object} metadata of LinkedWorkspace + * + */ + mapper() { + return { + required: false, + serializedName: 'LinkedWorkspace', + type: { + name: 'Composite', + className: 'LinkedWorkspace', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LinkedWorkspace; diff --git a/lib/services/automationManagement/lib/models/linuxProperties.js b/lib/services/automationManagement/lib/models/linuxProperties.js new file mode 100644 index 0000000000..3e25b2be22 --- /dev/null +++ b/lib/services/automationManagement/lib/models/linuxProperties.js @@ -0,0 +1,70 @@ +/* + * 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'; + +/** + * Linux specific update configuration. + * + */ +class LinuxProperties { + /** + * Create a LinuxProperties. + * @member {string} [includedPackageClassifications] Update classifications + * included in the software update configuration. Possible values include: + * 'Unclassified', 'Critical', 'Security', 'Other' + * @member {array} [excludedPackageNameMasks] packages excluded from the + * software update configuration. + */ + constructor() { + } + + /** + * Defines the metadata of LinuxProperties + * + * @returns {object} metadata of LinuxProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'LinuxProperties', + type: { + name: 'Composite', + className: 'LinuxProperties', + modelProperties: { + includedPackageClassifications: { + required: false, + serializedName: 'includedPackageClassifications', + type: { + name: 'String' + } + }, + excludedPackageNameMasks: { + required: false, + serializedName: 'excludedPackageNameMasks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = LinuxProperties; diff --git a/lib/services/automationManagement/lib/models/proxyResource.js b/lib/services/automationManagement/lib/models/proxyResource.js new file mode 100644 index 0000000000..71e7548fc0 --- /dev/null +++ b/lib/services/automationManagement/lib/models/proxyResource.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'; + +const models = require('./index'); + +/** + * The Resource definition. + * + * @extends models['BaseResource'] + */ +class ProxyResource extends models['BaseResource'] { + /** + * Create a ProxyResource. + * @member {string} [id] Resource Id + * @member {string} [name] Resource name + * @member {string} [type] Resource type + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ProxyResource + * + * @returns {object} metadata of ProxyResource + * + */ + mapper() { + return { + required: false, + serializedName: 'ProxyResource', + type: { + name: 'Composite', + className: 'ProxyResource', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ProxyResource; diff --git a/lib/services/automationManagement/lib/models/schedule.js b/lib/services/automationManagement/lib/models/schedule.js index ccca945bfe..51052d2000 100644 --- a/lib/services/automationManagement/lib/models/schedule.js +++ b/lib/services/automationManagement/lib/models/schedule.js @@ -19,8 +19,9 @@ const models = require('./index'); class Schedule { /** * Create a Schedule. - * @member {string} [id] Gets or sets the id of the resource. - * @member {string} [name] Gets or sets the name of the schedule. + * @member {string} [id] Gets the id of the resource. + * @member {string} [name] Gets name of the schedule. + * @member {string} [type] Resource type * @member {date} [startTime] Gets or sets the start time of the schedule. * @member {number} [startTimeOffsetMinutes] Gets the start time's offset in * minutes. @@ -66,6 +67,7 @@ class Schedule { modelProperties: { id: { required: false, + readOnly: true, serializedName: 'id', type: { name: 'String' @@ -73,11 +75,20 @@ class Schedule { }, name: { required: false, + readOnly: true, serializedName: 'name', type: { name: 'String' } }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, startTime: { required: false, serializedName: 'properties.startTime', diff --git a/lib/services/automationManagement/lib/models/scheduleCreateOrUpdateParameters.js b/lib/services/automationManagement/lib/models/scheduleCreateOrUpdateParameters.js index 77c21ffb80..fd14a76bd3 100644 --- a/lib/services/automationManagement/lib/models/scheduleCreateOrUpdateParameters.js +++ b/lib/services/automationManagement/lib/models/scheduleCreateOrUpdateParameters.js @@ -25,8 +25,8 @@ class ScheduleCreateOrUpdateParameters { * @member {date} startTime Gets or sets the start time of the schedule. * @member {date} [expiryTime] Gets or sets the end time of the schedule. * @member {object} [interval] Gets or sets the interval of the schedule. - * @member {string} frequency Gets or sets the frequency of the schedule. - * Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + * @member {string} frequency Possible values include: 'OneTime', 'Day', + * 'Hour', 'Week', 'Month' * @member {string} [timeZone] Gets or sets the time zone of the schedule. * @member {object} [advancedSchedule] Gets or sets the AdvancedSchedule. * @member {array} [advancedSchedule.weekDays] Days of the week that the job diff --git a/lib/services/automationManagement/lib/models/scheduleProperties.js b/lib/services/automationManagement/lib/models/scheduleProperties.js new file mode 100644 index 0000000000..b8c60c2389 --- /dev/null +++ b/lib/services/automationManagement/lib/models/scheduleProperties.js @@ -0,0 +1,172 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Definition of schedule parameters. + * + */ +class ScheduleProperties { + /** + * Create a ScheduleProperties. + * @member {date} [startTime] Gets or sets the start time of the schedule. + * @member {number} [startTimeOffsetMinutes] Gets the start time's offset in + * minutes. + * @member {date} [expiryTime] Gets or sets the end time of the schedule. + * @member {number} [expiryTimeOffsetMinutes] Gets or sets the expiry time's + * offset in minutes. + * @member {boolean} [isEnabled] Gets or sets a value indicating whether this + * schedule is enabled. Default value: false . + * @member {date} [nextRun] Gets or sets the next run time of the schedule. + * @member {number} [nextRunOffsetMinutes] Gets or sets the next run time's + * offset in minutes. + * @member {object} [interval] Gets or sets the interval of the schedule. + * @member {string} [frequency] Gets or sets the frequency of the schedule. + * Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + * @member {string} [timeZone] Gets or sets the time zone of the schedule. + * @member {object} [advancedSchedule] Gets or sets the advanced schedule. + * @member {array} [advancedSchedule.weekDays] Days of the week that the job + * should execute on. + * @member {array} [advancedSchedule.monthDays] Days of the month that the + * job should execute on. Must be between 1 and 31. + * @member {array} [advancedSchedule.monthlyOccurrences] Occurrences of days + * within a month. + * @member {date} [creationTime] Gets or sets the creation time. + * @member {date} [lastModifiedTime] Gets or sets the last modified time. + * @member {string} [description] Gets or sets the description. + */ + constructor() { + } + + /** + * Defines the metadata of ScheduleProperties + * + * @returns {object} metadata of ScheduleProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ScheduleProperties', + type: { + name: 'Composite', + className: 'ScheduleProperties', + modelProperties: { + startTime: { + required: false, + serializedName: 'startTime', + type: { + name: 'DateTime' + } + }, + startTimeOffsetMinutes: { + required: false, + readOnly: true, + serializedName: 'startTimeOffsetMinutes', + type: { + name: 'Number' + } + }, + expiryTime: { + required: false, + serializedName: 'expiryTime', + type: { + name: 'DateTime' + } + }, + expiryTimeOffsetMinutes: { + required: false, + serializedName: 'expiryTimeOffsetMinutes', + type: { + name: 'Number' + } + }, + isEnabled: { + required: false, + serializedName: 'isEnabled', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + nextRun: { + required: false, + serializedName: 'nextRun', + type: { + name: 'DateTime' + } + }, + nextRunOffsetMinutes: { + required: false, + serializedName: 'nextRunOffsetMinutes', + type: { + name: 'Number' + } + }, + interval: { + required: false, + serializedName: 'interval', + type: { + name: 'Object' + } + }, + frequency: { + required: false, + serializedName: 'frequency', + type: { + name: 'String' + } + }, + timeZone: { + required: false, + serializedName: 'timeZone', + type: { + name: 'String' + } + }, + advancedSchedule: { + required: false, + serializedName: 'advancedSchedule', + type: { + name: 'Composite', + className: 'AdvancedSchedule' + } + }, + creationTime: { + required: false, + serializedName: 'creationTime', + type: { + name: 'DateTime' + } + }, + lastModifiedTime: { + required: false, + serializedName: 'lastModifiedTime', + type: { + name: 'DateTime' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ScheduleProperties; diff --git a/lib/services/automationManagement/lib/models/scheduleUpdateParameters.js b/lib/services/automationManagement/lib/models/scheduleUpdateParameters.js index 70c4a02539..26bd642bec 100644 --- a/lib/services/automationManagement/lib/models/scheduleUpdateParameters.js +++ b/lib/services/automationManagement/lib/models/scheduleUpdateParameters.js @@ -17,7 +17,7 @@ class ScheduleUpdateParameters { /** * Create a ScheduleUpdateParameters. - * @member {string} name Gets or sets the name of the schedule. + * @member {string} [name] Gets or sets the name of the schedule. * @member {string} [description] Gets or sets the description of the * schedule. * @member {boolean} [isEnabled] Gets or sets a value indicating whether this @@ -41,7 +41,7 @@ class ScheduleUpdateParameters { className: 'ScheduleUpdateParameters', modelProperties: { name: { - required: true, + required: false, serializedName: 'name', type: { name: 'String' diff --git a/lib/services/automationManagement/lib/models/softwareUpdateConfiguration.js b/lib/services/automationManagement/lib/models/softwareUpdateConfiguration.js new file mode 100644 index 0000000000..e30cc4dca9 --- /dev/null +++ b/lib/services/automationManagement/lib/models/softwareUpdateConfiguration.js @@ -0,0 +1,218 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Software update configuration properties. + * + * @extends models['BaseResource'] + */ +class SoftwareUpdateConfiguration extends models['BaseResource'] { + /** + * Create a SoftwareUpdateConfiguration. + * @member {string} [name] Resource name. + * @member {string} [id] Resource Id. + * @member {string} [type] Resource type + * @member {object} updateConfiguration update specific properties for the + * Software update configuration + * @member {string} [updateConfiguration.operatingSystem] operating system of + * target machines. Possible values include: 'Windows', 'Linux' + * @member {object} [updateConfiguration.windows] Windows specific update + * configuration. + * @member {string} + * [updateConfiguration.windows.includedUpdateClassifications] Update + * classification included in the software update configuration. A comma + * separated string with required values. Possible values include: + * 'Unclassified', 'Critical', 'Security', 'UpdateRollup', 'FeaturePack', + * 'ServicePack', 'Definition', 'Tools', 'Updates' + * @member {array} [updateConfiguration.windows.excludedKbNumbers] KB numbers + * excluded from the software update configuration. + * @member {object} [updateConfiguration.linux] Linux specific update + * configuration. + * @member {string} + * [updateConfiguration.linux.includedPackageClassifications] Update + * classifications included in the software update configuration. Possible + * values include: 'Unclassified', 'Critical', 'Security', 'Other' + * @member {array} [updateConfiguration.linux.excludedPackageNameMasks] + * packages excluded from the software update configuration. + * @member {moment.duration} [updateConfiguration.duration] Maximum time + * allowed for the software update configuration run. Duration needs to be + * specified using the format PT[n]H[n]M[n]S as per ISO8601 + * @member {array} [updateConfiguration.azureVirtualMachines] List of azure + * resource Ids for azure virtual machines targeted by the software update + * configuration. + * @member {array} [updateConfiguration.nonAzureComputerNames] List of names + * of non-azure machines targeted by the software update configuration. + * @member {object} scheduleInfo Schedule information for the Software update + * configuration + * @member {date} [scheduleInfo.startTime] Gets or sets the start time of the + * schedule. + * @member {number} [scheduleInfo.startTimeOffsetMinutes] Gets the start + * time's offset in minutes. + * @member {date} [scheduleInfo.expiryTime] Gets or sets the end time of the + * schedule. + * @member {number} [scheduleInfo.expiryTimeOffsetMinutes] Gets or sets the + * expiry time's offset in minutes. + * @member {boolean} [scheduleInfo.isEnabled] Gets or sets a value indicating + * whether this schedule is enabled. + * @member {date} [scheduleInfo.nextRun] Gets or sets the next run time of + * the schedule. + * @member {number} [scheduleInfo.nextRunOffsetMinutes] Gets or sets the next + * run time's offset in minutes. + * @member {object} [scheduleInfo.interval] Gets or sets the interval of the + * schedule. + * @member {string} [scheduleInfo.frequency] Gets or sets the frequency of + * the schedule. Possible values include: 'OneTime', 'Day', 'Hour', 'Week', + * 'Month' + * @member {string} [scheduleInfo.timeZone] Gets or sets the time zone of the + * schedule. + * @member {object} [scheduleInfo.advancedSchedule] Gets or sets the advanced + * schedule. + * @member {array} [scheduleInfo.advancedSchedule.weekDays] Days of the week + * that the job should execute on. + * @member {array} [scheduleInfo.advancedSchedule.monthDays] Days of the + * month that the job should execute on. Must be between 1 and 31. + * @member {array} [scheduleInfo.advancedSchedule.monthlyOccurrences] + * Occurrences of days within a month. + * @member {date} [scheduleInfo.creationTime] Gets or sets the creation time. + * @member {date} [scheduleInfo.lastModifiedTime] Gets or sets the last + * modified time. + * @member {string} [scheduleInfo.description] Gets or sets the description. + * @member {string} [provisioningState] Provisioning state for the software + * update configuration, which only appears in the response. + * @member {object} [error] detailes of provisioning error + * @member {string} [error.code] Error code + * @member {string} [error.message] Error message indicating why the + * operation failed. + * @member {date} [creationTime] Creation time of theresource, which only + * appears in the response. + * @member {string} [createdBy] createdBy property, which only appears in the + * response. + * @member {date} [lastModifiedTime] Last time resource was modified, which + * only appears in the response. + * @member {string} [lastModifiedBy] lastModifiedBy property, which only + * appears in the response. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SoftwareUpdateConfiguration + * + * @returns {object} metadata of SoftwareUpdateConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'softwareUpdateConfiguration', + type: { + name: 'Composite', + className: 'SoftwareUpdateConfiguration', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + updateConfiguration: { + required: true, + serializedName: 'properties.updateConfiguration', + type: { + name: 'Composite', + className: 'UpdateConfiguration' + } + }, + scheduleInfo: { + required: true, + serializedName: 'properties.scheduleInfo', + type: { + name: 'Composite', + className: 'ScheduleProperties' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + error: { + required: false, + serializedName: 'properties.error', + type: { + name: 'Composite', + className: 'ErrorResponse' + } + }, + creationTime: { + required: false, + readOnly: true, + serializedName: 'properties.creationTime', + type: { + name: 'DateTime' + } + }, + createdBy: { + required: false, + readOnly: true, + serializedName: 'properties.createdBy', + type: { + name: 'String' + } + }, + lastModifiedTime: { + required: false, + readOnly: true, + serializedName: 'properties.lastModifiedTime', + type: { + name: 'DateTime' + } + }, + lastModifiedBy: { + required: false, + readOnly: true, + serializedName: 'properties.lastModifiedBy', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SoftwareUpdateConfiguration; diff --git a/lib/services/automationManagement/lib/models/softwareUpdateConfigurationCollectionItem.js b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationCollectionItem.js new file mode 100644 index 0000000000..3feed65506 --- /dev/null +++ b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationCollectionItem.js @@ -0,0 +1,136 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Software update configuration collection item properties. + * + */ +class SoftwareUpdateConfigurationCollectionItem { + /** + * Create a SoftwareUpdateConfigurationCollectionItem. + * @member {string} [name] Name of the software update configuration. + * @member {string} [id] Resource Id of the software update configuration + * @member {object} [updateConfiguration] Update specific properties of the + * software update configuration. + * @member {array} [updateConfiguration.azureVirtualMachines] List of azure + * resource Ids for azure virtual machines targeted by the software update + * configuration. + * @member {moment.duration} [updateConfiguration.duration] Maximum time + * allowed for the software update configuration run. Duration needs to be + * specified using the format PT[n]H[n]M[n]S as per ISO8601 + * @member {string} [frequency] execution frequency of the schedule + * associated with the software update configuration. Possible values + * include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + * @member {date} [startTime] the start time of the update. + * @member {date} [creationTime] Creation time of the software update + * configuration, which only appears in the response. + * @member {date} [lastModifiedTime] Last time software update configuration + * was modified, which only appears in the response. + * @member {string} [provisioningState] Provisioning state for the software + * update configuration, which only appears in the response. + * @member {date} [nextRun] ext run time of the update. + */ + constructor() { + } + + /** + * Defines the metadata of SoftwareUpdateConfigurationCollectionItem + * + * @returns {object} metadata of SoftwareUpdateConfigurationCollectionItem + * + */ + mapper() { + return { + required: false, + serializedName: 'softwareUpdateConfigurationCollectionItem', + type: { + name: 'Composite', + className: 'SoftwareUpdateConfigurationCollectionItem', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + updateConfiguration: { + required: false, + serializedName: 'properties.updateConfiguration', + type: { + name: 'Composite', + className: 'CollectionItemUpdateConfiguration' + } + }, + frequency: { + required: false, + serializedName: 'properties.frequency', + type: { + name: 'String' + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + creationTime: { + required: false, + readOnly: true, + serializedName: 'properties.creationTime', + type: { + name: 'DateTime' + } + }, + lastModifiedTime: { + required: false, + readOnly: true, + serializedName: 'properties.lastModifiedTime', + type: { + name: 'DateTime' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + nextRun: { + required: false, + serializedName: 'properties.nextRun', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = SoftwareUpdateConfigurationCollectionItem; diff --git a/lib/services/automationManagement/lib/models/softwareUpdateConfigurationListResult.js b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationListResult.js new file mode 100644 index 0000000000..74f8890db3 --- /dev/null +++ b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationListResult.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * result of listing all software update configuration + * + */ +class SoftwareUpdateConfigurationListResult { + /** + * Create a SoftwareUpdateConfigurationListResult. + * @member {array} [value] outer object returned when listing all software + * update configurations + */ + constructor() { + } + + /** + * Defines the metadata of SoftwareUpdateConfigurationListResult + * + * @returns {object} metadata of SoftwareUpdateConfigurationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'softwareUpdateConfigurationListResult', + type: { + name: 'Composite', + className: 'SoftwareUpdateConfigurationListResult', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SoftwareUpdateConfigurationCollectionItemElementType', + type: { + name: 'Composite', + className: 'SoftwareUpdateConfigurationCollectionItem' + } + } + } + } + } + } + }; + } +} + +module.exports = SoftwareUpdateConfigurationListResult; diff --git a/lib/services/automationManagement/lib/models/softwareUpdateConfigurationMachineRun.js b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationMachineRun.js new file mode 100644 index 0000000000..0220b60692 --- /dev/null +++ b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationMachineRun.js @@ -0,0 +1,218 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Software update configuration machine run model. + * + */ +class SoftwareUpdateConfigurationMachineRun { + /** + * Create a SoftwareUpdateConfigurationMachineRun. + * @member {string} [name] Name of the software update configuration machine + * run + * @member {string} [id] Resource Id of the software update configuration + * machine run + * @member {string} [targetComputer] name of the updated computer + * @member {string} [targetComputerType] type of the updated computer. + * @member {object} [softwareUpdateConfiguration] software update + * configuration triggered this run + * @member {string} [softwareUpdateConfiguration.name] Name of the software + * update configuration triggered the software update configuration run + * @member {string} [status] Status of the software update configuration + * machine run. + * @member {string} [osType] Operating system target of the software update + * configuration triggered this run + * @member {uuid} [correlationId] correlation id of the software update + * configuration machine run + * @member {uuid} [sourceComputerId] source computer id of the software + * update configuration machine run + * @member {date} [startTime] Start time of the software update configuration + * machine run. + * @member {date} [endTime] End time of the software update configuration + * machine run. + * @member {string} [configuredDuration] configured duration for the software + * update configuration run. + * @member {object} [job] Job associated with the software update + * configuration machine run + * @member {string} [job.id] Id of the job associated with the software + * update configuration run + * @member {date} [creationTime] Creation time of theresource, which only + * appears in the response. + * @member {string} [createdBy] createdBy property, which only appears in the + * response. + * @member {date} [lastModifiedTime] Last time resource was modified, which + * only appears in the response. + * @member {string} [lastModifiedBy] lastModifiedBy property, which only + * appears in the response. + */ + constructor() { + } + + /** + * Defines the metadata of SoftwareUpdateConfigurationMachineRun + * + * @returns {object} metadata of SoftwareUpdateConfigurationMachineRun + * + */ + mapper() { + return { + required: false, + serializedName: 'softwareUpdateConfigurationMachineRun', + type: { + name: 'Composite', + className: 'SoftwareUpdateConfigurationMachineRun', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + targetComputer: { + required: false, + readOnly: true, + serializedName: 'properties.targetComputer', + type: { + name: 'String' + } + }, + targetComputerType: { + required: false, + readOnly: true, + serializedName: 'properties.targetComputerType', + type: { + name: 'String' + } + }, + softwareUpdateConfiguration: { + required: false, + serializedName: 'properties.softwareUpdateConfiguration', + type: { + name: 'Composite', + className: 'UpdateConfigurationNavigation' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + osType: { + required: false, + readOnly: true, + serializedName: 'properties.osType', + type: { + name: 'String' + } + }, + correlationId: { + required: false, + readOnly: true, + serializedName: 'properties.correlationId', + type: { + name: 'String' + } + }, + sourceComputerId: { + required: false, + readOnly: true, + serializedName: 'properties.sourceComputerId', + type: { + name: 'String' + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + readOnly: true, + serializedName: 'properties.endTime', + type: { + name: 'DateTime' + } + }, + configuredDuration: { + required: false, + readOnly: true, + serializedName: 'properties.configuredDuration', + type: { + name: 'String' + } + }, + job: { + required: false, + serializedName: 'properties.job', + type: { + name: 'Composite', + className: 'JobNavigation' + } + }, + creationTime: { + required: false, + readOnly: true, + serializedName: 'properties.creationTime', + type: { + name: 'DateTime' + } + }, + createdBy: { + required: false, + readOnly: true, + serializedName: 'properties.createdBy', + type: { + name: 'String' + } + }, + lastModifiedTime: { + required: false, + readOnly: true, + serializedName: 'properties.lastModifiedTime', + type: { + name: 'DateTime' + } + }, + lastModifiedBy: { + required: false, + readOnly: true, + serializedName: 'properties.lastModifiedBy', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SoftwareUpdateConfigurationMachineRun; diff --git a/lib/services/automationManagement/lib/models/softwareUpdateConfigurationMachineRunListResult.js b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationMachineRunListResult.js new file mode 100644 index 0000000000..e6411a5fec --- /dev/null +++ b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationMachineRunListResult.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * result of listing all software update configuration machine runs + * + */ +class SoftwareUpdateConfigurationMachineRunListResult { + /** + * Create a SoftwareUpdateConfigurationMachineRunListResult. + * @member {array} [value] outer object returned when listing all software + * update configuration machine runs + * @member {string} [nextLink] link to next page of results. + */ + constructor() { + } + + /** + * Defines the metadata of SoftwareUpdateConfigurationMachineRunListResult + * + * @returns {object} metadata of SoftwareUpdateConfigurationMachineRunListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'softwareUpdateConfigurationMachineRunListResult', + type: { + name: 'Composite', + className: 'SoftwareUpdateConfigurationMachineRunListResult', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SoftwareUpdateConfigurationMachineRunElementType', + type: { + name: 'Composite', + className: 'SoftwareUpdateConfigurationMachineRun' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SoftwareUpdateConfigurationMachineRunListResult; diff --git a/lib/services/automationManagement/lib/models/softwareUpdateConfigurationRun.js b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationRun.js new file mode 100644 index 0000000000..d7c603ce40 --- /dev/null +++ b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationRun.js @@ -0,0 +1,184 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Software update configuration Run properties. + * + */ +class SoftwareUpdateConfigurationRun { + /** + * Create a SoftwareUpdateConfigurationRun. + * @member {string} [name] Name of the software update configuration run. + * @member {string} [id] Resource Id of the software update configuration run + * @member {object} [softwareUpdateConfiguration] software update + * configuration triggered this run + * @member {string} [softwareUpdateConfiguration.name] Name of the software + * update configuration triggered the software update configuration run + * @member {string} [status] Status of the software update configuration run. + * @member {string} [configuredDuration] configured duration for the software + * update configuration run. + * @member {string} [osType] Operating system target of the software update + * configuration triggered this run + * @member {date} [startTime] Etart time of the software update configuration + * run. + * @member {date} [endTime] End time of the software update configuration + * run. + * @member {number} [computerCount] Number of computers in the software + * update configuration run. + * @member {number} [failedCount] Number of computers with failed status. + * @member {date} [creationTime] Creation time of theresource, which only + * appears in the response. + * @member {string} [createdBy] createdBy property, which only appears in the + * response. + * @member {date} [lastModifiedTime] Last time resource was modified, which + * only appears in the response. + * @member {string} [lastModifiedBy] lastModifiedBy property, which only + * appears in the response. + */ + constructor() { + } + + /** + * Defines the metadata of SoftwareUpdateConfigurationRun + * + * @returns {object} metadata of SoftwareUpdateConfigurationRun + * + */ + mapper() { + return { + required: false, + serializedName: 'softwareUpdateConfigurationRun', + type: { + name: 'Composite', + className: 'SoftwareUpdateConfigurationRun', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + softwareUpdateConfiguration: { + required: false, + serializedName: 'properties.softwareUpdateConfiguration', + type: { + name: 'Composite', + className: 'UpdateConfigurationNavigation' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + configuredDuration: { + required: false, + readOnly: true, + serializedName: 'properties.configuredDuration', + type: { + name: 'String' + } + }, + osType: { + required: false, + readOnly: true, + serializedName: 'properties.osType', + type: { + name: 'String' + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + readOnly: true, + serializedName: 'properties.endTime', + type: { + name: 'DateTime' + } + }, + computerCount: { + required: false, + readOnly: true, + serializedName: 'properties.computerCount', + type: { + name: 'Number' + } + }, + failedCount: { + required: false, + readOnly: true, + serializedName: 'properties.failedCount', + type: { + name: 'Number' + } + }, + creationTime: { + required: false, + readOnly: true, + serializedName: 'properties.creationTime', + type: { + name: 'DateTime' + } + }, + createdBy: { + required: false, + readOnly: true, + serializedName: 'properties.createdBy', + type: { + name: 'String' + } + }, + lastModifiedTime: { + required: false, + readOnly: true, + serializedName: 'properties.lastModifiedTime', + type: { + name: 'DateTime' + } + }, + lastModifiedBy: { + required: false, + readOnly: true, + serializedName: 'properties.lastModifiedBy', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SoftwareUpdateConfigurationRun; diff --git a/lib/services/automationManagement/lib/models/softwareUpdateConfigurationRunListResult.js b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationRunListResult.js new file mode 100644 index 0000000000..24ccdc2172 --- /dev/null +++ b/lib/services/automationManagement/lib/models/softwareUpdateConfigurationRunListResult.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * result of listing all software update configuration runs + * + */ +class SoftwareUpdateConfigurationRunListResult { + /** + * Create a SoftwareUpdateConfigurationRunListResult. + * @member {array} [value] outer object returned when listing all software + * update configuration runs + * @member {string} [nextLink] link to next page of results. + */ + constructor() { + } + + /** + * Defines the metadata of SoftwareUpdateConfigurationRunListResult + * + * @returns {object} metadata of SoftwareUpdateConfigurationRunListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'softwareUpdateConfigurationRunListResult', + type: { + name: 'Composite', + className: 'SoftwareUpdateConfigurationRunListResult', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SoftwareUpdateConfigurationRunElementType', + type: { + name: 'Composite', + className: 'SoftwareUpdateConfigurationRun' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SoftwareUpdateConfigurationRunListResult; diff --git a/lib/services/automationManagement/lib/models/sourceControl.js b/lib/services/automationManagement/lib/models/sourceControl.js new file mode 100644 index 0000000000..b926558d2e --- /dev/null +++ b/lib/services/automationManagement/lib/models/sourceControl.js @@ -0,0 +1,153 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Definition of the source control. + * + * @extends models['BaseResource'] + */ +class SourceControl extends models['BaseResource'] { + /** + * Create a SourceControl. + * @member {string} [name] Resource name. + * @member {string} [id] Resource Id. + * @member {string} [type] Resource type. + * @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} [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. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SourceControl + * + * @returns {object} metadata of SourceControl + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceControl', + type: { + name: 'Composite', + className: 'SourceControl', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + repoUrl: { + required: false, + serializedName: 'properties.repoUrl', + type: { + name: 'String' + } + }, + branch: { + required: false, + serializedName: 'properties.branch', + type: { + name: 'String' + } + }, + folderPath: { + required: false, + serializedName: 'properties.folderPath', + type: { + name: 'String' + } + }, + autoSync: { + required: false, + serializedName: 'properties.autoSync', + type: { + name: 'Boolean' + } + }, + publishRunbook: { + required: false, + serializedName: 'properties.publishRunbook', + type: { + name: 'Boolean' + } + }, + sourceType: { + required: false, + serializedName: 'properties.sourceType', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + creationTime: { + required: false, + serializedName: 'properties.creationTime', + type: { + name: 'DateTime' + } + }, + lastModifiedTime: { + required: false, + serializedName: 'properties.lastModifiedTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = SourceControl; diff --git a/lib/services/automationManagement/lib/models/sourceControlCreateOrUpdateParameters.js b/lib/services/automationManagement/lib/models/sourceControlCreateOrUpdateParameters.js new file mode 100644 index 0000000000..ebed49622d --- /dev/null +++ b/lib/services/automationManagement/lib/models/sourceControlCreateOrUpdateParameters.js @@ -0,0 +1,132 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The parameters supplied to the create or update source control operation. + * + */ +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} [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. + */ + constructor() { + } + + /** + * Defines the metadata of SourceControlCreateOrUpdateParameters + * + * @returns {object} metadata of SourceControlCreateOrUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceControlCreateOrUpdateParameters', + type: { + name: 'Composite', + className: 'SourceControlCreateOrUpdateParameters', + modelProperties: { + repoUrl: { + required: false, + serializedName: 'properties.repoUrl', + constraints: { + MaxLength: 2000 + }, + type: { + name: 'String' + } + }, + branch: { + required: false, + serializedName: 'properties.branch', + constraints: { + MaxLength: 255 + }, + type: { + name: 'String' + } + }, + folderPath: { + required: false, + serializedName: 'properties.folderPath', + constraints: { + MaxLength: 255 + }, + type: { + name: 'String' + } + }, + autoSync: { + required: false, + serializedName: 'properties.autoSync', + type: { + name: 'Boolean' + } + }, + publishRunbook: { + required: false, + serializedName: 'properties.publishRunbook', + type: { + name: 'Boolean' + } + }, + sourceType: { + required: false, + serializedName: 'properties.sourceType', + type: { + name: 'String' + } + }, + securityToken: { + required: false, + serializedName: 'properties.securityToken', + constraints: { + MaxLength: 1024 + }, + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'properties.description', + constraints: { + MaxLength: 512 + }, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceControlCreateOrUpdateParameters; diff --git a/lib/services/automationManagement/lib/models/sourceControlListResult.js b/lib/services/automationManagement/lib/models/sourceControlListResult.js new file mode 100644 index 0000000000..18028ab656 --- /dev/null +++ b/lib/services/automationManagement/lib/models/sourceControlListResult.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The response model for the list source controls operation. + */ +class SourceControlListResult extends Array { + /** + * Create a SourceControlListResult. + * @member {string} [nextLink] Gets or sets the next link. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SourceControlListResult + * + * @returns {object} metadata of SourceControlListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceControlListResult', + type: { + name: 'Composite', + className: 'SourceControlListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SourceControlElementType', + type: { + name: 'Composite', + className: 'SourceControl' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceControlListResult; diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJob.js b/lib/services/automationManagement/lib/models/sourceControlSyncJob.js new file mode 100644 index 0000000000..77494ea6a2 --- /dev/null +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJob.js @@ -0,0 +1,124 @@ +/* + * 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'; + +/** + * Definition of the source control sync job. + * + */ +class SourceControlSyncJob { + /** + * Create a SourceControlSyncJob. + * @member {string} [name] Resource name. + * @member {string} [type] Resource type. + * @member {string} [id] Resource id. + * @member {string} [sourceControlSyncJobId] 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} [startedBy] Gets the user who started the sync job. + */ + constructor() { + } + + /** + * Defines the metadata of SourceControlSyncJob + * + * @returns {object} metadata of SourceControlSyncJob + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceControlSyncJob', + type: { + name: 'Composite', + className: 'SourceControlSyncJob', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + sourceControlSyncJobId: { + required: false, + serializedName: 'properties.sourceControlSyncJobId', + type: { + name: 'String' + } + }, + creationTime: { + required: false, + readOnly: true, + serializedName: 'properties.creationTime', + type: { + name: 'DateTime' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + readOnly: true, + serializedName: 'properties.endTime', + type: { + name: 'DateTime' + } + }, + startedBy: { + required: false, + serializedName: 'properties.startedBy', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceControlSyncJob; diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJobById.js b/lib/services/automationManagement/lib/models/sourceControlSyncJobById.js new file mode 100644 index 0000000000..5936289484 --- /dev/null +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobById.js @@ -0,0 +1,118 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Definition of the source control sync job. + * + */ +class SourceControlSyncJobById { + /** + * Create a SourceControlSyncJobById. + * @member {string} [id] Gets the id of the job. + * @member {string} [sourceControlSyncJobId] 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} [startedBy] Gets the user who started the sync job. + * @member {object} [errors] Error details of the source control sync job. + * @member {string} [errors.code] Gets the error code for the job. + * @member {string} [errors.message] Gets the error message for the job. + */ + constructor() { + } + + /** + * Defines the metadata of SourceControlSyncJobById + * + * @returns {object} metadata of SourceControlSyncJobById + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceControlSyncJobById', + type: { + name: 'Composite', + className: 'SourceControlSyncJobById', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + sourceControlSyncJobId: { + required: false, + serializedName: 'properties.sourceControlSyncJobId', + type: { + name: 'String' + } + }, + creationTime: { + required: false, + readOnly: true, + serializedName: 'properties.creationTime', + type: { + name: 'DateTime' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + readOnly: true, + serializedName: 'properties.endTime', + type: { + name: 'DateTime' + } + }, + startedBy: { + required: false, + serializedName: 'properties.startedBy', + type: { + name: 'String' + } + }, + errors: { + required: false, + serializedName: 'properties.errors', + type: { + name: 'Composite', + className: 'SourceControlSyncJobByIdErrors' + } + } + } + } + }; + } +} + +module.exports = SourceControlSyncJobById; diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJobByIdErrors.js b/lib/services/automationManagement/lib/models/sourceControlSyncJobByIdErrors.js new file mode 100644 index 0000000000..94a8ee52d0 --- /dev/null +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobByIdErrors.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Error details of the source control sync job. + * + */ +class SourceControlSyncJobByIdErrors { + /** + * Create a SourceControlSyncJobByIdErrors. + * @member {string} [code] Gets the error code for the job. + * @member {string} [message] Gets the error message for the job. + */ + constructor() { + } + + /** + * Defines the metadata of SourceControlSyncJobByIdErrors + * + * @returns {object} metadata of SourceControlSyncJobByIdErrors + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceControlSyncJobByIdErrors', + type: { + name: 'Composite', + className: 'SourceControlSyncJobByIdErrors', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceControlSyncJobByIdErrors; diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJobListResult.js b/lib/services/automationManagement/lib/models/sourceControlSyncJobListResult.js new file mode 100644 index 0000000000..328361f520 --- /dev/null +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobListResult.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The response model for the list source control sync jobs operation. + */ +class SourceControlSyncJobListResult extends Array { + /** + * Create a SourceControlSyncJobListResult. + * @member {string} [nextLink] Gets or sets the next link. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SourceControlSyncJobListResult + * + * @returns {object} metadata of SourceControlSyncJobListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceControlSyncJobListResult', + type: { + name: 'Composite', + className: 'SourceControlSyncJobListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SourceControlSyncJobElementType', + type: { + name: 'Composite', + className: 'SourceControlSyncJob' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceControlSyncJobListResult; diff --git a/lib/services/automationManagement/lib/models/sourceControlUpdateParameters.js b/lib/services/automationManagement/lib/models/sourceControlUpdateParameters.js new file mode 100644 index 0000000000..bd0062ebd6 --- /dev/null +++ b/lib/services/automationManagement/lib/models/sourceControlUpdateParameters.js @@ -0,0 +1,98 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The parameters supplied to the update source control operation. + * + */ +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. + */ + constructor() { + } + + /** + * Defines the metadata of SourceControlUpdateParameters + * + * @returns {object} metadata of SourceControlUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceControlUpdateParameters', + type: { + name: 'Composite', + className: 'SourceControlUpdateParameters', + modelProperties: { + branch: { + required: false, + serializedName: 'properties.branch', + type: { + name: 'String' + } + }, + folderPath: { + required: false, + serializedName: 'properties.folderPath', + type: { + name: 'String' + } + }, + autoSync: { + required: false, + serializedName: 'properties.autoSync', + type: { + name: 'Boolean' + } + }, + publishRunbook: { + required: false, + serializedName: 'properties.publishRunbook', + type: { + name: 'Boolean' + } + }, + securityToken: { + required: false, + serializedName: 'properties.securityToken', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceControlUpdateParameters; diff --git a/lib/services/automationManagement/lib/models/testJob.js b/lib/services/automationManagement/lib/models/testJob.js index ce4b2de4b2..5dfc6c310a 100644 --- a/lib/services/automationManagement/lib/models/testJob.js +++ b/lib/services/automationManagement/lib/models/testJob.js @@ -32,6 +32,8 @@ class TestJob { * @member {date} [lastStatusModifiedTime] Gets or sets the last status * modified time of the test job. * @member {object} [parameters] Gets or sets the parameters of the test job. + * @member {number} [logActivityTrace] The activity-level tracing options of + * the runbook. */ constructor() { } @@ -126,6 +128,13 @@ class TestJob { } } } + }, + logActivityTrace: { + required: false, + serializedName: 'logActivityTrace', + type: { + name: 'Number' + } } } } diff --git a/lib/services/automationManagement/lib/models/testJobCreateParameters.js b/lib/services/automationManagement/lib/models/testJobCreateParameters.js index 82eabcba96..23468ce8fd 100644 --- a/lib/services/automationManagement/lib/models/testJobCreateParameters.js +++ b/lib/services/automationManagement/lib/models/testJobCreateParameters.js @@ -17,7 +17,6 @@ class TestJobCreateParameters { /** * Create a TestJobCreateParameters. - * @member {string} runbookName Gets or sets the runbook name. * @member {object} [parameters] Gets or sets the parameters of the test job. * @member {string} [runOn] Gets or sets the runOn which specifies the group * name where the job is to be executed. @@ -39,13 +38,6 @@ class TestJobCreateParameters { name: 'Composite', className: 'TestJobCreateParameters', modelProperties: { - runbookName: { - required: true, - serializedName: 'runbookName', - type: { - name: 'String' - } - }, parameters: { required: false, serializedName: 'parameters', diff --git a/lib/services/automationManagement/lib/models/updateConfiguration.js b/lib/services/automationManagement/lib/models/updateConfiguration.js new file mode 100644 index 0000000000..49842befcc --- /dev/null +++ b/lib/services/automationManagement/lib/models/updateConfiguration.js @@ -0,0 +1,128 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Update specifc properties of the software update configuration. + * + */ +class UpdateConfiguration { + /** + * Create a UpdateConfiguration. + * @member {string} operatingSystem operating system of target machines. + * Possible values include: 'Windows', 'Linux' + * @member {object} [windows] Windows specific update configuration. + * @member {string} [windows.includedUpdateClassifications] Update + * classification included in the software update configuration. A comma + * separated string with required values. Possible values include: + * 'Unclassified', 'Critical', 'Security', 'UpdateRollup', 'FeaturePack', + * 'ServicePack', 'Definition', 'Tools', 'Updates' + * @member {array} [windows.excludedKbNumbers] KB numbers excluded from the + * software update configuration. + * @member {object} [linux] Linux specific update configuration. + * @member {string} [linux.includedPackageClassifications] Update + * classifications included in the software update configuration. Possible + * values include: 'Unclassified', 'Critical', 'Security', 'Other' + * @member {array} [linux.excludedPackageNameMasks] packages excluded from + * the software update configuration. + * @member {moment.duration} [duration] Maximum time allowed for the software + * update configuration run. Duration needs to be specified using the format + * PT[n]H[n]M[n]S as per ISO8601 + * @member {array} [azureVirtualMachines] List of azure resource Ids for + * azure virtual machines targeted by the software update configuration. + * @member {array} [nonAzureComputerNames] List of names of non-azure + * machines targeted by the software update configuration. + */ + constructor() { + } + + /** + * Defines the metadata of UpdateConfiguration + * + * @returns {object} metadata of UpdateConfiguration + * + */ + mapper() { + return { + required: false, + serializedName: 'updateConfiguration', + type: { + name: 'Composite', + className: 'UpdateConfiguration', + modelProperties: { + operatingSystem: { + required: true, + serializedName: 'operatingSystem', + type: { + name: 'Enum', + allowedValues: [ 'Windows', 'Linux' ] + } + }, + windows: { + required: false, + serializedName: 'windows', + type: { + name: 'Composite', + className: 'WindowsProperties' + } + }, + linux: { + required: false, + serializedName: 'linux', + type: { + name: 'Composite', + className: 'LinuxProperties' + } + }, + duration: { + required: false, + serializedName: 'duration', + type: { + name: 'TimeSpan' + } + }, + azureVirtualMachines: { + required: false, + serializedName: 'azureVirtualMachines', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + nonAzureComputerNames: { + required: false, + serializedName: 'nonAzureComputerNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = UpdateConfiguration; diff --git a/lib/services/automationManagement/lib/models/updateConfigurationNavigation.js b/lib/services/automationManagement/lib/models/updateConfigurationNavigation.js new file mode 100644 index 0000000000..0b35837171 --- /dev/null +++ b/lib/services/automationManagement/lib/models/updateConfigurationNavigation.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Software update configuration Run Navigation model. + * + */ +class UpdateConfigurationNavigation { + /** + * Create a UpdateConfigurationNavigation. + * @member {string} [name] Name of the software update configuration + * triggered the software update configuration run + */ + constructor() { + } + + /** + * Defines the metadata of UpdateConfigurationNavigation + * + * @returns {object} metadata of UpdateConfigurationNavigation + * + */ + mapper() { + return { + required: false, + serializedName: 'updateConfigurationNavigation', + type: { + name: 'Composite', + className: 'UpdateConfigurationNavigation', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = UpdateConfigurationNavigation; diff --git a/lib/services/automationManagement/lib/models/variable.js b/lib/services/automationManagement/lib/models/variable.js index 15cecf4457..192421272a 100644 --- a/lib/services/automationManagement/lib/models/variable.js +++ b/lib/services/automationManagement/lib/models/variable.js @@ -10,15 +10,19 @@ 'use strict'; +const models = require('./index'); + /** * Definition of the varible. * + * @extends models['BaseResource'] */ -class Variable { +class Variable extends models['BaseResource'] { /** * Create a Variable. - * @member {string} [id] Gets or sets the id of the resource. - * @member {string} [name] Gets or sets the name of the variable. + * @member {string} [id] Gets the id of the resource. + * @member {string} [name] Gets the name of the variable. + * @member {string} [type] Resource type * @member {string} [value] Gets or sets the value of the variable. * @member {boolean} [isEncrypted] Gets or sets the encrypted flag of the * variable. @@ -27,6 +31,7 @@ class Variable { * @member {string} [description] Gets or sets the description. */ constructor() { + super(); } /** @@ -45,6 +50,7 @@ class Variable { modelProperties: { id: { required: false, + readOnly: true, serializedName: 'id', type: { name: 'String' @@ -52,11 +58,20 @@ class Variable { }, name: { required: false, + readOnly: true, serializedName: 'name', type: { name: 'String' } }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, value: { required: false, serializedName: 'properties.value', diff --git a/lib/services/automationManagement/lib/models/variableUpdateParameters.js b/lib/services/automationManagement/lib/models/variableUpdateParameters.js index 14a64e03fa..d81497a7fe 100644 --- a/lib/services/automationManagement/lib/models/variableUpdateParameters.js +++ b/lib/services/automationManagement/lib/models/variableUpdateParameters.js @@ -17,7 +17,7 @@ class VariableUpdateParameters { /** * Create a VariableUpdateParameters. - * @member {string} name Gets or sets the name of the variable. + * @member {string} [name] Gets or sets the name of the variable. * @member {string} [value] Gets or sets the value of the variable. * @member {string} [description] Gets or sets the description of the * variable. @@ -40,7 +40,7 @@ class VariableUpdateParameters { className: 'VariableUpdateParameters', modelProperties: { name: { - required: true, + required: false, serializedName: 'name', type: { name: 'String' diff --git a/lib/services/automationManagement/lib/models/webhook.js b/lib/services/automationManagement/lib/models/webhook.js index 8c67739dfe..8f6f569ec5 100644 --- a/lib/services/automationManagement/lib/models/webhook.js +++ b/lib/services/automationManagement/lib/models/webhook.js @@ -15,12 +15,14 @@ const models = require('./index'); /** * Definition of the webhook type. * + * @extends models['BaseResource'] */ -class Webhook { +class Webhook extends models['BaseResource'] { /** * Create a Webhook. - * @member {string} [id] Gets or sets the id of the resource. - * @member {string} [name] Gets or sets the name of the webhook. + * @member {string} [id] Gets the id of the resource. + * @member {string} [name] Gets the name of the webhook. + * @member {string} [type] Gets the type of the resource. * @member {boolean} [isEnabled] Gets or sets the value of the enabled flag * of the webhook. Default value: false . * @member {string} [uri] Gets or sets the webhook uri. @@ -38,6 +40,7 @@ class Webhook { * @member {string} [description] Gets or sets the description. */ constructor() { + super(); } /** @@ -56,6 +59,7 @@ class Webhook { modelProperties: { id: { required: false, + readOnly: true, serializedName: 'id', type: { name: 'String' @@ -63,11 +67,20 @@ class Webhook { }, name: { required: false, + readOnly: true, serializedName: 'name', type: { name: 'String' } }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, isEnabled: { required: false, serializedName: 'properties.isEnabled', diff --git a/lib/services/automationManagement/lib/models/webhookUpdateParameters.js b/lib/services/automationManagement/lib/models/webhookUpdateParameters.js index 689df09516..99d7772239 100644 --- a/lib/services/automationManagement/lib/models/webhookUpdateParameters.js +++ b/lib/services/automationManagement/lib/models/webhookUpdateParameters.js @@ -17,7 +17,7 @@ class WebhookUpdateParameters { /** * Create a WebhookUpdateParameters. - * @member {string} name Gets or sets the name of the webhook. + * @member {string} [name] Gets or sets the name of the webhook. * @member {boolean} [isEnabled] Gets or sets the value of the enabled flag * of webhook. * @member {string} [runOn] Gets or sets the name of the hybrid worker group @@ -44,7 +44,7 @@ class WebhookUpdateParameters { className: 'WebhookUpdateParameters', modelProperties: { name: { - required: true, + required: false, serializedName: 'name', type: { name: 'String' diff --git a/lib/services/automationManagement/lib/models/windowsProperties.js b/lib/services/automationManagement/lib/models/windowsProperties.js new file mode 100644 index 0000000000..d58407607d --- /dev/null +++ b/lib/services/automationManagement/lib/models/windowsProperties.js @@ -0,0 +1,72 @@ +/* + * 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'; + +/** + * Windows specific update configuration. + * + */ +class WindowsProperties { + /** + * Create a WindowsProperties. + * @member {string} [includedUpdateClassifications] Update classification + * included in the software update configuration. A comma separated string + * with required values. Possible values include: 'Unclassified', 'Critical', + * 'Security', 'UpdateRollup', 'FeaturePack', 'ServicePack', 'Definition', + * 'Tools', 'Updates' + * @member {array} [excludedKbNumbers] KB numbers excluded from the software + * update configuration. + */ + constructor() { + } + + /** + * Defines the metadata of WindowsProperties + * + * @returns {object} metadata of WindowsProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'WindowsProperties', + type: { + name: 'Composite', + className: 'WindowsProperties', + modelProperties: { + includedUpdateClassifications: { + required: false, + serializedName: 'includedUpdateClassifications', + type: { + name: 'String' + } + }, + excludedKbNumbers: { + required: false, + serializedName: 'excludedKbNumbers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = WindowsProperties; diff --git a/lib/services/automationManagement/lib/operations/activityOperations.js b/lib/services/automationManagement/lib/operations/activityOperations.js index 7745455e88..4a5bc93aa6 100644 --- a/lib/services/automationManagement/lib/operations/activityOperations.js +++ b/lib/services/automationManagement/lib/operations/activityOperations.js @@ -18,8 +18,6 @@ const WebResource = msRest.WebResource; * Retrieve the activity in the module identified by module name and activity * name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -44,7 +42,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, moduleName, activityName, options, callback) { +function _get(automationAccountName, moduleName, activityName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54,15 +52,16 @@ function _get(resourceGroupName, automationAccountName, moduleName, activityName if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -77,9 +76,6 @@ function _get(resourceGroupName, automationAccountName, moduleName, activityName 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -90,13 +86,13 @@ function _get(resourceGroupName, automationAccountName, moduleName, activityName // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities/{activityName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{moduleName}', encodeURIComponent(moduleName)); requestUrl = requestUrl.replace('{activityName}', encodeURIComponent(activityName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -182,8 +178,6 @@ function _get(resourceGroupName, automationAccountName, moduleName, activityName /** * Retrieve a list of activities in the module identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -206,7 +200,7 @@ function _get(resourceGroupName, automationAccountName, moduleName, activityName * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByModule(resourceGroupName, automationAccountName, moduleName, options, callback) { +function _listByModule(automationAccountName, moduleName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -216,15 +210,16 @@ function _listByModule(resourceGroupName, automationAccountName, moduleName, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -236,9 +231,6 @@ function _listByModule(resourceGroupName, automationAccountName, moduleName, opt 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -249,12 +241,12 @@ function _listByModule(resourceGroupName, automationAccountName, moduleName, opt // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/activities'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{moduleName}', encodeURIComponent(moduleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -482,8 +474,6 @@ class ActivityOperations { * Retrieve the activity in the module identified by module name and activity * name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -501,11 +491,11 @@ class ActivityOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, moduleName, activityName, options) { + getWithHttpOperationResponse(automationAccountName, moduleName, activityName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, moduleName, activityName, options, (err, result, request, response) => { + self._get(automationAccountName, moduleName, activityName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -519,8 +509,6 @@ class ActivityOperations { * Retrieve the activity in the module identified by module name and activity * name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -554,7 +542,7 @@ class ActivityOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, moduleName, activityName, options, optionalCallback) { + get(automationAccountName, moduleName, activityName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -563,22 +551,20 @@ class ActivityOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, moduleName, activityName, options, (err, result, request, response) => { + self._get(automationAccountName, moduleName, activityName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, moduleName, activityName, options, optionalCallback); + return self._get(automationAccountName, moduleName, activityName, options, optionalCallback); } } /** * Retrieve a list of activities in the module identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -594,11 +580,11 @@ class ActivityOperations { * * @reject {Error} - The error object. */ - listByModuleWithHttpOperationResponse(resourceGroupName, automationAccountName, moduleName, options) { + listByModuleWithHttpOperationResponse(automationAccountName, moduleName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByModule(resourceGroupName, automationAccountName, moduleName, options, (err, result, request, response) => { + self._listByModule(automationAccountName, moduleName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -611,8 +597,6 @@ class ActivityOperations { /** * Retrieve a list of activities in the module identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -644,7 +628,7 @@ class ActivityOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByModule(resourceGroupName, automationAccountName, moduleName, options, optionalCallback) { + listByModule(automationAccountName, moduleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -653,14 +637,14 @@ class ActivityOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByModule(resourceGroupName, automationAccountName, moduleName, options, (err, result, request, response) => { + self._listByModule(automationAccountName, moduleName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByModule(resourceGroupName, automationAccountName, moduleName, options, optionalCallback); + return self._listByModule(automationAccountName, moduleName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/agentRegistrationInformation.js b/lib/services/automationManagement/lib/operations/agentRegistrationInformation.js index d772297337..c16cca7b04 100644 --- a/lib/services/automationManagement/lib/operations/agentRegistrationInformation.js +++ b/lib/services/automationManagement/lib/operations/agentRegistrationInformation.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Retrieve the automation agent registration information. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -39,7 +37,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, options, callback) { +function _get(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -49,15 +47,16 @@ function _get(resourceGroupName, automationAccountName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -66,9 +65,6 @@ function _get(resourceGroupName, automationAccountName, options, callback) { 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -79,11 +75,11 @@ function _get(resourceGroupName, automationAccountName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -169,15 +165,13 @@ function _get(resourceGroupName, automationAccountName, options, callback) { /** * Regenerate a primary or secondary agent registration key * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} parameters The name of the agent registration key to be * regenerated * * @param {string} parameters.keyName Gets or sets the agent registration key - * name - Primary or Secondary. Possible values include: 'Primary', 'Secondary' + * name - primary or secondary. Possible values include: 'primary', 'secondary' * * @param {string} [parameters.name] Gets or sets the name of the resource. * @@ -205,7 +199,7 @@ function _get(resourceGroupName, automationAccountName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _regenerateKey(resourceGroupName, automationAccountName, parameters, options, callback) { +function _regenerateKey(automationAccountName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -215,15 +209,16 @@ function _regenerateKey(resourceGroupName, automationAccountName, parameters, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -235,9 +230,6 @@ function _regenerateKey(resourceGroupName, automationAccountName, parameters, op 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -248,11 +240,11 @@ function _regenerateKey(resourceGroupName, automationAccountName, parameters, op // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/agentRegistrationInformation/regenerateKey'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -364,8 +356,6 @@ class AgentRegistrationInformation { /** * Retrieve the automation agent registration information. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -379,11 +369,11 @@ class AgentRegistrationInformation { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + getWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._get(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -396,8 +386,6 @@ class AgentRegistrationInformation { /** * Retrieve the automation agent registration information. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -427,7 +415,7 @@ class AgentRegistrationInformation { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, options, optionalCallback) { + get(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -436,29 +424,27 @@ class AgentRegistrationInformation { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._get(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, options, optionalCallback); + return self._get(automationAccountName, options, optionalCallback); } } /** * Regenerate a primary or secondary agent registration key * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} parameters The name of the agent registration key to be * regenerated * * @param {string} parameters.keyName Gets or sets the agent registration key - * name - Primary or Secondary. Possible values include: 'Primary', 'Secondary' + * name - primary or secondary. Possible values include: 'primary', 'secondary' * * @param {string} [parameters.name] Gets or sets the name of the resource. * @@ -479,11 +465,11 @@ class AgentRegistrationInformation { * * @reject {Error} - The error object. */ - regenerateKeyWithHttpOperationResponse(resourceGroupName, automationAccountName, parameters, options) { + regenerateKeyWithHttpOperationResponse(automationAccountName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._regenerateKey(resourceGroupName, automationAccountName, parameters, options, (err, result, request, response) => { + self._regenerateKey(automationAccountName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -496,15 +482,13 @@ class AgentRegistrationInformation { /** * Regenerate a primary or secondary agent registration key * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} parameters The name of the agent registration key to be * regenerated * * @param {string} parameters.keyName Gets or sets the agent registration key - * name - Primary or Secondary. Possible values include: 'Primary', 'Secondary' + * name - primary or secondary. Possible values include: 'primary', 'secondary' * * @param {string} [parameters.name] Gets or sets the name of the resource. * @@ -541,7 +525,7 @@ class AgentRegistrationInformation { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - regenerateKey(resourceGroupName, automationAccountName, parameters, options, optionalCallback) { + regenerateKey(automationAccountName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -550,14 +534,14 @@ class AgentRegistrationInformation { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._regenerateKey(resourceGroupName, automationAccountName, parameters, options, (err, result, request, response) => { + self._regenerateKey(automationAccountName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._regenerateKey(resourceGroupName, automationAccountName, parameters, options, optionalCallback); + return self._regenerateKey(automationAccountName, parameters, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/automationAccountOperations.js b/lib/services/automationManagement/lib/operations/automationAccountOperations.js index e7b24e4893..a35d725c5a 100644 --- a/lib/services/automationManagement/lib/operations/automationAccountOperations.js +++ b/lib/services/automationManagement/lib/operations/automationAccountOperations.js @@ -69,6 +69,7 @@ function _update(resourceGroupName, automationAccountName, parameters, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -89,9 +90,6 @@ function _update(resourceGroupName, automationAccountName, parameters, options, 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -106,7 +104,7 @@ function _update(resourceGroupName, automationAccountName, parameters, options, requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -259,6 +257,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -279,9 +278,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, parameters, o 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -296,7 +292,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, parameters, o requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -342,7 +338,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, parameters, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -372,7 +368,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, parameters, o let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -389,7 +385,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, parameters, o } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -444,6 +440,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -461,9 +458,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, options, callba 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -478,7 +472,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, options, callba requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -579,6 +573,7 @@ function _get(resourceGroupName, automationAccountName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -596,9 +591,6 @@ function _get(resourceGroupName, automationAccountName, options, callback) { 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -613,7 +605,7 @@ function _get(resourceGroupName, automationAccountName, options, callback) { requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -730,6 +722,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -744,9 +737,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -760,7 +750,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -877,14 +867,12 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -897,7 +885,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Automation/automationAccounts'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/automationManagement/lib/operations/certificateOperations.js b/lib/services/automationManagement/lib/operations/certificateOperations.js index 3023bbdcc3..85dd4c0f19 100644 --- a/lib/services/automationManagement/lib/operations/certificateOperations.js +++ b/lib/services/automationManagement/lib/operations/certificateOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Delete the certificate. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The name of certificate. @@ -40,7 +38,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, automationAccountName, certificateName, options, callback) { +function _deleteMethod(automationAccountName, certificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50,15 +48,16 @@ function _deleteMethod(resourceGroupName, automationAccountName, certificateName if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -70,9 +69,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, certificateName 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -83,12 +79,12 @@ function _deleteMethod(resourceGroupName, automationAccountName, certificateName // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{certificateName}', encodeURIComponent(certificateName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -157,8 +153,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, certificateName /** * Retrieve the certificate identified by certificate name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The name of certificate. @@ -181,7 +175,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, certificateName * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, certificateName, options, callback) { +function _get(automationAccountName, certificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -191,15 +185,16 @@ function _get(resourceGroupName, automationAccountName, certificateName, options if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -211,9 +206,6 @@ function _get(resourceGroupName, automationAccountName, certificateName, options 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -224,12 +216,12 @@ function _get(resourceGroupName, automationAccountName, certificateName, options // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{certificateName}', encodeURIComponent(certificateName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -315,8 +307,6 @@ function _get(resourceGroupName, automationAccountName, certificateName, options /** * Create a certificate. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The parameters supplied to the create or @@ -357,7 +347,7 @@ function _get(resourceGroupName, automationAccountName, certificateName, options * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, automationAccountName, certificateName, parameters, options, callback) { +function _createOrUpdate(automationAccountName, certificateName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -367,15 +357,16 @@ function _createOrUpdate(resourceGroupName, automationAccountName, certificateNa if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -390,9 +381,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, certificateNa 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -403,12 +391,12 @@ function _createOrUpdate(resourceGroupName, automationAccountName, certificateNa // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{certificateName}', encodeURIComponent(certificateName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -454,7 +442,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, certificateNa return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -484,7 +472,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, certificateNa let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -501,7 +489,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, certificateNa } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -525,8 +513,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, certificateNa /** * Update a certificate. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The parameters supplied to the update @@ -535,7 +521,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, certificateNa * @param {object} parameters The parameters supplied to the update certificate * operation. * - * @param {string} parameters.name Gets or sets the name of the certificate. + * @param {string} [parameters.name] Gets or sets the name of the certificate. * * @param {string} [parameters.description] Gets or sets the description of the * certificate. @@ -558,7 +544,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, certificateNa * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _update(resourceGroupName, automationAccountName, certificateName, parameters, options, callback) { +function _update(automationAccountName, certificateName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -568,15 +554,16 @@ function _update(resourceGroupName, automationAccountName, certificateName, para if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -591,9 +578,6 @@ function _update(resourceGroupName, automationAccountName, certificateName, para 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -604,12 +588,12 @@ function _update(resourceGroupName, automationAccountName, certificateName, para // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates/{certificateName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{certificateName}', encodeURIComponent(certificateName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -709,8 +693,6 @@ function _update(resourceGroupName, automationAccountName, certificateName, para /** * Retrieve a list of certificates. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -731,7 +713,7 @@ function _update(resourceGroupName, automationAccountName, certificateName, para * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { +function _listByAutomationAccount(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -741,15 +723,16 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -758,9 +741,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -771,11 +751,11 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/certificates'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1005,8 +985,6 @@ class CertificateOperations { /** * Delete the certificate. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The name of certificate. @@ -1022,11 +1000,11 @@ class CertificateOperations { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, certificateName, options) { + deleteMethodWithHttpOperationResponse(automationAccountName, certificateName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, certificateName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, certificateName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1039,8 +1017,6 @@ class CertificateOperations { /** * Delete the certificate. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The name of certificate. @@ -1071,7 +1047,7 @@ class CertificateOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, automationAccountName, certificateName, options, optionalCallback) { + deleteMethod(automationAccountName, certificateName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1080,22 +1056,20 @@ class CertificateOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, certificateName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, certificateName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, automationAccountName, certificateName, options, optionalCallback); + return self._deleteMethod(automationAccountName, certificateName, options, optionalCallback); } } /** * Retrieve the certificate identified by certificate name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The name of certificate. @@ -1111,11 +1085,11 @@ class CertificateOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, certificateName, options) { + getWithHttpOperationResponse(automationAccountName, certificateName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, certificateName, options, (err, result, request, response) => { + self._get(automationAccountName, certificateName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1128,8 +1102,6 @@ class CertificateOperations { /** * Retrieve the certificate identified by certificate name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The name of certificate. @@ -1161,7 +1133,7 @@ class CertificateOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, certificateName, options, optionalCallback) { + get(automationAccountName, certificateName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1170,22 +1142,20 @@ class CertificateOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, certificateName, options, (err, result, request, response) => { + self._get(automationAccountName, certificateName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, certificateName, options, optionalCallback); + return self._get(automationAccountName, certificateName, options, optionalCallback); } } /** * Create a certificate. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The parameters supplied to the create or @@ -1219,11 +1189,11 @@ class CertificateOperations { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, automationAccountName, certificateName, parameters, options) { + createOrUpdateWithHttpOperationResponse(automationAccountName, certificateName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, certificateName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, certificateName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1236,8 +1206,6 @@ class CertificateOperations { /** * Create a certificate. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The parameters supplied to the create or @@ -1287,7 +1255,7 @@ class CertificateOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, automationAccountName, certificateName, parameters, options, optionalCallback) { + createOrUpdate(automationAccountName, certificateName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1296,22 +1264,20 @@ class CertificateOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, certificateName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, certificateName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, automationAccountName, certificateName, parameters, options, optionalCallback); + return self._createOrUpdate(automationAccountName, certificateName, parameters, options, optionalCallback); } } /** * Update a certificate. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The parameters supplied to the update @@ -1320,7 +1286,7 @@ class CertificateOperations { * @param {object} parameters The parameters supplied to the update certificate * operation. * - * @param {string} parameters.name Gets or sets the name of the certificate. + * @param {string} [parameters.name] Gets or sets the name of the certificate. * * @param {string} [parameters.description] Gets or sets the description of the * certificate. @@ -1336,11 +1302,11 @@ class CertificateOperations { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, automationAccountName, certificateName, parameters, options) { + updateWithHttpOperationResponse(automationAccountName, certificateName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, certificateName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, certificateName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1353,8 +1319,6 @@ class CertificateOperations { /** * Update a certificate. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The parameters supplied to the update @@ -1363,7 +1327,7 @@ class CertificateOperations { * @param {object} parameters The parameters supplied to the update certificate * operation. * - * @param {string} parameters.name Gets or sets the name of the certificate. + * @param {string} [parameters.name] Gets or sets the name of the certificate. * * @param {string} [parameters.description] Gets or sets the description of the * certificate. @@ -1395,7 +1359,7 @@ class CertificateOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, automationAccountName, certificateName, parameters, options, optionalCallback) { + update(automationAccountName, certificateName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1404,22 +1368,20 @@ class CertificateOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, certificateName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, certificateName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, automationAccountName, certificateName, parameters, options, optionalCallback); + return self._update(automationAccountName, certificateName, parameters, options, optionalCallback); } } /** * Retrieve a list of certificates. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1433,11 +1395,11 @@ class CertificateOperations { * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1450,8 +1412,6 @@ class CertificateOperations { /** * Retrieve a list of certificates. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1481,7 +1441,7 @@ class CertificateOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + listByAutomationAccount(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1490,14 +1450,14 @@ class CertificateOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/connectionOperations.js b/lib/services/automationManagement/lib/operations/connectionOperations.js index 69a0c90857..01927ca169 100644 --- a/lib/services/automationManagement/lib/operations/connectionOperations.js +++ b/lib/services/automationManagement/lib/operations/connectionOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Delete the connection. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The name of connection. @@ -41,7 +39,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, automationAccountName, connectionName, options, callback) { +function _deleteMethod(automationAccountName, connectionName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51,15 +49,16 @@ function _deleteMethod(resourceGroupName, automationAccountName, connectionName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -71,9 +70,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, connectionName, 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -84,12 +80,12 @@ function _deleteMethod(resourceGroupName, automationAccountName, connectionName, // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -175,8 +171,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, connectionName, /** * Retrieve the connection identified by connection name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The name of connection. @@ -199,7 +193,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, connectionName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, connectionName, options, callback) { +function _get(automationAccountName, connectionName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -209,15 +203,16 @@ function _get(resourceGroupName, automationAccountName, connectionName, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -229,9 +224,6 @@ function _get(resourceGroupName, automationAccountName, connectionName, options, 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -242,12 +234,12 @@ function _get(resourceGroupName, automationAccountName, connectionName, options, // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -333,8 +325,6 @@ function _get(resourceGroupName, automationAccountName, connectionName, options, /** * Create or update a connection. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The parameters supplied to the create or @@ -375,7 +365,7 @@ function _get(resourceGroupName, automationAccountName, connectionName, options, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, automationAccountName, connectionName, parameters, options, callback) { +function _createOrUpdate(automationAccountName, connectionName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -385,15 +375,16 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionNam if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -408,9 +399,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionNam 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -421,12 +409,12 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionNam // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -472,7 +460,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionNam return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -502,7 +490,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionNam let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -519,7 +507,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionNam } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -543,8 +531,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionNam /** * Update a connection. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The parameters supplied to the update a @@ -579,7 +565,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionNam * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _update(resourceGroupName, automationAccountName, connectionName, parameters, options, callback) { +function _update(automationAccountName, connectionName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -589,15 +575,16 @@ function _update(resourceGroupName, automationAccountName, connectionName, param if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -612,9 +599,6 @@ function _update(resourceGroupName, automationAccountName, connectionName, param 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -625,12 +609,12 @@ function _update(resourceGroupName, automationAccountName, connectionName, param // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections/{connectionName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{connectionName}', encodeURIComponent(connectionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -730,8 +714,6 @@ function _update(resourceGroupName, automationAccountName, connectionName, param /** * Retrieve a list of connections. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -752,7 +734,7 @@ function _update(resourceGroupName, automationAccountName, connectionName, param * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { +function _listByAutomationAccount(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -762,15 +744,16 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -779,9 +762,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -792,11 +772,11 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connections'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1026,8 +1006,6 @@ class ConnectionOperations { /** * Delete the connection. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The name of connection. @@ -1043,11 +1021,11 @@ class ConnectionOperations { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, connectionName, options) { + deleteMethodWithHttpOperationResponse(automationAccountName, connectionName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, connectionName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, connectionName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1060,8 +1038,6 @@ class ConnectionOperations { /** * Delete the connection. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The name of connection. @@ -1093,7 +1069,7 @@ class ConnectionOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, automationAccountName, connectionName, options, optionalCallback) { + deleteMethod(automationAccountName, connectionName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1102,22 +1078,20 @@ class ConnectionOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, connectionName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, connectionName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, automationAccountName, connectionName, options, optionalCallback); + return self._deleteMethod(automationAccountName, connectionName, options, optionalCallback); } } /** * Retrieve the connection identified by connection name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The name of connection. @@ -1133,11 +1107,11 @@ class ConnectionOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, connectionName, options) { + getWithHttpOperationResponse(automationAccountName, connectionName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, connectionName, options, (err, result, request, response) => { + self._get(automationAccountName, connectionName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1150,8 +1124,6 @@ class ConnectionOperations { /** * Retrieve the connection identified by connection name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The name of connection. @@ -1183,7 +1155,7 @@ class ConnectionOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, connectionName, options, optionalCallback) { + get(automationAccountName, connectionName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1192,22 +1164,20 @@ class ConnectionOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, connectionName, options, (err, result, request, response) => { + self._get(automationAccountName, connectionName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, connectionName, options, optionalCallback); + return self._get(automationAccountName, connectionName, options, optionalCallback); } } /** * Create or update a connection. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The parameters supplied to the create or @@ -1241,11 +1211,11 @@ class ConnectionOperations { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, automationAccountName, connectionName, parameters, options) { + createOrUpdateWithHttpOperationResponse(automationAccountName, connectionName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, connectionName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, connectionName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1258,8 +1228,6 @@ class ConnectionOperations { /** * Create or update a connection. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The parameters supplied to the create or @@ -1309,7 +1277,7 @@ class ConnectionOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, automationAccountName, connectionName, parameters, options, optionalCallback) { + createOrUpdate(automationAccountName, connectionName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1318,22 +1286,20 @@ class ConnectionOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, connectionName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, connectionName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, automationAccountName, connectionName, parameters, options, optionalCallback); + return self._createOrUpdate(automationAccountName, connectionName, parameters, options, optionalCallback); } } /** * Update a connection. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The parameters supplied to the update a @@ -1361,11 +1327,11 @@ class ConnectionOperations { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, automationAccountName, connectionName, parameters, options) { + updateWithHttpOperationResponse(automationAccountName, connectionName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, connectionName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, connectionName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1378,8 +1344,6 @@ class ConnectionOperations { /** * Update a connection. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The parameters supplied to the update a @@ -1423,7 +1387,7 @@ class ConnectionOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, automationAccountName, connectionName, parameters, options, optionalCallback) { + update(automationAccountName, connectionName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1432,22 +1396,20 @@ class ConnectionOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, connectionName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, connectionName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, automationAccountName, connectionName, parameters, options, optionalCallback); + return self._update(automationAccountName, connectionName, parameters, options, optionalCallback); } } /** * Retrieve a list of connections. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1461,11 +1423,11 @@ class ConnectionOperations { * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1478,8 +1440,6 @@ class ConnectionOperations { /** * Retrieve a list of connections. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1509,7 +1469,7 @@ class ConnectionOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + listByAutomationAccount(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1518,14 +1478,14 @@ class ConnectionOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/connectionTypeOperations.js b/lib/services/automationManagement/lib/operations/connectionTypeOperations.js index 462f5136fd..fc53b8f316 100644 --- a/lib/services/automationManagement/lib/operations/connectionTypeOperations.js +++ b/lib/services/automationManagement/lib/operations/connectionTypeOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Delete the connectiontype. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionTypeName The name of connectiontype. @@ -40,7 +38,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, automationAccountName, connectionTypeName, options, callback) { +function _deleteMethod(automationAccountName, connectionTypeName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50,15 +48,16 @@ function _deleteMethod(resourceGroupName, automationAccountName, connectionTypeN if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -70,9 +69,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, connectionTypeN 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -83,12 +79,12 @@ function _deleteMethod(resourceGroupName, automationAccountName, connectionTypeN // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{connectionTypeName}', encodeURIComponent(connectionTypeName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -157,8 +153,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, connectionTypeN /** * Retrieve the connectiontype identified by connectiontype name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionTypeName The name of connectiontype. @@ -181,7 +175,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, connectionTypeN * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, connectionTypeName, options, callback) { +function _get(automationAccountName, connectionTypeName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -191,15 +185,16 @@ function _get(resourceGroupName, automationAccountName, connectionTypeName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -211,9 +206,6 @@ function _get(resourceGroupName, automationAccountName, connectionTypeName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -224,12 +216,12 @@ function _get(resourceGroupName, automationAccountName, connectionTypeName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{connectionTypeName}', encodeURIComponent(connectionTypeName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -315,8 +307,6 @@ function _get(resourceGroupName, automationAccountName, connectionTypeName, opti /** * Create a connectiontype. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionTypeName The parameters supplied to the create or @@ -352,7 +342,7 @@ function _get(resourceGroupName, automationAccountName, connectionTypeName, opti * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, automationAccountName, connectionTypeName, parameters, options, callback) { +function _createOrUpdate(automationAccountName, connectionTypeName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -362,15 +352,16 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionTyp if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -385,9 +376,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionTyp 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -398,12 +386,12 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionTyp // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes/{connectionTypeName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{connectionTypeName}', encodeURIComponent(connectionTypeName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -520,8 +508,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionTyp /** * Retrieve a list of connectiontypes. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -543,7 +529,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, connectionTyp * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { +function _listByAutomationAccount(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -553,15 +539,16 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -570,9 +557,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -583,11 +567,11 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/connectionTypes'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -817,8 +801,6 @@ class ConnectionTypeOperations { /** * Delete the connectiontype. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionTypeName The name of connectiontype. @@ -834,11 +816,11 @@ class ConnectionTypeOperations { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, connectionTypeName, options) { + deleteMethodWithHttpOperationResponse(automationAccountName, connectionTypeName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, connectionTypeName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, connectionTypeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -851,8 +833,6 @@ class ConnectionTypeOperations { /** * Delete the connectiontype. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionTypeName The name of connectiontype. @@ -883,7 +863,7 @@ class ConnectionTypeOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, automationAccountName, connectionTypeName, options, optionalCallback) { + deleteMethod(automationAccountName, connectionTypeName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -892,22 +872,20 @@ class ConnectionTypeOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, connectionTypeName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, connectionTypeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, automationAccountName, connectionTypeName, options, optionalCallback); + return self._deleteMethod(automationAccountName, connectionTypeName, options, optionalCallback); } } /** * Retrieve the connectiontype identified by connectiontype name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionTypeName The name of connectiontype. @@ -923,11 +901,11 @@ class ConnectionTypeOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, connectionTypeName, options) { + getWithHttpOperationResponse(automationAccountName, connectionTypeName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, connectionTypeName, options, (err, result, request, response) => { + self._get(automationAccountName, connectionTypeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -940,8 +918,6 @@ class ConnectionTypeOperations { /** * Retrieve the connectiontype identified by connectiontype name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionTypeName The name of connectiontype. @@ -973,7 +949,7 @@ class ConnectionTypeOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, connectionTypeName, options, optionalCallback) { + get(automationAccountName, connectionTypeName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -982,22 +958,20 @@ class ConnectionTypeOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, connectionTypeName, options, (err, result, request, response) => { + self._get(automationAccountName, connectionTypeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, connectionTypeName, options, optionalCallback); + return self._get(automationAccountName, connectionTypeName, options, optionalCallback); } } /** * Create a connectiontype. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionTypeName The parameters supplied to the create or @@ -1026,11 +1000,11 @@ class ConnectionTypeOperations { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, automationAccountName, connectionTypeName, parameters, options) { + createOrUpdateWithHttpOperationResponse(automationAccountName, connectionTypeName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, connectionTypeName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, connectionTypeName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1043,8 +1017,6 @@ class ConnectionTypeOperations { /** * Create a connectiontype. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionTypeName The parameters supplied to the create or @@ -1089,7 +1061,7 @@ class ConnectionTypeOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, automationAccountName, connectionTypeName, parameters, options, optionalCallback) { + createOrUpdate(automationAccountName, connectionTypeName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1098,22 +1070,20 @@ class ConnectionTypeOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, connectionTypeName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, connectionTypeName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, automationAccountName, connectionTypeName, parameters, options, optionalCallback); + return self._createOrUpdate(automationAccountName, connectionTypeName, parameters, options, optionalCallback); } } /** * Retrieve a list of connectiontypes. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1127,11 +1097,11 @@ class ConnectionTypeOperations { * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1144,8 +1114,6 @@ class ConnectionTypeOperations { /** * Retrieve a list of connectiontypes. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1176,7 +1144,7 @@ class ConnectionTypeOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + listByAutomationAccount(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1185,14 +1153,14 @@ class ConnectionTypeOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/credentialOperations.js b/lib/services/automationManagement/lib/operations/credentialOperations.js index ab79ce8fa1..2f7b0283a0 100644 --- a/lib/services/automationManagement/lib/operations/credentialOperations.js +++ b/lib/services/automationManagement/lib/operations/credentialOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Delete the credential. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The name of credential. @@ -40,7 +38,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, automationAccountName, credentialName, options, callback) { +function _deleteMethod(automationAccountName, credentialName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50,15 +48,16 @@ function _deleteMethod(resourceGroupName, automationAccountName, credentialName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -70,9 +69,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, credentialName, 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -83,12 +79,12 @@ function _deleteMethod(resourceGroupName, automationAccountName, credentialName, // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{credentialName}', encodeURIComponent(credentialName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -157,8 +153,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, credentialName, /** * Retrieve the credential identified by credential name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The name of credential. @@ -181,7 +175,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, credentialName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, credentialName, options, callback) { +function _get(automationAccountName, credentialName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -191,15 +185,16 @@ function _get(resourceGroupName, automationAccountName, credentialName, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -211,9 +206,6 @@ function _get(resourceGroupName, automationAccountName, credentialName, options, 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -224,12 +216,12 @@ function _get(resourceGroupName, automationAccountName, credentialName, options, // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{credentialName}', encodeURIComponent(credentialName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -315,8 +307,6 @@ function _get(resourceGroupName, automationAccountName, credentialName, options, /** * Create a credential. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The parameters supplied to the create or @@ -354,7 +344,7 @@ function _get(resourceGroupName, automationAccountName, credentialName, options, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, automationAccountName, credentialName, parameters, options, callback) { +function _createOrUpdate(automationAccountName, credentialName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -364,15 +354,16 @@ function _createOrUpdate(resourceGroupName, automationAccountName, credentialNam if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -387,9 +378,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, credentialNam 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -400,12 +388,12 @@ function _createOrUpdate(resourceGroupName, automationAccountName, credentialNam // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{credentialName}', encodeURIComponent(credentialName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -451,7 +439,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, credentialNam return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -481,7 +469,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, credentialNam let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -498,7 +486,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, credentialNam } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -522,8 +510,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, credentialNam /** * Update a credential. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The parameters supplied to the Update @@ -532,7 +518,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, credentialNam * @param {object} parameters The parameters supplied to the Update credential * operation. * - * @param {string} parameters.name Gets or sets the name of the credential. + * @param {string} [parameters.name] Gets or sets the name of the credential. * * @param {string} [parameters.userName] Gets or sets the user name of the * credential. @@ -561,7 +547,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, credentialNam * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _update(resourceGroupName, automationAccountName, credentialName, parameters, options, callback) { +function _update(automationAccountName, credentialName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -571,15 +557,16 @@ function _update(resourceGroupName, automationAccountName, credentialName, param if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -594,9 +581,6 @@ function _update(resourceGroupName, automationAccountName, credentialName, param 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -607,12 +591,12 @@ function _update(resourceGroupName, automationAccountName, credentialName, param // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials/{credentialName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{credentialName}', encodeURIComponent(credentialName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -712,8 +696,6 @@ function _update(resourceGroupName, automationAccountName, credentialName, param /** * Retrieve a list of credentials. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -734,7 +716,7 @@ function _update(resourceGroupName, automationAccountName, credentialName, param * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { +function _listByAutomationAccount(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -744,15 +726,16 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -761,9 +744,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -774,11 +754,11 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/credentials'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1006,8 +986,6 @@ class CredentialOperations { /** * Delete the credential. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The name of credential. @@ -1023,11 +1001,11 @@ class CredentialOperations { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, credentialName, options) { + deleteMethodWithHttpOperationResponse(automationAccountName, credentialName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, credentialName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, credentialName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1040,8 +1018,6 @@ class CredentialOperations { /** * Delete the credential. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The name of credential. @@ -1072,7 +1048,7 @@ class CredentialOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, automationAccountName, credentialName, options, optionalCallback) { + deleteMethod(automationAccountName, credentialName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1081,22 +1057,20 @@ class CredentialOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, credentialName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, credentialName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, automationAccountName, credentialName, options, optionalCallback); + return self._deleteMethod(automationAccountName, credentialName, options, optionalCallback); } } /** * Retrieve the credential identified by credential name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The name of credential. @@ -1112,11 +1086,11 @@ class CredentialOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, credentialName, options) { + getWithHttpOperationResponse(automationAccountName, credentialName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, credentialName, options, (err, result, request, response) => { + self._get(automationAccountName, credentialName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1129,8 +1103,6 @@ class CredentialOperations { /** * Retrieve the credential identified by credential name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The name of credential. @@ -1162,7 +1134,7 @@ class CredentialOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, credentialName, options, optionalCallback) { + get(automationAccountName, credentialName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1171,22 +1143,20 @@ class CredentialOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, credentialName, options, (err, result, request, response) => { + self._get(automationAccountName, credentialName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, credentialName, options, optionalCallback); + return self._get(automationAccountName, credentialName, options, optionalCallback); } } /** * Create a credential. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The parameters supplied to the create or @@ -1217,11 +1187,11 @@ class CredentialOperations { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, automationAccountName, credentialName, parameters, options) { + createOrUpdateWithHttpOperationResponse(automationAccountName, credentialName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, credentialName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, credentialName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1234,8 +1204,6 @@ class CredentialOperations { /** * Create a credential. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The parameters supplied to the create or @@ -1282,7 +1250,7 @@ class CredentialOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, automationAccountName, credentialName, parameters, options, optionalCallback) { + createOrUpdate(automationAccountName, credentialName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1291,22 +1259,20 @@ class CredentialOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, credentialName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, credentialName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, automationAccountName, credentialName, parameters, options, optionalCallback); + return self._createOrUpdate(automationAccountName, credentialName, parameters, options, optionalCallback); } } /** * Update a credential. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The parameters supplied to the Update @@ -1315,7 +1281,7 @@ class CredentialOperations { * @param {object} parameters The parameters supplied to the Update credential * operation. * - * @param {string} parameters.name Gets or sets the name of the credential. + * @param {string} [parameters.name] Gets or sets the name of the credential. * * @param {string} [parameters.userName] Gets or sets the user name of the * credential. @@ -1337,11 +1303,11 @@ class CredentialOperations { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, automationAccountName, credentialName, parameters, options) { + updateWithHttpOperationResponse(automationAccountName, credentialName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, credentialName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, credentialName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1354,8 +1320,6 @@ class CredentialOperations { /** * Update a credential. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The parameters supplied to the Update @@ -1364,7 +1328,7 @@ class CredentialOperations { * @param {object} parameters The parameters supplied to the Update credential * operation. * - * @param {string} parameters.name Gets or sets the name of the credential. + * @param {string} [parameters.name] Gets or sets the name of the credential. * * @param {string} [parameters.userName] Gets or sets the user name of the * credential. @@ -1402,7 +1366,7 @@ class CredentialOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, automationAccountName, credentialName, parameters, options, optionalCallback) { + update(automationAccountName, credentialName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1411,22 +1375,20 @@ class CredentialOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, credentialName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, credentialName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, automationAccountName, credentialName, parameters, options, optionalCallback); + return self._update(automationAccountName, credentialName, parameters, options, optionalCallback); } } /** * Retrieve a list of credentials. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1440,11 +1402,11 @@ class CredentialOperations { * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1457,8 +1419,6 @@ class CredentialOperations { /** * Retrieve a list of credentials. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1488,7 +1448,7 @@ class CredentialOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + listByAutomationAccount(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1497,14 +1457,14 @@ class CredentialOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/dscCompilationJobOperations.js b/lib/services/automationManagement/lib/operations/dscCompilationJobOperations.js index 8cb79e5abd..413df5947c 100644 --- a/lib/services/automationManagement/lib/operations/dscCompilationJobOperations.js +++ b/lib/services/automationManagement/lib/operations/dscCompilationJobOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Creates the Dsc compilation job of the configuration. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} compilationJobId The the DSC configuration Id. @@ -34,6 +32,9 @@ const WebResource = msRest.WebResource; * @param {object} [parameters.parameters] Gets or sets the parameters of the * job. * + * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a + * new build version of NodeConfiguration is required. + * * @param {string} [parameters.name] Gets or sets name of the resource. * * @param {string} [parameters.location] Gets or sets the location of the @@ -60,7 +61,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _create(resourceGroupName, automationAccountName, compilationJobId, parameters, options, callback) { +function _create(automationAccountName, compilationJobId, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -70,15 +71,16 @@ function _create(resourceGroupName, automationAccountName, compilationJobId, par if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -93,9 +95,6 @@ function _create(resourceGroupName, automationAccountName, compilationJobId, par 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -106,12 +105,12 @@ function _create(resourceGroupName, automationAccountName, compilationJobId, par // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{compilationJobId}', encodeURIComponent(compilationJobId.toString())); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -211,8 +210,6 @@ function _create(resourceGroupName, automationAccountName, compilationJobId, par /** * Retrieve the Dsc configuration compilation job identified by job id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} compilationJobId The Dsc configuration compilation job id. @@ -235,7 +232,7 @@ function _create(resourceGroupName, automationAccountName, compilationJobId, par * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, compilationJobId, options, callback) { +function _get(automationAccountName, compilationJobId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -245,15 +242,16 @@ function _get(resourceGroupName, automationAccountName, compilationJobId, option if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -265,9 +263,6 @@ function _get(resourceGroupName, automationAccountName, compilationJobId, option 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -278,12 +273,12 @@ function _get(resourceGroupName, automationAccountName, compilationJobId, option // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{compilationJobId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{compilationJobId}', encodeURIComponent(compilationJobId.toString())); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -369,8 +364,6 @@ function _get(resourceGroupName, automationAccountName, compilationJobId, option /** * Retrieve a list of dsc compilation jobs. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -394,7 +387,7 @@ function _get(resourceGroupName, automationAccountName, compilationJobId, option * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { +function _listByAutomationAccount(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -405,15 +398,16 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -425,9 +419,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -438,14 +429,14 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -531,8 +522,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti /** * Retrieve the job stream identified by job stream id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} jobId The job id. @@ -557,7 +546,7 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getStream(resourceGroupName, automationAccountName, jobId, jobStreamId, options, callback) { +function _getStream(automationAccountName, jobId, jobStreamId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -567,15 +556,16 @@ function _getStream(resourceGroupName, automationAccountName, jobId, jobStreamId if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -590,9 +580,6 @@ function _getStream(resourceGroupName, automationAccountName, jobId, jobStreamId 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -603,13 +590,13 @@ function _getStream(resourceGroupName, automationAccountName, jobId, jobStreamId // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/compilationjobs/{jobId}/streams/{jobStreamId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{jobId}', encodeURIComponent(jobId.toString())); requestUrl = requestUrl.replace('{jobStreamId}', encodeURIComponent(jobStreamId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -839,8 +826,6 @@ class DscCompilationJobOperations { /** * Creates the Dsc compilation job of the configuration. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} compilationJobId The the DSC configuration Id. @@ -856,6 +841,9 @@ class DscCompilationJobOperations { * @param {object} [parameters.parameters] Gets or sets the parameters of the * job. * + * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a + * new build version of NodeConfiguration is required. + * * @param {string} [parameters.name] Gets or sets name of the resource. * * @param {string} [parameters.location] Gets or sets the location of the @@ -875,11 +863,11 @@ class DscCompilationJobOperations { * * @reject {Error} - The error object. */ - createWithHttpOperationResponse(resourceGroupName, automationAccountName, compilationJobId, parameters, options) { + createWithHttpOperationResponse(automationAccountName, compilationJobId, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._create(resourceGroupName, automationAccountName, compilationJobId, parameters, options, (err, result, request, response) => { + self._create(automationAccountName, compilationJobId, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -892,8 +880,6 @@ class DscCompilationJobOperations { /** * Creates the Dsc compilation job of the configuration. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} compilationJobId The the DSC configuration Id. @@ -909,6 +895,9 @@ class DscCompilationJobOperations { * @param {object} [parameters.parameters] Gets or sets the parameters of the * job. * + * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a + * new build version of NodeConfiguration is required. + * * @param {string} [parameters.name] Gets or sets name of the resource. * * @param {string} [parameters.location] Gets or sets the location of the @@ -944,7 +933,7 @@ class DscCompilationJobOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - create(resourceGroupName, automationAccountName, compilationJobId, parameters, options, optionalCallback) { + create(automationAccountName, compilationJobId, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -953,22 +942,20 @@ class DscCompilationJobOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._create(resourceGroupName, automationAccountName, compilationJobId, parameters, options, (err, result, request, response) => { + self._create(automationAccountName, compilationJobId, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._create(resourceGroupName, automationAccountName, compilationJobId, parameters, options, optionalCallback); + return self._create(automationAccountName, compilationJobId, parameters, options, optionalCallback); } } /** * Retrieve the Dsc configuration compilation job identified by job id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} compilationJobId The Dsc configuration compilation job id. @@ -984,11 +971,11 @@ class DscCompilationJobOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, compilationJobId, options) { + getWithHttpOperationResponse(automationAccountName, compilationJobId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, compilationJobId, options, (err, result, request, response) => { + self._get(automationAccountName, compilationJobId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1001,8 +988,6 @@ class DscCompilationJobOperations { /** * Retrieve the Dsc configuration compilation job identified by job id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} compilationJobId The Dsc configuration compilation job id. @@ -1034,7 +1019,7 @@ class DscCompilationJobOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, compilationJobId, options, optionalCallback) { + get(automationAccountName, compilationJobId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1043,22 +1028,20 @@ class DscCompilationJobOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, compilationJobId, options, (err, result, request, response) => { + self._get(automationAccountName, compilationJobId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, compilationJobId, options, optionalCallback); + return self._get(automationAccountName, compilationJobId, options, optionalCallback); } } /** * Retrieve a list of dsc compilation jobs. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1074,11 +1057,11 @@ class DscCompilationJobOperations { * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1091,8 +1074,6 @@ class DscCompilationJobOperations { /** * Retrieve a list of dsc compilation jobs. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1125,7 +1106,7 @@ class DscCompilationJobOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + listByAutomationAccount(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1134,22 +1115,20 @@ class DscCompilationJobOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); } } /** * Retrieve the job stream identified by job stream id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} jobId The job id. @@ -1167,11 +1146,11 @@ class DscCompilationJobOperations { * * @reject {Error} - The error object. */ - getStreamWithHttpOperationResponse(resourceGroupName, automationAccountName, jobId, jobStreamId, options) { + getStreamWithHttpOperationResponse(automationAccountName, jobId, jobStreamId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getStream(resourceGroupName, automationAccountName, jobId, jobStreamId, options, (err, result, request, response) => { + self._getStream(automationAccountName, jobId, jobStreamId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1184,8 +1163,6 @@ class DscCompilationJobOperations { /** * Retrieve the job stream identified by job stream id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} jobId The job id. @@ -1219,7 +1196,7 @@ class DscCompilationJobOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getStream(resourceGroupName, automationAccountName, jobId, jobStreamId, options, optionalCallback) { + getStream(automationAccountName, jobId, jobStreamId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1228,14 +1205,14 @@ class DscCompilationJobOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getStream(resourceGroupName, automationAccountName, jobId, jobStreamId, options, (err, result, request, response) => { + self._getStream(automationAccountName, jobId, jobStreamId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getStream(resourceGroupName, automationAccountName, jobId, jobStreamId, options, optionalCallback); + return self._getStream(automationAccountName, jobId, jobStreamId, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/dscCompilationJobStream.js b/lib/services/automationManagement/lib/operations/dscCompilationJobStream.js new file mode 100644 index 0000000000..4afe189714 --- /dev/null +++ b/lib/services/automationManagement/lib/operations/dscCompilationJobStream.js @@ -0,0 +1,270 @@ +/* + * 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; + +/** + * Retrieve all the job streams for the compilation Job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {uuid} jobId The job id. + * + * @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 JobStreamListResult} 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 _listByJob(automationAccountName, jobId, 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 = '2015-10-31'; + // Validate + try { + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.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 (jobId === null || jobId === undefined || typeof jobId.valueOf() !== 'string' || !msRest.isValidUuid(jobId)) { + throw new Error('jobId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + 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}/compilationjobs/{jobId}/streams/'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{jobId}', encodeURIComponent(jobId.toString())); + 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['JobStreamListResult']().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 DscCompilationJobStream. */ +class DscCompilationJobStream { + /** + * Create a DscCompilationJobStream. + * @param {AutomationClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByJob = _listByJob; + } + + /** + * Retrieve all the job streams for the compilation Job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {uuid} jobId The job id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByJobWithHttpOperationResponse(automationAccountName, jobId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByJob(automationAccountName, jobId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieve all the job streams for the compilation Job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {uuid} jobId The job id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {JobStreamListResult} - 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 JobStreamListResult} 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. + */ + listByJob(automationAccountName, jobId, 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._listByJob(automationAccountName, jobId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByJob(automationAccountName, jobId, options, optionalCallback); + } + } + +} + +module.exports = DscCompilationJobStream; diff --git a/lib/services/automationManagement/lib/operations/dscConfigurationOperations.js b/lib/services/automationManagement/lib/operations/dscConfigurationOperations.js index 6cdfe616bb..c80ee3ac53 100644 --- a/lib/services/automationManagement/lib/operations/dscConfigurationOperations.js +++ b/lib/services/automationManagement/lib/operations/dscConfigurationOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Delete the dsc configuration identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The configuration name. @@ -40,7 +38,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, automationAccountName, configurationName, options, callback) { +function _deleteMethod(automationAccountName, configurationName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50,15 +48,16 @@ function _deleteMethod(resourceGroupName, automationAccountName, configurationNa if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -70,9 +69,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, configurationNa 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -83,12 +79,12 @@ function _deleteMethod(resourceGroupName, automationAccountName, configurationNa // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{configurationName}', encodeURIComponent(configurationName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -157,8 +153,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, configurationNa /** * Retrieve the configuration identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The configuration name. @@ -181,7 +175,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, configurationNa * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, configurationName, options, callback) { +function _get(automationAccountName, configurationName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -191,15 +185,16 @@ function _get(resourceGroupName, automationAccountName, configurationName, optio if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -211,9 +206,6 @@ function _get(resourceGroupName, automationAccountName, configurationName, optio 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -224,12 +216,12 @@ function _get(resourceGroupName, automationAccountName, configurationName, optio // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{configurationName}', encodeURIComponent(configurationName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -315,8 +307,6 @@ function _get(resourceGroupName, automationAccountName, configurationName, optio /** * Create the configuration identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The create or update parameters for @@ -380,7 +370,7 @@ function _get(resourceGroupName, automationAccountName, configurationName, optio * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, automationAccountName, configurationName, parameters, options, callback) { +function _createOrUpdate(automationAccountName, configurationName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -390,15 +380,16 @@ function _createOrUpdate(resourceGroupName, automationAccountName, configuration if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -413,9 +404,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, configuration 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -426,12 +414,12 @@ function _createOrUpdate(resourceGroupName, automationAccountName, configuration // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{configurationName}', encodeURIComponent(configurationName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -548,8 +536,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, configuration /** * Retrieve the configuration script identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The configuration name. @@ -565,13 +551,13 @@ function _createOrUpdate(resourceGroupName, automationAccountName, configuration * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {string} [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 _getContent(resourceGroupName, automationAccountName, configurationName, options, callback) { +function _getContent(automationAccountName, configurationName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -581,15 +567,16 @@ function _getContent(resourceGroupName, automationAccountName, configurationName if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -601,9 +588,6 @@ function _getContent(resourceGroupName, automationAccountName, configurationName 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -614,12 +598,12 @@ function _getContent(resourceGroupName, automationAccountName, configurationName // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations/{configurationName}/content'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{configurationName}', encodeURIComponent(configurationName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -646,22 +630,20 @@ function _getContent(resourceGroupName, automationAccountName, configurationName } httpRequest.body = null; // Send Request - httpRequest.streamedResponse = true; return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } - let statusCode = response.statusCode; if (statusCode !== 200) { - let error = new Error(`Unexpected status code: ${statusCode}`); + 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 { - if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { let internalError = null; if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; @@ -679,9 +661,33 @@ function _getContent(resourceGroupName, automationAccountName, configurationName } return callback(error); } - // Create Result - let result = response; + 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + 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); }); } @@ -689,8 +695,6 @@ function _getContent(resourceGroupName, automationAccountName, configurationName /** * Retrieve a list of configurations. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -712,7 +716,7 @@ function _getContent(resourceGroupName, automationAccountName, configurationName * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { +function _listByAutomationAccount(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -722,15 +726,16 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -739,9 +744,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -752,11 +754,11 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/configurations'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -987,8 +989,6 @@ class DscConfigurationOperations { /** * Delete the dsc configuration identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The configuration name. @@ -1004,11 +1004,11 @@ class DscConfigurationOperations { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, configurationName, options) { + deleteMethodWithHttpOperationResponse(automationAccountName, configurationName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, configurationName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, configurationName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1021,8 +1021,6 @@ class DscConfigurationOperations { /** * Delete the dsc configuration identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The configuration name. @@ -1053,7 +1051,7 @@ class DscConfigurationOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, automationAccountName, configurationName, options, optionalCallback) { + deleteMethod(automationAccountName, configurationName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1062,22 +1060,20 @@ class DscConfigurationOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, configurationName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, configurationName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, automationAccountName, configurationName, options, optionalCallback); + return self._deleteMethod(automationAccountName, configurationName, options, optionalCallback); } } /** * Retrieve the configuration identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The configuration name. @@ -1093,11 +1089,11 @@ class DscConfigurationOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, configurationName, options) { + getWithHttpOperationResponse(automationAccountName, configurationName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, configurationName, options, (err, result, request, response) => { + self._get(automationAccountName, configurationName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1110,8 +1106,6 @@ class DscConfigurationOperations { /** * Retrieve the configuration identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The configuration name. @@ -1143,7 +1137,7 @@ class DscConfigurationOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, configurationName, options, optionalCallback) { + get(automationAccountName, configurationName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1152,22 +1146,20 @@ class DscConfigurationOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, configurationName, options, (err, result, request, response) => { + self._get(automationAccountName, configurationName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, configurationName, options, optionalCallback); + return self._get(automationAccountName, configurationName, options, optionalCallback); } } /** * Create the configuration identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The create or update parameters for @@ -1224,11 +1216,11 @@ class DscConfigurationOperations { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, automationAccountName, configurationName, parameters, options) { + createOrUpdateWithHttpOperationResponse(automationAccountName, configurationName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, configurationName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, configurationName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1241,8 +1233,6 @@ class DscConfigurationOperations { /** * Create the configuration identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The create or update parameters for @@ -1315,7 +1305,7 @@ class DscConfigurationOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, automationAccountName, configurationName, parameters, options, optionalCallback) { + createOrUpdate(automationAccountName, configurationName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1324,22 +1314,20 @@ class DscConfigurationOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, configurationName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, configurationName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, automationAccountName, configurationName, parameters, options, optionalCallback); + return self._createOrUpdate(automationAccountName, configurationName, parameters, options, optionalCallback); } } /** * Retrieve the configuration script identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The configuration name. @@ -1351,15 +1339,15 @@ class DscConfigurationOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getContentWithHttpOperationResponse(resourceGroupName, automationAccountName, configurationName, options) { + getContentWithHttpOperationResponse(automationAccountName, configurationName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getContent(resourceGroupName, automationAccountName, configurationName, options, (err, result, request, response) => { + self._getContent(automationAccountName, configurationName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1372,8 +1360,6 @@ class DscConfigurationOperations { /** * Retrieve the configuration script identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The configuration name. @@ -1390,7 +1376,7 @@ class DscConfigurationOperations { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {String} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1398,13 +1384,13 @@ class DscConfigurationOperations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {string} [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. */ - getContent(resourceGroupName, automationAccountName, configurationName, options, optionalCallback) { + getContent(automationAccountName, configurationName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1413,22 +1399,20 @@ class DscConfigurationOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getContent(resourceGroupName, automationAccountName, configurationName, options, (err, result, request, response) => { + self._getContent(automationAccountName, configurationName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getContent(resourceGroupName, automationAccountName, configurationName, options, optionalCallback); + return self._getContent(automationAccountName, configurationName, options, optionalCallback); } } /** * Retrieve a list of configurations. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1442,11 +1426,11 @@ class DscConfigurationOperations { * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1459,8 +1443,6 @@ class DscConfigurationOperations { /** * Retrieve a list of configurations. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1491,7 +1473,7 @@ class DscConfigurationOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + listByAutomationAccount(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1500,14 +1482,14 @@ class DscConfigurationOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/dscNodeConfigurationOperations.js b/lib/services/automationManagement/lib/operations/dscNodeConfigurationOperations.js index 127b0969d5..324a545465 100644 --- a/lib/services/automationManagement/lib/operations/dscNodeConfigurationOperations.js +++ b/lib/services/automationManagement/lib/operations/dscNodeConfigurationOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Delete the Dsc node configurations by node configuration. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeConfigurationName The Dsc node configuration name. @@ -40,7 +38,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, automationAccountName, nodeConfigurationName, options, callback) { +function _deleteMethod(automationAccountName, nodeConfigurationName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50,15 +48,16 @@ function _deleteMethod(resourceGroupName, automationAccountName, nodeConfigurati if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -70,9 +69,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, nodeConfigurati 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -83,12 +79,12 @@ function _deleteMethod(resourceGroupName, automationAccountName, nodeConfigurati // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{nodeConfigurationName}', encodeURIComponent(nodeConfigurationName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -157,8 +153,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, nodeConfigurati /** * Retrieve the Dsc node configurations by node configuration. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeConfigurationName The Dsc node configuration name. @@ -181,7 +175,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, nodeConfigurati * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, nodeConfigurationName, options, callback) { +function _get(automationAccountName, nodeConfigurationName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -191,15 +185,16 @@ function _get(resourceGroupName, automationAccountName, nodeConfigurationName, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -211,9 +206,6 @@ function _get(resourceGroupName, automationAccountName, nodeConfigurationName, o 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -224,12 +216,12 @@ function _get(resourceGroupName, automationAccountName, nodeConfigurationName, o // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{nodeConfigurationName}', encodeURIComponent(nodeConfigurationName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -315,8 +307,6 @@ function _get(resourceGroupName, automationAccountName, nodeConfigurationName, o /** * Create the node configuration identified by node configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeConfigurationName The create or update parameters for @@ -352,6 +342,9 @@ function _get(resourceGroupName, automationAccountName, nodeConfigurationName, o * @param {string} [parameters.configuration.name] Gets or sets the name of the * Dsc configuration. * + * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a + * new build version of NodeConfiguration is required. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -370,7 +363,7 @@ function _get(resourceGroupName, automationAccountName, nodeConfigurationName, o * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, automationAccountName, nodeConfigurationName, parameters, options, callback) { +function _createOrUpdate(automationAccountName, nodeConfigurationName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -380,15 +373,16 @@ function _createOrUpdate(resourceGroupName, automationAccountName, nodeConfigura if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -403,9 +397,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, nodeConfigura 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -416,12 +407,12 @@ function _createOrUpdate(resourceGroupName, automationAccountName, nodeConfigura // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations/{nodeConfigurationName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{nodeConfigurationName}', encodeURIComponent(nodeConfigurationName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -467,7 +458,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, nodeConfigura return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -513,23 +504,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, nodeConfigura 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['DscNodeConfiguration']().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); }); @@ -538,8 +512,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, nodeConfigura /** * Retrieve a list of dsc node configurations. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -563,7 +535,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, nodeConfigura * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { +function _listByAutomationAccount(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -574,15 +546,16 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -594,9 +567,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -607,14 +577,14 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodeConfigurations'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -844,8 +814,6 @@ class DscNodeConfigurationOperations { /** * Delete the Dsc node configurations by node configuration. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeConfigurationName The Dsc node configuration name. @@ -861,11 +829,11 @@ class DscNodeConfigurationOperations { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, nodeConfigurationName, options) { + deleteMethodWithHttpOperationResponse(automationAccountName, nodeConfigurationName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, nodeConfigurationName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, nodeConfigurationName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -878,8 +846,6 @@ class DscNodeConfigurationOperations { /** * Delete the Dsc node configurations by node configuration. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeConfigurationName The Dsc node configuration name. @@ -910,7 +876,7 @@ class DscNodeConfigurationOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, automationAccountName, nodeConfigurationName, options, optionalCallback) { + deleteMethod(automationAccountName, nodeConfigurationName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -919,22 +885,20 @@ class DscNodeConfigurationOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, nodeConfigurationName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, nodeConfigurationName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, automationAccountName, nodeConfigurationName, options, optionalCallback); + return self._deleteMethod(automationAccountName, nodeConfigurationName, options, optionalCallback); } } /** * Retrieve the Dsc node configurations by node configuration. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeConfigurationName The Dsc node configuration name. @@ -950,11 +914,11 @@ class DscNodeConfigurationOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, nodeConfigurationName, options) { + getWithHttpOperationResponse(automationAccountName, nodeConfigurationName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, nodeConfigurationName, options, (err, result, request, response) => { + self._get(automationAccountName, nodeConfigurationName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -967,8 +931,6 @@ class DscNodeConfigurationOperations { /** * Retrieve the Dsc node configurations by node configuration. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeConfigurationName The Dsc node configuration name. @@ -1000,7 +962,7 @@ class DscNodeConfigurationOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, nodeConfigurationName, options, optionalCallback) { + get(automationAccountName, nodeConfigurationName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1009,22 +971,20 @@ class DscNodeConfigurationOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, nodeConfigurationName, options, (err, result, request, response) => { + self._get(automationAccountName, nodeConfigurationName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, nodeConfigurationName, options, optionalCallback); + return self._get(automationAccountName, nodeConfigurationName, options, optionalCallback); } } /** * Create the node configuration identified by node configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeConfigurationName The create or update parameters for @@ -1060,6 +1020,9 @@ class DscNodeConfigurationOperations { * @param {string} [parameters.configuration.name] Gets or sets the name of the * Dsc configuration. * + * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a + * new build version of NodeConfiguration is required. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1071,11 +1034,11 @@ class DscNodeConfigurationOperations { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, automationAccountName, nodeConfigurationName, parameters, options) { + createOrUpdateWithHttpOperationResponse(automationAccountName, nodeConfigurationName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, nodeConfigurationName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, nodeConfigurationName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1088,8 +1051,6 @@ class DscNodeConfigurationOperations { /** * Create the node configuration identified by node configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeConfigurationName The create or update parameters for @@ -1125,6 +1086,9 @@ class DscNodeConfigurationOperations { * @param {string} [parameters.configuration.name] Gets or sets the name of the * Dsc configuration. * + * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a + * new build version of NodeConfiguration is required. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1152,7 +1116,7 @@ class DscNodeConfigurationOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, automationAccountName, nodeConfigurationName, parameters, options, optionalCallback) { + createOrUpdate(automationAccountName, nodeConfigurationName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1161,22 +1125,20 @@ class DscNodeConfigurationOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, nodeConfigurationName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, nodeConfigurationName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, automationAccountName, nodeConfigurationName, parameters, options, optionalCallback); + return self._createOrUpdate(automationAccountName, nodeConfigurationName, parameters, options, optionalCallback); } } /** * Retrieve a list of dsc node configurations. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1192,11 +1154,11 @@ class DscNodeConfigurationOperations { * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1209,8 +1171,6 @@ class DscNodeConfigurationOperations { /** * Retrieve a list of dsc node configurations. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1243,7 +1203,7 @@ class DscNodeConfigurationOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + listByAutomationAccount(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1252,14 +1212,14 @@ class DscNodeConfigurationOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/dscNodeOperations.js b/lib/services/automationManagement/lib/operations/dscNodeOperations.js index a33bfd96bb..ad3a2e48e8 100644 --- a/lib/services/automationManagement/lib/operations/dscNodeOperations.js +++ b/lib/services/automationManagement/lib/operations/dscNodeOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Delete the dsc node identified by node id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName Automation account name. * * @param {string} nodeId The node id. @@ -41,7 +39,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, automationAccountName, nodeId, options, callback) { +function _deleteMethod(automationAccountName, nodeId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51,15 +49,16 @@ function _deleteMethod(resourceGroupName, automationAccountName, nodeId, options if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -71,9 +70,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, nodeId, options 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -84,12 +80,12 @@ function _deleteMethod(resourceGroupName, automationAccountName, nodeId, options // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{nodeId}', encodeURIComponent(nodeId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -175,8 +171,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, nodeId, options /** * Retrieve the dsc node identified by node id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The node id. @@ -199,7 +193,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, nodeId, options * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, nodeId, options, callback) { +function _get(automationAccountName, nodeId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -209,15 +203,16 @@ function _get(resourceGroupName, automationAccountName, nodeId, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -229,9 +224,6 @@ function _get(resourceGroupName, automationAccountName, nodeId, options, callbac 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -242,12 +234,12 @@ function _get(resourceGroupName, automationAccountName, nodeId, options, callbac // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{nodeId}', encodeURIComponent(nodeId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -333,8 +325,6 @@ function _get(resourceGroupName, automationAccountName, nodeId, options, callbac /** * Update the dsc node. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId Parameters supplied to the update dsc node. @@ -367,7 +357,7 @@ function _get(resourceGroupName, automationAccountName, nodeId, options, callbac * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _update(resourceGroupName, automationAccountName, nodeId, parameters, options, callback) { +function _update(automationAccountName, nodeId, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -377,15 +367,16 @@ function _update(resourceGroupName, automationAccountName, nodeId, parameters, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -400,9 +391,6 @@ function _update(resourceGroupName, automationAccountName, nodeId, parameters, o 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -413,12 +401,12 @@ function _update(resourceGroupName, automationAccountName, nodeId, parameters, o // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{nodeId}', encodeURIComponent(nodeId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -518,8 +506,6 @@ function _update(resourceGroupName, automationAccountName, nodeId, parameters, o /** * Retrieve a list of dsc nodes. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -542,7 +528,7 @@ function _update(resourceGroupName, automationAccountName, nodeId, parameters, o * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { +function _listByAutomationAccount(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -553,15 +539,16 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -573,9 +560,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -586,14 +570,14 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -822,8 +806,6 @@ class DscNodeOperations { /** * Delete the dsc node identified by node id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName Automation account name. * * @param {string} nodeId The node id. @@ -839,11 +821,11 @@ class DscNodeOperations { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, nodeId, options) { + deleteMethodWithHttpOperationResponse(automationAccountName, nodeId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, nodeId, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, nodeId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -856,8 +838,6 @@ class DscNodeOperations { /** * Delete the dsc node identified by node id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName Automation account name. * * @param {string} nodeId The node id. @@ -889,7 +869,7 @@ class DscNodeOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, automationAccountName, nodeId, options, optionalCallback) { + deleteMethod(automationAccountName, nodeId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -898,22 +878,20 @@ class DscNodeOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, nodeId, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, nodeId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, automationAccountName, nodeId, options, optionalCallback); + return self._deleteMethod(automationAccountName, nodeId, options, optionalCallback); } } /** * Retrieve the dsc node identified by node id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The node id. @@ -929,11 +907,11 @@ class DscNodeOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, nodeId, options) { + getWithHttpOperationResponse(automationAccountName, nodeId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, nodeId, options, (err, result, request, response) => { + self._get(automationAccountName, nodeId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -946,8 +924,6 @@ class DscNodeOperations { /** * Retrieve the dsc node identified by node id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The node id. @@ -979,7 +955,7 @@ class DscNodeOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, nodeId, options, optionalCallback) { + get(automationAccountName, nodeId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -988,22 +964,20 @@ class DscNodeOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, nodeId, options, (err, result, request, response) => { + self._get(automationAccountName, nodeId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, nodeId, options, optionalCallback); + return self._get(automationAccountName, nodeId, options, optionalCallback); } } /** * Update the dsc node. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId Parameters supplied to the update dsc node. @@ -1029,11 +1003,11 @@ class DscNodeOperations { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, automationAccountName, nodeId, parameters, options) { + updateWithHttpOperationResponse(automationAccountName, nodeId, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, nodeId, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, nodeId, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1046,8 +1020,6 @@ class DscNodeOperations { /** * Update the dsc node. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId Parameters supplied to the update dsc node. @@ -1089,7 +1061,7 @@ class DscNodeOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, automationAccountName, nodeId, parameters, options, optionalCallback) { + update(automationAccountName, nodeId, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1098,22 +1070,20 @@ class DscNodeOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, nodeId, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, nodeId, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, automationAccountName, nodeId, parameters, options, optionalCallback); + return self._update(automationAccountName, nodeId, parameters, options, optionalCallback); } } /** * Retrieve a list of dsc nodes. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1129,11 +1099,11 @@ class DscNodeOperations { * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1146,8 +1116,6 @@ class DscNodeOperations { /** * Retrieve a list of dsc nodes. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1179,7 +1147,7 @@ class DscNodeOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + listByAutomationAccount(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1188,14 +1156,14 @@ class DscNodeOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/fields.js b/lib/services/automationManagement/lib/operations/fields.js index 916be3573e..dcfadd3d8f 100644 --- a/lib/services/automationManagement/lib/operations/fields.js +++ b/lib/services/automationManagement/lib/operations/fields.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Retrieve a list of fields of a given type identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -43,7 +41,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByType(resourceGroupName, automationAccountName, moduleName, typeName, options, callback) { +function _listByType(automationAccountName, moduleName, typeName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53,15 +51,16 @@ function _listByType(resourceGroupName, automationAccountName, moduleName, typeN if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -76,9 +75,6 @@ function _listByType(resourceGroupName, automationAccountName, moduleName, typeN 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -89,13 +85,13 @@ function _listByType(resourceGroupName, automationAccountName, moduleName, typeN // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/types/{typeName}/fields'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{moduleName}', encodeURIComponent(moduleName)); requestUrl = requestUrl.replace('{typeName}', encodeURIComponent(typeName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -192,8 +188,6 @@ class Fields { /** * Retrieve a list of fields of a given type identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -211,11 +205,11 @@ class Fields { * * @reject {Error} - The error object. */ - listByTypeWithHttpOperationResponse(resourceGroupName, automationAccountName, moduleName, typeName, options) { + listByTypeWithHttpOperationResponse(automationAccountName, moduleName, typeName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByType(resourceGroupName, automationAccountName, moduleName, typeName, options, (err, result, request, response) => { + self._listByType(automationAccountName, moduleName, typeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -228,8 +222,6 @@ class Fields { /** * Retrieve a list of fields of a given type identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -263,7 +255,7 @@ class Fields { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByType(resourceGroupName, automationAccountName, moduleName, typeName, options, optionalCallback) { + listByType(automationAccountName, moduleName, typeName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -272,14 +264,14 @@ class Fields { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByType(resourceGroupName, automationAccountName, moduleName, typeName, options, (err, result, request, response) => { + self._listByType(automationAccountName, moduleName, typeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByType(resourceGroupName, automationAccountName, moduleName, typeName, options, optionalCallback); + return self._listByType(automationAccountName, moduleName, typeName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/hybridRunbookWorkerGroupOperations.js b/lib/services/automationManagement/lib/operations/hybridRunbookWorkerGroupOperations.js index 70335296c0..327e721335 100644 --- a/lib/services/automationManagement/lib/operations/hybridRunbookWorkerGroupOperations.js +++ b/lib/services/automationManagement/lib/operations/hybridRunbookWorkerGroupOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Delete a hybrid runbook worker group. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName Automation account name. * * @param {string} hybridRunbookWorkerGroupName The hybrid runbook worker group @@ -41,7 +39,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, options, callback) { +function _deleteMethod(automationAccountName, hybridRunbookWorkerGroupName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51,15 +49,16 @@ function _deleteMethod(resourceGroupName, automationAccountName, hybridRunbookWo if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -71,9 +70,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, hybridRunbookWo 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -84,12 +80,12 @@ function _deleteMethod(resourceGroupName, automationAccountName, hybridRunbookWo // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{hybridRunbookWorkerGroupName}', encodeURIComponent(hybridRunbookWorkerGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -158,8 +154,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, hybridRunbookWo /** * Retrieve a hybrid runbook worker group. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} hybridRunbookWorkerGroupName The hybrid runbook worker group @@ -184,7 +178,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, hybridRunbookWo * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, options, callback) { +function _get(automationAccountName, hybridRunbookWorkerGroupName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -194,15 +188,16 @@ function _get(resourceGroupName, automationAccountName, hybridRunbookWorkerGroup if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -214,9 +209,6 @@ function _get(resourceGroupName, automationAccountName, hybridRunbookWorkerGroup 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -227,12 +219,12 @@ function _get(resourceGroupName, automationAccountName, hybridRunbookWorkerGroup // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{hybridRunbookWorkerGroupName}', encodeURIComponent(hybridRunbookWorkerGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -318,8 +310,6 @@ function _get(resourceGroupName, automationAccountName, hybridRunbookWorkerGroup /** * Update a hybrid runbook worker group. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} hybridRunbookWorkerGroupName The hybrid runbook worker group @@ -352,7 +342,7 @@ function _get(resourceGroupName, automationAccountName, hybridRunbookWorkerGroup * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _update(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters, options, callback) { +function _update(automationAccountName, hybridRunbookWorkerGroupName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -362,15 +352,16 @@ function _update(resourceGroupName, automationAccountName, hybridRunbookWorkerGr if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -385,9 +376,6 @@ function _update(resourceGroupName, automationAccountName, hybridRunbookWorkerGr 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -398,12 +386,12 @@ function _update(resourceGroupName, automationAccountName, hybridRunbookWorkerGr // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups/{hybridRunbookWorkerGroupName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{hybridRunbookWorkerGroupName}', encodeURIComponent(hybridRunbookWorkerGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -503,8 +491,6 @@ function _update(resourceGroupName, automationAccountName, hybridRunbookWorkerGr /** * Retrieve a list of hybrid runbook worker groups. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -526,7 +512,7 @@ function _update(resourceGroupName, automationAccountName, hybridRunbookWorkerGr * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { +function _listByAutomationAccount(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -536,15 +522,16 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -553,9 +540,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -566,11 +550,11 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/hybridRunbookWorkerGroups'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -800,8 +784,6 @@ class HybridRunbookWorkerGroupOperations { /** * Delete a hybrid runbook worker group. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName Automation account name. * * @param {string} hybridRunbookWorkerGroupName The hybrid runbook worker group @@ -818,11 +800,11 @@ class HybridRunbookWorkerGroupOperations { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, options) { + deleteMethodWithHttpOperationResponse(automationAccountName, hybridRunbookWorkerGroupName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, hybridRunbookWorkerGroupName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -835,8 +817,6 @@ class HybridRunbookWorkerGroupOperations { /** * Delete a hybrid runbook worker group. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName Automation account name. * * @param {string} hybridRunbookWorkerGroupName The hybrid runbook worker group @@ -868,7 +848,7 @@ class HybridRunbookWorkerGroupOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, options, optionalCallback) { + deleteMethod(automationAccountName, hybridRunbookWorkerGroupName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -877,22 +857,20 @@ class HybridRunbookWorkerGroupOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, hybridRunbookWorkerGroupName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, options, optionalCallback); + return self._deleteMethod(automationAccountName, hybridRunbookWorkerGroupName, options, optionalCallback); } } /** * Retrieve a hybrid runbook worker group. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} hybridRunbookWorkerGroupName The hybrid runbook worker group @@ -909,11 +887,11 @@ class HybridRunbookWorkerGroupOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, options) { + getWithHttpOperationResponse(automationAccountName, hybridRunbookWorkerGroupName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, options, (err, result, request, response) => { + self._get(automationAccountName, hybridRunbookWorkerGroupName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -926,8 +904,6 @@ class HybridRunbookWorkerGroupOperations { /** * Retrieve a hybrid runbook worker group. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} hybridRunbookWorkerGroupName The hybrid runbook worker group @@ -961,7 +937,7 @@ class HybridRunbookWorkerGroupOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, options, optionalCallback) { + get(automationAccountName, hybridRunbookWorkerGroupName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -970,22 +946,20 @@ class HybridRunbookWorkerGroupOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, options, (err, result, request, response) => { + self._get(automationAccountName, hybridRunbookWorkerGroupName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, options, optionalCallback); + return self._get(automationAccountName, hybridRunbookWorkerGroupName, options, optionalCallback); } } /** * Update a hybrid runbook worker group. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} hybridRunbookWorkerGroupName The hybrid runbook worker group @@ -1010,11 +984,11 @@ class HybridRunbookWorkerGroupOperations { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters, options) { + updateWithHttpOperationResponse(automationAccountName, hybridRunbookWorkerGroupName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, hybridRunbookWorkerGroupName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1027,8 +1001,6 @@ class HybridRunbookWorkerGroupOperations { /** * Update a hybrid runbook worker group. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} hybridRunbookWorkerGroupName The hybrid runbook worker group @@ -1070,7 +1042,7 @@ class HybridRunbookWorkerGroupOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters, options, optionalCallback) { + update(automationAccountName, hybridRunbookWorkerGroupName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1079,22 +1051,20 @@ class HybridRunbookWorkerGroupOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, hybridRunbookWorkerGroupName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, automationAccountName, hybridRunbookWorkerGroupName, parameters, options, optionalCallback); + return self._update(automationAccountName, hybridRunbookWorkerGroupName, parameters, options, optionalCallback); } } /** * Retrieve a list of hybrid runbook worker groups. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1108,11 +1078,11 @@ class HybridRunbookWorkerGroupOperations { * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1125,8 +1095,6 @@ class HybridRunbookWorkerGroupOperations { /** * Retrieve a list of hybrid runbook worker groups. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1157,7 +1125,7 @@ class HybridRunbookWorkerGroupOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + listByAutomationAccount(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1166,14 +1134,14 @@ class HybridRunbookWorkerGroupOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/index.d.ts b/lib/services/automationManagement/lib/operations/index.d.ts index 8c78318a2d..2041f688c2 100644 --- a/lib/services/automationManagement/lib/operations/index.d.ts +++ b/lib/services/automationManagement/lib/operations/index.d.ts @@ -9,7 +9,6 @@ */ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; -import * as stream from 'stream'; import * as models from '../models'; @@ -783,8 +782,6 @@ export interface CertificateOperations { /** * Delete the certificate. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The name of certificate. @@ -800,13 +797,11 @@ export interface CertificateOperations { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(automationAccountName: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Delete the certificate. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The name of certificate. @@ -837,16 +832,14 @@ export interface CertificateOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, automationAccountName: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, automationAccountName: string, certificateName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, automationAccountName: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(automationAccountName: string, certificateName: string, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve the certificate identified by certificate name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The name of certificate. @@ -862,13 +855,11 @@ export interface CertificateOperations { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the certificate identified by certificate name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The name of certificate. @@ -900,16 +891,14 @@ export interface CertificateOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, automationAccountName: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, certificateName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, certificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, certificateName: string, callback: ServiceCallback): void; + get(automationAccountName: string, certificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Create a certificate. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The parameters supplied to the create or @@ -943,13 +932,11 @@ export interface CertificateOperations { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, certificateName: string, parameters: models.CertificateCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(automationAccountName: string, certificateName: string, parameters: models.CertificateCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Create a certificate. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The parameters supplied to the create or @@ -999,16 +986,14 @@ export interface CertificateOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, automationAccountName: string, certificateName: string, parameters: models.CertificateCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, automationAccountName: string, certificateName: string, parameters: models.CertificateCreateOrUpdateParameters, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, automationAccountName: string, certificateName: string, parameters: models.CertificateCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, certificateName: string, parameters: models.CertificateCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(automationAccountName: string, certificateName: string, parameters: models.CertificateCreateOrUpdateParameters, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, certificateName: string, parameters: models.CertificateCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Update a certificate. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The parameters supplied to the update @@ -1017,7 +1002,7 @@ export interface CertificateOperations { * @param {object} parameters The parameters supplied to the update certificate * operation. * - * @param {string} parameters.name Gets or sets the name of the certificate. + * @param {string} [parameters.name] Gets or sets the name of the certificate. * * @param {string} [parameters.description] Gets or sets the description of the * certificate. @@ -1033,13 +1018,11 @@ export interface CertificateOperations { * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, certificateName: string, parameters: models.CertificateUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(automationAccountName: string, certificateName: string, parameters: models.CertificateUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Update a certificate. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} certificateName The parameters supplied to the update @@ -1048,7 +1031,7 @@ export interface CertificateOperations { * @param {object} parameters The parameters supplied to the update certificate * operation. * - * @param {string} parameters.name Gets or sets the name of the certificate. + * @param {string} [parameters.name] Gets or sets the name of the certificate. * * @param {string} [parameters.description] Gets or sets the description of the * certificate. @@ -1080,16 +1063,14 @@ export interface CertificateOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, automationAccountName: string, certificateName: string, parameters: models.CertificateUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, automationAccountName: string, certificateName: string, parameters: models.CertificateUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, automationAccountName: string, certificateName: string, parameters: models.CertificateUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(automationAccountName: string, certificateName: string, parameters: models.CertificateUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(automationAccountName: string, certificateName: string, parameters: models.CertificateUpdateParameters, callback: ServiceCallback): void; + update(automationAccountName: string, certificateName: string, parameters: models.CertificateUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve a list of certificates. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1103,13 +1084,11 @@ export interface CertificateOperations { * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve a list of certificates. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1139,9 +1118,9 @@ export interface CertificateOperations { * * {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; + listByAutomationAccount(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -1213,8 +1192,6 @@ export interface ConnectionOperations { /** * Delete the connection. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The name of connection. @@ -1230,13 +1207,11 @@ export interface ConnectionOperations { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(automationAccountName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Delete the connection. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The name of connection. @@ -1268,16 +1243,14 @@ export interface ConnectionOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, automationAccountName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, automationAccountName: string, connectionName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, automationAccountName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(automationAccountName: string, connectionName: string, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve the connection identified by connection name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The name of connection. @@ -1293,13 +1266,11 @@ export interface ConnectionOperations { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the connection identified by connection name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The name of connection. @@ -1331,16 +1302,14 @@ export interface ConnectionOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, automationAccountName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, connectionName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, connectionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, connectionName: string, callback: ServiceCallback): void; + get(automationAccountName: string, connectionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Create or update a connection. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The parameters supplied to the create or @@ -1374,13 +1343,11 @@ export interface ConnectionOperations { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, connectionName: string, parameters: models.ConnectionCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(automationAccountName: string, connectionName: string, parameters: models.ConnectionCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Create or update a connection. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The parameters supplied to the create or @@ -1430,16 +1397,14 @@ export interface ConnectionOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, automationAccountName: string, connectionName: string, parameters: models.ConnectionCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, automationAccountName: string, connectionName: string, parameters: models.ConnectionCreateOrUpdateParameters, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, automationAccountName: string, connectionName: string, parameters: models.ConnectionCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, connectionName: string, parameters: models.ConnectionCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(automationAccountName: string, connectionName: string, parameters: models.ConnectionCreateOrUpdateParameters, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, connectionName: string, parameters: models.ConnectionCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Update a connection. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The parameters supplied to the update a @@ -1467,13 +1432,11 @@ export interface ConnectionOperations { * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, connectionName: string, parameters: models.ConnectionUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(automationAccountName: string, connectionName: string, parameters: models.ConnectionUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Update a connection. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionName The parameters supplied to the update a @@ -1517,16 +1480,14 @@ export interface ConnectionOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, automationAccountName: string, connectionName: string, parameters: models.ConnectionUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, automationAccountName: string, connectionName: string, parameters: models.ConnectionUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, automationAccountName: string, connectionName: string, parameters: models.ConnectionUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(automationAccountName: string, connectionName: string, parameters: models.ConnectionUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(automationAccountName: string, connectionName: string, parameters: models.ConnectionUpdateParameters, callback: ServiceCallback): void; + update(automationAccountName: string, connectionName: string, parameters: models.ConnectionUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve a list of connections. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1540,13 +1501,11 @@ export interface ConnectionOperations { * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve a list of connections. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1576,9 +1535,9 @@ export interface ConnectionOperations { * * {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; + listByAutomationAccount(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -1650,8 +1609,6 @@ export interface ConnectionTypeOperations { /** * Delete the connectiontype. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionTypeName The name of connectiontype. @@ -1667,13 +1624,11 @@ export interface ConnectionTypeOperations { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(automationAccountName: string, connectionTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Delete the connectiontype. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionTypeName The name of connectiontype. @@ -1704,16 +1659,14 @@ export interface ConnectionTypeOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, connectionTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(automationAccountName: string, connectionTypeName: string, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, connectionTypeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve the connectiontype identified by connectiontype name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionTypeName The name of connectiontype. @@ -1729,13 +1682,11 @@ export interface ConnectionTypeOperations { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, connectionTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the connectiontype identified by connectiontype name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionTypeName The name of connectiontype. @@ -1767,16 +1718,14 @@ export interface ConnectionTypeOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, connectionTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, connectionTypeName: string, callback: ServiceCallback): void; + get(automationAccountName: string, connectionTypeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Create a connectiontype. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionTypeName The parameters supplied to the create or @@ -1805,13 +1754,11 @@ export interface ConnectionTypeOperations { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, parameters: models.ConnectionTypeCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(automationAccountName: string, connectionTypeName: string, parameters: models.ConnectionTypeCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Create a connectiontype. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} connectionTypeName The parameters supplied to the create or @@ -1856,16 +1803,14 @@ export interface ConnectionTypeOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, parameters: models.ConnectionTypeCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, parameters: models.ConnectionTypeCreateOrUpdateParameters, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, automationAccountName: string, connectionTypeName: string, parameters: models.ConnectionTypeCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, connectionTypeName: string, parameters: models.ConnectionTypeCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(automationAccountName: string, connectionTypeName: string, parameters: models.ConnectionTypeCreateOrUpdateParameters, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, connectionTypeName: string, parameters: models.ConnectionTypeCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve a list of connectiontypes. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1879,13 +1824,11 @@ export interface ConnectionTypeOperations { * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve a list of connectiontypes. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1916,9 +1859,9 @@ export interface ConnectionTypeOperations { * * {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; + listByAutomationAccount(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -1991,8 +1934,6 @@ export interface CredentialOperations { /** * Delete the credential. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The name of credential. @@ -2008,13 +1949,11 @@ export interface CredentialOperations { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(automationAccountName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Delete the credential. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The name of credential. @@ -2045,16 +1984,14 @@ export interface CredentialOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, automationAccountName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, automationAccountName: string, credentialName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, automationAccountName: string, credentialName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(automationAccountName: string, credentialName: string, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, credentialName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve the credential identified by credential name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The name of credential. @@ -2070,13 +2007,11 @@ export interface CredentialOperations { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the credential identified by credential name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The name of credential. @@ -2108,16 +2043,14 @@ export interface CredentialOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, automationAccountName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, credentialName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, credentialName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, credentialName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, credentialName: string, callback: ServiceCallback): void; + get(automationAccountName: string, credentialName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Create a credential. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The parameters supplied to the create or @@ -2148,13 +2081,11 @@ export interface CredentialOperations { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, credentialName: string, parameters: models.CredentialCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(automationAccountName: string, credentialName: string, parameters: models.CredentialCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Create a credential. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The parameters supplied to the create or @@ -2201,16 +2132,14 @@ export interface CredentialOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, automationAccountName: string, credentialName: string, parameters: models.CredentialCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, automationAccountName: string, credentialName: string, parameters: models.CredentialCreateOrUpdateParameters, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, automationAccountName: string, credentialName: string, parameters: models.CredentialCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, credentialName: string, parameters: models.CredentialCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(automationAccountName: string, credentialName: string, parameters: models.CredentialCreateOrUpdateParameters, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, credentialName: string, parameters: models.CredentialCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Update a credential. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The parameters supplied to the Update @@ -2219,7 +2148,7 @@ export interface CredentialOperations { * @param {object} parameters The parameters supplied to the Update credential * operation. * - * @param {string} parameters.name Gets or sets the name of the credential. + * @param {string} [parameters.name] Gets or sets the name of the credential. * * @param {string} [parameters.userName] Gets or sets the user name of the * credential. @@ -2241,13 +2170,11 @@ export interface CredentialOperations { * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, credentialName: string, parameters: models.CredentialUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(automationAccountName: string, credentialName: string, parameters: models.CredentialUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Update a credential. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} credentialName The parameters supplied to the Update @@ -2256,7 +2183,7 @@ export interface CredentialOperations { * @param {object} parameters The parameters supplied to the Update credential * operation. * - * @param {string} parameters.name Gets or sets the name of the credential. + * @param {string} [parameters.name] Gets or sets the name of the credential. * * @param {string} [parameters.userName] Gets or sets the user name of the * credential. @@ -2294,16 +2221,14 @@ export interface CredentialOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, automationAccountName: string, credentialName: string, parameters: models.CredentialUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, automationAccountName: string, credentialName: string, parameters: models.CredentialUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, automationAccountName: string, credentialName: string, parameters: models.CredentialUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(automationAccountName: string, credentialName: string, parameters: models.CredentialUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(automationAccountName: string, credentialName: string, parameters: models.CredentialUpdateParameters, callback: ServiceCallback): void; + update(automationAccountName: string, credentialName: string, parameters: models.CredentialUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve a list of credentials. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -2317,13 +2242,11 @@ export interface CredentialOperations { * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve a list of credentials. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -2353,9 +2276,9 @@ export interface CredentialOperations { * * {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; + listByAutomationAccount(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -2427,8 +2350,6 @@ export interface DscCompilationJobOperations { /** * Creates the Dsc compilation job of the configuration. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} compilationJobId The the DSC configuration Id. @@ -2444,6 +2365,9 @@ export interface DscCompilationJobOperations { * @param {object} [parameters.parameters] Gets or sets the parameters of the * job. * + * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a + * new build version of NodeConfiguration is required. + * * @param {string} [parameters.name] Gets or sets name of the resource. * * @param {string} [parameters.location] Gets or sets the location of the @@ -2463,13 +2387,11 @@ export interface DscCompilationJobOperations { * * @reject {Error|ServiceError} - The error object. */ - createWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, compilationJobId: string, parameters: models.DscCompilationJobCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(automationAccountName: string, compilationJobId: string, parameters: models.DscCompilationJobCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Creates the Dsc compilation job of the configuration. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} compilationJobId The the DSC configuration Id. @@ -2485,6 +2407,9 @@ export interface DscCompilationJobOperations { * @param {object} [parameters.parameters] Gets or sets the parameters of the * job. * + * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a + * new build version of NodeConfiguration is required. + * * @param {string} [parameters.name] Gets or sets name of the resource. * * @param {string} [parameters.location] Gets or sets the location of the @@ -2520,16 +2445,14 @@ export interface DscCompilationJobOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - create(resourceGroupName: string, automationAccountName: string, compilationJobId: string, parameters: models.DscCompilationJobCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - create(resourceGroupName: string, automationAccountName: string, compilationJobId: string, parameters: models.DscCompilationJobCreateParameters, callback: ServiceCallback): void; - create(resourceGroupName: string, automationAccountName: string, compilationJobId: string, parameters: models.DscCompilationJobCreateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(automationAccountName: string, compilationJobId: string, parameters: models.DscCompilationJobCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(automationAccountName: string, compilationJobId: string, parameters: models.DscCompilationJobCreateParameters, callback: ServiceCallback): void; + create(automationAccountName: string, compilationJobId: string, parameters: models.DscCompilationJobCreateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve the Dsc configuration compilation job identified by job id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} compilationJobId The Dsc configuration compilation job id. @@ -2545,13 +2468,11 @@ export interface DscCompilationJobOperations { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, compilationJobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, compilationJobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the Dsc configuration compilation job identified by job id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} compilationJobId The Dsc configuration compilation job id. @@ -2583,16 +2504,14 @@ export interface DscCompilationJobOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, automationAccountName: string, compilationJobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, compilationJobId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, compilationJobId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, compilationJobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, compilationJobId: string, callback: ServiceCallback): void; + get(automationAccountName: string, compilationJobId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve a list of dsc compilation jobs. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -2608,13 +2527,11 @@ export interface DscCompilationJobOperations { * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve a list of dsc compilation jobs. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -2647,16 +2564,14 @@ export interface DscCompilationJobOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByAutomationAccount(resourceGroupName: string, automationAccountName: string, callback: ServiceCallback): void; - listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve the job stream identified by job stream id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} jobId The job id. @@ -2674,13 +2589,11 @@ export interface DscCompilationJobOperations { * * @reject {Error|ServiceError} - The error object. */ - getStreamWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobId: string, jobStreamId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getStreamWithHttpOperationResponse(automationAccountName: string, jobId: string, jobStreamId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the job stream identified by job stream id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} jobId The job id. @@ -2714,9 +2627,9 @@ export interface DscCompilationJobOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getStream(resourceGroupName: string, automationAccountName: string, jobId: string, jobStreamId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getStream(resourceGroupName: string, automationAccountName: string, jobId: string, jobStreamId: string, callback: ServiceCallback): void; - getStream(resourceGroupName: string, automationAccountName: string, jobId: string, jobStreamId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getStream(automationAccountName: string, jobId: string, jobStreamId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getStream(automationAccountName: string, jobId: string, jobStreamId: string, callback: ServiceCallback): void; + getStream(automationAccountName: string, jobId: string, jobStreamId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -2777,6 +2690,74 @@ export interface DscCompilationJobOperations { listByAutomationAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * DscCompilationJobStream + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface DscCompilationJobStream { + + + /** + * Retrieve all the job streams for the compilation Job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {uuid} jobId The job id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByJobWithHttpOperationResponse(automationAccountName: string, jobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve all the job streams for the compilation Job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {uuid} jobId The job id. + * + * @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 {JobStreamListResult} - 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. + * + * {JobStreamListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobStreamListResult} 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. + */ + listByJob(automationAccountName: string, jobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByJob(automationAccountName: string, jobId: string, callback: ServiceCallback): void; + listByJob(automationAccountName: string, jobId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * DscConfigurationOperations @@ -2789,8 +2770,6 @@ export interface DscConfigurationOperations { /** * Delete the dsc configuration identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The configuration name. @@ -2806,13 +2785,11 @@ export interface DscConfigurationOperations { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, configurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(automationAccountName: string, configurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Delete the dsc configuration identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The configuration name. @@ -2843,16 +2820,14 @@ export interface DscConfigurationOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, automationAccountName: string, configurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, automationAccountName: string, configurationName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, automationAccountName: string, configurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, configurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(automationAccountName: string, configurationName: string, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, configurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve the configuration identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The configuration name. @@ -2868,13 +2843,11 @@ export interface DscConfigurationOperations { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, configurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, configurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the configuration identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The configuration name. @@ -2906,16 +2879,14 @@ export interface DscConfigurationOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, automationAccountName: string, configurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, configurationName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, configurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, configurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, configurationName: string, callback: ServiceCallback): void; + get(automationAccountName: string, configurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Create the configuration identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The create or update parameters for @@ -2972,13 +2943,11 @@ export interface DscConfigurationOperations { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, configurationName: string, parameters: models.DscConfigurationCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(automationAccountName: string, configurationName: string, parameters: models.DscConfigurationCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Create the configuration identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The create or update parameters for @@ -3051,16 +3020,14 @@ export interface DscConfigurationOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, automationAccountName: string, configurationName: string, parameters: models.DscConfigurationCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, automationAccountName: string, configurationName: string, parameters: models.DscConfigurationCreateOrUpdateParameters, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, automationAccountName: string, configurationName: string, parameters: models.DscConfigurationCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, configurationName: string, parameters: models.DscConfigurationCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(automationAccountName: string, configurationName: string, parameters: models.DscConfigurationCreateOrUpdateParameters, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, configurationName: string, parameters: models.DscConfigurationCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve the configuration script identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The configuration name. @@ -3072,17 +3039,15 @@ export interface DscConfigurationOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getContentWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, configurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getContentWithHttpOperationResponse(automationAccountName: string, configurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the configuration script identified by configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} configurationName The configuration name. @@ -3099,7 +3064,7 @@ export interface DscConfigurationOperations { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {String} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3107,22 +3072,20 @@ export interface DscConfigurationOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {String} [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. */ - getContent(resourceGroupName: string, automationAccountName: string, configurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getContent(resourceGroupName: string, automationAccountName: string, configurationName: string, callback: ServiceCallback): void; - getContent(resourceGroupName: string, automationAccountName: string, configurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getContent(automationAccountName: string, configurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getContent(automationAccountName: string, configurationName: string, callback: ServiceCallback): void; + getContent(automationAccountName: string, configurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve a list of configurations. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -3136,13 +3099,11 @@ export interface DscConfigurationOperations { * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve a list of configurations. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -3173,9 +3134,9 @@ export interface DscConfigurationOperations { * * {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; + listByAutomationAccount(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -3248,8 +3209,6 @@ export interface AgentRegistrationInformation { /** * Retrieve the automation agent registration information. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -3263,13 +3222,11 @@ export interface AgentRegistrationInformation { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the automation agent registration information. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -3299,23 +3256,21 @@ export interface AgentRegistrationInformation { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, callback: ServiceCallback): void; + get(automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Regenerate a primary or secondary agent registration key * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} parameters The name of the agent registration key to be * regenerated * * @param {string} parameters.keyName Gets or sets the agent registration key - * name - Primary or Secondary. Possible values include: 'Primary', 'Secondary' + * name - primary or secondary. Possible values include: 'primary', 'secondary' * * @param {string} [parameters.name] Gets or sets the name of the resource. * @@ -3336,20 +3291,18 @@ export interface AgentRegistrationInformation { * * @reject {Error|ServiceError} - The error object. */ - regenerateKeyWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, parameters: models.AgentRegistrationRegenerateKeyParameter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + regenerateKeyWithHttpOperationResponse(automationAccountName: string, parameters: models.AgentRegistrationRegenerateKeyParameter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Regenerate a primary or secondary agent registration key * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} parameters The name of the agent registration key to be * regenerated * * @param {string} parameters.keyName Gets or sets the agent registration key - * name - Primary or Secondary. Possible values include: 'Primary', 'Secondary' + * name - primary or secondary. Possible values include: 'primary', 'secondary' * * @param {string} [parameters.name] Gets or sets the name of the resource. * @@ -3386,9 +3339,9 @@ export interface AgentRegistrationInformation { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - regenerateKey(resourceGroupName: string, automationAccountName: string, parameters: models.AgentRegistrationRegenerateKeyParameter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - regenerateKey(resourceGroupName: string, automationAccountName: string, parameters: models.AgentRegistrationRegenerateKeyParameter, callback: ServiceCallback): void; - regenerateKey(resourceGroupName: string, automationAccountName: string, parameters: models.AgentRegistrationRegenerateKeyParameter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + regenerateKey(automationAccountName: string, parameters: models.AgentRegistrationRegenerateKeyParameter, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + regenerateKey(automationAccountName: string, parameters: models.AgentRegistrationRegenerateKeyParameter, callback: ServiceCallback): void; + regenerateKey(automationAccountName: string, parameters: models.AgentRegistrationRegenerateKeyParameter, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** @@ -3403,8 +3356,6 @@ export interface DscNodeOperations { /** * Delete the dsc node identified by node id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName Automation account name. * * @param {string} nodeId The node id. @@ -3420,13 +3371,11 @@ export interface DscNodeOperations { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, nodeId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(automationAccountName: string, nodeId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Delete the dsc node identified by node id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName Automation account name. * * @param {string} nodeId The node id. @@ -3458,16 +3407,14 @@ export interface DscNodeOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, automationAccountName: string, nodeId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, automationAccountName: string, nodeId: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, automationAccountName: string, nodeId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, nodeId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(automationAccountName: string, nodeId: string, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, nodeId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve the dsc node identified by node id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The node id. @@ -3483,13 +3430,11 @@ export interface DscNodeOperations { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, nodeId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, nodeId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the dsc node identified by node id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The node id. @@ -3521,16 +3466,14 @@ export interface DscNodeOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, automationAccountName: string, nodeId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, nodeId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, nodeId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, nodeId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, nodeId: string, callback: ServiceCallback): void; + get(automationAccountName: string, nodeId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Update the dsc node. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId Parameters supplied to the update dsc node. @@ -3556,13 +3499,11 @@ export interface DscNodeOperations { * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, nodeId: string, parameters: models.DscNodeUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(automationAccountName: string, nodeId: string, parameters: models.DscNodeUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Update the dsc node. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId Parameters supplied to the update dsc node. @@ -3604,16 +3545,14 @@ export interface DscNodeOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, automationAccountName: string, nodeId: string, parameters: models.DscNodeUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, automationAccountName: string, nodeId: string, parameters: models.DscNodeUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, automationAccountName: string, nodeId: string, parameters: models.DscNodeUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(automationAccountName: string, nodeId: string, parameters: models.DscNodeUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(automationAccountName: string, nodeId: string, parameters: models.DscNodeUpdateParameters, callback: ServiceCallback): void; + update(automationAccountName: string, nodeId: string, parameters: models.DscNodeUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve a list of dsc nodes. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -3629,13 +3568,11 @@ export interface DscNodeOperations { * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve a list of dsc nodes. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -3667,9 +3604,9 @@ export interface DscNodeOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByAutomationAccount(resourceGroupName: string, automationAccountName: string, callback: ServiceCallback): void; - listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -3741,8 +3678,6 @@ export interface NodeReports { /** * Retrieve the Dsc node report list by node id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The parameters supplied to the list operation. @@ -3760,13 +3695,11 @@ export interface NodeReports { * * @reject {Error|ServiceError} - The error object. */ - listByNodeWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, nodeId: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByNodeWithHttpOperationResponse(automationAccountName: string, nodeId: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the Dsc node report list by node id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The parameters supplied to the list operation. @@ -3801,16 +3734,14 @@ export interface NodeReports { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByNode(resourceGroupName: string, automationAccountName: string, nodeId: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByNode(resourceGroupName: string, automationAccountName: string, nodeId: string, callback: ServiceCallback): void; - listByNode(resourceGroupName: string, automationAccountName: string, nodeId: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByNode(automationAccountName: string, nodeId: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByNode(automationAccountName: string, nodeId: string, callback: ServiceCallback): void; + listByNode(automationAccountName: string, nodeId: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve the Dsc node report data by node id and report id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The Dsc node id. @@ -3828,13 +3759,11 @@ export interface NodeReports { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, nodeId: string, reportId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, nodeId: string, reportId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the Dsc node report data by node id and report id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The Dsc node id. @@ -3868,16 +3797,14 @@ export interface NodeReports { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, automationAccountName: string, nodeId: string, reportId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, nodeId: string, reportId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, nodeId: string, reportId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, nodeId: string, reportId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, nodeId: string, reportId: string, callback: ServiceCallback): void; + get(automationAccountName: string, nodeId: string, reportId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve the Dsc node reports by node id and report id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The Dsc node id. @@ -3895,13 +3822,11 @@ export interface NodeReports { * * @reject {Error|ServiceError} - The error object. */ - getContentWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, nodeId: string, reportId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getContentWithHttpOperationResponse(automationAccountName: string, nodeId: string, reportId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the Dsc node reports by node id and report id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The Dsc node id. @@ -3934,9 +3859,9 @@ export interface NodeReports { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getContent(resourceGroupName: string, automationAccountName: string, nodeId: string, reportId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getContent(resourceGroupName: string, automationAccountName: string, nodeId: string, reportId: string, callback: ServiceCallback): void; - getContent(resourceGroupName: string, automationAccountName: string, nodeId: string, reportId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getContent(automationAccountName: string, nodeId: string, reportId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getContent(automationAccountName: string, nodeId: string, reportId: string, callback: ServiceCallback): void; + getContent(automationAccountName: string, nodeId: string, reportId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -4009,8 +3934,6 @@ export interface DscNodeConfigurationOperations { /** * Delete the Dsc node configurations by node configuration. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeConfigurationName The Dsc node configuration name. @@ -4026,13 +3949,11 @@ export interface DscNodeConfigurationOperations { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, nodeConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(automationAccountName: string, nodeConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Delete the Dsc node configurations by node configuration. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeConfigurationName The Dsc node configuration name. @@ -4063,16 +3984,14 @@ export interface DscNodeConfigurationOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, automationAccountName: string, nodeConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, automationAccountName: string, nodeConfigurationName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, automationAccountName: string, nodeConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, nodeConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(automationAccountName: string, nodeConfigurationName: string, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, nodeConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve the Dsc node configurations by node configuration. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeConfigurationName The Dsc node configuration name. @@ -4088,13 +4007,11 @@ export interface DscNodeConfigurationOperations { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, nodeConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, nodeConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve the Dsc node configurations by node configuration. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeConfigurationName The Dsc node configuration name. @@ -4126,16 +4043,14 @@ export interface DscNodeConfigurationOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, automationAccountName: string, nodeConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, nodeConfigurationName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, nodeConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, nodeConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, nodeConfigurationName: string, callback: ServiceCallback): void; + get(automationAccountName: string, nodeConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Create the node configuration identified by node configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeConfigurationName The create or update parameters for @@ -4171,6 +4086,9 @@ export interface DscNodeConfigurationOperations { * @param {string} [parameters.configuration.name] Gets or sets the name of the * Dsc configuration. * + * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a + * new build version of NodeConfiguration is required. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4182,13 +4100,11 @@ export interface DscNodeConfigurationOperations { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, nodeConfigurationName: string, parameters: models.DscNodeConfigurationCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(automationAccountName: string, nodeConfigurationName: string, parameters: models.DscNodeConfigurationCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Create the node configuration identified by node configuration name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeConfigurationName The create or update parameters for @@ -4224,6 +4140,9 @@ export interface DscNodeConfigurationOperations { * @param {string} [parameters.configuration.name] Gets or sets the name of the * Dsc configuration. * + * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a + * new build version of NodeConfiguration is required. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4251,16 +4170,14 @@ export interface DscNodeConfigurationOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, automationAccountName: string, nodeConfigurationName: string, parameters: models.DscNodeConfigurationCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, automationAccountName: string, nodeConfigurationName: string, parameters: models.DscNodeConfigurationCreateOrUpdateParameters, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, automationAccountName: string, nodeConfigurationName: string, parameters: models.DscNodeConfigurationCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, nodeConfigurationName: string, parameters: models.DscNodeConfigurationCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(automationAccountName: string, nodeConfigurationName: string, parameters: models.DscNodeConfigurationCreateOrUpdateParameters, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, nodeConfigurationName: string, parameters: models.DscNodeConfigurationCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve a list of dsc node configurations. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -4276,13 +4193,11 @@ export interface DscNodeConfigurationOperations { * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve a list of dsc node configurations. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -4315,9 +4230,9 @@ export interface DscNodeConfigurationOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByAutomationAccount(resourceGroupName: string, automationAccountName: string, callback: ServiceCallback): void; - listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -4390,8 +4305,6 @@ export interface HybridRunbookWorkerGroupOperations { /** * Delete a hybrid runbook worker group. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName Automation account name. * * @param {string} hybridRunbookWorkerGroupName The hybrid runbook worker group @@ -4408,13 +4321,11 @@ export interface HybridRunbookWorkerGroupOperations { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, hybridRunbookWorkerGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(automationAccountName: string, hybridRunbookWorkerGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Delete a hybrid runbook worker group. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName Automation account name. * * @param {string} hybridRunbookWorkerGroupName The hybrid runbook worker group @@ -4446,16 +4357,14 @@ export interface HybridRunbookWorkerGroupOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, automationAccountName: string, hybridRunbookWorkerGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, automationAccountName: string, hybridRunbookWorkerGroupName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, automationAccountName: string, hybridRunbookWorkerGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, hybridRunbookWorkerGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(automationAccountName: string, hybridRunbookWorkerGroupName: string, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, hybridRunbookWorkerGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve a hybrid runbook worker group. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} hybridRunbookWorkerGroupName The hybrid runbook worker group @@ -4472,13 +4381,11 @@ export interface HybridRunbookWorkerGroupOperations { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, hybridRunbookWorkerGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, hybridRunbookWorkerGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve a hybrid runbook worker group. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} hybridRunbookWorkerGroupName The hybrid runbook worker group @@ -4512,16 +4419,14 @@ export interface HybridRunbookWorkerGroupOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, automationAccountName: string, hybridRunbookWorkerGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, hybridRunbookWorkerGroupName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, hybridRunbookWorkerGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, hybridRunbookWorkerGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, hybridRunbookWorkerGroupName: string, callback: ServiceCallback): void; + get(automationAccountName: string, hybridRunbookWorkerGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Update a hybrid runbook worker group. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} hybridRunbookWorkerGroupName The hybrid runbook worker group @@ -4546,13 +4451,11 @@ export interface HybridRunbookWorkerGroupOperations { * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, hybridRunbookWorkerGroupName: string, parameters: models.HybridRunbookWorkerGroupUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(automationAccountName: string, hybridRunbookWorkerGroupName: string, parameters: models.HybridRunbookWorkerGroupUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Update a hybrid runbook worker group. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} hybridRunbookWorkerGroupName The hybrid runbook worker group @@ -4594,16 +4497,14 @@ export interface HybridRunbookWorkerGroupOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, automationAccountName: string, hybridRunbookWorkerGroupName: string, parameters: models.HybridRunbookWorkerGroupUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, automationAccountName: string, hybridRunbookWorkerGroupName: string, parameters: models.HybridRunbookWorkerGroupUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, automationAccountName: string, hybridRunbookWorkerGroupName: string, parameters: models.HybridRunbookWorkerGroupUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(automationAccountName: string, hybridRunbookWorkerGroupName: string, parameters: models.HybridRunbookWorkerGroupUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(automationAccountName: string, hybridRunbookWorkerGroupName: string, parameters: models.HybridRunbookWorkerGroupUpdateParameters, callback: ServiceCallback): void; + update(automationAccountName: string, hybridRunbookWorkerGroupName: string, parameters: models.HybridRunbookWorkerGroupUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** * Retrieve a list of hybrid runbook worker groups. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -4617,13 +4518,11 @@ export interface HybridRunbookWorkerGroupOperations { * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Retrieve a list of hybrid runbook worker groups. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -4654,9 +4553,9 @@ export interface HybridRunbookWorkerGroupOperations { * * {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; + listByAutomationAccount(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -4719,21 +4618,19 @@ export interface HybridRunbookWorkerGroupOperations { /** * @class - * JobOperations + * JobScheduleOperations * __NOTE__: An instance of this class is automatically created for an * instance of the AutomationClient. */ -export interface JobOperations { +export interface JobScheduleOperations { /** - * Retrieve the job output identified by job id. - * - * @param {string} resourceGroupName The resource group name. + * Delete the job schedule identified by job schedule name. * * @param {string} automationAccountName The automation account name. * - * @param {string} jobId The job id. + * @param {uuid} jobScheduleId The job schedule name. * * @param {object} [options] Optional Parameters. * @@ -4742,20 +4639,18 @@ export interface JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getOutputWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(automationAccountName: string, jobScheduleId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve the job output identified by job id. - * - * @param {string} resourceGroupName The resource group name. + * Delete the job schedule identified by job schedule name. * * @param {string} automationAccountName The automation account name. * - * @param {string} jobId The job id. + * @param {uuid} jobScheduleId The job schedule name. * * @param {object} [options] Optional Parameters. * @@ -4769,7 +4664,7 @@ export interface JobOperations { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4777,25 +4672,23 @@ export interface JobOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {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. */ - getOutput(resourceGroupName: string, automationAccountName: string, jobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getOutput(resourceGroupName: string, automationAccountName: string, jobId: string, callback: ServiceCallback): void; - getOutput(resourceGroupName: string, automationAccountName: string, jobId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, jobScheduleId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(automationAccountName: string, jobScheduleId: string, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, jobScheduleId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve the runbook content of the job identified by job id. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the job schedule identified by job schedule name. * * @param {string} automationAccountName The automation account name. * - * @param {string} jobId The job id. + * @param {uuid} jobScheduleId The job schedule name. * * @param {object} [options] Optional Parameters. * @@ -4804,20 +4697,18 @@ export interface JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getRunbookContentWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, jobScheduleId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve the runbook content of the job identified by job id. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the job schedule identified by job schedule name. * * @param {string} automationAccountName The automation account name. * - * @param {string} jobId The job id. + * @param {uuid} jobScheduleId The job schedule name. * * @param {object} [options] Optional Parameters. * @@ -4831,7 +4722,7 @@ export interface JobOperations { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {JobSchedule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4839,25 +4730,43 @@ export interface JobOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {JobSchedule} [result] - The deserialized result object if an error did not occur. + * See {@link JobSchedule} 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. */ - getRunbookContent(resourceGroupName: string, automationAccountName: string, jobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getRunbookContent(resourceGroupName: string, automationAccountName: string, jobId: string, callback: ServiceCallback): void; - getRunbookContent(resourceGroupName: string, automationAccountName: string, jobId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, jobScheduleId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, jobScheduleId: string, callback: ServiceCallback): void; + get(automationAccountName: string, jobScheduleId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Suspend the job identified by jobId. - * - * @param {string} resourceGroupName The resource group name. + * Create a job schedule. * * @param {string} automationAccountName The automation account name. * - * @param {uuid} jobId The job id. + * @param {uuid} jobScheduleId The job schedule name. + * + * @param {object} parameters The parameters supplied to the create job + * schedule operation. + * + * @param {object} parameters.schedule Gets or sets the schedule. + * + * @param {string} [parameters.schedule.name] Gets or sets the name of the + * schedule. + * + * @param {object} parameters.runbook Gets or sets the runbook. + * + * @param {string} [parameters.runbook.name] Gets or sets the name of the + * runbook. + * + * @param {string} [parameters.runOn] Gets or sets the hybrid worker group that + * the scheduled job should run on. + * + * @param {object} [parameters.parameters] Gets or sets a list of job + * properties. * * @param {object} [options] Optional Parameters. * @@ -4866,20 +4775,37 @@ export interface JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - suspendWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(automationAccountName: string, jobScheduleId: string, parameters: models.JobScheduleCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Suspend the job identified by jobId. - * - * @param {string} resourceGroupName The resource group name. + * Create a job schedule. * * @param {string} automationAccountName The automation account name. * - * @param {uuid} jobId The job id. + * @param {uuid} jobScheduleId The job schedule name. + * + * @param {object} parameters The parameters supplied to the create job + * schedule operation. + * + * @param {object} parameters.schedule Gets or sets the schedule. + * + * @param {string} [parameters.schedule.name] Gets or sets the name of the + * schedule. + * + * @param {object} parameters.runbook Gets or sets the runbook. + * + * @param {string} [parameters.runbook.name] Gets or sets the name of the + * runbook. + * + * @param {string} [parameters.runOn] Gets or sets the hybrid worker group that + * the scheduled job should run on. + * + * @param {object} [parameters.parameters] Gets or sets a list of job + * properties. * * @param {object} [options] Optional Parameters. * @@ -4893,7 +4819,7 @@ export interface JobOperations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {JobSchedule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4901,26 +4827,23 @@ export interface JobOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {JobSchedule} [result] - The deserialized result object if an error did not occur. + * See {@link JobSchedule} 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. */ - suspend(resourceGroupName: string, automationAccountName: string, jobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - suspend(resourceGroupName: string, automationAccountName: string, jobId: string, callback: ServiceCallback): void; - suspend(resourceGroupName: string, automationAccountName: string, jobId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(automationAccountName: string, jobScheduleId: string, parameters: models.JobScheduleCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(automationAccountName: string, jobScheduleId: string, parameters: models.JobScheduleCreateParameters, callback: ServiceCallback): void; + create(automationAccountName: string, jobScheduleId: string, parameters: models.JobScheduleCreateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Stop the job identified by jobId. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of job schedules. * * @param {string} automationAccountName The automation account name. * - * @param {uuid} jobId The job id. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4928,21 +4851,17 @@ export interface JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - stopWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Stop the job identified by jobId. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of job schedules. * * @param {string} automationAccountName The automation account name. * - * @param {uuid} jobId The job id. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4955,7 +4874,7 @@ export interface JobOperations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {JobScheduleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4963,25 +4882,23 @@ export interface JobOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {JobScheduleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobScheduleListResult} 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. */ - stop(resourceGroupName: string, automationAccountName: string, jobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - stop(resourceGroupName: string, automationAccountName: string, jobId: string, callback: ServiceCallback): void; - stop(resourceGroupName: string, automationAccountName: string, jobId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve the job identified by job id. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Retrieve a list of job schedules. * - * @param {uuid} jobId The job id. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -4990,20 +4907,17 @@ export interface JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve the job identified by job id. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Retrieve a list of job schedules. * - * @param {uuid} jobId The job id. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -5017,7 +4931,7 @@ export interface JobOperations { * * {Promise} A promise is returned. * - * @resolve {Job} - The deserialized result object. + * @resolve {JobScheduleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5025,49 +4939,32 @@ export interface JobOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Job} [result] - The deserialized result object if an error did not occur. - * See {@link Job} for more information. + * {JobScheduleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobScheduleListResult} 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, jobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, jobId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, jobId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 + * LinkedWorkspaceOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface LinkedWorkspaceOperations { /** - * Create a job of the runbook. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the linked workspace for the account id. * * @param {string} automationAccountName The automation account name. * - * @param {uuid} jobId The job id. - * - * @param {object} parameters The parameters supplied to the create job - * operation. - * - * @param {object} parameters.runbook Gets or sets the runbook. - * - * @param {string} [parameters.runbook.name] Gets or sets the name of the - * runbook. - * - * @param {object} [parameters.parameters] Gets or sets the parameters of the - * job. - * - * @param {string} [parameters.runOn] Gets or sets the runOn which specifies - * the group name where the job is to be executed. - * - * @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 @@ -5075,43 +4972,17 @@ export interface JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobId: string, parameters: models.JobCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create a job of the runbook. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the linked workspace for the account id. * * @param {string} automationAccountName The automation account name. * - * @param {uuid} jobId The job id. - * - * @param {object} parameters The parameters supplied to the create job - * operation. - * - * @param {object} parameters.runbook Gets or sets the runbook. - * - * @param {string} [parameters.runbook.name] Gets or sets the name of the - * runbook. - * - * @param {object} [parameters.parameters] Gets or sets the parameters of the - * job. - * - * @param {string} [parameters.runOn] Gets or sets the runOn which specifies - * the group name where the job is to be executed. - * - * @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 @@ -5124,7 +4995,7 @@ export interface JobOperations { * * {Promise} A promise is returned. * - * @resolve {Job} - The deserialized result object. + * @resolve {LinkedWorkspace} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5132,50 +5003,61 @@ export interface JobOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Job} [result] - The deserialized result object if an error did not occur. - * See {@link Job} for more information. + * {LinkedWorkspace} [result] - The deserialized result object if an error did not occur. + * See {@link LinkedWorkspace} 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. */ - create(resourceGroupName: string, automationAccountName: string, jobId: string, parameters: models.JobCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - create(resourceGroupName: string, automationAccountName: string, jobId: string, parameters: models.JobCreateParameters, callback: ServiceCallback): void; - create(resourceGroupName: string, automationAccountName: string, jobId: string, parameters: models.JobCreateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, callback: ServiceCallback): void; + get(automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ActivityOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface ActivityOperations { /** - * Retrieve a list of jobs. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the activity in the module identified by module name and activity + * name. * * @param {string} automationAccountName The automation account name. * - * @param {object} [options] Optional Parameters. + * @param {string} moduleName The name of module. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} activityName The name of activity. + * + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, moduleName: string, activityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of jobs. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the activity in the module identified by module name and activity + * name. * * @param {string} automationAccountName The automation account name. * - * @param {object} [options] Optional Parameters. + * @param {string} moduleName The name of module. * - * @param {string} [options.filter] The filter to apply on the operation. + * @param {string} activityName The name of activity. + * + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5187,7 +5069,7 @@ export interface JobOperations { * * {Promise} A promise is returned. * - * @resolve {JobListResult} - The deserialized result object. + * @resolve {Activity} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5195,26 +5077,24 @@ export interface JobOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobListResult} for more information. + * {Activity} [result] - The deserialized result object if an error did not occur. + * See {@link Activity} 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?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByAutomationAccount(resourceGroupName: string, automationAccountName: string, callback: ServiceCallback): void; - listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, moduleName: string, activityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, moduleName: string, activityName: string, callback: ServiceCallback): void; + get(automationAccountName: string, moduleName: string, activityName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Resume the job identified by jobId. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of activities in the module identified by module name. * * @param {string} automationAccountName The automation account name. * - * @param {uuid} jobId The job id. + * @param {string} moduleName The name of module. * * @param {object} [options] Optional Parameters. * @@ -5223,20 +5103,18 @@ export interface JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - resumeWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByModuleWithHttpOperationResponse(automationAccountName: string, moduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Resume the job identified by jobId. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of activities in the module identified by module name. * * @param {string} automationAccountName The automation account name. * - * @param {uuid} jobId The job id. + * @param {string} moduleName The name of module. * * @param {object} [options] Optional Parameters. * @@ -5250,7 +5128,7 @@ export interface JobOperations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ActivityListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5258,19 +5136,20 @@ export interface JobOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ActivityListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ActivityListResult} 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. */ - resume(resourceGroupName: string, automationAccountName: string, jobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - resume(resourceGroupName: string, automationAccountName: string, jobId: string, callback: ServiceCallback): void; - resume(resourceGroupName: string, automationAccountName: string, jobId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByModule(automationAccountName: string, moduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByModule(automationAccountName: string, moduleName: string, callback: ServiceCallback): void; + listByModule(automationAccountName: string, moduleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of jobs. + * Retrieve a list of activities in the module identified by module name. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5282,14 +5161,14 @@ export interface JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByModuleNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of jobs. + * Retrieve a list of activities in the module identified by module name. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5306,7 +5185,7 @@ export interface JobOperations { * * {Promise} A promise is returned. * - * @resolve {JobListResult} - The deserialized result object. + * @resolve {ActivityListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5314,37 +5193,33 @@ export interface JobOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobListResult} for more information. - * + * {ActivityListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ActivityListResult} 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; + listByModuleNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByModuleNext(nextPageLink: string, callback: ServiceCallback): void; + listByModuleNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * JobStreamOperations + * ModuleOperations * __NOTE__: An instance of this class is automatically created for an * instance of the AutomationClient. */ -export interface JobStreamOperations { +export interface ModuleOperations { /** - * Retrieve the job stream identified by job stream id. - * - * @param {string} resourceGroupName The resource group name. + * Delete the module by name. * * @param {string} automationAccountName The automation account name. * - * @param {string} jobId The job id. - * - * @param {string} jobStreamId The job stream id. + * @param {string} moduleName The module name. * * @param {object} [options] Optional Parameters. * @@ -5353,22 +5228,18 @@ export interface JobStreamOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobId: string, jobStreamId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(automationAccountName: string, moduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve the job stream identified by job stream id. - * - * @param {string} resourceGroupName The resource group name. + * Delete the module by name. * * @param {string} automationAccountName The automation account name. * - * @param {string} jobId The job id. - * - * @param {string} jobStreamId The job stream id. + * @param {string} moduleName The module name. * * @param {object} [options] Optional Parameters. * @@ -5382,7 +5253,7 @@ export interface JobStreamOperations { * * {Promise} A promise is returned. * - * @resolve {JobStream} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5390,55 +5261,46 @@ export interface JobStreamOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobStream} [result] - The deserialized result object if an error did not occur. - * See {@link JobStream} for more information. + * {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. */ - get(resourceGroupName: string, automationAccountName: string, jobId: string, jobStreamId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, jobId: string, jobStreamId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, jobId: string, jobStreamId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, moduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(automationAccountName: string, moduleName: string, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, moduleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of jobs streams identified by job id. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the module identified by module name. * * @param {string} automationAccountName The automation account name. * - * @param {string} jobId The job Id. + * @param {string} moduleName The module name. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByJobWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobId: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, moduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of jobs streams identified by job id. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the module identified by module name. * * @param {string} automationAccountName The automation account name. * - * @param {string} jobId The job Id. + * @param {string} moduleName The module name. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -5449,7 +5311,7 @@ export interface JobStreamOperations { * * {Promise} A promise is returned. * - * @resolve {JobStreamListResult} - The deserialized result object. + * @resolve {Module} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5457,23 +5319,50 @@ export interface JobStreamOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobStreamListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobStreamListResult} for more information. + * {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. */ - listByJob(resourceGroupName: string, automationAccountName: string, jobId: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByJob(resourceGroupName: string, automationAccountName: string, jobId: string, callback: ServiceCallback): void; - listByJob(resourceGroupName: string, automationAccountName: string, jobId: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, moduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, moduleName: string, callback: ServiceCallback): void; + get(automationAccountName: string, moduleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of jobs streams identified by job id. + * Create or Update the module identified by module name. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} automationAccountName The automation account name. + * + * @param {string} moduleName The name of module. + * + * @param {object} parameters The create or update parameters for module. + * + * @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. * @@ -5482,17 +5371,44 @@ export interface JobStreamOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByJobNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(automationAccountName: string, moduleName: string, parameters: models.ModuleCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of jobs streams identified by job id. + * Create or Update the module identified by module name. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} automationAccountName The automation account name. + * + * @param {string} moduleName The name of module. + * + * @param {object} parameters The create or update parameters for module. + * + * @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. * @@ -5506,7 +5422,7 @@ export interface JobStreamOperations { * * {Promise} A promise is returned. * - * @resolve {JobStreamListResult} - The deserialized result object. + * @resolve {Module} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5514,35 +5430,51 @@ export interface JobStreamOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobStreamListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobStreamListResult} for more information. + * {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. */ - listByJobNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByJobNext(nextPageLink: string, callback: ServiceCallback): void; - listByJobNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * JobScheduleOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the AutomationClient. - */ -export interface JobScheduleOperations { + createOrUpdate(automationAccountName: string, moduleName: string, parameters: models.ModuleCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(automationAccountName: string, moduleName: string, parameters: models.ModuleCreateOrUpdateParameters, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, moduleName: string, parameters: models.ModuleCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Delete the job schedule identified by job schedule name. - * - * @param {string} resourceGroupName The resource group name. + * Update the module identified by module name. * * @param {string} automationAccountName The automation account name. * - * @param {uuid} jobScheduleId The job schedule name. + * @param {string} moduleName The name of module. + * + * @param {object} parameters The update parameters for module. + * + * @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. * @@ -5551,20 +5483,45 @@ export interface JobScheduleOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobScheduleId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(automationAccountName: string, moduleName: string, parameters: models.ModuleUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Delete the job schedule identified by job schedule name. - * - * @param {string} resourceGroupName The resource group name. + * Update the module identified by module name. * * @param {string} automationAccountName The automation account name. * - * @param {uuid} jobScheduleId The job schedule name. + * @param {string} moduleName The name of module. + * + * @param {object} parameters The update parameters for module. + * + * @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. * @@ -5578,7 +5535,7 @@ export interface JobScheduleOperations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {Module} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5586,26 +5543,23 @@ export interface JobScheduleOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - deleteMethod(resourceGroupName: string, automationAccountName: string, jobScheduleId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, automationAccountName: string, jobScheduleId: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, automationAccountName: string, jobScheduleId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(automationAccountName: string, moduleName: string, parameters: models.ModuleUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(automationAccountName: string, moduleName: string, parameters: models.ModuleUpdateParameters, callback: ServiceCallback): void; + update(automationAccountName: string, moduleName: string, parameters: models.ModuleUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve the job schedule identified by job schedule name. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of modules. * * @param {string} automationAccountName The automation account name. * - * @param {uuid} jobScheduleId The job schedule name. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5613,21 +5567,17 @@ export interface JobScheduleOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobScheduleId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve the job schedule identified by job schedule name. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of modules. * * @param {string} automationAccountName The automation account name. * - * @param {uuid} jobScheduleId The job schedule name. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5640,7 +5590,7 @@ export interface JobScheduleOperations { * * {Promise} A promise is returned. * - * @resolve {JobSchedule} - The deserialized result object. + * @resolve {ModuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5648,86 +5598,114 @@ export interface JobScheduleOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobSchedule} [result] - The deserialized result object if an error did not occur. - * See {@link JobSchedule} for more information. + * {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. */ - get(resourceGroupName: string, automationAccountName: string, jobScheduleId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, jobScheduleId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, jobScheduleId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Create a job schedule. + * Retrieve a list of modules. * - * @param {string} resourceGroupName The resource group name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} automationAccountName The automation account name. + * @param {object} [options] Optional Parameters. * - * @param {uuid} jobScheduleId The job schedule name. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} parameters The parameters supplied to the create job - * schedule operation. + * @returns {Promise} A promise is returned * - * @param {object} parameters.schedule Gets or sets the schedule. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.schedule.name] Gets or sets the name of the - * schedule. + * @reject {Error|ServiceError} - The error object. + */ + listByAutomationAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve a list of modules. * - * @param {object} parameters.runbook Gets or sets the runbook. - * - * @param {string} [parameters.runbook.name] Gets or sets the name of the - * runbook. - * - * @param {string} [parameters.runOn] Gets or sets the hybrid worker group that - * the scheduled job should run on. - * - * @param {object} [parameters.parameters] Gets or sets a list of job - * properties. + * @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 + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @reject {Error|ServiceError} - The error object. + * {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. */ - createWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, jobScheduleId: string, parameters: models.JobScheduleCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 + * ObjectDataTypes + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface ObjectDataTypes { + /** - * Create a job schedule. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of fields of a given type identified by module name. * * @param {string} automationAccountName The automation account name. * - * @param {uuid} jobScheduleId The job schedule name. + * @param {string} moduleName The name of module. * - * @param {object} parameters The parameters supplied to the create job - * schedule operation. + * @param {string} typeName The name of type. * - * @param {object} parameters.schedule Gets or sets the schedule. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.schedule.name] Gets or sets the name of the - * schedule. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} parameters.runbook Gets or sets the runbook. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.runbook.name] Gets or sets the name of the - * runbook. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.runOn] Gets or sets the hybrid worker group that - * the scheduled job should run on. + * @reject {Error|ServiceError} - The error object. + */ + listFieldsByModuleAndTypeWithHttpOperationResponse(automationAccountName: string, moduleName: string, typeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve a list of fields of a given type identified by module name. * - * @param {object} [parameters.parameters] Gets or sets a list of job - * properties. + * @param {string} automationAccountName The automation account name. + * + * @param {string} moduleName The name of module. + * + * @param {string} typeName The name of type. * * @param {object} [options] Optional Parameters. * @@ -5741,7 +5719,7 @@ export interface JobScheduleOperations { * * {Promise} A promise is returned. * - * @resolve {JobSchedule} - The deserialized result object. + * @resolve {TypeFieldListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5749,25 +5727,25 @@ export interface JobScheduleOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobSchedule} [result] - The deserialized result object if an error did not occur. - * See {@link JobSchedule} for more information. + * {TypeFieldListResult} [result] - The deserialized result object if an error did not occur. + * See {@link TypeFieldListResult} 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. */ - create(resourceGroupName: string, automationAccountName: string, jobScheduleId: string, parameters: models.JobScheduleCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - create(resourceGroupName: string, automationAccountName: string, jobScheduleId: string, parameters: models.JobScheduleCreateParameters, callback: ServiceCallback): void; - create(resourceGroupName: string, automationAccountName: string, jobScheduleId: string, parameters: models.JobScheduleCreateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listFieldsByModuleAndType(automationAccountName: string, moduleName: string, typeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listFieldsByModuleAndType(automationAccountName: string, moduleName: string, typeName: string, callback: ServiceCallback): void; + listFieldsByModuleAndType(automationAccountName: string, moduleName: string, typeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of job schedules. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of fields of a given type across all accessible modules. * * @param {string} automationAccountName The automation account name. * + * @param {string} typeName The name of type. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5775,19 +5753,19 @@ export interface JobScheduleOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listFieldsByTypeWithHttpOperationResponse(automationAccountName: string, typeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of job schedules. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of fields of a given type across all accessible modules. * * @param {string} automationAccountName The automation account name. * + * @param {string} typeName The name of type. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5800,7 +5778,7 @@ export interface JobScheduleOperations { * * {Promise} A promise is returned. * - * @resolve {JobScheduleListResult} - The deserialized result object. + * @resolve {TypeFieldListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5808,23 +5786,35 @@ export interface JobScheduleOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobScheduleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobScheduleListResult} for more information. + * {TypeFieldListResult} [result] - The deserialized result object if an error did not occur. + * See {@link TypeFieldListResult} 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; + listFieldsByType(automationAccountName: string, typeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listFieldsByType(automationAccountName: string, typeName: string, callback: ServiceCallback): void; + listFieldsByType(automationAccountName: string, typeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Fields + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface Fields { /** - * Retrieve a list of job schedules. + * Retrieve a list of fields of a given type identified by module name. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} automationAccountName The automation account name. + * + * @param {string} moduleName The name of module. + * + * @param {string} typeName The name of type. * * @param {object} [options] Optional Parameters. * @@ -5833,17 +5823,20 @@ export interface JobScheduleOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByTypeWithHttpOperationResponse(automationAccountName: string, moduleName: string, typeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of job schedules. + * Retrieve a list of fields of a given type identified by module name. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} automationAccountName The automation account name. + * + * @param {string} moduleName The name of module. + * + * @param {string} typeName The name of type. * * @param {object} [options] Optional Parameters. * @@ -5857,7 +5850,7 @@ export interface JobScheduleOperations { * * {Promise} A promise is returned. * - * @resolve {JobScheduleListResult} - The deserialized result object. + * @resolve {TypeFieldListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5865,38 +5858,33 @@ export interface JobScheduleOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobScheduleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobScheduleListResult} for more information. + * {TypeFieldListResult} [result] - The deserialized result object if an error did not occur. + * See {@link TypeFieldListResult} 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; + listByType(automationAccountName: string, moduleName: string, typeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByType(automationAccountName: string, moduleName: string, typeName: string, callback: ServiceCallback): void; + listByType(automationAccountName: string, moduleName: string, typeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * ActivityOperations + * RunbookDraftOperations * __NOTE__: An instance of this class is automatically created for an * instance of the AutomationClient. */ -export interface ActivityOperations { +export interface RunbookDraftOperations { /** - * Retrieve the activity in the module identified by module name and activity - * name. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the content of runbook draft identified by runbook name. * * @param {string} automationAccountName The automation account name. * - * @param {string} moduleName The name of module. - * - * @param {string} activityName The name of activity. + * @param {string} runbookName The runbook name. * * @param {object} [options] Optional Parameters. * @@ -5905,23 +5893,18 @@ export interface ActivityOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, moduleName: string, activityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getContentWithHttpOperationResponse(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve the activity in the module identified by module name and activity - * name. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the content of runbook draft identified by runbook name. * * @param {string} automationAccountName The automation account name. * - * @param {string} moduleName The name of module. - * - * @param {string} activityName The name of activity. + * @param {string} runbookName The runbook name. * * @param {object} [options] Optional Parameters. * @@ -5935,7 +5918,7 @@ export interface ActivityOperations { * * {Promise} A promise is returned. * - * @resolve {Activity} - The deserialized result object. + * @resolve {String} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5943,26 +5926,25 @@ export interface ActivityOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Activity} [result] - The deserialized result object if an error did not occur. - * See {@link Activity} for more information. + * {String} [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. */ - get(resourceGroupName: string, automationAccountName: string, moduleName: string, activityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, moduleName: string, activityName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, moduleName: string, activityName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getContent(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getContent(automationAccountName: string, runbookName: string, callback: ServiceCallback): void; + getContent(automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of activities in the module identified by module name. - * - * @param {string} resourceGroupName The resource group name. + * Replaces the runbook draft content. * * @param {string} automationAccountName The automation account name. * - * @param {string} moduleName The name of module. + * @param {string} runbookName The runbook name. + * + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -5971,20 +5953,20 @@ export interface ActivityOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByModuleWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, moduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + replaceContentWithHttpOperationResponse(automationAccountName: string, runbookName: string, runbookContent: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of activities in the module identified by module name. - * - * @param {string} resourceGroupName The resource group name. + * Replaces the runbook draft content. * * @param {string} automationAccountName The automation account name. * - * @param {string} moduleName The name of module. + * @param {string} runbookName The runbook name. + * + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -5998,7 +5980,7 @@ export interface ActivityOperations { * * {Promise} A promise is returned. * - * @resolve {ActivityListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6006,23 +5988,23 @@ export interface ActivityOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ActivityListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ActivityListResult} for more information. + * {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. */ - listByModule(resourceGroupName: string, automationAccountName: string, moduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByModule(resourceGroupName: string, automationAccountName: string, moduleName: string, callback: ServiceCallback): void; - listByModule(resourceGroupName: string, automationAccountName: string, moduleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + replaceContent(automationAccountName: string, runbookName: string, runbookContent: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + replaceContent(automationAccountName: string, runbookName: string, runbookContent: string, callback: ServiceCallback): void; + replaceContent(automationAccountName: string, runbookName: string, runbookContent: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of activities in the module identified by module name. + * Retrieve the runbook draft identified by runbook name. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook name. * * @param {object} [options] Optional Parameters. * @@ -6031,17 +6013,18 @@ export interface ActivityOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByModuleNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of activities in the module identified by module name. + * Retrieve the runbook draft identified by runbook name. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook name. * * @param {object} [options] Optional Parameters. * @@ -6055,7 +6038,7 @@ export interface ActivityOperations { * * {Promise} A promise is returned. * - * @resolve {ActivityListResult} - The deserialized result object. + * @resolve {RunbookDraft} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6063,35 +6046,25 @@ export interface ActivityOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ActivityListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ActivityListResult} for more information. + * {RunbookDraft} [result] - The deserialized result object if an error did not occur. + * See {@link RunbookDraft} 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. */ - listByModuleNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByModuleNext(nextPageLink: string, callback: ServiceCallback): void; - listByModuleNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ModuleOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the AutomationClient. - */ -export interface ModuleOperations { + get(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, runbookName: string, callback: ServiceCallback): void; + get(automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Delete the module by name. - * - * @param {string} resourceGroupName The resource group name. + * Publish runbook draft. * * @param {string} automationAccountName The automation account name. * - * @param {string} moduleName The module name. + * @param {string} runbookName The parameters supplied to the publish runbook + * operation. * * @param {object} [options] Optional Parameters. * @@ -6104,16 +6077,15 @@ export interface ModuleOperations { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, moduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + publishWithHttpOperationResponse(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Delete the module by name. - * - * @param {string} resourceGroupName The resource group name. + * Publish runbook draft. * * @param {string} automationAccountName The automation account name. * - * @param {string} moduleName The module name. + * @param {string} runbookName The parameters supplied to the publish runbook + * operation. * * @param {object} [options] Optional Parameters. * @@ -6141,19 +6113,17 @@ export interface ModuleOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, automationAccountName: string, moduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, automationAccountName: string, moduleName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, automationAccountName: string, moduleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + publish(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + publish(automationAccountName: string, runbookName: string, callback: ServiceCallback): void; + publish(automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve the module identified by module name. - * - * @param {string} resourceGroupName The resource group name. + * Undo draft edit to last known published state identified by runbook name. * * @param {string} automationAccountName The automation account name. * - * @param {string} moduleName The module name. + * @param {string} runbookName The runbook name. * * @param {object} [options] Optional Parameters. * @@ -6162,20 +6132,18 @@ export interface ModuleOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, moduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + undoEditWithHttpOperationResponse(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve the module identified by module name. - * - * @param {string} resourceGroupName The resource group name. + * Undo draft edit to last known published state identified by runbook name. * * @param {string} automationAccountName The automation account name. * - * @param {string} moduleName The module name. + * @param {string} runbookName The runbook name. * * @param {object} [options] Optional Parameters. * @@ -6189,7 +6157,7 @@ export interface ModuleOperations { * * {Promise} A promise is returned. * - * @resolve {Module} - The deserialized result object. + * @resolve {RunbookDraftUndoEditResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6197,52 +6165,27 @@ export interface ModuleOperations { * * {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. - * + * {RunbookDraftUndoEditResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunbookDraftUndoEditResult} 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, moduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, moduleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, moduleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + undoEdit(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + undoEdit(automationAccountName: string, runbookName: string, callback: ServiceCallback): void; + undoEdit(automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Create or Update the module identified by module name. - * - * @param {string} resourceGroupName The resource group name. + * Replaces the runbook draft content. * * @param {string} automationAccountName The automation account name. * - * @param {string} moduleName The name of module. - * - * @param {object} parameters The create or update parameters for module. - * - * @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 {string} runbookName The runbook name. * - * @param {object} [parameters.tags] Gets or sets the tags attached to the - * resource. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -6251,46 +6194,20 @@ export interface ModuleOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, moduleName: string, parameters: models.ModuleCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginReplaceContentWithHttpOperationResponse(automationAccountName: string, runbookName: string, runbookContent: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create or Update the module identified by module name. - * - * @param {string} resourceGroupName The resource group name. + * Replaces the runbook draft content. * * @param {string} automationAccountName The automation account name. * - * @param {string} moduleName The name of module. - * - * @param {object} parameters The create or update parameters for module. - * - * @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 {string} runbookName The runbook name. * - * @param {object} [parameters.tags] Gets or sets the tags attached to the - * resource. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -6304,7 +6221,7 @@ export interface ModuleOperations { * * {Promise} A promise is returned. * - * @resolve {Module} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6312,53 +6229,24 @@ export interface ModuleOperations { * * {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. + * {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. */ - createOrUpdate(resourceGroupName: string, automationAccountName: string, moduleName: string, parameters: models.ModuleCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, automationAccountName: string, moduleName: string, parameters: models.ModuleCreateOrUpdateParameters, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, automationAccountName: string, moduleName: string, parameters: models.ModuleCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginReplaceContent(automationAccountName: string, runbookName: string, runbookContent: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginReplaceContent(automationAccountName: string, runbookName: string, runbookContent: string, callback: ServiceCallback): void; + beginReplaceContent(automationAccountName: string, runbookName: string, runbookContent: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Update the module identified by module name. - * - * @param {string} resourceGroupName The resource group name. + * Publish runbook draft. * * @param {string} automationAccountName The automation account name. * - * @param {string} moduleName The name of module. - * - * @param {object} parameters The update parameters for module. - * - * @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 {string} runbookName The parameters supplied to the publish runbook + * operation. * * @param {object} [options] Optional Parameters. * @@ -6367,47 +6255,19 @@ export interface ModuleOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, moduleName: string, parameters: models.ModuleUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginPublishWithHttpOperationResponse(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Update the module identified by module name. - * - * @param {string} resourceGroupName The resource group name. + * Publish runbook draft. * * @param {string} automationAccountName The automation account name. * - * @param {string} moduleName The name of module. - * - * @param {object} parameters The update parameters for module. - * - * @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 {string} runbookName The parameters supplied to the publish runbook + * operation. * * @param {object} [options] Optional Parameters. * @@ -6421,7 +6281,7 @@ export interface ModuleOperations { * * {Promise} A promise is returned. * - * @resolve {Module} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6429,25 +6289,33 @@ export interface ModuleOperations { * * {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. + * {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. */ - update(resourceGroupName: string, automationAccountName: string, moduleName: string, parameters: models.ModuleUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, automationAccountName: string, moduleName: string, parameters: models.ModuleUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, automationAccountName: string, moduleName: string, parameters: models.ModuleUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginPublish(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginPublish(automationAccountName: string, runbookName: string, callback: ServiceCallback): void; + beginPublish(automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * RunbookOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface RunbookOperations { /** - * Retrieve a list of modules. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the content of runbook identified by runbook name. * * @param {string} automationAccountName The automation account name. * + * @param {string} runbookName The runbook name. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6455,19 +6323,19 @@ export interface ModuleOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getContentWithHttpOperationResponse(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of modules. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the content of runbook identified by runbook name. * * @param {string} automationAccountName The automation account name. * + * @param {string} runbookName The runbook name. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6480,7 +6348,7 @@ export interface ModuleOperations { * * {Promise} A promise is returned. * - * @resolve {ModuleListResult} - The deserialized result object. + * @resolve {String} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6488,23 +6356,23 @@ export interface ModuleOperations { * * {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. + * {String} [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. */ - 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; + getContent(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getContent(automationAccountName: string, runbookName: string, callback: ServiceCallback): void; + getContent(automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of modules. + * Retrieve the runbook identified by runbook name. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook name. * * @param {object} [options] Optional Parameters. * @@ -6513,17 +6381,18 @@ export interface ModuleOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of modules. + * Retrieve the runbook identified by runbook name. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook name. * * @param {object} [options] Optional Parameters. * @@ -6537,7 +6406,7 @@ export interface ModuleOperations { * * {Promise} A promise is returned. * - * @resolve {ModuleListResult} - The deserialized result object. + * @resolve {Runbook} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6545,102 +6414,88 @@ export interface ModuleOperations { * * {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. + * {Runbook} [result] - The deserialized result object if an error did not occur. + * See {@link Runbook} 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 - * ObjectDataTypes - * __NOTE__: An instance of this class is automatically created for an - * instance of the AutomationClient. - */ -export interface ObjectDataTypes { + get(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, runbookName: string, callback: ServiceCallback): void; + get(automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of fields of a given type identified by module name. - * - * @param {string} resourceGroupName The resource group name. + * Create the runbook identified by runbook name. * * @param {string} automationAccountName The automation account name. * - * @param {string} moduleName The name of module. + * @param {string} runbookName The runbook name. * - * @param {string} typeName The name of type. + * @param {object} parameters The create or update parameters for runbook. + * Provide either content link for a published runbook or draft, not both. * - * @param {object} [options] Optional Parameters. + * @param {boolean} [parameters.logVerbose] Gets or sets verbose log option. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {boolean} [parameters.logProgress] Gets or sets progress log option. * - * @returns {Promise} A promise is returned + * @param {string} parameters.runbookType Gets or sets the type of the runbook. + * Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', + * 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} [parameters.draft] Gets or sets the draft runbook + * properties. * - * @reject {Error|ServiceError} - The error object. - */ - listFieldsByModuleAndTypeWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, moduleName: string, typeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieve a list of fields of a given type identified by module name. + * @param {boolean} [parameters.draft.inEdit] Gets or sets whether runbook is + * in edit mode. * - * @param {string} resourceGroupName The resource group name. + * @param {object} [parameters.draft.draftContentLink] Gets or sets the draft + * runbook content link. * - * @param {string} automationAccountName The automation account name. + * @param {date} [parameters.draft.creationTime] Gets or sets the creation time + * of the runbook draft. * - * @param {string} moduleName The name of module. + * @param {date} [parameters.draft.lastModifiedTime] Gets or sets the last + * modified time of the runbook draft. * - * @param {string} typeName The name of type. + * @param {object} [parameters.draft.parameters] Gets or sets the runbook draft + * parameters. * - * @param {object} [options] Optional Parameters. + * @param {array} [parameters.draft.outputTypes] Gets or sets the runbook + * output types. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.publishContentLink] Gets or sets the published + * runbook content link. * - * @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 {TypeFieldListResult} - The deserialized result object. + * @param {string} [parameters.publishContentLink.uri] Gets or sets the uri of + * the runbook content. * - * @reject {Error|ServiceError} - The error object. + * @param {object} [parameters.publishContentLink.contentHash] Gets or sets the + * hash. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} parameters.publishContentLink.contentHash.algorithm Gets or + * sets the content hash algorithm used to hash the content. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} parameters.publishContentLink.contentHash.value Gets or sets + * expected hash value of the content. * - * {TypeFieldListResult} [result] - The deserialized result object if an error did not occur. - * See {@link TypeFieldListResult} for more information. + * @param {string} [parameters.publishContentLink.version] Gets or sets the + * version of the content. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.description] Gets or sets the description of the + * runbook. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listFieldsByModuleAndType(resourceGroupName: string, automationAccountName: string, moduleName: string, typeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listFieldsByModuleAndType(resourceGroupName: string, automationAccountName: string, moduleName: string, typeName: string, callback: ServiceCallback): void; - listFieldsByModuleAndType(resourceGroupName: string, automationAccountName: string, moduleName: string, typeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieve a list of fields of a given type across all accessible modules. + * @param {number} [parameters.logActivityTrace] Gets or sets the + * activity-level tracing options of the runbook. * - * @param {string} resourceGroupName The resource group name. + * @param {string} [parameters.name] Gets or sets the name of the resource. * - * @param {string} automationAccountName The automation account name. + * @param {string} [parameters.location] Gets or sets the location of the + * resource. * - * @param {string} typeName The name of type. + * @param {object} [parameters.tags] Gets or sets the tags attached to the + * resource. * * @param {object} [options] Optional Parameters. * @@ -6649,96 +6504,82 @@ export interface ObjectDataTypes { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listFieldsByTypeWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, typeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(automationAccountName: string, runbookName: string, parameters: models.RunbookCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of fields of a given type across all accessible modules. - * - * @param {string} resourceGroupName The resource group name. + * Create the runbook identified by runbook name. * * @param {string} automationAccountName The automation account name. * - * @param {string} typeName The name of type. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} runbookName The runbook name. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} parameters The create or update parameters for runbook. + * Provide either content link for a published runbook or draft, not both. * - * {Promise} A promise is returned. + * @param {boolean} [parameters.logVerbose] Gets or sets verbose log option. * - * @resolve {TypeFieldListResult} - The deserialized result object. + * @param {boolean} [parameters.logProgress] Gets or sets progress log option. * - * @reject {Error|ServiceError} - The error object. + * @param {string} parameters.runbookType Gets or sets the type of the runbook. + * Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', + * 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [parameters.draft] Gets or sets the draft runbook + * properties. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {boolean} [parameters.draft.inEdit] Gets or sets whether runbook is + * in edit mode. * - * {TypeFieldListResult} [result] - The deserialized result object if an error did not occur. - * See {@link TypeFieldListResult} for more information. + * @param {object} [parameters.draft.draftContentLink] Gets or sets the draft + * runbook content link. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {date} [parameters.draft.creationTime] Gets or sets the creation time + * of the runbook draft. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listFieldsByType(resourceGroupName: string, automationAccountName: string, typeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listFieldsByType(resourceGroupName: string, automationAccountName: string, typeName: string, callback: ServiceCallback): void; - listFieldsByType(resourceGroupName: string, automationAccountName: string, typeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Fields - * __NOTE__: An instance of this class is automatically created for an - * instance of the AutomationClient. - */ -export interface Fields { - - - /** - * Retrieve a list of fields of a given type identified by module name. + * @param {date} [parameters.draft.lastModifiedTime] Gets or sets the last + * modified time of the runbook draft. * - * @param {string} resourceGroupName The resource group name. + * @param {object} [parameters.draft.parameters] Gets or sets the runbook draft + * parameters. * - * @param {string} automationAccountName The automation account name. + * @param {array} [parameters.draft.outputTypes] Gets or sets the runbook + * output types. * - * @param {string} moduleName The name of module. + * @param {object} [parameters.publishContentLink] Gets or sets the published + * runbook content link. * - * @param {string} typeName The name of type. + * @param {string} [parameters.publishContentLink.uri] Gets or sets the uri of + * the runbook content. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.publishContentLink.contentHash] Gets or sets the + * hash. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} parameters.publishContentLink.contentHash.algorithm Gets or + * sets the content hash algorithm used to hash the content. * - * @returns {Promise} A promise is returned + * @param {string} parameters.publishContentLink.contentHash.value Gets or sets + * expected hash value of the content. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.publishContentLink.version] Gets or sets the + * version of the content. * - * @reject {Error|ServiceError} - The error object. - */ - listByTypeWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, moduleName: string, typeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieve a list of fields of a given type identified by module name. + * @param {string} [parameters.description] Gets or sets the description of the + * runbook. * - * @param {string} resourceGroupName The resource group name. + * @param {number} [parameters.logActivityTrace] Gets or sets the + * activity-level tracing options of the runbook. * - * @param {string} automationAccountName The automation account name. + * @param {string} [parameters.name] Gets or sets the name of the resource. * - * @param {string} moduleName The name of module. + * @param {string} [parameters.location] Gets or sets the location of the + * resource. * - * @param {string} typeName The name of type. + * @param {object} [parameters.tags] Gets or sets the tags attached to the + * resource. * * @param {object} [options] Optional Parameters. * @@ -6752,7 +6593,7 @@ export interface Fields { * * {Promise} A promise is returned. * - * @resolve {TypeFieldListResult} - The deserialized result object. + * @resolve {Runbook} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6760,36 +6601,45 @@ export interface Fields { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TypeFieldListResult} [result] - The deserialized result object if an error did not occur. - * See {@link TypeFieldListResult} for more information. + * {Runbook} [result] - The deserialized result object if an error did not occur. + * See {@link Runbook} 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. */ - listByType(resourceGroupName: string, automationAccountName: string, moduleName: string, typeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByType(resourceGroupName: string, automationAccountName: string, moduleName: string, typeName: string, callback: ServiceCallback): void; - listByType(resourceGroupName: string, automationAccountName: string, moduleName: string, typeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * RunbookDraftOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the AutomationClient. - */ -export interface RunbookDraftOperations { + createOrUpdate(automationAccountName: string, runbookName: string, parameters: models.RunbookCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(automationAccountName: string, runbookName: string, parameters: models.RunbookCreateOrUpdateParameters, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, runbookName: string, parameters: models.RunbookCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve the content of runbook draft identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Update the runbook identified by runbook name. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * + * @param {object} parameters The update parameters for runbook. + * + * @param {string} [parameters.description] Gets or sets the description of the + * runbook. + * + * @param {boolean} [parameters.logVerbose] Gets or sets verbose log option. + * + * @param {boolean} [parameters.logProgress] Gets or sets progress log option. + * + * @param {number} [parameters.logActivityTrace] Gets or sets the + * activity-level tracing options of the runbook. + * + * @param {string} [parameters.name] Gets or sets the 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 @@ -6797,21 +6647,39 @@ export interface RunbookDraftOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getContentWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(automationAccountName: string, runbookName: string, parameters: models.RunbookUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve the content of runbook draft identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Update the runbook identified by runbook name. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * + * @param {object} parameters The update parameters for runbook. + * + * @param {string} [parameters.description] Gets or sets the description of the + * runbook. + * + * @param {boolean} [parameters.logVerbose] Gets or sets verbose log option. + * + * @param {boolean} [parameters.logProgress] Gets or sets progress log option. + * + * @param {number} [parameters.logActivityTrace] Gets or sets the + * activity-level tracing options of the runbook. + * + * @param {string} [parameters.name] Gets or sets the 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 @@ -6824,7 +6692,7 @@ export interface RunbookDraftOperations { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {Runbook} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6832,28 +6700,25 @@ export interface RunbookDraftOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {Runbook} [result] - The deserialized result object if an error did not occur. + * See {@link Runbook} 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. */ - getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; - getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(automationAccountName: string, runbookName: string, parameters: models.RunbookUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(automationAccountName: string, runbookName: string, parameters: models.RunbookUpdateParameters, callback: ServiceCallback): void; + update(automationAccountName: string, runbookName: string, parameters: models.RunbookUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates the runbook draft with runbookStream as its content. - * - * @param {string} resourceGroupName The resource group name. + * Delete the runbook by name. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * - * @param {object} runbookContent The runbook draft content. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6865,19 +6730,15 @@ export interface RunbookDraftOperations { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: stream.Readable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates the runbook draft with runbookStream as its content. - * - * @param {string} resourceGroupName The resource group name. + * Delete the runbook by name. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * - * @param {object} runbookContent The runbook draft content. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6904,20 +6765,16 @@ export interface RunbookDraftOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: stream.Readable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: stream.Readable, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: stream.Readable, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(automationAccountName: string, runbookName: string, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve the runbook draft identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of runbooks. * * @param {string} automationAccountName The automation account name. * - * @param {string} runbookName The runbook name. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6925,21 +6782,17 @@ export interface RunbookDraftOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve the runbook draft identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of runbooks. * * @param {string} automationAccountName The automation account name. * - * @param {string} runbookName The runbook name. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6952,7 +6805,7 @@ export interface RunbookDraftOperations { * * {Promise} A promise is returned. * - * @resolve {RunbookDraft} - The deserialized result object. + * @resolve {RunbookListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6960,27 +6813,23 @@ export interface RunbookDraftOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RunbookDraft} [result] - The deserialized result object if an error did not occur. - * See {@link RunbookDraft} for more information. + * {RunbookListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunbookListResult} 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, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Publish runbook draft. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Retrieve a list of runbooks. * - * @param {string} runbookName The parameters supplied to the publish runbook - * operation. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -6989,21 +6838,17 @@ export interface RunbookDraftOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - publishWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Publish runbook draft. + * Retrieve a list of runbooks. * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} runbookName The parameters supplied to the publish runbook - * operation. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7017,7 +6862,7 @@ export interface RunbookDraftOperations { * * {Promise} A promise is returned. * - * @resolve {Runbook} - The deserialized result object. + * @resolve {RunbookListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7025,27 +6870,37 @@ export interface RunbookDraftOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Runbook} [result] - The deserialized result object if an error did not occur. - * See {@link Runbook} for more information. + * {RunbookListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunbookListResult} 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. */ - publish(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - publish(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; - publish(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 + * TestJobStreams + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface TestJobStreams { /** - * Retrieve the runbook identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a test job stream of the test job identified by runbook name and + * stream id. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * + * @param {string} jobStreamId The job stream id. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7053,21 +6908,22 @@ export interface RunbookDraftOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - undoEditWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, runbookName: string, jobStreamId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve the runbook identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a test job stream of the test job identified by runbook name and + * stream id. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * + * @param {string} jobStreamId The job stream id. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7080,7 +6936,7 @@ export interface RunbookDraftOperations { * * {Promise} A promise is returned. * - * @resolve {RunbookDraftUndoEditResult} - The deserialized result object. + * @resolve {JobStream} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7088,56 +6944,51 @@ export interface RunbookDraftOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RunbookDraftUndoEditResult} [result] - The deserialized result object if an error did not occur. - * See {@link RunbookDraftUndoEditResult} for more - * information. + * {JobStream} [result] - The deserialized result object if an error did not occur. + * See {@link JobStream} 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. */ - undoEdit(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - undoEdit(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; - undoEdit(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, runbookName: string, jobStreamId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, runbookName: string, jobStreamId: string, callback: ServiceCallback): void; + get(automationAccountName: string, runbookName: string, jobStreamId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates the runbook draft with runbookStream as its content. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of test job streams identified by runbook name. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * - * @param {object} runbookContent The runbook draft content. - * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] The filter to apply on the operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: stream.Readable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByTestJobWithHttpOperationResponse(automationAccountName: string, runbookName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates the runbook draft with runbookStream as its content. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of test job streams identified by runbook name. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * - * @param {object} runbookContent The runbook draft content. - * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] The filter to apply on the operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -7148,7 +6999,7 @@ export interface RunbookDraftOperations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {JobStreamListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7156,26 +7007,23 @@ export interface RunbookDraftOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {JobStreamListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobStreamListResult} 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. */ - beginCreateOrUpdate(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: stream.Readable, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: stream.Readable, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, automationAccountName: string, runbookName: string, runbookContent: stream.Readable, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByTestJob(automationAccountName: string, runbookName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByTestJob(automationAccountName: string, runbookName: string, callback: ServiceCallback): void; + listByTestJob(automationAccountName: string, runbookName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Publish runbook draft. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Retrieve a list of test job streams identified by runbook name. * - * @param {string} runbookName The parameters supplied to the publish runbook - * operation. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7184,21 +7032,17 @@ export interface RunbookDraftOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginPublishWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByTestJobNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Publish runbook draft. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Retrieve a list of test job streams identified by runbook name. * - * @param {string} runbookName The parameters supplied to the publish runbook - * operation. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7212,7 +7056,7 @@ export interface RunbookDraftOperations { * * {Promise} A promise is returned. * - * @resolve {Runbook} - The deserialized result object. + * @resolve {JobStreamListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7220,35 +7064,43 @@ export interface RunbookDraftOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Runbook} [result] - The deserialized result object if an error did not occur. - * See {@link Runbook} for more information. + * {JobStreamListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobStreamListResult} 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. */ - beginPublish(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginPublish(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; - beginPublish(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByTestJobNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByTestJobNext(nextPageLink: string, callback: ServiceCallback): void; + listByTestJobNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * RunbookOperations + * TestJobOperations * __NOTE__: An instance of this class is automatically created for an * instance of the AutomationClient. */ -export interface RunbookOperations { +export interface TestJobOperations { /** - * Retrieve the content of runbook identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Create a test job of the runbook. * * @param {string} automationAccountName The automation account name. * - * @param {string} runbookName The runbook name. + * @param {string} runbookName The parameters supplied to the create test job + * operation. + * + * @param {object} parameters The parameters supplied to the create test job + * operation. + * + * @param {object} [parameters.parameters] Gets or sets the parameters of the + * test job. + * + * @param {string} [parameters.runOn] Gets or sets the runOn which specifies + * the group name where the job is to be executed. * * @param {object} [options] Optional Parameters. * @@ -7257,20 +7109,28 @@ export interface RunbookOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getContentWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(automationAccountName: string, runbookName: string, parameters: models.TestJobCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve the content of runbook identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Create a test job of the runbook. * * @param {string} automationAccountName The automation account name. * - * @param {string} runbookName The runbook name. + * @param {string} runbookName The parameters supplied to the create test job + * operation. + * + * @param {object} parameters The parameters supplied to the create test job + * operation. + * + * @param {object} [parameters.parameters] Gets or sets the parameters of the + * test job. + * + * @param {string} [parameters.runOn] Gets or sets the runOn which specifies + * the group name where the job is to be executed. * * @param {object} [options] Optional Parameters. * @@ -7284,7 +7144,7 @@ export interface RunbookOperations { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {TestJob} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7292,21 +7152,20 @@ export interface RunbookOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {TestJob} [result] - The deserialized result object if an error did not occur. + * See {@link TestJob} 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. */ - getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; - getContent(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(automationAccountName: string, runbookName: string, parameters: models.TestJobCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(automationAccountName: string, runbookName: string, parameters: models.TestJobCreateParameters, callback: ServiceCallback): void; + create(automationAccountName: string, runbookName: string, parameters: models.TestJobCreateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve the runbook identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the test job for the specified runbook. * * @param {string} automationAccountName The automation account name. * @@ -7319,16 +7178,14 @@ export interface RunbookOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve the runbook identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the test job for the specified runbook. * * @param {string} automationAccountName The automation account name. * @@ -7346,7 +7203,7 @@ export interface RunbookOperations { * * {Promise} A promise is returned. * - * @resolve {Runbook} - The deserialized result object. + * @resolve {TestJob} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7354,90 +7211,82 @@ export interface RunbookOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Runbook} [result] - The deserialized result object if an error did not occur. - * See {@link Runbook} for more information. + * {TestJob} [result] - The deserialized result object if an error did not occur. + * See {@link TestJob} 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, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, runbookName: string, callback: ServiceCallback): void; + get(automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Create the runbook identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Resume the test job. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * - * @param {object} parameters The create or update parameters for runbook. - * Provide either content link for a published runbook or draft, not both. - * - * @param {boolean} [parameters.logVerbose] Gets or sets verbose log option. + * @param {object} [options] Optional Parameters. * - * @param {boolean} [parameters.logProgress] Gets or sets progress log option. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} parameters.runbookType Gets or sets the type of the runbook. - * Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', - * 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + * @returns {Promise} A promise is returned * - * @param {object} [parameters.draft] Gets or sets the draft runbook - * properties. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} [parameters.draft.inEdit] Gets or sets whether runbook is - * in edit mode. + * @reject {Error|ServiceError} - The error object. + */ + resumeWithHttpOperationResponse(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Resume the test job. * - * @param {object} [parameters.draft.draftContentLink] Gets or sets the draft - * runbook content link. + * @param {string} automationAccountName The automation account name. * - * @param {date} [parameters.draft.creationTime] Gets or sets the creation time - * of the runbook draft. + * @param {string} runbookName The runbook name. * - * @param {date} [parameters.draft.lastModifiedTime] Gets or sets the last - * modified time of the runbook draft. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.draft.parameters] Gets or sets the runbook draft - * parameters. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.draft.outputTypes] Gets or sets the runbook - * output types. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [parameters.publishContentLink] Gets or sets the published - * runbook content link. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.publishContentLink.uri] Gets or sets the uri of - * the runbook content. + * {Promise} A promise is returned. * - * @param {object} [parameters.publishContentLink.contentHash] Gets or sets the - * hash. + * @resolve {null} - The deserialized result object. * - * @param {string} parameters.publishContentLink.contentHash.algorithm Gets or - * sets the content hash algorithm used to hash the content. + * @reject {Error|ServiceError} - The error object. * - * @param {string} parameters.publishContentLink.contentHash.value Gets or sets - * expected hash value of the content. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} [parameters.publishContentLink.version] Gets or sets the - * version of the content. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.description] Gets or sets the description of the - * runbook. + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {number} [parameters.logActivityTrace] Gets or sets the - * activity-level tracing options of the runbook. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [parameters.name] Gets or sets the name of the resource. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + resume(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resume(automationAccountName: string, runbookName: string, callback: ServiceCallback): void; + resume(automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Stop the test job. * - * @param {string} [parameters.location] Gets or sets the location of the - * resource. + * @param {string} automationAccountName The automation account name. * - * @param {object} [parameters.tags] Gets or sets the tags attached to the - * resource. + * @param {string} runbookName The runbook name. * * @param {object} [options] Optional Parameters. * @@ -7450,80 +7299,1411 @@ export interface RunbookOperations { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, parameters: models.RunbookCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + stopWithHttpOperationResponse(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create the runbook identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Stop the test job. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * - * @param {object} parameters The create or update parameters for runbook. - * Provide either content link for a published runbook or draft, not both. + * @param {object} [options] Optional Parameters. * - * @param {boolean} [parameters.logVerbose] Gets or sets verbose log option. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [parameters.logProgress] Gets or sets progress log option. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} parameters.runbookType Gets or sets the type of the runbook. - * Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', - * 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {object} [parameters.draft] Gets or sets the draft runbook - * properties. + * {Promise} A promise is returned. * - * @param {boolean} [parameters.draft.inEdit] Gets or sets whether runbook is - * in edit mode. + * @resolve {null} - The deserialized result object. * - * @param {object} [parameters.draft.draftContentLink] Gets or sets the draft - * runbook content link. + * @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. + */ + stop(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stop(automationAccountName: string, runbookName: string, callback: ServiceCallback): void; + stop(automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Suspend the test job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook 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. + */ + suspendWithHttpOperationResponse(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Suspend the test job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook 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. + */ + suspend(automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + suspend(automationAccountName: string, runbookName: string, callback: ServiceCallback): void; + suspend(automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ScheduleOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface ScheduleOperations { + + + /** + * Create a schedule. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} scheduleName The schedule name. + * + * @param {object} parameters The parameters supplied to the create or update + * schedule operation. + * + * @param {string} parameters.name Gets or sets the name of the schedule. + * + * @param {string} [parameters.description] Gets or sets the description of the + * schedule. + * + * @param {date} parameters.startTime Gets or sets the start time of the + * schedule. + * + * @param {date} [parameters.expiryTime] Gets or sets the end time of the + * schedule. + * + * @param {object} [parameters.interval] Gets or sets the interval of the + * schedule. + * + * @param {string} parameters.frequency Possible values include: 'OneTime', + * 'Day', 'Hour', 'Week', 'Month' + * + * @param {string} [parameters.timeZone] Gets or sets the time zone of the + * schedule. + * + * @param {object} [parameters.advancedSchedule] Gets or sets the + * AdvancedSchedule. + * + * @param {array} [parameters.advancedSchedule.weekDays] Days of the week that + * the job should execute on. + * + * @param {array} [parameters.advancedSchedule.monthDays] Days of the month + * that the job should execute on. Must be between 1 and 31. + * + * @param {array} [parameters.advancedSchedule.monthlyOccurrences] Occurrences + * of days within a month. + * + * @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(automationAccountName: string, scheduleName: string, parameters: models.ScheduleCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create a schedule. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} scheduleName The schedule name. + * + * @param {object} parameters The parameters supplied to the create or update + * schedule operation. + * + * @param {string} parameters.name Gets or sets the name of the schedule. + * + * @param {string} [parameters.description] Gets or sets the description of the + * schedule. + * + * @param {date} parameters.startTime Gets or sets the start time of the + * schedule. + * + * @param {date} [parameters.expiryTime] Gets or sets the end time of the + * schedule. + * + * @param {object} [parameters.interval] Gets or sets the interval of the + * schedule. + * + * @param {string} parameters.frequency Possible values include: 'OneTime', + * 'Day', 'Hour', 'Week', 'Month' + * + * @param {string} [parameters.timeZone] Gets or sets the time zone of the + * schedule. + * + * @param {object} [parameters.advancedSchedule] Gets or sets the + * AdvancedSchedule. + * + * @param {array} [parameters.advancedSchedule.weekDays] Days of the week that + * the job should execute on. + * + * @param {array} [parameters.advancedSchedule.monthDays] Days of the month + * that the job should execute on. Must be between 1 and 31. + * + * @param {array} [parameters.advancedSchedule.monthlyOccurrences] Occurrences + * of days within a month. + * + * @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 {Schedule} - 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. + * + * {Schedule} [result] - The deserialized result object if an error did not occur. + * See {@link Schedule} 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(automationAccountName: string, scheduleName: string, parameters: models.ScheduleCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(automationAccountName: string, scheduleName: string, parameters: models.ScheduleCreateOrUpdateParameters, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, scheduleName: string, parameters: models.ScheduleCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Update the schedule identified by schedule name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} scheduleName The schedule name. + * + * @param {object} parameters The parameters supplied to the update schedule + * operation. + * + * @param {string} [parameters.name] Gets or sets the name of the schedule. + * + * @param {string} [parameters.description] Gets or sets the description of the + * schedule. + * + * @param {boolean} [parameters.isEnabled] Gets or sets a value indicating + * whether this schedule is enabled. + * + * @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(automationAccountName: string, scheduleName: string, parameters: models.ScheduleUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Update the schedule identified by schedule name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} scheduleName The schedule name. + * + * @param {object} parameters The parameters supplied to the update schedule + * operation. + * + * @param {string} [parameters.name] Gets or sets the name of the schedule. + * + * @param {string} [parameters.description] Gets or sets the description of the + * schedule. + * + * @param {boolean} [parameters.isEnabled] Gets or sets a value indicating + * whether this schedule is enabled. + * + * @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 {Schedule} - 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. + * + * {Schedule} [result] - The deserialized result object if an error did not occur. + * See {@link Schedule} 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(automationAccountName: string, scheduleName: string, parameters: models.ScheduleUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(automationAccountName: string, scheduleName: string, parameters: models.ScheduleUpdateParameters, callback: ServiceCallback): void; + update(automationAccountName: string, scheduleName: string, parameters: models.ScheduleUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieve the schedule identified by schedule name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} scheduleName The schedule 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(automationAccountName: string, scheduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve the schedule identified by schedule name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} scheduleName The schedule 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 {Schedule} - 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. + * + * {Schedule} [result] - The deserialized result object if an error did not occur. + * See {@link Schedule} 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(automationAccountName: string, scheduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, scheduleName: string, callback: ServiceCallback): void; + get(automationAccountName: string, scheduleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Delete the schedule identified by schedule name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} scheduleName The schedule 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(automationAccountName: string, scheduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Delete the schedule identified by schedule name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} scheduleName The schedule 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(automationAccountName: string, scheduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(automationAccountName: string, scheduleName: string, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, scheduleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieve a list of schedules. + * + * @param {string} automationAccountName The automation account 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. + */ + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve a list of schedules. + * + * @param {string} automationAccountName The automation account 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 {ScheduleListResult} - 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. + * + * {ScheduleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ScheduleListResult} 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(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieve a list of schedules. + * + * @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 schedules. + * + * @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 {ScheduleListResult} - 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. + * + * {ScheduleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ScheduleListResult} 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 + * VariableOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface VariableOperations { + + + /** + * Create a variable. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} variableName The variable name. + * + * @param {object} parameters The parameters supplied to the create or update + * variable operation. + * + * @param {string} parameters.name Gets or sets the name of the variable. + * + * @param {string} [parameters.value] Gets or sets the value of the variable. + * + * @param {string} [parameters.description] Gets or sets the description of the + * variable. + * + * @param {boolean} [parameters.isEncrypted] Gets or sets the encrypted flag of + * the variable. + * + * @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(automationAccountName: string, variableName: string, parameters: models.VariableCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create a variable. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} variableName The variable name. + * + * @param {object} parameters The parameters supplied to the create or update + * variable operation. + * + * @param {string} parameters.name Gets or sets the name of the variable. + * + * @param {string} [parameters.value] Gets or sets the value of the variable. + * + * @param {string} [parameters.description] Gets or sets the description of the + * variable. + * + * @param {boolean} [parameters.isEncrypted] Gets or sets the encrypted flag of + * the variable. + * + * @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 {Variable} - 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. + * + * {Variable} [result] - The deserialized result object if an error did not occur. + * See {@link Variable} 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(automationAccountName: string, variableName: string, parameters: models.VariableCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(automationAccountName: string, variableName: string, parameters: models.VariableCreateOrUpdateParameters, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, variableName: string, parameters: models.VariableCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Update a variable. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} variableName The variable name. + * + * @param {object} parameters The parameters supplied to the update variable + * operation. + * + * @param {string} [parameters.name] Gets or sets the name of the variable. + * + * @param {string} [parameters.value] Gets or sets the value of the variable. + * + * @param {string} [parameters.description] Gets or sets the description of the + * variable. + * + * @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(automationAccountName: string, variableName: string, parameters: models.VariableUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Update a variable. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} variableName The variable name. + * + * @param {object} parameters The parameters supplied to the update variable + * operation. + * + * @param {string} [parameters.name] Gets or sets the name of the variable. + * + * @param {string} [parameters.value] Gets or sets the value of the variable. + * + * @param {string} [parameters.description] Gets or sets the description of the + * variable. + * + * @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 {Variable} - 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. + * + * {Variable} [result] - The deserialized result object if an error did not occur. + * See {@link Variable} 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(automationAccountName: string, variableName: string, parameters: models.VariableUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(automationAccountName: string, variableName: string, parameters: models.VariableUpdateParameters, callback: ServiceCallback): void; + update(automationAccountName: string, variableName: string, parameters: models.VariableUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Delete the variable. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} variableName The name of variable. + * + * @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(automationAccountName: string, variableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Delete the variable. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} variableName The name of variable. + * + * @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(automationAccountName: string, variableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(automationAccountName: string, variableName: string, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, variableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieve the variable identified by variable name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} variableName The name of variable. + * + * @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(automationAccountName: string, variableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve the variable identified by variable name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} variableName The name of variable. + * + * @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 {Variable} - 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. + * + * {Variable} [result] - The deserialized result object if an error did not occur. + * See {@link Variable} 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(automationAccountName: string, variableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, variableName: string, callback: ServiceCallback): void; + get(automationAccountName: string, variableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieve a list of variables. + * + * @param {string} automationAccountName The automation account 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. + */ + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve a list of variables. + * + * @param {string} automationAccountName The automation account 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 {VariableListResult} - 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. + * + * {VariableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VariableListResult} 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(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieve a list of variables. + * + * @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 variables. + * + * @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 {VariableListResult} - 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. + * + * {VariableListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VariableListResult} 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 + * WebhookOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface WebhookOperations { + + + /** + * Generates a Uri for use in creating a webhook. + * + * @param {string} automationAccountName The automation account 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. + */ + generateUriWithHttpOperationResponse(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Generates a Uri for use in creating a webhook. + * + * @param {string} automationAccountName The automation account 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 {String} - 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. + * + * {String} [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. + */ + generateUri(automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generateUri(automationAccountName: string, callback: ServiceCallback): void; + generateUri(automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Delete the webhook by name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} webhookName The webhook 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(automationAccountName: string, webhookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Delete the webhook by name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} webhookName The webhook 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(automationAccountName: string, webhookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(automationAccountName: string, webhookName: string, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, webhookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieve the webhook identified by webhook name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} webhookName The webhook 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(automationAccountName: string, webhookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve the webhook identified by webhook name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} webhookName The webhook 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 {Webhook} - 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. + * + * {Webhook} [result] - The deserialized result object if an error did not occur. + * See {@link Webhook} 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(automationAccountName: string, webhookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, webhookName: string, callback: ServiceCallback): void; + get(automationAccountName: string, webhookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Create the webhook identified by webhook name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} webhookName The webhook name. * - * @param {date} [parameters.draft.creationTime] Gets or sets the creation time - * of the runbook draft. + * @param {object} parameters The create or update parameters for webhook. * - * @param {date} [parameters.draft.lastModifiedTime] Gets or sets the last - * modified time of the runbook draft. + * @param {string} parameters.name Gets or sets the name of the webhook. * - * @param {object} [parameters.draft.parameters] Gets or sets the runbook draft - * parameters. + * @param {boolean} [parameters.isEnabled] Gets or sets the value of the + * enabled flag of webhook. * - * @param {array} [parameters.draft.outputTypes] Gets or sets the runbook - * output types. + * @param {string} [parameters.uri] Gets or sets the uri. * - * @param {object} [parameters.publishContentLink] Gets or sets the published - * runbook content link. + * @param {date} [parameters.expiryTime] Gets or sets the expiry time. * - * @param {string} [parameters.publishContentLink.uri] Gets or sets the uri of - * the runbook content. + * @param {object} [parameters.parameters] Gets or sets the parameters of the + * job. * - * @param {object} [parameters.publishContentLink.contentHash] Gets or sets the - * hash. + * @param {object} [parameters.runbook] Gets or sets the runbook. * - * @param {string} parameters.publishContentLink.contentHash.algorithm Gets or - * sets the content hash algorithm used to hash the content. + * @param {string} [parameters.runbook.name] Gets or sets the name of the + * runbook. * - * @param {string} parameters.publishContentLink.contentHash.value Gets or sets - * expected hash value of the content. + * @param {string} [parameters.runOn] Gets or sets the name of the hybrid + * worker group the webhook job will run on. * - * @param {string} [parameters.publishContentLink.version] Gets or sets the - * version of the content. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.description] Gets or sets the description of the + * @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(automationAccountName: string, webhookName: string, parameters: models.WebhookCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create the webhook identified by webhook name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} webhookName The webhook name. + * + * @param {object} parameters The create or update parameters for webhook. + * + * @param {string} parameters.name Gets or sets the name of the webhook. + * + * @param {boolean} [parameters.isEnabled] Gets or sets the value of the + * enabled flag of webhook. + * + * @param {string} [parameters.uri] Gets or sets the uri. + * + * @param {date} [parameters.expiryTime] Gets or sets the expiry time. + * + * @param {object} [parameters.parameters] Gets or sets the parameters of the + * job. + * + * @param {object} [parameters.runbook] Gets or sets the runbook. + * + * @param {string} [parameters.runbook.name] Gets or sets the name of the * runbook. * - * @param {number} [parameters.logActivityTrace] Gets or sets the - * activity-level tracing options of the runbook. + * @param {string} [parameters.runOn] Gets or sets the name of the hybrid + * worker group the webhook job will run on. * - * @param {string} [parameters.name] Gets or sets the name of 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 {Webhook} - 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. + * + * {Webhook} [result] - The deserialized result object if an error did not occur. + * See {@link Webhook} 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(automationAccountName: string, webhookName: string, parameters: models.WebhookCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(automationAccountName: string, webhookName: string, parameters: models.WebhookCreateOrUpdateParameters, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, webhookName: string, parameters: models.WebhookCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Update the webhook identified by webhook name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} webhookName The webhook name. + * + * @param {object} parameters The update parameters for webhook. + * + * @param {string} [parameters.name] Gets or sets the name of the webhook. + * + * @param {boolean} [parameters.isEnabled] Gets or sets the value of the + * enabled flag of webhook. + * + * @param {string} [parameters.runOn] Gets or sets the name of the hybrid + * worker group the webhook job will run on. + * + * @param {object} [parameters.parameters] Gets or sets the parameters of the + * job. + * + * @param {string} [parameters.description] Gets or sets the description of the + * webhook. + * + * @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(automationAccountName: string, webhookName: string, parameters: models.WebhookUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Update the webhook identified by webhook name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} webhookName The webhook name. + * + * @param {object} parameters The update parameters for webhook. + * + * @param {string} [parameters.name] Gets or sets the name of the webhook. + * + * @param {boolean} [parameters.isEnabled] Gets or sets the value of the + * enabled flag of webhook. + * + * @param {string} [parameters.runOn] Gets or sets the name of the hybrid + * worker group the webhook job will run on. + * + * @param {object} [parameters.parameters] Gets or sets the parameters of the + * job. + * + * @param {string} [parameters.description] Gets or sets the description of the + * webhook. + * + * @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 {Webhook} - 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. + * + * {Webhook} [result] - The deserialized result object if an error did not occur. + * See {@link Webhook} 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(automationAccountName: string, webhookName: string, parameters: models.WebhookUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(automationAccountName: string, webhookName: string, parameters: models.WebhookUpdateParameters, callback: ServiceCallback): void; + update(automationAccountName: string, webhookName: string, parameters: models.WebhookUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieve a list of webhooks. + * + * @param {string} automationAccountName The automation account name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @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(automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve a list of webhooks. + * + * @param {string} automationAccountName The automation account name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @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 {WebhookListResult} - 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. + * + * {WebhookListResult} [result] - The deserialized result object if an error did not occur. + * See {@link WebhookListResult} 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(automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieve a list of webhooks. + * + * @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. * - * @param {string} [parameters.location] Gets or sets the location of the - * resource. + * @reject {Error|ServiceError} - The error object. + */ + listByAutomationAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve a list of webhooks. * - * @param {object} [parameters.tags] Gets or sets the tags attached to the - * resource. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7537,7 +8717,7 @@ export interface RunbookOperations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {WebhookListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7545,45 +8725,136 @@ export interface RunbookOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {WebhookListResult} [result] - The deserialized result object if an error did not occur. + * See {@link WebhookListResult} 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, runbookName: string, parameters: models.RunbookCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, automationAccountName: string, runbookName: string, parameters: models.RunbookCreateOrUpdateParameters, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, automationAccountName: string, runbookName: string, parameters: models.RunbookCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 + * SoftwareUpdateConfigurations + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface SoftwareUpdateConfigurations { /** - * Update the runbook identified by runbook name. + * Create a new software update configuration with the name given in the URI. * - * @param {string} resourceGroupName The resource group name. + * @param {string} softwareUpdateConfigurationName The name of the software + * update configuration to be created. * - * @param {string} automationAccountName The automation account name. + * @param {object} parameters Request body. * - * @param {string} runbookName The runbook name. + * @param {object} parameters.updateConfiguration update specific properties + * for the Software update configuration * - * @param {object} parameters The update parameters for runbook. + * @param {string} parameters.updateConfiguration.operatingSystem operating + * system of target machines. Possible values include: 'Windows', 'Linux' * - * @param {string} [parameters.description] Gets or sets the description of the - * runbook. + * @param {object} [parameters.updateConfiguration.windows] Windows specific + * update configuration. * - * @param {boolean} [parameters.logVerbose] Gets or sets verbose log option. + * @param {string} + * [parameters.updateConfiguration.windows.includedUpdateClassifications] + * Update classification included in the software update configuration. A comma + * separated string with required values. Possible values include: + * 'Unclassified', 'Critical', 'Security', 'UpdateRollup', 'FeaturePack', + * 'ServicePack', 'Definition', 'Tools', 'Updates' * - * @param {boolean} [parameters.logProgress] Gets or sets progress log option. + * @param {array} [parameters.updateConfiguration.windows.excludedKbNumbers] KB + * numbers excluded from the software update configuration. * - * @param {number} [parameters.logActivityTrace] Gets or sets the - * activity-level tracing options of the runbook. + * @param {object} [parameters.updateConfiguration.linux] Linux specific update + * configuration. * - * @param {string} [parameters.name] Gets or sets the name of the resource. + * @param {string} + * [parameters.updateConfiguration.linux.includedPackageClassifications] Update + * classifications included in the software update configuration. Possible + * values include: 'Unclassified', 'Critical', 'Security', 'Other' * - * @param {string} [parameters.location] Gets or sets the location of the - * resource. + * @param {array} + * [parameters.updateConfiguration.linux.excludedPackageNameMasks] packages + * excluded from the software update configuration. * - * @param {object} [parameters.tags] Gets or sets the tags attached to the - * resource. + * @param {moment.duration} [parameters.updateConfiguration.duration] Maximum + * time allowed for the software update configuration run. Duration needs to be + * specified using the format PT[n]H[n]M[n]S as per ISO8601 + * + * @param {array} [parameters.updateConfiguration.azureVirtualMachines] List of + * azure resource Ids for azure virtual machines targeted by the software + * update configuration. + * + * @param {array} [parameters.updateConfiguration.nonAzureComputerNames] List + * of names of non-azure machines targeted by the software update + * configuration. + * + * @param {object} parameters.scheduleInfo Schedule information for the + * Software update configuration + * + * @param {date} [parameters.scheduleInfo.startTime] Gets or sets the start + * time of the schedule. + * + * @param {date} [parameters.scheduleInfo.expiryTime] Gets or sets the end time + * of the schedule. + * + * @param {number} [parameters.scheduleInfo.expiryTimeOffsetMinutes] Gets or + * sets the expiry time's offset in minutes. + * + * @param {boolean} [parameters.scheduleInfo.isEnabled] Gets or sets a value + * indicating whether this schedule is enabled. + * + * @param {date} [parameters.scheduleInfo.nextRun] Gets or sets the next run + * time of the schedule. + * + * @param {number} [parameters.scheduleInfo.nextRunOffsetMinutes] Gets or sets + * the next run time's offset in minutes. + * + * @param {object} [parameters.scheduleInfo.interval] Gets or sets the interval + * of the schedule. + * + * @param {string} [parameters.scheduleInfo.frequency] Gets or sets the + * frequency of the schedule. Possible values include: 'OneTime', 'Day', + * 'Hour', 'Week', 'Month' + * + * @param {string} [parameters.scheduleInfo.timeZone] Gets or sets the time + * zone of the schedule. + * + * @param {object} [parameters.scheduleInfo.advancedSchedule] Gets or sets the + * advanced schedule. + * + * @param {array} [parameters.scheduleInfo.advancedSchedule.weekDays] Days of + * the week that the job should execute on. + * + * @param {array} [parameters.scheduleInfo.advancedSchedule.monthDays] Days of + * the month that the job should execute on. Must be between 1 and 31. + * + * @param {array} [parameters.scheduleInfo.advancedSchedule.monthlyOccurrences] + * Occurrences of days within a month. + * + * @param {date} [parameters.scheduleInfo.creationTime] Gets or sets the + * creation time. + * + * @param {date} [parameters.scheduleInfo.lastModifiedTime] Gets or sets the + * last modified time. + * + * @param {string} [parameters.scheduleInfo.description] Gets or sets the + * description. + * + * @param {object} [parameters.error] detailes of provisioning error + * + * @param {string} [parameters.error.code] Error code + * + * @param {string} [parameters.error.message] Error message indicating why the + * operation failed. * * @param {object} [options] Optional Parameters. * @@ -7592,103 +8863,121 @@ export interface RunbookOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, parameters: models.RunbookUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(softwareUpdateConfigurationName: string, parameters: models.SoftwareUpdateConfiguration, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Update the runbook identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Create a new software update configuration with the name given in the URI. * - * @param {string} automationAccountName The automation account name. + * @param {string} softwareUpdateConfigurationName The name of the software + * update configuration to be created. * - * @param {string} runbookName The runbook name. + * @param {object} parameters Request body. * - * @param {object} parameters The update parameters for runbook. + * @param {object} parameters.updateConfiguration update specific properties + * for the Software update configuration * - * @param {string} [parameters.description] Gets or sets the description of the - * runbook. + * @param {string} parameters.updateConfiguration.operatingSystem operating + * system of target machines. Possible values include: 'Windows', 'Linux' * - * @param {boolean} [parameters.logVerbose] Gets or sets verbose log option. + * @param {object} [parameters.updateConfiguration.windows] Windows specific + * update configuration. * - * @param {boolean} [parameters.logProgress] Gets or sets progress log option. + * @param {string} + * [parameters.updateConfiguration.windows.includedUpdateClassifications] + * Update classification included in the software update configuration. A comma + * separated string with required values. Possible values include: + * 'Unclassified', 'Critical', 'Security', 'UpdateRollup', 'FeaturePack', + * 'ServicePack', 'Definition', 'Tools', 'Updates' * - * @param {number} [parameters.logActivityTrace] Gets or sets the - * activity-level tracing options of the runbook. + * @param {array} [parameters.updateConfiguration.windows.excludedKbNumbers] KB + * numbers excluded from the software update configuration. * - * @param {string} [parameters.name] Gets or sets the name of the resource. + * @param {object} [parameters.updateConfiguration.linux] Linux specific update + * configuration. * - * @param {string} [parameters.location] Gets or sets the location of the - * resource. + * @param {string} + * [parameters.updateConfiguration.linux.includedPackageClassifications] Update + * classifications included in the software update configuration. Possible + * values include: 'Unclassified', 'Critical', 'Security', 'Other' * - * @param {object} [parameters.tags] Gets or sets the tags attached to the - * resource. + * @param {array} + * [parameters.updateConfiguration.linux.excludedPackageNameMasks] packages + * excluded from the software update configuration. * - * @param {object} [options] Optional Parameters. + * @param {moment.duration} [parameters.updateConfiguration.duration] Maximum + * time allowed for the software update configuration run. Duration needs to be + * specified using the format PT[n]H[n]M[n]S as per ISO8601 * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [parameters.updateConfiguration.azureVirtualMachines] List of + * azure resource Ids for azure virtual machines targeted by the software + * update configuration. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {array} [parameters.updateConfiguration.nonAzureComputerNames] List + * of names of non-azure machines targeted by the software update + * configuration. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} parameters.scheduleInfo Schedule information for the + * Software update configuration * - * {Promise} A promise is returned. + * @param {date} [parameters.scheduleInfo.startTime] Gets or sets the start + * time of the schedule. * - * @resolve {Runbook} - The deserialized result object. + * @param {date} [parameters.scheduleInfo.expiryTime] Gets or sets the end time + * of the schedule. * - * @reject {Error|ServiceError} - The error object. + * @param {number} [parameters.scheduleInfo.expiryTimeOffsetMinutes] Gets or + * sets the expiry time's offset in minutes. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {boolean} [parameters.scheduleInfo.isEnabled] Gets or sets a value + * indicating whether this schedule is enabled. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {date} [parameters.scheduleInfo.nextRun] Gets or sets the next run + * time of the schedule. * - * {Runbook} [result] - The deserialized result object if an error did not occur. - * See {@link Runbook} for more information. + * @param {number} [parameters.scheduleInfo.nextRunOffsetMinutes] Gets or sets + * the next run time's offset in minutes. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} [parameters.scheduleInfo.interval] Gets or sets the interval + * of the schedule. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - update(resourceGroupName: string, automationAccountName: string, runbookName: string, parameters: models.RunbookUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, automationAccountName: string, runbookName: string, parameters: models.RunbookUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, automationAccountName: string, runbookName: string, parameters: models.RunbookUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Delete the runbook by name. + * @param {string} [parameters.scheduleInfo.frequency] Gets or sets the + * frequency of the schedule. Possible values include: 'OneTime', 'Day', + * 'Hour', 'Week', 'Month' * - * @param {string} resourceGroupName The resource group name. + * @param {string} [parameters.scheduleInfo.timeZone] Gets or sets the time + * zone of the schedule. * - * @param {string} automationAccountName The automation account name. + * @param {object} [parameters.scheduleInfo.advancedSchedule] Gets or sets the + * advanced schedule. * - * @param {string} runbookName The runbook name. + * @param {array} [parameters.scheduleInfo.advancedSchedule.weekDays] Days of + * the week that the job should execute on. * - * @param {object} [options] Optional Parameters. + * @param {array} [parameters.scheduleInfo.advancedSchedule.monthDays] Days of + * the month that the job should execute on. Must be between 1 and 31. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [parameters.scheduleInfo.advancedSchedule.monthlyOccurrences] + * Occurrences of days within a month. * - * @returns {Promise} A promise is returned + * @param {date} [parameters.scheduleInfo.creationTime] Gets or sets the + * creation time. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {date} [parameters.scheduleInfo.lastModifiedTime] Gets or sets the + * last modified time. * - * @reject {Error|ServiceError} - The error object. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Delete the runbook by name. + * @param {string} [parameters.scheduleInfo.description] Gets or sets the + * description. * - * @param {string} resourceGroupName The resource group name. + * @param {object} [parameters.error] detailes of provisioning error * - * @param {string} automationAccountName The automation account name. + * @param {string} [parameters.error.code] Error code * - * @param {string} runbookName The runbook name. + * @param {string} [parameters.error.message] Error message indicating why the + * operation failed. * * @param {object} [options] Optional Parameters. * @@ -7702,7 +8991,7 @@ export interface RunbookOperations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SoftwareUpdateConfiguration} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7710,23 +8999,24 @@ export interface RunbookOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SoftwareUpdateConfiguration} [result] - The deserialized result object if an error did not occur. + * See {@link SoftwareUpdateConfiguration} 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. */ - deleteMethod(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(softwareUpdateConfigurationName: string, parameters: models.SoftwareUpdateConfiguration, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(softwareUpdateConfigurationName: string, parameters: models.SoftwareUpdateConfiguration, callback: ServiceCallback): void; + create(softwareUpdateConfigurationName: string, parameters: models.SoftwareUpdateConfiguration, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of runbooks. + * Get a single software update configuration by name. * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * @param {string} softwareUpdateConfigurationName The name of the software + * update configuration to be created. * * @param {object} [options] Optional Parameters. * @@ -7735,18 +9025,17 @@ export interface RunbookOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getByNameWithHttpOperationResponse(softwareUpdateConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of runbooks. - * - * @param {string} resourceGroupName The resource group name. + * Get a single software update configuration by name. * - * @param {string} automationAccountName The automation account name. + * @param {string} softwareUpdateConfigurationName The name of the software + * update configuration to be created. * * @param {object} [options] Optional Parameters. * @@ -7760,7 +9049,7 @@ export interface RunbookOperations { * * {Promise} A promise is returned. * - * @resolve {RunbookListResult} - The deserialized result object. + * @resolve {SoftwareUpdateConfiguration} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7768,23 +9057,24 @@ export interface RunbookOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RunbookListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RunbookListResult} for more information. + * {SoftwareUpdateConfiguration} [result] - The deserialized result object if an error did not occur. + * See {@link SoftwareUpdateConfiguration} 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; + getByName(softwareUpdateConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getByName(softwareUpdateConfigurationName: string, callback: ServiceCallback): void; + getByName(softwareUpdateConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of runbooks. + * delete a specific software update configuration. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} softwareUpdateConfigurationName The name of the software + * update configuration to be created. * * @param {object} [options] Optional Parameters. * @@ -7793,17 +9083,17 @@ export interface RunbookOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(softwareUpdateConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of runbooks. + * delete a specific software update configuration. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} softwareUpdateConfigurationName The name of the software + * update configuration to be created. * * @param {object} [options] Optional Parameters. * @@ -7817,7 +9107,7 @@ export interface RunbookOperations { * * {Promise} A promise is returned. * - * @resolve {RunbookListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7825,64 +9115,42 @@ export interface RunbookOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RunbookListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RunbookListResult} for more information. + * {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. */ - 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 - * TestJobStreams - * __NOTE__: An instance of this class is automatically created for an - * instance of the AutomationClient. - */ -export interface TestJobStreams { + deleteMethod(softwareUpdateConfigurationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(softwareUpdateConfigurationName: string, callback: ServiceCallback): void; + deleteMethod(softwareUpdateConfigurationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a test job streams identified by runbook name and stream id. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} runbookName The runbook name. - * - * @param {string} jobStreamId The job stream id. + * Get all software update configurations for the account. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] The filter to apply on the operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, jobStreamId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a test job streams identified by runbook name and stream id. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} runbookName The runbook name. - * - * @param {string} jobStreamId The job stream id. + * Get all software update configurations for the account. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] The filter to apply on the operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -7893,7 +9161,7 @@ export interface TestJobStreams { * * {Promise} A promise is returned. * - * @resolve {JobStream} - The deserialized result object. + * @resolve {SoftwareUpdateConfigurationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7901,55 +9169,55 @@ export interface TestJobStreams { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobStream} [result] - The deserialized result object if an error did not occur. - * See {@link JobStream} for more information. + * {SoftwareUpdateConfigurationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SoftwareUpdateConfigurationListResult} 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, runbookName: string, jobStreamId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, runbookName: string, jobStreamId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, runbookName: string, jobStreamId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * SoftwareUpdateConfigurationRuns + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface SoftwareUpdateConfigurationRuns { /** - * Retrieve a list of test job streams identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Get a single software update configuration Run by Id. * - * @param {string} runbookName The runbook name. + * @param {uuid} softwareUpdateConfigurationRunId The Id of the software update + * configuration run. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByTestJobWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getByIdWithHttpOperationResponse(softwareUpdateConfigurationRunId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of test job streams identified by runbook name. + * Get a single software update configuration Run by Id. * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} runbookName The runbook name. + * @param {uuid} softwareUpdateConfigurationRunId The Id of the software update + * configuration run. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The filter to apply on the operation. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -7960,7 +9228,7 @@ export interface TestJobStreams { * * {Promise} A promise is returned. * - * @resolve {JobStreamListResult} - The deserialized result object. + * @resolve {SoftwareUpdateConfigurationRun} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7968,45 +9236,60 @@ export interface TestJobStreams { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobStreamListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobStreamListResult} for more information. + * {SoftwareUpdateConfigurationRun} [result] - The deserialized result object if an error did not occur. + * See {@link SoftwareUpdateConfigurationRun} 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. */ - listByTestJob(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByTestJob(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; - listByTestJob(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getById(softwareUpdateConfigurationRunId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getById(softwareUpdateConfigurationRunId: string, callback: ServiceCallback): void; + getById(softwareUpdateConfigurationRunId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of test job streams identified by runbook name. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Return list of software update configuration runs * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] The filter to apply on the operation. You + * can use the following filters: 'properties/osType', 'properties/status', + * 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' + * + * @param {string} [options.skip] number of entries you skip before returning + * results + * + * @param {string} [options.top] Maximum number of entries returned in the + * results collection + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByTestJobNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { filter? : string, skip? : string, top? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of test job streams identified by runbook name. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Return list of software update configuration runs * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] The filter to apply on the operation. You + * can use the following filters: 'properties/osType', 'properties/status', + * 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' + * + * @param {string} [options.skip] number of entries you skip before returning + * results + * + * @param {string} [options.top] Maximum number of entries returned in the + * results collection + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -8017,7 +9300,7 @@ export interface TestJobStreams { * * {Promise} A promise is returned. * - * @resolve {JobStreamListResult} - The deserialized result object. + * @resolve {SoftwareUpdateConfigurationRunListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8025,47 +9308,33 @@ export interface TestJobStreams { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {JobStreamListResult} [result] - The deserialized result object if an error did not occur. - * See {@link JobStreamListResult} for more information. + * {SoftwareUpdateConfigurationRunListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SoftwareUpdateConfigurationRunListResult} + * 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. */ - listByTestJobNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByTestJobNext(nextPageLink: string, callback: ServiceCallback): void; - listByTestJobNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { filter? : string, skip? : string, top? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { filter? : string, skip? : string, top? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * TestJobs + * SoftwareUpdateConfigurationMachineRuns * __NOTE__: An instance of this class is automatically created for an * instance of the AutomationClient. */ -export interface TestJobs { +export interface SoftwareUpdateConfigurationMachineRuns { /** - * Create a test job of the runbook. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} runbookName The parameters supplied to the create test job - * operation. - * - * @param {object} parameters The parameters supplied to the create test job - * operation. - * - * @param {string} parameters.runbookName Gets or sets the runbook name. - * - * @param {object} [parameters.parameters] Gets or sets the parameters of the - * test job. + * Get a single software update configuration machine run by Id. * - * @param {string} [parameters.runOn] Gets or sets the runOn which specifies - * the group name where the job is to be executed. + * @param {uuid} softwareUpdateConfigurationMachineRunId The Id of the software + * update configuration machine run. * * @param {object} [options] Optional Parameters. * @@ -8074,32 +9343,17 @@ export interface TestJobs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, parameters: models.TestJobCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getByIdWithHttpOperationResponse(softwareUpdateConfigurationMachineRunId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create a test job of the runbook. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} runbookName The parameters supplied to the create test job - * operation. - * - * @param {object} parameters The parameters supplied to the create test job - * operation. - * - * @param {string} parameters.runbookName Gets or sets the runbook name. - * - * @param {object} [parameters.parameters] Gets or sets the parameters of the - * test job. + * Get a single software update configuration machine run by Id. * - * @param {string} [parameters.runOn] Gets or sets the runOn which specifies - * the group name where the job is to be executed. + * @param {uuid} softwareUpdateConfigurationMachineRunId The Id of the software + * update configuration machine run. * * @param {object} [options] Optional Parameters. * @@ -8113,7 +9367,7 @@ export interface TestJobs { * * {Promise} A promise is returned. * - * @resolve {TestJob} - The deserialized result object. + * @resolve {SoftwareUpdateConfigurationMachineRun} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8121,50 +9375,59 @@ export interface TestJobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TestJob} [result] - The deserialized result object if an error did not occur. - * See {@link TestJob} for more information. + * {SoftwareUpdateConfigurationMachineRun} [result] - The deserialized result object if an error did not occur. + * See {@link SoftwareUpdateConfigurationMachineRun} 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. */ - create(resourceGroupName: string, automationAccountName: string, runbookName: string, parameters: models.TestJobCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - create(resourceGroupName: string, automationAccountName: string, runbookName: string, parameters: models.TestJobCreateParameters, callback: ServiceCallback): void; - create(resourceGroupName: string, automationAccountName: string, runbookName: string, parameters: models.TestJobCreateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getById(softwareUpdateConfigurationMachineRunId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getById(softwareUpdateConfigurationMachineRunId: string, callback: ServiceCallback): void; + getById(softwareUpdateConfigurationMachineRunId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve the test job for the specified runbook. + * Return list of software update configuration machine runs * - * @param {string} resourceGroupName The resource group name. + * @param {object} [options] Optional Parameters. * - * @param {string} automationAccountName The automation account name. + * @param {string} [options.filter] The filter to apply on the operation. You + * can use the following filters: 'properties/osType', 'properties/status', + * 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' * - * @param {string} runbookName The runbook name. + * @param {string} [options.skip] number of entries you skip before returning + * results * - * @param {object} [options] Optional Parameters. + * @param {string} [options.top] Maximum number of entries returned in the + * results collection * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { filter? : string, skip? : string, top? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve the test job for the specified runbook. + * Return list of software update configuration machine runs * - * @param {string} resourceGroupName The resource group name. + * @param {object} [options] Optional Parameters. * - * @param {string} automationAccountName The automation account name. + * @param {string} [options.filter] The filter to apply on the operation. You + * can use the following filters: 'properties/osType', 'properties/status', + * 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' * - * @param {string} runbookName The runbook name. + * @param {string} [options.skip] number of entries you skip before returning + * results * - * @param {object} [options] Optional Parameters. + * @param {string} [options.top] Maximum number of entries returned in the + * results collection * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -8176,7 +9439,7 @@ export interface TestJobs { * * {Promise} A promise is returned. * - * @resolve {TestJob} - The deserialized result object. + * @resolve {SoftwareUpdateConfigurationMachineRunListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8184,26 +9447,63 @@ export interface TestJobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TestJob} [result] - The deserialized result object if an error did not occur. - * See {@link TestJob} for more information. + * {SoftwareUpdateConfigurationMachineRunListResult} [result] - The deserialized result object if an error did not occur. + * See {@link + * SoftwareUpdateConfigurationMachineRunListResult} 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, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { filter? : string, skip? : string, top? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { filter? : string, skip? : string, top? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * SourceControlOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface SourceControlOperations { /** - * Resume the test job. - * - * @param {string} resourceGroupName The resource group name. + * Create a source control. * * @param {string} automationAccountName The automation account name. * - * @param {string} runbookName The runbook name. + * @param {string} sourceControlName The source control name. + * + * @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.branch] Gets or sets 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 {boolean} [parameters.autoSync] Gets or sets 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 {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 {string} [parameters.description] Gets or sets the user description + * of the source control. * * @param {object} [options] Optional Parameters. * @@ -8212,20 +9512,46 @@ export interface TestJobs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - resumeWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(automationAccountName: string, sourceControlName: string, parameters: models.SourceControlCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Resume the test job. - * - * @param {string} resourceGroupName The resource group name. + * Create a source control. * * @param {string} automationAccountName The automation account name. * - * @param {string} runbookName The runbook name. + * @param {string} sourceControlName The source control name. + * + * @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.branch] Gets or sets 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 {boolean} [parameters.autoSync] Gets or sets 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 {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 {string} [parameters.description] Gets or sets the user description + * of the source control. * * @param {object} [options] Optional Parameters. * @@ -8239,7 +9565,7 @@ export interface TestJobs { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SourceControl} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8247,25 +9573,45 @@ export interface TestJobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SourceControl} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControl} 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. */ - resume(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - resume(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; - resume(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, sourceControlName: string, parameters: models.SourceControlCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(automationAccountName: string, sourceControlName: string, parameters: models.SourceControlCreateOrUpdateParameters, callback: ServiceCallback): void; + createOrUpdate(automationAccountName: string, sourceControlName: string, parameters: models.SourceControlCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Stop the test job. - * - * @param {string} resourceGroupName The resource group name. + * Update a source control. * * @param {string} automationAccountName The automation account name. * - * @param {string} runbookName The runbook name. + * @param {string} sourceControlName The source control name. + * + * @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.folderPath] Gets or sets 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.publishRunbook] Gets or sets 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 {string} [parameters.description] Gets or sets the user description + * of the source control. * * @param {object} [options] Optional Parameters. * @@ -8274,20 +9620,39 @@ export interface TestJobs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - stopWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(automationAccountName: string, sourceControlName: string, parameters: models.SourceControlUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Stop the test job. - * - * @param {string} resourceGroupName The resource group name. + * Update a source control. * * @param {string} automationAccountName The automation account name. * - * @param {string} runbookName The runbook name. + * @param {string} sourceControlName The source control name. + * + * @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.folderPath] Gets or sets 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.publishRunbook] Gets or sets 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 {string} [parameters.description] Gets or sets the user description + * of the source control. * * @param {object} [options] Optional Parameters. * @@ -8301,7 +9666,7 @@ export interface TestJobs { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SourceControl} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8309,25 +9674,24 @@ export interface TestJobs { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SourceControl} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControl} 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. */ - stop(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - stop(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; - stop(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(automationAccountName: string, sourceControlName: string, parameters: models.SourceControlUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(automationAccountName: string, sourceControlName: string, parameters: models.SourceControlUpdateParameters, callback: ServiceCallback): void; + update(automationAccountName: string, sourceControlName: string, parameters: models.SourceControlUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Suspend the test job. - * - * @param {string} resourceGroupName The resource group name. + * Delete the source control. * * @param {string} automationAccountName The automation account name. * - * @param {string} runbookName The runbook name. + * @param {string} sourceControlName The name of source control. * * @param {object} [options] Optional Parameters. * @@ -8340,16 +9704,14 @@ export interface TestJobs { * * @reject {Error|ServiceError} - The error object. */ - suspendWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(automationAccountName: string, sourceControlName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Suspend the test job. - * - * @param {string} resourceGroupName The resource group name. + * Delete the source control. * * @param {string} automationAccountName The automation account name. * - * @param {string} runbookName The runbook name. + * @param {string} sourceControlName The name of source control. * * @param {object} [options] Optional Parameters. * @@ -8377,63 +9739,17 @@ export interface TestJobs { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - suspend(resourceGroupName: string, automationAccountName: string, runbookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - suspend(resourceGroupName: string, automationAccountName: string, runbookName: string, callback: ServiceCallback): void; - suspend(resourceGroupName: string, automationAccountName: string, runbookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ScheduleOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the AutomationClient. - */ -export interface ScheduleOperations { + deleteMethod(automationAccountName: string, sourceControlName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(automationAccountName: string, sourceControlName: string, callback: ServiceCallback): void; + deleteMethod(automationAccountName: string, sourceControlName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Create a schedule. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the source control identified by source control name. * * @param {string} automationAccountName The automation account name. * - * @param {string} scheduleName The schedule name. - * - * @param {object} parameters The parameters supplied to the create or update - * schedule operation. - * - * @param {string} parameters.name Gets or sets the name of the schedule. - * - * @param {string} [parameters.description] Gets or sets the description of the - * schedule. - * - * @param {date} parameters.startTime Gets or sets the start time of the - * schedule. - * - * @param {date} [parameters.expiryTime] Gets or sets the end time of the - * schedule. - * - * @param {object} [parameters.interval] Gets or sets the interval of the - * schedule. - * - * @param {string} parameters.frequency Gets or sets the frequency of the - * schedule. Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' - * - * @param {string} [parameters.timeZone] Gets or sets the time zone of the - * schedule. - * - * @param {object} [parameters.advancedSchedule] Gets or sets the - * AdvancedSchedule. - * - * @param {array} [parameters.advancedSchedule.weekDays] Days of the week that - * the job should execute on. - * - * @param {array} [parameters.advancedSchedule.monthDays] Days of the month - * that the job should execute on. Must be between 1 and 31. - * - * @param {array} [parameters.advancedSchedule.monthlyOccurrences] Occurrences - * of days within a month. + * @param {string} sourceControlName The name of source control. * * @param {object} [options] Optional Parameters. * @@ -8442,55 +9758,18 @@ export interface ScheduleOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, scheduleName: string, parameters: models.ScheduleCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, sourceControlName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create a schedule. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the source control identified by source control name. * * @param {string} automationAccountName The automation account name. * - * @param {string} scheduleName The schedule name. - * - * @param {object} parameters The parameters supplied to the create or update - * schedule operation. - * - * @param {string} parameters.name Gets or sets the name of the schedule. - * - * @param {string} [parameters.description] Gets or sets the description of the - * schedule. - * - * @param {date} parameters.startTime Gets or sets the start time of the - * schedule. - * - * @param {date} [parameters.expiryTime] Gets or sets the end time of the - * schedule. - * - * @param {object} [parameters.interval] Gets or sets the interval of the - * schedule. - * - * @param {string} parameters.frequency Gets or sets the frequency of the - * schedule. Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' - * - * @param {string} [parameters.timeZone] Gets or sets the time zone of the - * schedule. - * - * @param {object} [parameters.advancedSchedule] Gets or sets the - * AdvancedSchedule. - * - * @param {array} [parameters.advancedSchedule.weekDays] Days of the week that - * the job should execute on. - * - * @param {array} [parameters.advancedSchedule.monthDays] Days of the month - * that the job should execute on. Must be between 1 and 31. - * - * @param {array} [parameters.advancedSchedule.monthlyOccurrences] Occurrences - * of days within a month. + * @param {string} sourceControlName The name of source control. * * @param {object} [options] Optional Parameters. * @@ -8504,7 +9783,7 @@ export interface ScheduleOperations { * * {Promise} A promise is returned. * - * @resolve {Schedule} - The deserialized result object. + * @resolve {SourceControl} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8512,73 +9791,47 @@ export interface ScheduleOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Schedule} [result] - The deserialized result object if an error did not occur. - * See {@link Schedule} for more information. + * {SourceControl} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControl} 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, scheduleName: string, parameters: models.ScheduleCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, automationAccountName: string, scheduleName: string, parameters: models.ScheduleCreateOrUpdateParameters, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, automationAccountName: string, scheduleName: string, parameters: models.ScheduleCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(automationAccountName: string, sourceControlName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, sourceControlName: string, callback: ServiceCallback): void; + get(automationAccountName: string, sourceControlName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Update the schedule identified by schedule name. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of source controls. * * @param {string} automationAccountName The automation account name. * - * @param {string} scheduleName The schedule name. - * - * @param {object} parameters The parameters supplied to the update schedule - * operation. - * - * @param {string} parameters.name Gets or sets the name of the schedule. - * - * @param {string} [parameters.description] Gets or sets the description of the - * schedule. - * - * @param {boolean} [parameters.isEnabled] Gets or sets a value indicating - * whether this schedule is enabled. - * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] The filter to apply on the operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, scheduleName: string, parameters: models.ScheduleUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Update the schedule identified by schedule name. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of source controls. * * @param {string} automationAccountName The automation account name. * - * @param {string} scheduleName The schedule name. - * - * @param {object} parameters The parameters supplied to the update schedule - * operation. - * - * @param {string} parameters.name Gets or sets the name of the schedule. - * - * @param {string} [parameters.description] Gets or sets the description of the - * schedule. - * - * @param {boolean} [parameters.isEnabled] Gets or sets a value indicating - * whether this schedule is enabled. - * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] The filter to apply on the operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -8589,7 +9842,7 @@ export interface ScheduleOperations { * * {Promise} A promise is returned. * - * @resolve {Schedule} - The deserialized result object. + * @resolve {SourceControlListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8597,26 +9850,24 @@ export interface ScheduleOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Schedule} [result] - The deserialized result object if an error did not occur. - * See {@link Schedule} for more information. + * {SourceControlListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControlListResult} 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, scheduleName: string, parameters: models.ScheduleUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, automationAccountName: string, scheduleName: string, parameters: models.ScheduleUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, automationAccountName: string, scheduleName: string, parameters: models.ScheduleUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve the schedule identified by schedule name. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Retrieve a list of source controls. * - * @param {string} scheduleName The schedule name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8625,20 +9876,17 @@ export interface ScheduleOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, scheduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieve the schedule identified by schedule name. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + listByAutomationAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve a list of source controls. * - * @param {string} scheduleName The schedule name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8652,7 +9900,7 @@ export interface ScheduleOperations { * * {Promise} A promise is returned. * - * @resolve {Schedule} - The deserialized result object. + * @resolve {SourceControlListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8660,26 +9908,36 @@ export interface ScheduleOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Schedule} [result] - The deserialized result object if an error did not occur. - * See {@link Schedule} for more information. + * {SourceControlListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControlListResult} 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, scheduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, scheduleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, scheduleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 + * SourceControlSyncJobOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface SourceControlSyncJobOperations { /** - * Delete the schedule identified by schedule name. - * - * @param {string} resourceGroupName The resource group name. + * Creates the sync job for a source control. * * @param {string} automationAccountName The automation account name. * - * @param {string} scheduleName The schedule name. + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. * * @param {object} [options] Optional Parameters. * @@ -8688,20 +9946,20 @@ export interface ScheduleOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, scheduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(automationAccountName: string, sourceControlName: string, sourceControlSyncJobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Delete the schedule identified by schedule name. - * - * @param {string} resourceGroupName The resource group name. + * Creates the sync job for a source control. * * @param {string} automationAccountName The automation account name. * - * @param {string} scheduleName The schedule name. + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. * * @param {object} [options] Optional Parameters. * @@ -8715,7 +9973,7 @@ export interface ScheduleOperations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SourceControlSyncJob} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8723,24 +9981,27 @@ export interface ScheduleOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SourceControlSyncJob} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControlSyncJob} 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. */ - deleteMethod(resourceGroupName: string, automationAccountName: string, scheduleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, automationAccountName: string, scheduleName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, automationAccountName: string, scheduleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(automationAccountName: string, sourceControlName: string, sourceControlSyncJobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(automationAccountName: string, sourceControlName: string, sourceControlSyncJobId: string, callback: ServiceCallback): void; + create(automationAccountName: string, sourceControlName: string, sourceControlSyncJobId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of schedules. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the source control sync job identified by job id. * * @param {string} automationAccountName The automation account name. * + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8748,19 +10009,21 @@ export interface ScheduleOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(automationAccountName: string, sourceControlName: string, sourceControlSyncJobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of schedules. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the source control sync job identified by job id. * * @param {string} automationAccountName The automation account name. * + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8773,7 +10036,7 @@ export interface ScheduleOperations { * * {Promise} A promise is returned. * - * @resolve {ScheduleListResult} - The deserialized result object. + * @resolve {SourceControlSyncJobById} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8781,45 +10044,52 @@ export interface ScheduleOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ScheduleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ScheduleListResult} for more information. + * {SourceControlSyncJobById} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControlSyncJobById} 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; + get(automationAccountName: string, sourceControlName: string, sourceControlSyncJobId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(automationAccountName: string, sourceControlName: string, sourceControlSyncJobId: string, callback: ServiceCallback): void; + get(automationAccountName: string, sourceControlName: string, sourceControlSyncJobId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of schedules. + * Retrieve a list of source control sync jobs. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] The filter to apply on the operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountWithHttpOperationResponse(automationAccountName: string, sourceControlName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of schedules. + * Retrieve a list of source control sync jobs. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] The filter to apply on the operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -8830,7 +10100,7 @@ export interface ScheduleOperations { * * {Promise} A promise is returned. * - * @resolve {ScheduleListResult} - The deserialized result object. + * @resolve {SourceControlSyncJobListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8838,48 +10108,24 @@ export interface ScheduleOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ScheduleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ScheduleListResult} for more information. + * {SourceControlSyncJobListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControlSyncJobListResult} 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 - * VariableOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the AutomationClient. - */ -export interface VariableOperations { + listByAutomationAccount(automationAccountName: string, sourceControlName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(automationAccountName: string, sourceControlName: string, callback: ServiceCallback): void; + listByAutomationAccount(automationAccountName: string, sourceControlName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Create a variable. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} variableName The variable name. - * - * @param {object} parameters The parameters supplied to the create or update - * variable operation. - * - * @param {string} parameters.name Gets or sets the name of the variable. + * Retrieve a list of source control sync jobs. * - * @param {string} [parameters.value] Gets or sets the value of the variable. - * - * @param {string} [parameters.description] Gets or sets the description of the - * variable. - * - * @param {boolean} [parameters.isEncrypted] Gets or sets the encrypted flag of - * the variable. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8888,33 +10134,17 @@ export interface VariableOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, variableName: string, parameters: models.VariableCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create a variable. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} variableName The variable name. - * - * @param {object} parameters The parameters supplied to the create or update - * variable operation. - * - * @param {string} parameters.name Gets or sets the name of the variable. - * - * @param {string} [parameters.value] Gets or sets the value of the variable. + * Retrieve a list of source control sync jobs. * - * @param {string} [parameters.description] Gets or sets the description of the - * variable. - * - * @param {boolean} [parameters.isEncrypted] Gets or sets the encrypted flag of - * the variable. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8928,7 +10158,7 @@ export interface VariableOperations { * * {Promise} A promise is returned. * - * @resolve {Variable} - The deserialized result object. + * @resolve {SourceControlSyncJobListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8936,36 +10166,32 @@ export interface VariableOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Variable} [result] - The deserialized result object if an error did not occur. - * See {@link Variable} for more information. + * {SourceControlSyncJobListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControlSyncJobListResult} 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, variableName: string, parameters: models.VariableCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, automationAccountName: string, variableName: string, parameters: models.VariableCreateOrUpdateParameters, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, automationAccountName: string, variableName: string, parameters: models.VariableCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 + * JobOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface JobOperations { /** - * Update a variable. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} variableName The variable name. - * - * @param {object} parameters The parameters supplied to the update variable - * operation. - * - * @param {string} parameters.name Gets or sets the name of the variable. + * Retrieve the job output identified by job name. * - * @param {string} [parameters.value] Gets or sets the value of the variable. - * - * @param {string} [parameters.description] Gets or sets the description of the - * variable. + * @param {string} jobName The name of the job to be created. * * @param {object} [options] Optional Parameters. * @@ -8974,30 +10200,16 @@ export interface VariableOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, variableName: string, parameters: models.VariableUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getOutputWithHttpOperationResponse(jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Update a variable. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} variableName The variable name. - * - * @param {object} parameters The parameters supplied to the update variable - * operation. + * Retrieve the job output identified by job name. * - * @param {string} parameters.name Gets or sets the name of the variable. - * - * @param {string} [parameters.value] Gets or sets the value of the variable. - * - * @param {string} [parameters.description] Gets or sets the description of the - * variable. + * @param {string} jobName The name of the job to be created. * * @param {object} [options] Optional Parameters. * @@ -9011,7 +10223,7 @@ export interface VariableOperations { * * {Promise} A promise is returned. * - * @resolve {Variable} - The deserialized result object. + * @resolve {String} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9019,26 +10231,21 @@ export interface VariableOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Variable} [result] - The deserialized result object if an error did not occur. - * See {@link Variable} for more information. + * {String} [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. */ - update(resourceGroupName: string, automationAccountName: string, variableName: string, parameters: models.VariableUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, automationAccountName: string, variableName: string, parameters: models.VariableUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, automationAccountName: string, variableName: string, parameters: models.VariableUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getOutput(jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getOutput(jobName: string, callback: ServiceCallback): void; + getOutput(jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Delete the variable. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Retrieve the runbook content of the job identified by job name. * - * @param {string} variableName The name of variable. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -9047,20 +10254,16 @@ export interface VariableOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, variableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getRunbookContentWithHttpOperationResponse(jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Delete the variable. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Retrieve the runbook content of the job identified by job name. * - * @param {string} variableName The name of variable. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -9074,7 +10277,7 @@ export interface VariableOperations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {String} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9082,25 +10285,21 @@ export interface VariableOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {String} [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, variableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, automationAccountName: string, variableName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, automationAccountName: string, variableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getRunbookContent(jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getRunbookContent(jobName: string, callback: ServiceCallback): void; + getRunbookContent(jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve the variable identified by variable name. - * - * @param {string} resourceGroupName The resource group name. + * Suspend the job identified by job name. * - * @param {string} automationAccountName The automation account name. - * - * @param {string} variableName The name of variable. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -9109,20 +10308,16 @@ export interface VariableOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, variableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + suspendWithHttpOperationResponse(jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve the variable identified by variable name. - * - * @param {string} resourceGroupName The resource group name. + * Suspend the job identified by job name. * - * @param {string} automationAccountName The automation account name. - * - * @param {string} variableName The name of variable. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -9136,7 +10331,7 @@ export interface VariableOperations { * * {Promise} A promise is returned. * - * @resolve {Variable} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9144,24 +10339,21 @@ export interface VariableOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Variable} [result] - The deserialized result object if an error did not occur. - * See {@link Variable} for more information. + * {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. */ - get(resourceGroupName: string, automationAccountName: string, variableName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, variableName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, variableName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + suspend(jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + suspend(jobName: string, callback: ServiceCallback): void; + suspend(jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of variables. - * - * @param {string} resourceGroupName The resource group name. + * Stop the job identified by jobName. * - * @param {string} automationAccountName The automation account name. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -9170,18 +10362,16 @@ export interface VariableOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + stopWithHttpOperationResponse(jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of variables. - * - * @param {string} resourceGroupName The resource group name. + * Stop the job identified by jobName. * - * @param {string} automationAccountName The automation account name. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -9195,7 +10385,7 @@ export interface VariableOperations { * * {Promise} A promise is returned. * - * @resolve {VariableListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9203,23 +10393,21 @@ export interface VariableOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VariableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VariableListResult} for more information. + * {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. */ - 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; + stop(jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stop(jobName: string, callback: ServiceCallback): void; + stop(jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of variables. + * Retrieve the job identified by job name. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -9228,17 +10416,16 @@ export interface VariableOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of variables. + * Retrieve the job identified by job name. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -9252,41 +10439,44 @@ export interface VariableOperations { * * {Promise} A promise is returned. * - * @resolve {VariableListResult} - The deserialized result object. + * @resolve {Job} - 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. - * - * {VariableListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VariableListResult} 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 - * WebhookOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the AutomationClient. - */ -export interface WebhookOperations { + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Job} [result] - The deserialized result object if an error did not occur. + * See {@link Job} 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(jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(jobName: string, callback: ServiceCallback): void; + get(jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Generates a Uri for use in creating a webhook. + * Create a job of the runbook. * - * @param {string} resourceGroupName The resource group name. + * @param {string} jobName The job name. * - * @param {string} automationAccountName The automation account name. + * @param {object} parameters The parameters supplied to the create job + * operation. + * + * @param {object} parameters.runbook Gets or sets the runbook. + * + * @param {string} [parameters.runbook.name] Gets or sets the name of the + * runbook. + * + * @param {object} [parameters.parameters] Gets or sets the parameters of the + * job. + * + * @param {string} [parameters.runOn] Gets or sets the runOn which specifies + * the group name where the job is to be executed. * * @param {object} [options] Optional Parameters. * @@ -9295,18 +10485,30 @@ export interface WebhookOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - generateUriWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(jobName: string, parameters: models.JobCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Generates a Uri for use in creating a webhook. + * Create a job of the runbook. * - * @param {string} resourceGroupName The resource group name. + * @param {string} jobName The job name. * - * @param {string} automationAccountName The automation account name. + * @param {object} parameters The parameters supplied to the create job + * operation. + * + * @param {object} parameters.runbook Gets or sets the runbook. + * + * @param {string} [parameters.runbook.name] Gets or sets the name of the + * runbook. + * + * @param {object} [parameters.parameters] Gets or sets the parameters of the + * job. + * + * @param {string} [parameters.runOn] Gets or sets the runOn which specifies + * the group name where the job is to be executed. * * @param {object} [options] Optional Parameters. * @@ -9320,7 +10522,7 @@ export interface WebhookOperations { * * {Promise} A promise is returned. * - * @resolve {String} - The deserialized result object. + * @resolve {Job} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9328,50 +10530,43 @@ export interface WebhookOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {String} [result] - The deserialized result object if an error did not occur. + * {Job} [result] - The deserialized result object if an error did not occur. + * See {@link Job} 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. */ - generateUri(resourceGroupName: string, automationAccountName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - generateUri(resourceGroupName: string, automationAccountName: string, callback: ServiceCallback): void; - generateUri(resourceGroupName: string, automationAccountName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(jobName: string, parameters: models.JobCreateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(jobName: string, parameters: models.JobCreateParameters, callback: ServiceCallback): void; + create(jobName: string, parameters: models.JobCreateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Delete the webhook by name. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} webhookName The webhook name. + * Retrieve a list of jobs. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] The filter to apply on the operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, webhookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountWithHttpOperationResponse(options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Delete the webhook by name. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} webhookName The webhook name. + * Retrieve a list of jobs. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.filter] The filter to apply on the operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -9382,7 +10577,7 @@ export interface WebhookOperations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {JobListResultV2} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9390,25 +10585,22 @@ export interface WebhookOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {JobListResultV2} [result] - The deserialized result object if an error did not occur. + * See {@link JobListResultV2} 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. */ - deleteMethod(resourceGroupName: string, automationAccountName: string, webhookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, automationAccountName: string, webhookName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, automationAccountName: string, webhookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByAutomationAccount(options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByAutomationAccount(callback: ServiceCallback): void; + listByAutomationAccount(options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve the webhook identified by webhook name. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Resume the job identified by jobName. * - * @param {string} webhookName The webhook name. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -9417,20 +10609,16 @@ export interface WebhookOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, webhookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + resumeWithHttpOperationResponse(jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve the webhook identified by webhook name. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Resume the job identified by jobName. * - * @param {string} webhookName The webhook name. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -9444,7 +10632,7 @@ export interface WebhookOperations { * * {Promise} A promise is returned. * - * @resolve {Webhook} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9452,48 +10640,22 @@ export interface WebhookOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Webhook} [result] - The deserialized result object if an error did not occur. - * See {@link Webhook} for more information. + * {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. */ - get(resourceGroupName: string, automationAccountName: string, webhookName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, automationAccountName: string, webhookName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, automationAccountName: string, webhookName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + resume(jobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resume(jobName: string, callback: ServiceCallback): void; + resume(jobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Create the webhook identified by webhook name. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} webhookName The webhook name. - * - * @param {object} parameters The create or update parameters for webhook. - * - * @param {string} parameters.name Gets or sets the name of the webhook. - * - * @param {boolean} [parameters.isEnabled] Gets or sets the value of the - * enabled flag of webhook. - * - * @param {string} [parameters.uri] Gets or sets the uri. - * - * @param {date} [parameters.expiryTime] Gets or sets the expiry time. - * - * @param {object} [parameters.parameters] Gets or sets the parameters of the - * job. - * - * @param {object} [parameters.runbook] Gets or sets the runbook. - * - * @param {string} [parameters.runbook.name] Gets or sets the name of the - * runbook. + * Retrieve a list of jobs. * - * @param {string} [parameters.runOn] Gets or sets the name of the hybrid - * worker group the webhook job will run on. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9502,42 +10664,17 @@ export interface WebhookOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, webhookName: string, parameters: models.WebhookCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByAutomationAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Create the webhook identified by webhook name. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} webhookName The webhook name. - * - * @param {object} parameters The create or update parameters for webhook. - * - * @param {string} parameters.name Gets or sets the name of the webhook. - * - * @param {boolean} [parameters.isEnabled] Gets or sets the value of the - * enabled flag of webhook. - * - * @param {string} [parameters.uri] Gets or sets the uri. - * - * @param {date} [parameters.expiryTime] Gets or sets the expiry time. - * - * @param {object} [parameters.parameters] Gets or sets the parameters of the - * job. - * - * @param {object} [parameters.runbook] Gets or sets the runbook. - * - * @param {string} [parameters.runbook.name] Gets or sets the name of the - * runbook. + * Retrieve a list of jobs. * - * @param {string} [parameters.runOn] Gets or sets the name of the hybrid - * worker group the webhook job will run on. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9551,7 +10688,7 @@ export interface WebhookOperations { * * {Promise} A promise is returned. * - * @resolve {Webhook} - The deserialized result object. + * @resolve {JobListResultV2} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9559,42 +10696,33 @@ export interface WebhookOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Webhook} [result] - The deserialized result object if an error did not occur. - * See {@link Webhook} for more information. + * {JobListResultV2} [result] - The deserialized result object if an error did not occur. + * See {@link JobListResultV2} 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, webhookName: string, parameters: models.WebhookCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, automationAccountName: string, webhookName: string, parameters: models.WebhookCreateOrUpdateParameters, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, automationAccountName: string, webhookName: string, parameters: models.WebhookCreateOrUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 + * JobStreamOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface JobStreamOperations { /** - * Update the webhook identified by webhook name. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} webhookName The webhook name. - * - * @param {object} parameters The update parameters for webhook. - * - * @param {string} parameters.name Gets or sets the name of the webhook. - * - * @param {boolean} [parameters.isEnabled] Gets or sets the value of the - * enabled flag of webhook. - * - * @param {string} [parameters.runOn] Gets or sets the name of the hybrid - * worker group the webhook job will run on. + * Retrieve the job stream identified by job stream id. * - * @param {object} [parameters.parameters] Gets or sets the parameters of the - * job. + * @param {string} jobName The job name. * - * @param {string} [parameters.description] Gets or sets the description of the - * webhook. + * @param {string} jobStreamId The job stream id. * * @param {object} [options] Optional Parameters. * @@ -9603,36 +10731,18 @@ export interface WebhookOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, webhookName: string, parameters: models.WebhookUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(jobName: string, jobStreamId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Update the webhook identified by webhook name. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} webhookName The webhook name. - * - * @param {object} parameters The update parameters for webhook. - * - * @param {string} parameters.name Gets or sets the name of the webhook. - * - * @param {boolean} [parameters.isEnabled] Gets or sets the value of the - * enabled flag of webhook. - * - * @param {string} [parameters.runOn] Gets or sets the name of the hybrid - * worker group the webhook job will run on. + * Retrieve the job stream identified by job stream id. * - * @param {object} [parameters.parameters] Gets or sets the parameters of the - * job. + * @param {string} jobName The job name. * - * @param {string} [parameters.description] Gets or sets the description of the - * webhook. + * @param {string} jobStreamId The job stream id. * * @param {object} [options] Optional Parameters. * @@ -9646,7 +10756,7 @@ export interface WebhookOperations { * * {Promise} A promise is returned. * - * @resolve {Webhook} - The deserialized result object. + * @resolve {JobStream} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9654,24 +10764,22 @@ export interface WebhookOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Webhook} [result] - The deserialized result object if an error did not occur. - * See {@link Webhook} for more information. + * {JobStream} [result] - The deserialized result object if an error did not occur. + * See {@link JobStream} 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, webhookName: string, parameters: models.WebhookUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, automationAccountName: string, webhookName: string, parameters: models.WebhookUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, automationAccountName: string, webhookName: string, parameters: models.WebhookUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(jobName: string, jobStreamId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(jobName: string, jobStreamId: string, callback: ServiceCallback): void; + get(jobName: string, jobStreamId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of webhooks. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of jobs streams identified by job name. * - * @param {string} automationAccountName The automation account name. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -9682,18 +10790,16 @@ export interface WebhookOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByJobWithHttpOperationResponse(jobName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of webhooks. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of jobs streams identified by job name. * - * @param {string} automationAccountName The automation account name. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -9709,7 +10815,7 @@ export interface WebhookOperations { * * {Promise} A promise is returned. * - * @resolve {WebhookListResult} - The deserialized result object. + * @resolve {JobStreamListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9717,20 +10823,20 @@ export interface WebhookOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {WebhookListResult} [result] - The deserialized result object if an error did not occur. - * See {@link WebhookListResult} for more information. + * {JobStreamListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobStreamListResult} 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?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByAutomationAccount(resourceGroupName: string, automationAccountName: string, callback: ServiceCallback): void; - listByAutomationAccount(resourceGroupName: string, automationAccountName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByJob(jobName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByJob(jobName: string, callback: ServiceCallback): void; + listByJob(jobName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Retrieve a list of webhooks. + * Retrieve a list of jobs streams identified by job name. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -9742,14 +10848,14 @@ export interface WebhookOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByAutomationAccountNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByJobNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieve a list of webhooks. + * Retrieve a list of jobs streams identified by job name. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -9766,7 +10872,7 @@ export interface WebhookOperations { * * {Promise} A promise is returned. * - * @resolve {WebhookListResult} - The deserialized result object. + * @resolve {JobStreamListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9774,14 +10880,14 @@ export interface WebhookOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {WebhookListResult} [result] - The deserialized result object if an error did not occur. - * See {@link WebhookListResult} for more information. + * {JobStreamListResult} [result] - The deserialized result object if an error did not occur. + * See {@link JobStreamListResult} 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; + listByJobNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByJobNext(nextPageLink: string, callback: ServiceCallback): void; + listByJobNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } diff --git a/lib/services/automationManagement/lib/operations/index.js b/lib/services/automationManagement/lib/operations/index.js index b644c547af..0d74e3cdb1 100644 --- a/lib/services/automationManagement/lib/operations/index.js +++ b/lib/services/automationManagement/lib/operations/index.js @@ -23,15 +23,15 @@ exports.ConnectionOperations = require('./connectionOperations'); exports.ConnectionTypeOperations = require('./connectionTypeOperations'); exports.CredentialOperations = require('./credentialOperations'); exports.DscCompilationJobOperations = require('./dscCompilationJobOperations'); +exports.DscCompilationJobStream = require('./dscCompilationJobStream'); exports.DscConfigurationOperations = require('./dscConfigurationOperations'); exports.AgentRegistrationInformation = require('./agentRegistrationInformation'); exports.DscNodeOperations = require('./dscNodeOperations'); exports.NodeReports = require('./nodeReports'); exports.DscNodeConfigurationOperations = require('./dscNodeConfigurationOperations'); exports.HybridRunbookWorkerGroupOperations = require('./hybridRunbookWorkerGroupOperations'); -exports.JobOperations = require('./jobOperations'); -exports.JobStreamOperations = require('./jobStreamOperations'); exports.JobScheduleOperations = require('./jobScheduleOperations'); +exports.LinkedWorkspaceOperations = require('./linkedWorkspaceOperations'); exports.ActivityOperations = require('./activityOperations'); exports.ModuleOperations = require('./moduleOperations'); exports.ObjectDataTypes = require('./objectDataTypes'); @@ -39,7 +39,14 @@ exports.Fields = require('./fields'); exports.RunbookDraftOperations = require('./runbookDraftOperations'); exports.RunbookOperations = require('./runbookOperations'); exports.TestJobStreams = require('./testJobStreams'); -exports.TestJobs = require('./testJobs'); +exports.TestJobOperations = require('./testJobOperations'); exports.ScheduleOperations = require('./scheduleOperations'); exports.VariableOperations = require('./variableOperations'); exports.WebhookOperations = require('./webhookOperations'); +exports.SoftwareUpdateConfigurations = require('./softwareUpdateConfigurations'); +exports.SoftwareUpdateConfigurationRuns = require('./softwareUpdateConfigurationRuns'); +exports.SoftwareUpdateConfigurationMachineRuns = require('./softwareUpdateConfigurationMachineRuns'); +exports.SourceControlOperations = require('./sourceControlOperations'); +exports.SourceControlSyncJobOperations = require('./sourceControlSyncJobOperations'); +exports.JobOperations = require('./jobOperations'); +exports.JobStreamOperations = require('./jobStreamOperations'); diff --git a/lib/services/automationManagement/lib/operations/jobOperations.js b/lib/services/automationManagement/lib/operations/jobOperations.js index adea536863..05c64386ee 100644 --- a/lib/services/automationManagement/lib/operations/jobOperations.js +++ b/lib/services/automationManagement/lib/operations/jobOperations.js @@ -15,13 +15,9 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * Retrieve the job output identified by job id. + * Retrieve the job output identified by job name. * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} jobId The job id. + * @param {string} jobName The name of the job to be created. * * @param {object} [options] Optional Parameters. * @@ -34,13 +30,13 @@ const WebResource = msRest.WebResource; * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {string} [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 _getOutput(resourceGroupName, automationAccountName, jobId, options, callback) { +function _getOutput(jobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50,28 +46,29 @@ function _getOutput(resourceGroupName, automationAccountName, jobId, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2017-05-15-preview'; // 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.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.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.automationAccountName cannot be null or undefined and it must be of type string.'); } - if (jobId === null || jobId === undefined || typeof jobId.valueOf() !== 'string') { - throw new Error('jobId cannot be null or undefined and it must be of type string.'); + if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { + throw new Error('jobName 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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.'); @@ -82,13 +79,13 @@ function _getOutput(resourceGroupName, automationAccountName, jobId, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/output'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); - requestUrl = requestUrl.replace('{jobId}', encodeURIComponent(jobId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/output'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -103,6 +100,9 @@ function _getOutput(resourceGroupName, automationAccountName, jobId, options, ca if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } + if (this.client.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } @@ -115,30 +115,27 @@ function _getOutput(resourceGroupName, automationAccountName, jobId, options, ca } httpRequest.body = null; // Send Request - httpRequest.streamedResponse = true; return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } - let statusCode = response.statusCode; if (statusCode !== 200) { - let error = new Error(`Unexpected status code: ${statusCode}`); + 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 { - if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + 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.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -148,21 +145,41 @@ function _getOutput(resourceGroupName, automationAccountName, jobId, options, ca } return callback(error); } - // Create Result - let result = response; + 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + 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 the runbook content of the job identified by job id. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Retrieve the runbook content of the job identified by job name. * - * @param {string} jobId The job id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -175,13 +192,13 @@ function _getOutput(resourceGroupName, automationAccountName, jobId, options, ca * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {string} [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 _getRunbookContent(resourceGroupName, automationAccountName, jobId, options, callback) { +function _getRunbookContent(jobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -191,28 +208,29 @@ function _getRunbookContent(resourceGroupName, automationAccountName, jobId, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2017-05-15-preview'; // 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.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 (jobId === null || jobId === undefined || typeof jobId.valueOf() !== 'string') { - throw new Error('jobId cannot be null or undefined and it must be of type string.'); + if (this.client.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.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 (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { + throw new Error('jobName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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.'); @@ -223,13 +241,13 @@ function _getRunbookContent(resourceGroupName, automationAccountName, jobId, opt // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/runbookContent'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); - requestUrl = requestUrl.replace('{jobId}', encodeURIComponent(jobId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/runbookContent'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -244,6 +262,9 @@ function _getRunbookContent(resourceGroupName, automationAccountName, jobId, opt if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } + if (this.client.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } @@ -256,30 +277,27 @@ function _getRunbookContent(resourceGroupName, automationAccountName, jobId, opt } httpRequest.body = null; // Send Request - httpRequest.streamedResponse = true; return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } - let statusCode = response.statusCode; if (statusCode !== 200) { - let error = new Error(`Unexpected status code: ${statusCode}`); + 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 { - if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + 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.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -289,21 +307,41 @@ function _getRunbookContent(resourceGroupName, automationAccountName, jobId, opt } return callback(error); } - // Create Result - let result = response; + 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + 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); }); } /** - * Suspend the job identified by jobId. - * - * @param {string} resourceGroupName The resource group name. + * Suspend the job identified by job name. * - * @param {string} automationAccountName The automation account name. - * - * @param {uuid} jobId The job id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -322,7 +360,7 @@ function _getRunbookContent(resourceGroupName, automationAccountName, jobId, opt * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _suspend(resourceGroupName, automationAccountName, jobId, options, callback) { +function _suspend(jobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -332,28 +370,29 @@ function _suspend(resourceGroupName, automationAccountName, jobId, options, call if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2017-05-15-preview'; // 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 (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.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.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 (jobId === null || jobId === undefined || typeof jobId.valueOf() !== 'string' || !msRest.isValidUuid(jobId)) { - throw new Error('jobId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + if (this.client.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.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 (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { + throw new Error('jobName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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.'); @@ -364,13 +403,13 @@ function _suspend(resourceGroupName, automationAccountName, jobId, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/suspend'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); - requestUrl = requestUrl.replace('{jobId}', encodeURIComponent(jobId.toString())); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/suspend'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -385,6 +424,9 @@ function _suspend(resourceGroupName, automationAccountName, jobId, options, call if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } + if (this.client.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } @@ -437,13 +479,9 @@ function _suspend(resourceGroupName, automationAccountName, jobId, options, call } /** - * Stop the job identified by jobId. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Stop the job identified by jobName. * - * @param {uuid} jobId The job id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -462,7 +500,7 @@ function _suspend(resourceGroupName, automationAccountName, jobId, options, call * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _stop(resourceGroupName, automationAccountName, jobId, options, callback) { +function _stop(jobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -472,28 +510,29 @@ function _stop(resourceGroupName, automationAccountName, jobId, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2017-05-15-preview'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.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.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.automationAccountName cannot be null or undefined and it must be of type string.'); } - if (jobId === null || jobId === undefined || typeof jobId.valueOf() !== 'string' || !msRest.isValidUuid(jobId)) { - throw new Error('jobId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { + throw new Error('jobName 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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.'); @@ -504,13 +543,13 @@ function _stop(resourceGroupName, automationAccountName, jobId, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/stop'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); - requestUrl = requestUrl.replace('{jobId}', encodeURIComponent(jobId.toString())); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/stop'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -525,6 +564,9 @@ function _stop(resourceGroupName, automationAccountName, jobId, options, callbac if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } + if (this.client.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } @@ -577,13 +619,9 @@ function _stop(resourceGroupName, automationAccountName, jobId, options, callbac } /** - * Retrieve the job identified by job id. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the job identified by job name. * - * @param {string} automationAccountName The automation account name. - * - * @param {uuid} jobId The job id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -603,7 +641,7 @@ function _stop(resourceGroupName, automationAccountName, jobId, options, callbac * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, jobId, options, callback) { +function _get(jobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -613,28 +651,29 @@ function _get(resourceGroupName, automationAccountName, jobId, options, callback if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2017-05-15-preview'; // 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.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 (jobId === null || jobId === undefined || typeof jobId.valueOf() !== 'string' || !msRest.isValidUuid(jobId)) { - throw new Error('jobId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + if (this.client.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.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 (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { + throw new Error('jobName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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.'); @@ -645,13 +684,13 @@ function _get(resourceGroupName, automationAccountName, jobId, options, callback // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); - requestUrl = requestUrl.replace('{jobId}', encodeURIComponent(jobId.toString())); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -666,6 +705,9 @@ function _get(resourceGroupName, automationAccountName, jobId, options, callback if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } + if (this.client.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } @@ -737,11 +779,7 @@ function _get(resourceGroupName, automationAccountName, jobId, options, callback /** * Create a job of the runbook. * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {uuid} jobId The job id. + * @param {string} jobName The job name. * * @param {object} parameters The parameters supplied to the create job * operation. @@ -757,14 +795,6 @@ function _get(resourceGroupName, automationAccountName, jobId, options, callback * @param {string} [parameters.runOn] Gets or sets the runOn which specifies * the group name where the job is to be executed. * - * @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 @@ -783,7 +813,7 @@ function _get(resourceGroupName, automationAccountName, jobId, options, callback * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _create(resourceGroupName, automationAccountName, jobId, parameters, options, callback) { +function _create(jobName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -793,31 +823,32 @@ function _create(resourceGroupName, automationAccountName, jobId, parameters, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2017-05-15-preview'; // 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.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.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.automationAccountName cannot be null or undefined and it must be of type string.'); } - if (jobId === null || jobId === undefined || typeof jobId.valueOf() !== 'string' || !msRest.isValidUuid(jobId)) { - throw new Error('jobId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { + throw new Error('jobName 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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.'); @@ -828,13 +859,13 @@ function _create(resourceGroupName, automationAccountName, jobId, parameters, op // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); - requestUrl = requestUrl.replace('{jobId}', encodeURIComponent(jobId.toString())); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -849,6 +880,9 @@ function _create(resourceGroupName, automationAccountName, jobId, parameters, op if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } + if (this.client.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } @@ -934,10 +968,6 @@ function _create(resourceGroupName, automationAccountName, jobId, parameters, op /** * Retrieve a list of jobs. * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * * @param {object} [options] Optional Parameters. * * @param {string} [options.filter] The filter to apply on the operation. @@ -952,13 +982,13 @@ function _create(resourceGroupName, automationAccountName, jobId, parameters, op * {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 JobListResult} for more information. + * See {@link JobListResultV2} 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) { +function _listByAutomationAccount(options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -969,19 +999,20 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2017-05-15-preview'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.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.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.automationAccountName cannot be null or undefined and it must be of type string.'); } if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { throw new Error('filter must be of type string.'); @@ -989,8 +1020,8 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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.'); @@ -1002,14 +1033,14 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1024,6 +1055,9 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } + if (this.client.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } @@ -1077,7 +1111,7 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['JobListResult']().mapper(); + let resultMapper = new client.models['JobListResultV2']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1093,13 +1127,9 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti } /** - * Resume the job identified by jobId. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Resume the job identified by jobName. * - * @param {uuid} jobId The job id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -1118,7 +1148,7 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _resume(resourceGroupName, automationAccountName, jobId, options, callback) { +function _resume(jobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1128,28 +1158,29 @@ function _resume(resourceGroupName, automationAccountName, jobId, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2017-05-15-preview'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.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.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.automationAccountName cannot be null or undefined and it must be of type string.'); } - if (jobId === null || jobId === undefined || typeof jobId.valueOf() !== 'string' || !msRest.isValidUuid(jobId)) { - throw new Error('jobId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { + throw new Error('jobName 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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.'); @@ -1160,13 +1191,13 @@ function _resume(resourceGroupName, automationAccountName, jobId, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/resume'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); - requestUrl = requestUrl.replace('{jobId}', encodeURIComponent(jobId.toString())); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/resume'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1181,6 +1212,9 @@ function _resume(resourceGroupName, automationAccountName, jobId, options, callb if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } + if (this.client.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } @@ -1250,7 +1284,7 @@ function _resume(resourceGroupName, automationAccountName, jobId, options, callb * {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 JobListResult} for more information. + * See {@link JobListResultV2} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1271,6 +1305,9 @@ function _listByAutomationAccountNext(nextPageLink, options, callback) { 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.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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.'); } @@ -1292,6 +1329,9 @@ function _listByAutomationAccountNext(nextPageLink, options, callback) { if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } + if (this.client.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } @@ -1345,7 +1385,7 @@ function _listByAutomationAccountNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['JobListResult']().mapper(); + let resultMapper = new client.models['JobListResultV2']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1380,13 +1420,9 @@ class JobOperations { } /** - * Retrieve the job output identified by job id. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the job output identified by job name. * - * @param {string} automationAccountName The automation account name. - * - * @param {string} jobId The job id. + * @param {string} jobName The name of the job to be created. * * @param {object} [options] Optional Parameters. * @@ -1395,15 +1431,15 @@ class JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getOutputWithHttpOperationResponse(resourceGroupName, automationAccountName, jobId, options) { + getOutputWithHttpOperationResponse(jobName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getOutput(resourceGroupName, automationAccountName, jobId, options, (err, result, request, response) => { + self._getOutput(jobName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1414,13 +1450,9 @@ class JobOperations { } /** - * Retrieve the job output identified by job id. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Retrieve the job output identified by job name. * - * @param {string} jobId The job id. + * @param {string} jobName The name of the job to be created. * * @param {object} [options] Optional Parameters. * @@ -1434,7 +1466,7 @@ class JobOperations { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {String} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1442,13 +1474,13 @@ class JobOperations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {string} [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. */ - getOutput(resourceGroupName, automationAccountName, jobId, options, optionalCallback) { + getOutput(jobName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1457,25 +1489,21 @@ class JobOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getOutput(resourceGroupName, automationAccountName, jobId, options, (err, result, request, response) => { + self._getOutput(jobName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getOutput(resourceGroupName, automationAccountName, jobId, options, optionalCallback); + return self._getOutput(jobName, options, optionalCallback); } } /** - * Retrieve the runbook content of the job identified by job id. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the runbook content of the job identified by job name. * - * @param {string} automationAccountName The automation account name. - * - * @param {string} jobId The job id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -1484,15 +1512,15 @@ class JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getRunbookContentWithHttpOperationResponse(resourceGroupName, automationAccountName, jobId, options) { + getRunbookContentWithHttpOperationResponse(jobName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getRunbookContent(resourceGroupName, automationAccountName, jobId, options, (err, result, request, response) => { + self._getRunbookContent(jobName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1503,13 +1531,9 @@ class JobOperations { } /** - * Retrieve the runbook content of the job identified by job id. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Retrieve the runbook content of the job identified by job name. * - * @param {string} jobId The job id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -1523,7 +1547,7 @@ class JobOperations { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {String} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1531,13 +1555,13 @@ class JobOperations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {string} [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. */ - getRunbookContent(resourceGroupName, automationAccountName, jobId, options, optionalCallback) { + getRunbookContent(jobName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1546,25 +1570,21 @@ class JobOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getRunbookContent(resourceGroupName, automationAccountName, jobId, options, (err, result, request, response) => { + self._getRunbookContent(jobName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getRunbookContent(resourceGroupName, automationAccountName, jobId, options, optionalCallback); + return self._getRunbookContent(jobName, options, optionalCallback); } } /** - * Suspend the job identified by jobId. - * - * @param {string} resourceGroupName The resource group name. + * Suspend the job identified by job name. * - * @param {string} automationAccountName The automation account name. - * - * @param {uuid} jobId The job id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -1577,11 +1597,11 @@ class JobOperations { * * @reject {Error} - The error object. */ - suspendWithHttpOperationResponse(resourceGroupName, automationAccountName, jobId, options) { + suspendWithHttpOperationResponse(jobName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._suspend(resourceGroupName, automationAccountName, jobId, options, (err, result, request, response) => { + self._suspend(jobName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1592,13 +1612,9 @@ class JobOperations { } /** - * Suspend the job identified by jobId. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Suspend the job identified by job name. * - * @param {uuid} jobId The job id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -1626,7 +1642,7 @@ class JobOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - suspend(resourceGroupName, automationAccountName, jobId, options, optionalCallback) { + suspend(jobName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1635,25 +1651,21 @@ class JobOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._suspend(resourceGroupName, automationAccountName, jobId, options, (err, result, request, response) => { + self._suspend(jobName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._suspend(resourceGroupName, automationAccountName, jobId, options, optionalCallback); + return self._suspend(jobName, options, optionalCallback); } } /** - * Stop the job identified by jobId. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Stop the job identified by jobName. * - * @param {uuid} jobId The job id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -1666,11 +1678,11 @@ class JobOperations { * * @reject {Error} - The error object. */ - stopWithHttpOperationResponse(resourceGroupName, automationAccountName, jobId, options) { + stopWithHttpOperationResponse(jobName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._stop(resourceGroupName, automationAccountName, jobId, options, (err, result, request, response) => { + self._stop(jobName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1681,13 +1693,9 @@ class JobOperations { } /** - * Stop the job identified by jobId. + * Stop the job identified by jobName. * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {uuid} jobId The job id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -1715,7 +1723,7 @@ class JobOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - stop(resourceGroupName, automationAccountName, jobId, options, optionalCallback) { + stop(jobName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1724,25 +1732,21 @@ class JobOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._stop(resourceGroupName, automationAccountName, jobId, options, (err, result, request, response) => { + self._stop(jobName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._stop(resourceGroupName, automationAccountName, jobId, options, optionalCallback); + return self._stop(jobName, options, optionalCallback); } } /** - * Retrieve the job identified by job id. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the job identified by job name. * - * @param {string} automationAccountName The automation account name. - * - * @param {uuid} jobId The job id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -1755,11 +1759,11 @@ class JobOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, jobId, options) { + getWithHttpOperationResponse(jobName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, jobId, options, (err, result, request, response) => { + self._get(jobName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1770,13 +1774,9 @@ class JobOperations { } /** - * Retrieve the job identified by job id. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve the job identified by job name. * - * @param {string} automationAccountName The automation account name. - * - * @param {uuid} jobId The job id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -1805,7 +1805,7 @@ class JobOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, jobId, options, optionalCallback) { + get(jobName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1814,25 +1814,21 @@ class JobOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, jobId, options, (err, result, request, response) => { + self._get(jobName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, jobId, options, optionalCallback); + return self._get(jobName, options, optionalCallback); } } /** * Create a job of the runbook. * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {uuid} jobId The job id. + * @param {string} jobName The job name. * * @param {object} parameters The parameters supplied to the create job * operation. @@ -1848,14 +1844,6 @@ class JobOperations { * @param {string} [parameters.runOn] Gets or sets the runOn which specifies * the group name where the job is to be executed. * - * @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 @@ -1867,11 +1855,11 @@ class JobOperations { * * @reject {Error} - The error object. */ - createWithHttpOperationResponse(resourceGroupName, automationAccountName, jobId, parameters, options) { + createWithHttpOperationResponse(jobName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._create(resourceGroupName, automationAccountName, jobId, parameters, options, (err, result, request, response) => { + self._create(jobName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1884,11 +1872,7 @@ class JobOperations { /** * Create a job of the runbook. * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {uuid} jobId The job id. + * @param {string} jobName The job name. * * @param {object} parameters The parameters supplied to the create job * operation. @@ -1904,14 +1888,6 @@ class JobOperations { * @param {string} [parameters.runOn] Gets or sets the runOn which specifies * the group name where the job is to be executed. * - * @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 @@ -1939,7 +1915,7 @@ class JobOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - create(resourceGroupName, automationAccountName, jobId, parameters, options, optionalCallback) { + create(jobName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1948,24 +1924,20 @@ class JobOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._create(resourceGroupName, automationAccountName, jobId, parameters, options, (err, result, request, response) => { + self._create(jobName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._create(resourceGroupName, automationAccountName, jobId, parameters, options, optionalCallback); + return self._create(jobName, parameters, options, optionalCallback); } } /** * Retrieve a list of jobs. * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * * @param {object} [options] Optional Parameters. * * @param {string} [options.filter] The filter to apply on the operation. @@ -1975,15 +1947,15 @@ class JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1996,10 +1968,6 @@ class JobOperations { /** * Retrieve a list of jobs. * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * * @param {object} [options] Optional Parameters. * * @param {string} [options.filter] The filter to apply on the operation. @@ -2014,7 +1982,7 @@ class JobOperations { * * {Promise} A promise is returned * - * @resolve {JobListResult} - The deserialized result object. + * @resolve {JobListResultV2} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2023,13 +1991,13 @@ class JobOperations { * {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 JobListResult} for more information. + * See {@link JobListResultV2} 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) { + listByAutomationAccount(options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2038,25 +2006,21 @@ class JobOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(options, optionalCallback); } } /** - * Resume the job identified by jobId. + * Resume the job identified by jobName. * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {uuid} jobId The job id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -2069,11 +2033,11 @@ class JobOperations { * * @reject {Error} - The error object. */ - resumeWithHttpOperationResponse(resourceGroupName, automationAccountName, jobId, options) { + resumeWithHttpOperationResponse(jobName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._resume(resourceGroupName, automationAccountName, jobId, options, (err, result, request, response) => { + self._resume(jobName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2084,13 +2048,9 @@ class JobOperations { } /** - * Resume the job identified by jobId. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Resume the job identified by jobName. * - * @param {uuid} jobId The job id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -2118,7 +2078,7 @@ class JobOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - resume(resourceGroupName, automationAccountName, jobId, options, optionalCallback) { + resume(jobName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2127,14 +2087,14 @@ class JobOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resume(resourceGroupName, automationAccountName, jobId, options, (err, result, request, response) => { + self._resume(jobName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resume(resourceGroupName, automationAccountName, jobId, options, optionalCallback); + return self._resume(jobName, options, optionalCallback); } } @@ -2151,7 +2111,7 @@ class JobOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -2187,7 +2147,7 @@ class JobOperations { * * {Promise} A promise is returned * - * @resolve {JobListResult} - The deserialized result object. + * @resolve {JobListResultV2} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2196,7 +2156,7 @@ class JobOperations { * {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 JobListResult} for more information. + * See {@link JobListResultV2} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * diff --git a/lib/services/automationManagement/lib/operations/jobScheduleOperations.js b/lib/services/automationManagement/lib/operations/jobScheduleOperations.js index 580185b3ab..073d28a536 100644 --- a/lib/services/automationManagement/lib/operations/jobScheduleOperations.js +++ b/lib/services/automationManagement/lib/operations/jobScheduleOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Delete the job schedule identified by job schedule name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} jobScheduleId The job schedule name. @@ -40,7 +38,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, automationAccountName, jobScheduleId, options, callback) { +function _deleteMethod(automationAccountName, jobScheduleId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50,15 +48,16 @@ function _deleteMethod(resourceGroupName, automationAccountName, jobScheduleId, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -70,9 +69,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, jobScheduleId, 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -83,12 +79,12 @@ function _deleteMethod(resourceGroupName, automationAccountName, jobScheduleId, // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{jobScheduleId}', encodeURIComponent(jobScheduleId.toString())); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -157,8 +153,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, jobScheduleId, /** * Retrieve the job schedule identified by job schedule name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} jobScheduleId The job schedule name. @@ -181,7 +175,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, jobScheduleId, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, jobScheduleId, options, callback) { +function _get(automationAccountName, jobScheduleId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -191,15 +185,16 @@ function _get(resourceGroupName, automationAccountName, jobScheduleId, options, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -211,9 +206,6 @@ function _get(resourceGroupName, automationAccountName, jobScheduleId, options, 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -224,12 +216,12 @@ function _get(resourceGroupName, automationAccountName, jobScheduleId, options, // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{jobScheduleId}', encodeURIComponent(jobScheduleId.toString())); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -315,8 +307,6 @@ function _get(resourceGroupName, automationAccountName, jobScheduleId, options, /** * Create a job schedule. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} jobScheduleId The job schedule name. @@ -358,7 +348,7 @@ function _get(resourceGroupName, automationAccountName, jobScheduleId, options, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _create(resourceGroupName, automationAccountName, jobScheduleId, parameters, options, callback) { +function _create(automationAccountName, jobScheduleId, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -368,15 +358,16 @@ function _create(resourceGroupName, automationAccountName, jobScheduleId, parame if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -391,9 +382,6 @@ function _create(resourceGroupName, automationAccountName, jobScheduleId, parame 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -404,12 +392,12 @@ function _create(resourceGroupName, automationAccountName, jobScheduleId, parame // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules/{jobScheduleId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{jobScheduleId}', encodeURIComponent(jobScheduleId.toString())); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -509,8 +497,6 @@ function _create(resourceGroupName, automationAccountName, jobScheduleId, parame /** * Retrieve a list of job schedules. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -531,7 +517,7 @@ function _create(resourceGroupName, automationAccountName, jobScheduleId, parame * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { +function _listByAutomationAccount(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -541,15 +527,16 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -558,9 +545,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -571,11 +555,11 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobSchedules'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -804,8 +788,6 @@ class JobScheduleOperations { /** * Delete the job schedule identified by job schedule name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} jobScheduleId The job schedule name. @@ -821,11 +803,11 @@ class JobScheduleOperations { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, jobScheduleId, options) { + deleteMethodWithHttpOperationResponse(automationAccountName, jobScheduleId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, jobScheduleId, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, jobScheduleId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -838,8 +820,6 @@ class JobScheduleOperations { /** * Delete the job schedule identified by job schedule name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} jobScheduleId The job schedule name. @@ -870,7 +850,7 @@ class JobScheduleOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, automationAccountName, jobScheduleId, options, optionalCallback) { + deleteMethod(automationAccountName, jobScheduleId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -879,22 +859,20 @@ class JobScheduleOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, jobScheduleId, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, jobScheduleId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, automationAccountName, jobScheduleId, options, optionalCallback); + return self._deleteMethod(automationAccountName, jobScheduleId, options, optionalCallback); } } /** * Retrieve the job schedule identified by job schedule name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} jobScheduleId The job schedule name. @@ -910,11 +888,11 @@ class JobScheduleOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, jobScheduleId, options) { + getWithHttpOperationResponse(automationAccountName, jobScheduleId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, jobScheduleId, options, (err, result, request, response) => { + self._get(automationAccountName, jobScheduleId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -927,8 +905,6 @@ class JobScheduleOperations { /** * Retrieve the job schedule identified by job schedule name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} jobScheduleId The job schedule name. @@ -960,7 +936,7 @@ class JobScheduleOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, jobScheduleId, options, optionalCallback) { + get(automationAccountName, jobScheduleId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -969,22 +945,20 @@ class JobScheduleOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, jobScheduleId, options, (err, result, request, response) => { + self._get(automationAccountName, jobScheduleId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, jobScheduleId, options, optionalCallback); + return self._get(automationAccountName, jobScheduleId, options, optionalCallback); } } /** * Create a job schedule. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} jobScheduleId The job schedule name. @@ -1019,11 +993,11 @@ class JobScheduleOperations { * * @reject {Error} - The error object. */ - createWithHttpOperationResponse(resourceGroupName, automationAccountName, jobScheduleId, parameters, options) { + createWithHttpOperationResponse(automationAccountName, jobScheduleId, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._create(resourceGroupName, automationAccountName, jobScheduleId, parameters, options, (err, result, request, response) => { + self._create(automationAccountName, jobScheduleId, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1036,8 +1010,6 @@ class JobScheduleOperations { /** * Create a job schedule. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {uuid} jobScheduleId The job schedule name. @@ -1088,7 +1060,7 @@ class JobScheduleOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - create(resourceGroupName, automationAccountName, jobScheduleId, parameters, options, optionalCallback) { + create(automationAccountName, jobScheduleId, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1097,22 +1069,20 @@ class JobScheduleOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._create(resourceGroupName, automationAccountName, jobScheduleId, parameters, options, (err, result, request, response) => { + self._create(automationAccountName, jobScheduleId, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._create(resourceGroupName, automationAccountName, jobScheduleId, parameters, options, optionalCallback); + return self._create(automationAccountName, jobScheduleId, parameters, options, optionalCallback); } } /** * Retrieve a list of job schedules. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1126,11 +1096,11 @@ class JobScheduleOperations { * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1143,8 +1113,6 @@ class JobScheduleOperations { /** * Retrieve a list of job schedules. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1174,7 +1142,7 @@ class JobScheduleOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + listByAutomationAccount(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1183,14 +1151,14 @@ class JobScheduleOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/jobStreamOperations.js b/lib/services/automationManagement/lib/operations/jobStreamOperations.js index 44e5c0dbfd..75db40543f 100644 --- a/lib/services/automationManagement/lib/operations/jobStreamOperations.js +++ b/lib/services/automationManagement/lib/operations/jobStreamOperations.js @@ -17,11 +17,7 @@ const WebResource = msRest.WebResource; /** * Retrieve the job stream identified by job stream id. * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} jobId The job id. + * @param {string} jobName The job name. * * @param {string} jobStreamId The job stream id. * @@ -43,7 +39,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, jobId, jobStreamId, options, callback) { +function _get(jobName, jobStreamId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53,31 +49,32 @@ function _get(resourceGroupName, automationAccountName, jobId, jobStreamId, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2017-05-15-preview'; // 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 (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.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.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.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.automationAccountName cannot be null or undefined and it must be of type string.'); } - if (jobId === null || jobId === undefined || typeof jobId.valueOf() !== 'string') { - throw new Error('jobId cannot be null or undefined and it must be of type string.'); + if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { + throw new Error('jobName cannot be null or undefined and it must be of type string.'); } if (jobStreamId === null || jobStreamId === undefined || typeof jobStreamId.valueOf() !== 'string') { throw new Error('jobStreamId 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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.'); @@ -88,14 +85,14 @@ function _get(resourceGroupName, automationAccountName, jobId, jobStreamId, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/streams/{jobStreamId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); - requestUrl = requestUrl.replace('{jobId}', encodeURIComponent(jobId)); - requestUrl = requestUrl.replace('{jobStreamId}', encodeURIComponent(jobStreamId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams/{jobStreamId}'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); + requestUrl = requestUrl.replace('{jobStreamId}', encodeURIComponent(jobStreamId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -110,6 +107,9 @@ function _get(resourceGroupName, automationAccountName, jobId, jobStreamId, opti if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } + if (this.client.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } @@ -179,13 +179,9 @@ function _get(resourceGroupName, automationAccountName, jobId, jobStreamId, opti } /** - * Retrieve a list of jobs streams identified by job id. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of jobs streams identified by job name. * - * @param {string} automationAccountName The automation account name. - * - * @param {string} jobId The job Id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -207,7 +203,7 @@ function _get(resourceGroupName, automationAccountName, jobId, jobStreamId, opti * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByJob(resourceGroupName, automationAccountName, jobId, options, callback) { +function _listByJob(jobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -218,22 +214,23 @@ function _listByJob(resourceGroupName, automationAccountName, jobId, options, ca throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2017-05-15-preview'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.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.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.automationAccountName cannot be null or undefined and it must be of type string.'); } - if (jobId === null || jobId === undefined || typeof jobId.valueOf() !== 'string') { - throw new Error('jobId cannot be null or undefined and it must be of type string.'); + if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { + throw new Error('jobName cannot be null or undefined and it must be of type string.'); } if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { throw new Error('filter must be of type string.'); @@ -241,8 +238,8 @@ function _listByJob(resourceGroupName, automationAccountName, jobId, options, ca 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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.'); @@ -253,16 +250,16 @@ function _listByJob(resourceGroupName, automationAccountName, jobId, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobId}/streams'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); - requestUrl = requestUrl.replace('{jobId}', encodeURIComponent(jobId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/jobs/{jobName}/streams'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -277,6 +274,9 @@ function _listByJob(resourceGroupName, automationAccountName, jobId, options, ca if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } + if (this.client.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } @@ -346,7 +346,7 @@ function _listByJob(resourceGroupName, automationAccountName, jobId, options, ca } /** - * Retrieve a list of jobs streams identified by job id. + * Retrieve a list of jobs streams identified by job name. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -384,6 +384,9 @@ function _listByJobNext(nextPageLink, options, callback) { 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.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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.'); } @@ -405,6 +408,9 @@ function _listByJobNext(nextPageLink, options, callback) { if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } + if (this.client.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } @@ -489,11 +495,7 @@ class JobStreamOperations { /** * Retrieve the job stream identified by job stream id. * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} jobId The job id. + * @param {string} jobName The job name. * * @param {string} jobStreamId The job stream id. * @@ -508,11 +510,11 @@ class JobStreamOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, jobId, jobStreamId, options) { + getWithHttpOperationResponse(jobName, jobStreamId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, jobId, jobStreamId, options, (err, result, request, response) => { + self._get(jobName, jobStreamId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -525,11 +527,7 @@ class JobStreamOperations { /** * Retrieve the job stream identified by job stream id. * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. - * - * @param {string} jobId The job id. + * @param {string} jobName The job name. * * @param {string} jobStreamId The job stream id. * @@ -560,7 +558,7 @@ class JobStreamOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, jobId, jobStreamId, options, optionalCallback) { + get(jobName, jobStreamId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -569,25 +567,21 @@ class JobStreamOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, jobId, jobStreamId, options, (err, result, request, response) => { + self._get(jobName, jobStreamId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, jobId, jobStreamId, options, optionalCallback); + return self._get(jobName, jobStreamId, options, optionalCallback); } } /** - * Retrieve a list of jobs streams identified by job id. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a list of jobs streams identified by job name. * - * @param {string} automationAccountName The automation account name. - * - * @param {string} jobId The job Id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -602,11 +596,11 @@ class JobStreamOperations { * * @reject {Error} - The error object. */ - listByJobWithHttpOperationResponse(resourceGroupName, automationAccountName, jobId, options) { + listByJobWithHttpOperationResponse(jobName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByJob(resourceGroupName, automationAccountName, jobId, options, (err, result, request, response) => { + self._listByJob(jobName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -617,13 +611,9 @@ class JobStreamOperations { } /** - * Retrieve a list of jobs streams identified by job id. - * - * @param {string} resourceGroupName The resource group name. - * - * @param {string} automationAccountName The automation account name. + * Retrieve a list of jobs streams identified by job name. * - * @param {string} jobId The job Id. + * @param {string} jobName The job name. * * @param {object} [options] Optional Parameters. * @@ -654,7 +644,7 @@ class JobStreamOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByJob(resourceGroupName, automationAccountName, jobId, options, optionalCallback) { + listByJob(jobName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -663,19 +653,19 @@ class JobStreamOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByJob(resourceGroupName, automationAccountName, jobId, options, (err, result, request, response) => { + self._listByJob(jobName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByJob(resourceGroupName, automationAccountName, jobId, options, optionalCallback); + return self._listByJob(jobName, options, optionalCallback); } } /** - * Retrieve a list of jobs streams identified by job id. + * Retrieve a list of jobs streams identified by job name. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -706,7 +696,7 @@ class JobStreamOperations { } /** - * Retrieve a list of jobs streams identified by job id. + * Retrieve a list of jobs streams identified by job name. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. diff --git a/lib/services/automationManagement/lib/operations/linkedWorkspaceOperations.js b/lib/services/automationManagement/lib/operations/linkedWorkspaceOperations.js new file mode 100644 index 0000000000..1853bbf687 --- /dev/null +++ b/lib/services/automationManagement/lib/operations/linkedWorkspaceOperations.js @@ -0,0 +1,260 @@ +/* + * 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; + +/** + * Retrieve the linked workspace for the account id. + * + * @param {string} automationAccountName The automation account 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 LinkedWorkspace} 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(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 = '2015-10-31'; + // Validate + try { + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.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}/linkedWorkspace'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.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['LinkedWorkspace']().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 LinkedWorkspaceOperations. */ +class LinkedWorkspaceOperations { + /** + * Create a LinkedWorkspaceOperations. + * @param {AutomationClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + } + + /** + * Retrieve the linked workspace for the account id. + * + * @param {string} automationAccountName The automation account 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(automationAccountName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(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 the linked workspace for the account id. + * + * @param {string} automationAccountName The automation account 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 {LinkedWorkspace} - 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 LinkedWorkspace} 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(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._get(automationAccountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(automationAccountName, options, optionalCallback); + } + } + +} + +module.exports = LinkedWorkspaceOperations; diff --git a/lib/services/automationManagement/lib/operations/moduleOperations.js b/lib/services/automationManagement/lib/operations/moduleOperations.js index 99ee8c08be..edef4bcdce 100644 --- a/lib/services/automationManagement/lib/operations/moduleOperations.js +++ b/lib/services/automationManagement/lib/operations/moduleOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Delete the module by name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The module name. @@ -40,7 +38,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, automationAccountName, moduleName, options, callback) { +function _deleteMethod(automationAccountName, moduleName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50,15 +48,16 @@ function _deleteMethod(resourceGroupName, automationAccountName, moduleName, opt if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -70,9 +69,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, moduleName, opt 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -83,12 +79,12 @@ function _deleteMethod(resourceGroupName, automationAccountName, moduleName, opt // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{moduleName}', encodeURIComponent(moduleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -157,8 +153,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, moduleName, opt /** * Retrieve the module identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The module name. @@ -181,7 +175,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, moduleName, opt * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, moduleName, options, callback) { +function _get(automationAccountName, moduleName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -191,15 +185,16 @@ function _get(resourceGroupName, automationAccountName, moduleName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -211,9 +206,6 @@ function _get(resourceGroupName, automationAccountName, moduleName, options, cal 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -224,12 +216,12 @@ function _get(resourceGroupName, automationAccountName, moduleName, options, cal // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{moduleName}', encodeURIComponent(moduleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -315,8 +307,6 @@ function _get(resourceGroupName, automationAccountName, moduleName, options, cal /** * Create or Update the module identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -365,7 +355,7 @@ function _get(resourceGroupName, automationAccountName, moduleName, options, cal * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, automationAccountName, moduleName, parameters, options, callback) { +function _createOrUpdate(automationAccountName, moduleName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -375,15 +365,16 @@ function _createOrUpdate(resourceGroupName, automationAccountName, moduleName, p if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -398,9 +389,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, moduleName, p 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -411,12 +399,12 @@ function _createOrUpdate(resourceGroupName, automationAccountName, moduleName, p // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{moduleName}', encodeURIComponent(moduleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -462,7 +450,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, moduleName, p return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -492,7 +480,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, moduleName, p let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -509,7 +497,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, moduleName, p } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -533,8 +521,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, moduleName, p /** * Update the module identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -584,7 +570,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, moduleName, p * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _update(resourceGroupName, automationAccountName, moduleName, parameters, options, callback) { +function _update(automationAccountName, moduleName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -594,15 +580,16 @@ function _update(resourceGroupName, automationAccountName, moduleName, parameter if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -617,9 +604,6 @@ function _update(resourceGroupName, automationAccountName, moduleName, parameter 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -630,12 +614,12 @@ function _update(resourceGroupName, automationAccountName, moduleName, parameter // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{moduleName}', encodeURIComponent(moduleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -735,8 +719,6 @@ function _update(resourceGroupName, automationAccountName, moduleName, parameter /** * Retrieve a list of modules. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -757,7 +739,7 @@ function _update(resourceGroupName, automationAccountName, moduleName, parameter * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { +function _listByAutomationAccount(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -767,15 +749,16 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -784,9 +767,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -797,11 +777,11 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1031,8 +1011,6 @@ class ModuleOperations { /** * Delete the module by name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The module name. @@ -1048,11 +1026,11 @@ class ModuleOperations { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, moduleName, options) { + deleteMethodWithHttpOperationResponse(automationAccountName, moduleName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, moduleName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, moduleName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1065,8 +1043,6 @@ class ModuleOperations { /** * Delete the module by name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The module name. @@ -1097,7 +1073,7 @@ class ModuleOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, automationAccountName, moduleName, options, optionalCallback) { + deleteMethod(automationAccountName, moduleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1106,22 +1082,20 @@ class ModuleOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, moduleName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, moduleName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, automationAccountName, moduleName, options, optionalCallback); + return self._deleteMethod(automationAccountName, moduleName, options, optionalCallback); } } /** * Retrieve the module identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The module name. @@ -1137,11 +1111,11 @@ class ModuleOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, moduleName, options) { + getWithHttpOperationResponse(automationAccountName, moduleName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, moduleName, options, (err, result, request, response) => { + self._get(automationAccountName, moduleName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1154,8 +1128,6 @@ class ModuleOperations { /** * Retrieve the module identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The module name. @@ -1187,7 +1159,7 @@ class ModuleOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, moduleName, options, optionalCallback) { + get(automationAccountName, moduleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1196,22 +1168,20 @@ class ModuleOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, moduleName, options, (err, result, request, response) => { + self._get(automationAccountName, moduleName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, moduleName, options, optionalCallback); + return self._get(automationAccountName, moduleName, options, optionalCallback); } } /** * Create or Update the module identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -1253,11 +1223,11 @@ class ModuleOperations { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, automationAccountName, moduleName, parameters, options) { + createOrUpdateWithHttpOperationResponse(automationAccountName, moduleName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, moduleName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, moduleName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1270,8 +1240,6 @@ class ModuleOperations { /** * Create or Update the module identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -1329,7 +1297,7 @@ class ModuleOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, automationAccountName, moduleName, parameters, options, optionalCallback) { + createOrUpdate(automationAccountName, moduleName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1338,22 +1306,20 @@ class ModuleOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, moduleName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, moduleName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, automationAccountName, moduleName, parameters, options, optionalCallback); + return self._createOrUpdate(automationAccountName, moduleName, parameters, options, optionalCallback); } } /** * Update the module identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -1396,11 +1362,11 @@ class ModuleOperations { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, automationAccountName, moduleName, parameters, options) { + updateWithHttpOperationResponse(automationAccountName, moduleName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, moduleName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, moduleName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1413,8 +1379,6 @@ class ModuleOperations { /** * Update the module identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -1473,7 +1437,7 @@ class ModuleOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, automationAccountName, moduleName, parameters, options, optionalCallback) { + update(automationAccountName, moduleName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1482,22 +1446,20 @@ class ModuleOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, moduleName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, moduleName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, automationAccountName, moduleName, parameters, options, optionalCallback); + return self._update(automationAccountName, moduleName, parameters, options, optionalCallback); } } /** * Retrieve a list of modules. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1511,11 +1473,11 @@ class ModuleOperations { * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1528,8 +1490,6 @@ class ModuleOperations { /** * Retrieve a list of modules. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1559,7 +1519,7 @@ class ModuleOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + listByAutomationAccount(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1568,14 +1528,14 @@ class ModuleOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/nodeReports.js b/lib/services/automationManagement/lib/operations/nodeReports.js index 1a33c45841..aea8ef8eb3 100644 --- a/lib/services/automationManagement/lib/operations/nodeReports.js +++ b/lib/services/automationManagement/lib/operations/nodeReports.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Retrieve the Dsc node report list by node id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The parameters supplied to the list operation. @@ -44,7 +42,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByNode(resourceGroupName, automationAccountName, nodeId, options, callback) { +function _listByNode(automationAccountName, nodeId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55,15 +53,16 @@ function _listByNode(resourceGroupName, automationAccountName, nodeId, options, throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -78,9 +77,6 @@ function _listByNode(resourceGroupName, automationAccountName, nodeId, options, 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -91,7 +87,7 @@ function _listByNode(resourceGroupName, automationAccountName, nodeId, options, // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{nodeId}', encodeURIComponent(nodeId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); @@ -99,7 +95,7 @@ function _listByNode(resourceGroupName, automationAccountName, nodeId, options, if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -185,8 +181,6 @@ function _listByNode(resourceGroupName, automationAccountName, nodeId, options, /** * Retrieve the Dsc node report data by node id and report id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The Dsc node id. @@ -211,7 +205,7 @@ function _listByNode(resourceGroupName, automationAccountName, nodeId, options, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, nodeId, reportId, options, callback) { +function _get(automationAccountName, nodeId, reportId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -221,15 +215,16 @@ function _get(resourceGroupName, automationAccountName, nodeId, reportId, option if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -244,9 +239,6 @@ function _get(resourceGroupName, automationAccountName, nodeId, reportId, option 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -257,13 +249,13 @@ function _get(resourceGroupName, automationAccountName, nodeId, reportId, option // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{nodeId}', encodeURIComponent(nodeId)); requestUrl = requestUrl.replace('{reportId}', encodeURIComponent(reportId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -349,8 +341,6 @@ function _get(resourceGroupName, automationAccountName, nodeId, reportId, option /** * Retrieve the Dsc node reports by node id and report id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The Dsc node id. @@ -374,7 +364,7 @@ function _get(resourceGroupName, automationAccountName, nodeId, reportId, option * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getContent(resourceGroupName, automationAccountName, nodeId, reportId, options, callback) { +function _getContent(automationAccountName, nodeId, reportId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -384,15 +374,16 @@ function _getContent(resourceGroupName, automationAccountName, nodeId, reportId, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -407,9 +398,6 @@ function _getContent(resourceGroupName, automationAccountName, nodeId, reportId, 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -420,13 +408,13 @@ function _getContent(resourceGroupName, automationAccountName, nodeId, reportId, // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/nodes/{nodeId}/reports/{reportId}/content'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{nodeId}', encodeURIComponent(nodeId)); requestUrl = requestUrl.replace('{reportId}', encodeURIComponent(reportId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -453,22 +441,20 @@ function _getContent(resourceGroupName, automationAccountName, nodeId, reportId, } httpRequest.body = null; // Send Request - httpRequest.streamedResponse = true; return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } - let statusCode = response.statusCode; if (statusCode !== 200) { - let error = new Error(`Unexpected status code: ${statusCode}`); + 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 { - if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { let internalError = null; if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; @@ -486,9 +472,33 @@ function _getContent(resourceGroupName, automationAccountName, nodeId, reportId, } return callback(error); } - // Create Result - let result = response; + 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Object' + } + }; + 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); }); } @@ -639,8 +649,6 @@ class NodeReports { /** * Retrieve the Dsc node report list by node id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The parameters supplied to the list operation. @@ -658,11 +666,11 @@ class NodeReports { * * @reject {Error} - The error object. */ - listByNodeWithHttpOperationResponse(resourceGroupName, automationAccountName, nodeId, options) { + listByNodeWithHttpOperationResponse(automationAccountName, nodeId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByNode(resourceGroupName, automationAccountName, nodeId, options, (err, result, request, response) => { + self._listByNode(automationAccountName, nodeId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -675,8 +683,6 @@ class NodeReports { /** * Retrieve the Dsc node report list by node id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The parameters supplied to the list operation. @@ -711,7 +717,7 @@ class NodeReports { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByNode(resourceGroupName, automationAccountName, nodeId, options, optionalCallback) { + listByNode(automationAccountName, nodeId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -720,22 +726,20 @@ class NodeReports { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByNode(resourceGroupName, automationAccountName, nodeId, options, (err, result, request, response) => { + self._listByNode(automationAccountName, nodeId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByNode(resourceGroupName, automationAccountName, nodeId, options, optionalCallback); + return self._listByNode(automationAccountName, nodeId, options, optionalCallback); } } /** * Retrieve the Dsc node report data by node id and report id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The Dsc node id. @@ -753,11 +757,11 @@ class NodeReports { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, nodeId, reportId, options) { + getWithHttpOperationResponse(automationAccountName, nodeId, reportId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, nodeId, reportId, options, (err, result, request, response) => { + self._get(automationAccountName, nodeId, reportId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -770,8 +774,6 @@ class NodeReports { /** * Retrieve the Dsc node report data by node id and report id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The Dsc node id. @@ -805,7 +807,7 @@ class NodeReports { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, nodeId, reportId, options, optionalCallback) { + get(automationAccountName, nodeId, reportId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -814,22 +816,20 @@ class NodeReports { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, nodeId, reportId, options, (err, result, request, response) => { + self._get(automationAccountName, nodeId, reportId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, nodeId, reportId, options, optionalCallback); + return self._get(automationAccountName, nodeId, reportId, options, optionalCallback); } } /** * Retrieve the Dsc node reports by node id and report id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The Dsc node id. @@ -847,11 +847,11 @@ class NodeReports { * * @reject {Error} - The error object. */ - getContentWithHttpOperationResponse(resourceGroupName, automationAccountName, nodeId, reportId, options) { + getContentWithHttpOperationResponse(automationAccountName, nodeId, reportId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getContent(resourceGroupName, automationAccountName, nodeId, reportId, options, (err, result, request, response) => { + self._getContent(automationAccountName, nodeId, reportId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -864,8 +864,6 @@ class NodeReports { /** * Retrieve the Dsc node reports by node id and report id. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} nodeId The Dsc node id. @@ -898,7 +896,7 @@ class NodeReports { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getContent(resourceGroupName, automationAccountName, nodeId, reportId, options, optionalCallback) { + getContent(automationAccountName, nodeId, reportId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -907,14 +905,14 @@ class NodeReports { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getContent(resourceGroupName, automationAccountName, nodeId, reportId, options, (err, result, request, response) => { + self._getContent(automationAccountName, nodeId, reportId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getContent(resourceGroupName, automationAccountName, nodeId, reportId, options, optionalCallback); + return self._getContent(automationAccountName, nodeId, reportId, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/objectDataTypes.js b/lib/services/automationManagement/lib/operations/objectDataTypes.js index 0155911b8c..86d9aad839 100644 --- a/lib/services/automationManagement/lib/operations/objectDataTypes.js +++ b/lib/services/automationManagement/lib/operations/objectDataTypes.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Retrieve a list of fields of a given type identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -43,7 +41,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listFieldsByModuleAndType(resourceGroupName, automationAccountName, moduleName, typeName, options, callback) { +function _listFieldsByModuleAndType(automationAccountName, moduleName, typeName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53,15 +51,16 @@ function _listFieldsByModuleAndType(resourceGroupName, automationAccountName, mo if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -76,9 +75,6 @@ function _listFieldsByModuleAndType(resourceGroupName, automationAccountName, mo 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -89,13 +85,13 @@ function _listFieldsByModuleAndType(resourceGroupName, automationAccountName, mo // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/modules/{moduleName}/objectDataTypes/{typeName}/fields'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{moduleName}', encodeURIComponent(moduleName)); requestUrl = requestUrl.replace('{typeName}', encodeURIComponent(typeName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -181,8 +177,6 @@ function _listFieldsByModuleAndType(resourceGroupName, automationAccountName, mo /** * Retrieve a list of fields of a given type across all accessible modules. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} typeName The name of type. @@ -205,7 +199,7 @@ function _listFieldsByModuleAndType(resourceGroupName, automationAccountName, mo * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listFieldsByType(resourceGroupName, automationAccountName, typeName, options, callback) { +function _listFieldsByType(automationAccountName, typeName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -215,15 +209,16 @@ function _listFieldsByType(resourceGroupName, automationAccountName, typeName, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -235,9 +230,6 @@ function _listFieldsByType(resourceGroupName, automationAccountName, typeName, o 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -248,12 +240,12 @@ function _listFieldsByType(resourceGroupName, automationAccountName, typeName, o // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/objectDataTypes/{typeName}/fields'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{typeName}', encodeURIComponent(typeName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -351,8 +343,6 @@ class ObjectDataTypes { /** * Retrieve a list of fields of a given type identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -370,11 +360,11 @@ class ObjectDataTypes { * * @reject {Error} - The error object. */ - listFieldsByModuleAndTypeWithHttpOperationResponse(resourceGroupName, automationAccountName, moduleName, typeName, options) { + listFieldsByModuleAndTypeWithHttpOperationResponse(automationAccountName, moduleName, typeName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listFieldsByModuleAndType(resourceGroupName, automationAccountName, moduleName, typeName, options, (err, result, request, response) => { + self._listFieldsByModuleAndType(automationAccountName, moduleName, typeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -387,8 +377,6 @@ class ObjectDataTypes { /** * Retrieve a list of fields of a given type identified by module name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} moduleName The name of module. @@ -422,7 +410,7 @@ class ObjectDataTypes { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listFieldsByModuleAndType(resourceGroupName, automationAccountName, moduleName, typeName, options, optionalCallback) { + listFieldsByModuleAndType(automationAccountName, moduleName, typeName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -431,22 +419,20 @@ class ObjectDataTypes { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listFieldsByModuleAndType(resourceGroupName, automationAccountName, moduleName, typeName, options, (err, result, request, response) => { + self._listFieldsByModuleAndType(automationAccountName, moduleName, typeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listFieldsByModuleAndType(resourceGroupName, automationAccountName, moduleName, typeName, options, optionalCallback); + return self._listFieldsByModuleAndType(automationAccountName, moduleName, typeName, options, optionalCallback); } } /** * Retrieve a list of fields of a given type across all accessible modules. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} typeName The name of type. @@ -462,11 +448,11 @@ class ObjectDataTypes { * * @reject {Error} - The error object. */ - listFieldsByTypeWithHttpOperationResponse(resourceGroupName, automationAccountName, typeName, options) { + listFieldsByTypeWithHttpOperationResponse(automationAccountName, typeName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listFieldsByType(resourceGroupName, automationAccountName, typeName, options, (err, result, request, response) => { + self._listFieldsByType(automationAccountName, typeName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -479,8 +465,6 @@ class ObjectDataTypes { /** * Retrieve a list of fields of a given type across all accessible modules. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} typeName The name of type. @@ -512,7 +496,7 @@ class ObjectDataTypes { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listFieldsByType(resourceGroupName, automationAccountName, typeName, options, optionalCallback) { + listFieldsByType(automationAccountName, typeName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -521,14 +505,14 @@ class ObjectDataTypes { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listFieldsByType(resourceGroupName, automationAccountName, typeName, options, (err, result, request, response) => { + self._listFieldsByType(automationAccountName, typeName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listFieldsByType(resourceGroupName, automationAccountName, typeName, options, optionalCallback); + return self._listFieldsByType(automationAccountName, typeName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/operations.js b/lib/services/automationManagement/lib/operations/operations.js index 413be0f936..f7b6c1a8fb 100644 --- a/lib/services/automationManagement/lib/operations/operations.js +++ b/lib/services/automationManagement/lib/operations/operations.js @@ -45,11 +45,9 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // Validate try { - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -61,7 +59,7 @@ function _list(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Automation/operations'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/automationManagement/lib/operations/runbookDraftOperations.js b/lib/services/automationManagement/lib/operations/runbookDraftOperations.js index 314add164e..e4e627796f 100644 --- a/lib/services/automationManagement/lib/operations/runbookDraftOperations.js +++ b/lib/services/automationManagement/lib/operations/runbookDraftOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Retrieve the content of runbook draft identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -34,13 +32,13 @@ const WebResource = msRest.WebResource; * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {string} [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 _getContent(resourceGroupName, automationAccountName, runbookName, options, callback) { +function _getContent(automationAccountName, runbookName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50,15 +48,19 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (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.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -67,12 +69,6 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti if (runbookName === null || runbookName === undefined || typeof runbookName.valueOf() !== 'string') { throw new Error('runbookName 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -83,12 +79,12 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -115,30 +111,27 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti } httpRequest.body = null; // Send Request - httpRequest.streamedResponse = true; return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } - let statusCode = response.statusCode; if (statusCode !== 200) { - let error = new Error(`Unexpected status code: ${statusCode}`); + 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 { - if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + 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.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -148,24 +141,46 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti } return callback(error); } - // Create Result - let result = response; + 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + 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); }); } /** - * Updates the runbook draft with runbookStream as its content. - * - * @param {string} resourceGroupName The resource group name. + * Replaces the runbook draft content. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * - * @param {object} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -184,7 +199,7 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, automationAccountName, runbookName, runbookContent, options, callback) { +function _replaceContent(automationAccountName, runbookName, runbookContent, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -197,7 +212,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, runbookName, } // Send request - this.beginCreateOrUpdate(resourceGroupName, automationAccountName, runbookName, runbookContent, options, (err, parsedResult, httpRequest, response) => { + this.beginReplaceContent(automationAccountName, runbookName, runbookContent, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -225,8 +240,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, runbookName, /** * Retrieve the runbook draft identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -249,7 +262,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, runbookName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, runbookName, options, callback) { +function _get(automationAccountName, runbookName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -259,15 +272,19 @@ function _get(resourceGroupName, automationAccountName, runbookName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -276,12 +293,6 @@ function _get(resourceGroupName, automationAccountName, runbookName, options, ca if (runbookName === null || runbookName === undefined || typeof runbookName.valueOf() !== 'string') { throw new Error('runbookName 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -292,12 +303,12 @@ function _get(resourceGroupName, automationAccountName, runbookName, options, ca // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -384,8 +395,6 @@ function _get(resourceGroupName, automationAccountName, runbookName, options, ca /** * Publish runbook draft. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The parameters supplied to the publish runbook @@ -402,14 +411,13 @@ function _get(resourceGroupName, automationAccountName, runbookName, options, ca * * {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 Runbook} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _publish(resourceGroupName, automationAccountName, runbookName, options, callback) { +function _publish(automationAccountName, runbookName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -422,7 +430,7 @@ function _publish(resourceGroupName, automationAccountName, runbookName, options } // Send request - this.beginPublish(resourceGroupName, automationAccountName, runbookName, options, (err, parsedResult, httpRequest, response) => { + this.beginPublish(automationAccountName, runbookName, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -441,20 +449,6 @@ function _publish(resourceGroupName, automationAccountName, runbookName, options if (responseBody === '') responseBody = null; // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Runbook']().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); }); @@ -462,9 +456,7 @@ function _publish(resourceGroupName, automationAccountName, runbookName, options } /** - * Retrieve the runbook identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Undo draft edit to last known published state identified by runbook name. * * @param {string} automationAccountName The automation account name. * @@ -489,7 +481,7 @@ function _publish(resourceGroupName, automationAccountName, runbookName, options * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _undoEdit(resourceGroupName, automationAccountName, runbookName, options, callback) { +function _undoEdit(automationAccountName, runbookName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -499,15 +491,19 @@ function _undoEdit(resourceGroupName, automationAccountName, runbookName, option if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (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.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -516,12 +512,6 @@ function _undoEdit(resourceGroupName, automationAccountName, runbookName, option if (runbookName === null || runbookName === undefined || typeof runbookName.valueOf() !== 'string') { throw new Error('runbookName 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -532,12 +522,12 @@ function _undoEdit(resourceGroupName, automationAccountName, runbookName, option // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/undoEdit'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -621,15 +611,13 @@ function _undoEdit(resourceGroupName, automationAccountName, runbookName, option } /** - * Updates the runbook draft with runbookStream as its content. - * - * @param {string} resourceGroupName The resource group name. + * Replaces the runbook draft content. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * - * @param {object} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -648,7 +636,7 @@ function _undoEdit(resourceGroupName, automationAccountName, runbookName, option * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateOrUpdate(resourceGroupName, automationAccountName, runbookName, runbookContent, options, callback) { +function _beginReplaceContent(automationAccountName, runbookName, runbookContent, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -658,15 +646,19 @@ function _beginCreateOrUpdate(resourceGroupName, automationAccountName, runbookN if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -675,14 +667,8 @@ function _beginCreateOrUpdate(resourceGroupName, automationAccountName, runbookN if (runbookName === null || runbookName === undefined || typeof runbookName.valueOf() !== 'string') { throw new Error('runbookName cannot be null or undefined and it must be of type string.'); } - if (runbookContent === null || runbookContent === undefined) { - throw new Error('runbookContent cannot be null or undefined and it must be of type object.'); - } - 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + if (runbookContent === null || runbookContent === undefined || typeof runbookContent.valueOf() !== 'string') { + throw new Error('runbookContent 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.'); @@ -694,12 +680,12 @@ function _beginCreateOrUpdate(resourceGroupName, automationAccountName, runbookN // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/content'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -710,7 +696,7 @@ function _beginCreateOrUpdate(resourceGroupName, automationAccountName, runbookN httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + httpRequest.headers['Content-Type'] = 'text/powershell'; if (this.client.generateClientRequestId) { httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); } @@ -725,7 +711,25 @@ function _beginCreateOrUpdate(resourceGroupName, automationAccountName, runbookN } } // Serialize Request - let requestContent = runbookContent; + let requestContent = null; + let requestModel = null; + try { + if (runbookContent !== null && runbookContent !== undefined) { + let requestModelMapper = { + required: true, + serializedName: 'runbookContent', + type: { + name: 'String' + } + }; + requestModel = client.serialize(requestModelMapper, runbookContent, 'runbookContent'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(runbookContent, null, 2)}.`); + return callback(serializationError); + } httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { @@ -733,7 +737,7 @@ function _beginCreateOrUpdate(resourceGroupName, automationAccountName, runbookN return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 200) { + if (statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -770,8 +774,6 @@ function _beginCreateOrUpdate(resourceGroupName, automationAccountName, runbookN /** * Publish runbook draft. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The parameters supplied to the publish runbook @@ -788,14 +790,13 @@ function _beginCreateOrUpdate(resourceGroupName, automationAccountName, runbookN * * {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 Runbook} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginPublish(resourceGroupName, automationAccountName, runbookName, options, callback) { +function _beginPublish(automationAccountName, runbookName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -805,15 +806,19 @@ function _beginPublish(resourceGroupName, automationAccountName, runbookName, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -822,12 +827,6 @@ function _beginPublish(resourceGroupName, automationAccountName, runbookName, op if (runbookName === null || runbookName === undefined || typeof runbookName.valueOf() !== 'string') { throw new Error('runbookName 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -838,12 +837,12 @@ function _beginPublish(resourceGroupName, automationAccountName, runbookName, op // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/publish'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -875,7 +874,7 @@ function _beginPublish(resourceGroupName, automationAccountName, runbookName, op return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 200) { + if (statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -904,23 +903,6 @@ function _beginPublish(resourceGroupName, automationAccountName, runbookName, op // 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['Runbook']().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); }); @@ -935,19 +917,17 @@ class RunbookDraftOperations { constructor(client) { this.client = client; this._getContent = _getContent; - this._createOrUpdate = _createOrUpdate; + this._replaceContent = _replaceContent; this._get = _get; this._publish = _publish; this._undoEdit = _undoEdit; - this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginReplaceContent = _beginReplaceContent; this._beginPublish = _beginPublish; } /** * Retrieve the content of runbook draft identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -959,15 +939,15 @@ class RunbookDraftOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getContentWithHttpOperationResponse(resourceGroupName, automationAccountName, runbookName, options) { + getContentWithHttpOperationResponse(automationAccountName, runbookName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getContent(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._getContent(automationAccountName, runbookName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -980,8 +960,6 @@ class RunbookDraftOperations { /** * Retrieve the content of runbook draft identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -998,7 +976,7 @@ class RunbookDraftOperations { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {String} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1006,13 +984,13 @@ class RunbookDraftOperations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {string} [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. */ - getContent(resourceGroupName, automationAccountName, runbookName, options, optionalCallback) { + getContent(automationAccountName, runbookName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1021,27 +999,25 @@ class RunbookDraftOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getContent(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._getContent(automationAccountName, runbookName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getContent(resourceGroupName, automationAccountName, runbookName, options, optionalCallback); + return self._getContent(automationAccountName, runbookName, options, optionalCallback); } } /** - * Updates the runbook draft with runbookStream as its content. - * - * @param {string} resourceGroupName The resource group name. + * Replaces the runbook draft content. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * - * @param {object} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -1054,11 +1030,11 @@ class RunbookDraftOperations { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, automationAccountName, runbookName, runbookContent, options) { + replaceContentWithHttpOperationResponse(automationAccountName, runbookName, runbookContent, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, runbookName, runbookContent, options, (err, result, request, response) => { + self._replaceContent(automationAccountName, runbookName, runbookContent, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1069,15 +1045,13 @@ class RunbookDraftOperations { } /** - * Updates the runbook draft with runbookStream as its content. - * - * @param {string} resourceGroupName The resource group name. + * Replaces the runbook draft content. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * - * @param {object} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -1105,7 +1079,7 @@ class RunbookDraftOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, automationAccountName, runbookName, runbookContent, options, optionalCallback) { + replaceContent(automationAccountName, runbookName, runbookContent, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1114,22 +1088,20 @@ class RunbookDraftOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, runbookName, runbookContent, options, (err, result, request, response) => { + self._replaceContent(automationAccountName, runbookName, runbookContent, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, automationAccountName, runbookName, runbookContent, options, optionalCallback); + return self._replaceContent(automationAccountName, runbookName, runbookContent, options, optionalCallback); } } /** * Retrieve the runbook draft identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -1145,11 +1117,11 @@ class RunbookDraftOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, runbookName, options) { + getWithHttpOperationResponse(automationAccountName, runbookName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._get(automationAccountName, runbookName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1162,8 +1134,6 @@ class RunbookDraftOperations { /** * Retrieve the runbook draft identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -1195,7 +1165,7 @@ class RunbookDraftOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, runbookName, options, optionalCallback) { + get(automationAccountName, runbookName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1204,22 +1174,20 @@ class RunbookDraftOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._get(automationAccountName, runbookName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, runbookName, options, optionalCallback); + return self._get(automationAccountName, runbookName, options, optionalCallback); } } /** * Publish runbook draft. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The parameters supplied to the publish runbook @@ -1232,15 +1200,15 @@ class RunbookDraftOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - publishWithHttpOperationResponse(resourceGroupName, automationAccountName, runbookName, options) { + publishWithHttpOperationResponse(automationAccountName, runbookName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._publish(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._publish(automationAccountName, runbookName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1253,8 +1221,6 @@ class RunbookDraftOperations { /** * Publish runbook draft. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The parameters supplied to the publish runbook @@ -1272,7 +1238,7 @@ class RunbookDraftOperations { * * {Promise} A promise is returned * - * @resolve {Runbook} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1280,14 +1246,13 @@ class RunbookDraftOperations { * * {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 Runbook} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - publish(resourceGroupName, automationAccountName, runbookName, options, optionalCallback) { + publish(automationAccountName, runbookName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1296,21 +1261,19 @@ class RunbookDraftOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._publish(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._publish(automationAccountName, runbookName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._publish(resourceGroupName, automationAccountName, runbookName, options, optionalCallback); + return self._publish(automationAccountName, runbookName, options, optionalCallback); } } /** - * Retrieve the runbook identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Undo draft edit to last known published state identified by runbook name. * * @param {string} automationAccountName The automation account name. * @@ -1327,11 +1290,11 @@ class RunbookDraftOperations { * * @reject {Error} - The error object. */ - undoEditWithHttpOperationResponse(resourceGroupName, automationAccountName, runbookName, options) { + undoEditWithHttpOperationResponse(automationAccountName, runbookName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._undoEdit(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._undoEdit(automationAccountName, runbookName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1342,9 +1305,7 @@ class RunbookDraftOperations { } /** - * Retrieve the runbook identified by runbook name. - * - * @param {string} resourceGroupName The resource group name. + * Undo draft edit to last known published state identified by runbook name. * * @param {string} automationAccountName The automation account name. * @@ -1378,7 +1339,7 @@ class RunbookDraftOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - undoEdit(resourceGroupName, automationAccountName, runbookName, options, optionalCallback) { + undoEdit(automationAccountName, runbookName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1387,27 +1348,25 @@ class RunbookDraftOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._undoEdit(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._undoEdit(automationAccountName, runbookName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._undoEdit(resourceGroupName, automationAccountName, runbookName, options, optionalCallback); + return self._undoEdit(automationAccountName, runbookName, options, optionalCallback); } } /** - * Updates the runbook draft with runbookStream as its content. - * - * @param {string} resourceGroupName The resource group name. + * Replaces the runbook draft content. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * - * @param {object} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -1420,11 +1379,11 @@ class RunbookDraftOperations { * * @reject {Error} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, automationAccountName, runbookName, runbookContent, options) { + beginReplaceContentWithHttpOperationResponse(automationAccountName, runbookName, runbookContent, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, automationAccountName, runbookName, runbookContent, options, (err, result, request, response) => { + self._beginReplaceContent(automationAccountName, runbookName, runbookContent, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1435,15 +1394,13 @@ class RunbookDraftOperations { } /** - * Updates the runbook draft with runbookStream as its content. - * - * @param {string} resourceGroupName The resource group name. + * Replaces the runbook draft content. * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. * - * @param {object} runbookContent The runbook draft content. + * @param {string} runbookContent The runbook draft content. * * @param {object} [options] Optional Parameters. * @@ -1471,7 +1428,7 @@ class RunbookDraftOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName, automationAccountName, runbookName, runbookContent, options, optionalCallback) { + beginReplaceContent(automationAccountName, runbookName, runbookContent, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1480,22 +1437,20 @@ class RunbookDraftOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(resourceGroupName, automationAccountName, runbookName, runbookContent, options, (err, result, request, response) => { + self._beginReplaceContent(automationAccountName, runbookName, runbookContent, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginCreateOrUpdate(resourceGroupName, automationAccountName, runbookName, runbookContent, options, optionalCallback); + return self._beginReplaceContent(automationAccountName, runbookName, runbookContent, options, optionalCallback); } } /** * Publish runbook draft. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The parameters supplied to the publish runbook @@ -1508,15 +1463,15 @@ class RunbookDraftOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginPublishWithHttpOperationResponse(resourceGroupName, automationAccountName, runbookName, options) { + beginPublishWithHttpOperationResponse(automationAccountName, runbookName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginPublish(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._beginPublish(automationAccountName, runbookName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1529,8 +1484,6 @@ class RunbookDraftOperations { /** * Publish runbook draft. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The parameters supplied to the publish runbook @@ -1548,7 +1501,7 @@ class RunbookDraftOperations { * * {Promise} A promise is returned * - * @resolve {Runbook} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1556,14 +1509,13 @@ class RunbookDraftOperations { * * {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 Runbook} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginPublish(resourceGroupName, automationAccountName, runbookName, options, optionalCallback) { + beginPublish(automationAccountName, runbookName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1572,14 +1524,14 @@ class RunbookDraftOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginPublish(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._beginPublish(automationAccountName, runbookName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginPublish(resourceGroupName, automationAccountName, runbookName, options, optionalCallback); + return self._beginPublish(automationAccountName, runbookName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/runbookOperations.js b/lib/services/automationManagement/lib/operations/runbookOperations.js index 337773ce4f..727f2c4ed7 100644 --- a/lib/services/automationManagement/lib/operations/runbookOperations.js +++ b/lib/services/automationManagement/lib/operations/runbookOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Retrieve the content of runbook identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -34,13 +32,13 @@ const WebResource = msRest.WebResource; * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {string} [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 _getContent(resourceGroupName, automationAccountName, runbookName, options, callback) { +function _getContent(automationAccountName, runbookName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50,15 +48,19 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (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.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -67,12 +69,6 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti if (runbookName === null || runbookName === undefined || typeof runbookName.valueOf() !== 'string') { throw new Error('runbookName 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -83,12 +79,12 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/content'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -115,30 +111,27 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti } httpRequest.body = null; // Send Request - httpRequest.streamedResponse = true; return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } - let statusCode = response.statusCode; if (statusCode !== 200) { - let error = new Error(`Unexpected status code: ${statusCode}`); + 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 { - if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + 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.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -148,9 +141,33 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti } return callback(error); } - // Create Result - let result = response; + 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + 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); }); } @@ -158,8 +175,6 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti /** * Retrieve the runbook identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -182,7 +197,7 @@ function _getContent(resourceGroupName, automationAccountName, runbookName, opti * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, runbookName, options, callback) { +function _get(automationAccountName, runbookName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -192,15 +207,19 @@ function _get(resourceGroupName, automationAccountName, runbookName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (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.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -209,12 +228,6 @@ function _get(resourceGroupName, automationAccountName, runbookName, options, ca if (runbookName === null || runbookName === undefined || typeof runbookName.valueOf() !== 'string') { throw new Error('runbookName 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -225,12 +238,12 @@ function _get(resourceGroupName, automationAccountName, runbookName, options, ca // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -316,8 +329,6 @@ function _get(resourceGroupName, automationAccountName, runbookName, options, ca /** * Create the runbook identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -397,13 +408,14 @@ function _get(resourceGroupName, automationAccountName, runbookName, options, ca * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Runbook} 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, runbookName, parameters, options, callback) { +function _createOrUpdate(automationAccountName, runbookName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -413,15 +425,19 @@ function _createOrUpdate(resourceGroupName, automationAccountName, runbookName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (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.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -433,12 +449,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, runbookName, 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -449,12 +459,12 @@ function _createOrUpdate(resourceGroupName, automationAccountName, runbookName, // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -529,6 +539,40 @@ function _createOrUpdate(resourceGroupName, automationAccountName, runbookName, // 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['Runbook']().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['Runbook']().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); }); @@ -537,8 +581,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, runbookName, /** * Update the runbook identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -581,7 +623,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, runbookName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _update(resourceGroupName, automationAccountName, runbookName, parameters, options, callback) { +function _update(automationAccountName, runbookName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -591,15 +633,19 @@ function _update(resourceGroupName, automationAccountName, runbookName, paramete if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -611,12 +657,6 @@ function _update(resourceGroupName, automationAccountName, runbookName, paramete 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -627,12 +667,12 @@ function _update(resourceGroupName, automationAccountName, runbookName, paramete // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -732,8 +772,6 @@ function _update(resourceGroupName, automationAccountName, runbookName, paramete /** * Delete the runbook by name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -755,7 +793,7 @@ function _update(resourceGroupName, automationAccountName, runbookName, paramete * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, automationAccountName, runbookName, options, callback) { +function _deleteMethod(automationAccountName, runbookName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -765,15 +803,19 @@ function _deleteMethod(resourceGroupName, automationAccountName, runbookName, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (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.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -782,12 +824,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, runbookName, op if (runbookName === null || runbookName === undefined || typeof runbookName.valueOf() !== 'string') { throw new Error('runbookName 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -798,12 +834,12 @@ function _deleteMethod(resourceGroupName, automationAccountName, runbookName, op // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -835,7 +871,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, runbookName, op return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -872,8 +908,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, runbookName, op /** * Retrieve a list of runbooks. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -894,7 +928,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, runbookName, op * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { +function _listByAutomationAccount(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -904,26 +938,24 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (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.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -934,11 +966,11 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1169,8 +1201,6 @@ class RunbookOperations { /** * Retrieve the content of runbook identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -1182,15 +1212,15 @@ class RunbookOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getContentWithHttpOperationResponse(resourceGroupName, automationAccountName, runbookName, options) { + getContentWithHttpOperationResponse(automationAccountName, runbookName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getContent(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._getContent(automationAccountName, runbookName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1203,8 +1233,6 @@ class RunbookOperations { /** * Retrieve the content of runbook identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -1221,7 +1249,7 @@ class RunbookOperations { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {String} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1229,13 +1257,13 @@ class RunbookOperations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. + * {string} [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. */ - getContent(resourceGroupName, automationAccountName, runbookName, options, optionalCallback) { + getContent(automationAccountName, runbookName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1244,22 +1272,20 @@ class RunbookOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getContent(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._getContent(automationAccountName, runbookName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getContent(resourceGroupName, automationAccountName, runbookName, options, optionalCallback); + return self._getContent(automationAccountName, runbookName, options, optionalCallback); } } /** * Retrieve the runbook identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -1275,11 +1301,11 @@ class RunbookOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, runbookName, options) { + getWithHttpOperationResponse(automationAccountName, runbookName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._get(automationAccountName, runbookName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1292,8 +1318,6 @@ class RunbookOperations { /** * Retrieve the runbook identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -1325,7 +1349,7 @@ class RunbookOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, runbookName, options, optionalCallback) { + get(automationAccountName, runbookName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1334,22 +1358,20 @@ class RunbookOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._get(automationAccountName, runbookName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, runbookName, options, optionalCallback); + return self._get(automationAccountName, runbookName, options, optionalCallback); } } /** * Create the runbook identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -1425,15 +1447,15 @@ class RunbookOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, automationAccountName, runbookName, parameters, options) { + createOrUpdateWithHttpOperationResponse(automationAccountName, runbookName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, runbookName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, runbookName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1446,8 +1468,6 @@ class RunbookOperations { /** * Create the runbook identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -1528,7 +1548,7 @@ class RunbookOperations { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Runbook} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1536,13 +1556,14 @@ class RunbookOperations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Runbook} 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, runbookName, parameters, options, optionalCallback) { + createOrUpdate(automationAccountName, runbookName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1551,22 +1572,20 @@ class RunbookOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, runbookName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, runbookName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, automationAccountName, runbookName, parameters, options, optionalCallback); + return self._createOrUpdate(automationAccountName, runbookName, parameters, options, optionalCallback); } } /** * Update the runbook identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -1602,11 +1621,11 @@ class RunbookOperations { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, automationAccountName, runbookName, parameters, options) { + updateWithHttpOperationResponse(automationAccountName, runbookName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, runbookName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, runbookName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1619,8 +1638,6 @@ class RunbookOperations { /** * Update the runbook identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -1672,7 +1689,7 @@ class RunbookOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, automationAccountName, runbookName, parameters, options, optionalCallback) { + update(automationAccountName, runbookName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1681,22 +1698,20 @@ class RunbookOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, runbookName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, runbookName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, automationAccountName, runbookName, parameters, options, optionalCallback); + return self._update(automationAccountName, runbookName, parameters, options, optionalCallback); } } /** * Delete the runbook by name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -1712,11 +1727,11 @@ class RunbookOperations { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, runbookName, options) { + deleteMethodWithHttpOperationResponse(automationAccountName, runbookName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, runbookName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1729,8 +1744,6 @@ class RunbookOperations { /** * Delete the runbook by name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -1761,7 +1774,7 @@ class RunbookOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, automationAccountName, runbookName, options, optionalCallback) { + deleteMethod(automationAccountName, runbookName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1770,22 +1783,20 @@ class RunbookOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, runbookName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, automationAccountName, runbookName, options, optionalCallback); + return self._deleteMethod(automationAccountName, runbookName, options, optionalCallback); } } /** * Retrieve a list of runbooks. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1799,11 +1810,11 @@ class RunbookOperations { * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1816,8 +1827,6 @@ class RunbookOperations { /** * Retrieve a list of runbooks. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1847,7 +1856,7 @@ class RunbookOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + listByAutomationAccount(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1856,14 +1865,14 @@ class RunbookOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/scheduleOperations.js b/lib/services/automationManagement/lib/operations/scheduleOperations.js index fed9372728..48f5c87207 100644 --- a/lib/services/automationManagement/lib/operations/scheduleOperations.js +++ b/lib/services/automationManagement/lib/operations/scheduleOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Create a schedule. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} scheduleName The schedule name. @@ -40,8 +38,8 @@ const WebResource = msRest.WebResource; * @param {object} [parameters.interval] Gets or sets the interval of the * schedule. * - * @param {string} parameters.frequency Gets or sets the frequency of the - * schedule. Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + * @param {string} parameters.frequency Possible values include: 'OneTime', + * 'Day', 'Hour', 'Week', 'Month' * * @param {string} [parameters.timeZone] Gets or sets the time zone of the * schedule. @@ -76,7 +74,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, automationAccountName, scheduleName, parameters, options, callback) { +function _createOrUpdate(automationAccountName, scheduleName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -86,15 +84,16 @@ function _createOrUpdate(resourceGroupName, automationAccountName, scheduleName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -109,9 +108,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, scheduleName, 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -122,12 +118,12 @@ function _createOrUpdate(resourceGroupName, automationAccountName, scheduleName, // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{scheduleName}', encodeURIComponent(scheduleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -227,8 +223,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, scheduleName, /** * Update the schedule identified by schedule name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} scheduleName The schedule name. @@ -236,7 +230,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, scheduleName, * @param {object} parameters The parameters supplied to the update schedule * operation. * - * @param {string} parameters.name Gets or sets the name of the schedule. + * @param {string} [parameters.name] Gets or sets the name of the schedule. * * @param {string} [parameters.description] Gets or sets the description of the * schedule. @@ -262,7 +256,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, scheduleName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _update(resourceGroupName, automationAccountName, scheduleName, parameters, options, callback) { +function _update(automationAccountName, scheduleName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -272,15 +266,16 @@ function _update(resourceGroupName, automationAccountName, scheduleName, paramet if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -295,9 +290,6 @@ function _update(resourceGroupName, automationAccountName, scheduleName, paramet 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -308,12 +300,12 @@ function _update(resourceGroupName, automationAccountName, scheduleName, paramet // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{scheduleName}', encodeURIComponent(scheduleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -413,8 +405,6 @@ function _update(resourceGroupName, automationAccountName, scheduleName, paramet /** * Retrieve the schedule identified by schedule name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} scheduleName The schedule name. @@ -437,7 +427,7 @@ function _update(resourceGroupName, automationAccountName, scheduleName, paramet * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, scheduleName, options, callback) { +function _get(automationAccountName, scheduleName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -447,15 +437,16 @@ function _get(resourceGroupName, automationAccountName, scheduleName, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -467,9 +458,6 @@ function _get(resourceGroupName, automationAccountName, scheduleName, options, c 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -480,12 +468,12 @@ function _get(resourceGroupName, automationAccountName, scheduleName, options, c // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{scheduleName}', encodeURIComponent(scheduleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -571,8 +559,6 @@ function _get(resourceGroupName, automationAccountName, scheduleName, options, c /** * Delete the schedule identified by schedule name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} scheduleName The schedule name. @@ -594,7 +580,7 @@ function _get(resourceGroupName, automationAccountName, scheduleName, options, c * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, automationAccountName, scheduleName, options, callback) { +function _deleteMethod(automationAccountName, scheduleName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -604,15 +590,16 @@ function _deleteMethod(resourceGroupName, automationAccountName, scheduleName, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -624,9 +611,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, scheduleName, o 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -637,12 +621,12 @@ function _deleteMethod(resourceGroupName, automationAccountName, scheduleName, o // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules/{scheduleName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{scheduleName}', encodeURIComponent(scheduleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -711,8 +695,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, scheduleName, o /** * Retrieve a list of schedules. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -733,7 +715,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, scheduleName, o * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { +function _listByAutomationAccount(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -743,15 +725,16 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -760,9 +743,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -773,11 +753,11 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/schedules'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1007,8 +987,6 @@ class ScheduleOperations { /** * Create a schedule. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} scheduleName The schedule name. @@ -1030,8 +1008,8 @@ class ScheduleOperations { * @param {object} [parameters.interval] Gets or sets the interval of the * schedule. * - * @param {string} parameters.frequency Gets or sets the frequency of the - * schedule. Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + * @param {string} parameters.frequency Possible values include: 'OneTime', + * 'Day', 'Hour', 'Week', 'Month' * * @param {string} [parameters.timeZone] Gets or sets the time zone of the * schedule. @@ -1059,11 +1037,11 @@ class ScheduleOperations { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, automationAccountName, scheduleName, parameters, options) { + createOrUpdateWithHttpOperationResponse(automationAccountName, scheduleName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, scheduleName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, scheduleName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1076,8 +1054,6 @@ class ScheduleOperations { /** * Create a schedule. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} scheduleName The schedule name. @@ -1099,8 +1075,8 @@ class ScheduleOperations { * @param {object} [parameters.interval] Gets or sets the interval of the * schedule. * - * @param {string} parameters.frequency Gets or sets the frequency of the - * schedule. Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month' + * @param {string} parameters.frequency Possible values include: 'OneTime', + * 'Day', 'Hour', 'Week', 'Month' * * @param {string} [parameters.timeZone] Gets or sets the time zone of the * schedule. @@ -1144,7 +1120,7 @@ class ScheduleOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, automationAccountName, scheduleName, parameters, options, optionalCallback) { + createOrUpdate(automationAccountName, scheduleName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1153,22 +1129,20 @@ class ScheduleOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, scheduleName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, scheduleName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, automationAccountName, scheduleName, parameters, options, optionalCallback); + return self._createOrUpdate(automationAccountName, scheduleName, parameters, options, optionalCallback); } } /** * Update the schedule identified by schedule name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} scheduleName The schedule name. @@ -1176,7 +1150,7 @@ class ScheduleOperations { * @param {object} parameters The parameters supplied to the update schedule * operation. * - * @param {string} parameters.name Gets or sets the name of the schedule. + * @param {string} [parameters.name] Gets or sets the name of the schedule. * * @param {string} [parameters.description] Gets or sets the description of the * schedule. @@ -1195,11 +1169,11 @@ class ScheduleOperations { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, automationAccountName, scheduleName, parameters, options) { + updateWithHttpOperationResponse(automationAccountName, scheduleName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, scheduleName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, scheduleName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1212,8 +1186,6 @@ class ScheduleOperations { /** * Update the schedule identified by schedule name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} scheduleName The schedule name. @@ -1221,7 +1193,7 @@ class ScheduleOperations { * @param {object} parameters The parameters supplied to the update schedule * operation. * - * @param {string} parameters.name Gets or sets the name of the schedule. + * @param {string} [parameters.name] Gets or sets the name of the schedule. * * @param {string} [parameters.description] Gets or sets the description of the * schedule. @@ -1256,7 +1228,7 @@ class ScheduleOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, automationAccountName, scheduleName, parameters, options, optionalCallback) { + update(automationAccountName, scheduleName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1265,22 +1237,20 @@ class ScheduleOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, scheduleName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, scheduleName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, automationAccountName, scheduleName, parameters, options, optionalCallback); + return self._update(automationAccountName, scheduleName, parameters, options, optionalCallback); } } /** * Retrieve the schedule identified by schedule name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} scheduleName The schedule name. @@ -1296,11 +1266,11 @@ class ScheduleOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, scheduleName, options) { + getWithHttpOperationResponse(automationAccountName, scheduleName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, scheduleName, options, (err, result, request, response) => { + self._get(automationAccountName, scheduleName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1313,8 +1283,6 @@ class ScheduleOperations { /** * Retrieve the schedule identified by schedule name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} scheduleName The schedule name. @@ -1346,7 +1314,7 @@ class ScheduleOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, scheduleName, options, optionalCallback) { + get(automationAccountName, scheduleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1355,22 +1323,20 @@ class ScheduleOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, scheduleName, options, (err, result, request, response) => { + self._get(automationAccountName, scheduleName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, scheduleName, options, optionalCallback); + return self._get(automationAccountName, scheduleName, options, optionalCallback); } } /** * Delete the schedule identified by schedule name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} scheduleName The schedule name. @@ -1386,11 +1352,11 @@ class ScheduleOperations { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, scheduleName, options) { + deleteMethodWithHttpOperationResponse(automationAccountName, scheduleName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, scheduleName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, scheduleName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1403,8 +1369,6 @@ class ScheduleOperations { /** * Delete the schedule identified by schedule name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} scheduleName The schedule name. @@ -1435,7 +1399,7 @@ class ScheduleOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, automationAccountName, scheduleName, options, optionalCallback) { + deleteMethod(automationAccountName, scheduleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1444,22 +1408,20 @@ class ScheduleOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, scheduleName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, scheduleName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, automationAccountName, scheduleName, options, optionalCallback); + return self._deleteMethod(automationAccountName, scheduleName, options, optionalCallback); } } /** * Retrieve a list of schedules. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1473,11 +1435,11 @@ class ScheduleOperations { * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1490,8 +1452,6 @@ class ScheduleOperations { /** * Retrieve a list of schedules. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1521,7 +1481,7 @@ class ScheduleOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + listByAutomationAccount(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1530,14 +1490,14 @@ class ScheduleOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/softwareUpdateConfigurationMachineRuns.js b/lib/services/automationManagement/lib/operations/softwareUpdateConfigurationMachineRuns.js new file mode 100644 index 0000000000..0e7ecad27e --- /dev/null +++ b/lib/services/automationManagement/lib/operations/softwareUpdateConfigurationMachineRuns.js @@ -0,0 +1,559 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Get a single software update configuration machine run by Id. + * + * @param {uuid} softwareUpdateConfigurationMachineRunId The Id of the software + * update configuration machine run. + * + * @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 SoftwareUpdateConfigurationMachineRun} 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 _getById(softwareUpdateConfigurationMachineRunId, 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 = '2017-05-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (this.client.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (softwareUpdateConfigurationMachineRunId === null || softwareUpdateConfigurationMachineRunId === undefined || typeof softwareUpdateConfigurationMachineRunId.valueOf() !== 'string' || !msRest.isValidUuid(softwareUpdateConfigurationMachineRunId)) { + throw new Error('softwareUpdateConfigurationMachineRunId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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}/softwareUpdateConfigurationMachineRuns/{softwareUpdateConfigurationMachineRunId}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + requestUrl = requestUrl.replace('{softwareUpdateConfigurationMachineRunId}', encodeURIComponent(softwareUpdateConfigurationMachineRunId.toString())); + 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.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } + 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 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SoftwareUpdateConfigurationMachineRun']().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); + }); +} + +/** + * Return list of software update configuration machine runs + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. You + * can use the following filters: 'properties/osType', 'properties/status', + * 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' + * + * @param {string} [options.skip] number of entries you skip before returning + * results + * + * @param {string} [options.top] Maximum number of entries returned in the + * results collection + * + * @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 + * SoftwareUpdateConfigurationMachineRunListResult} 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 _list(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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + let skip = (options && options.skip !== undefined) ? options.skip : undefined; + let top = (options && options.top !== undefined) ? options.top : undefined; + let apiVersion = '2017-05-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (this.client.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (skip !== null && skip !== undefined && typeof skip.valueOf() !== 'string') { + throw new Error('skip must be of type string.'); + } + if (top !== null && top !== undefined && typeof top.valueOf() !== 'string') { + throw new Error('top 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}/softwareUpdateConfigurationMachineRuns'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (skip !== null && skip !== undefined) { + queryParameters.push('$skip=' + encodeURIComponent(skip)); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top)); + } + 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.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } + 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 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SoftwareUpdateConfigurationMachineRunListResult']().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 SoftwareUpdateConfigurationMachineRuns. */ +class SoftwareUpdateConfigurationMachineRuns { + /** + * Create a SoftwareUpdateConfigurationMachineRuns. + * @param {AutomationClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._getById = _getById; + this._list = _list; + } + + /** + * Get a single software update configuration machine run by Id. + * + * @param {uuid} softwareUpdateConfigurationMachineRunId The Id of the software + * update configuration machine run. + * + * @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. + */ + getByIdWithHttpOperationResponse(softwareUpdateConfigurationMachineRunId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getById(softwareUpdateConfigurationMachineRunId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get a single software update configuration machine run by Id. + * + * @param {uuid} softwareUpdateConfigurationMachineRunId The Id of the software + * update configuration machine run. + * + * @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 {SoftwareUpdateConfigurationMachineRun} - 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 SoftwareUpdateConfigurationMachineRun} 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. + */ + getById(softwareUpdateConfigurationMachineRunId, 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._getById(softwareUpdateConfigurationMachineRunId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getById(softwareUpdateConfigurationMachineRunId, options, optionalCallback); + } + } + + /** + * Return list of software update configuration machine runs + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. You + * can use the following filters: 'properties/osType', 'properties/status', + * 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' + * + * @param {string} [options.skip] number of entries you skip before returning + * results + * + * @param {string} [options.top] Maximum number of entries returned in the + * results collection + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Return list of software update configuration machine runs + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. You + * can use the following filters: 'properties/osType', 'properties/status', + * 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' + * + * @param {string} [options.skip] number of entries you skip before returning + * results + * + * @param {string} [options.top] Maximum number of entries returned in the + * results collection + * + * @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 {SoftwareUpdateConfigurationMachineRunListResult} - 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 + * SoftwareUpdateConfigurationMachineRunListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + +} + +module.exports = SoftwareUpdateConfigurationMachineRuns; diff --git a/lib/services/automationManagement/lib/operations/softwareUpdateConfigurationRuns.js b/lib/services/automationManagement/lib/operations/softwareUpdateConfigurationRuns.js new file mode 100644 index 0000000000..ed70966f40 --- /dev/null +++ b/lib/services/automationManagement/lib/operations/softwareUpdateConfigurationRuns.js @@ -0,0 +1,557 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Get a single software update configuration Run by Id. + * + * @param {uuid} softwareUpdateConfigurationRunId The Id of the software update + * configuration run. + * + * @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 SoftwareUpdateConfigurationRun} 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 _getById(softwareUpdateConfigurationRunId, 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 = '2017-05-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (this.client.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (softwareUpdateConfigurationRunId === null || softwareUpdateConfigurationRunId === undefined || typeof softwareUpdateConfigurationRunId.valueOf() !== 'string' || !msRest.isValidUuid(softwareUpdateConfigurationRunId)) { + throw new Error('softwareUpdateConfigurationRunId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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}/softwareUpdateConfigurationRuns/{softwareUpdateConfigurationRunId}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + requestUrl = requestUrl.replace('{softwareUpdateConfigurationRunId}', encodeURIComponent(softwareUpdateConfigurationRunId.toString())); + 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.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } + 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 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SoftwareUpdateConfigurationRun']().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); + }); +} + +/** + * Return list of software update configuration runs + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. You + * can use the following filters: 'properties/osType', 'properties/status', + * 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' + * + * @param {string} [options.skip] number of entries you skip before returning + * results + * + * @param {string} [options.top] Maximum number of entries returned in the + * results collection + * + * @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 SoftwareUpdateConfigurationRunListResult} + * 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 _list(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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + let skip = (options && options.skip !== undefined) ? options.skip : undefined; + let top = (options && options.top !== undefined) ? options.top : undefined; + let apiVersion = '2017-05-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (this.client.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (skip !== null && skip !== undefined && typeof skip.valueOf() !== 'string') { + throw new Error('skip must be of type string.'); + } + if (top !== null && top !== undefined && typeof top.valueOf() !== 'string') { + throw new Error('top 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}/softwareUpdateConfigurationRuns'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (skip !== null && skip !== undefined) { + queryParameters.push('$skip=' + encodeURIComponent(skip)); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top)); + } + 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.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } + 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 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SoftwareUpdateConfigurationRunListResult']().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 SoftwareUpdateConfigurationRuns. */ +class SoftwareUpdateConfigurationRuns { + /** + * Create a SoftwareUpdateConfigurationRuns. + * @param {AutomationClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._getById = _getById; + this._list = _list; + } + + /** + * Get a single software update configuration Run by Id. + * + * @param {uuid} softwareUpdateConfigurationRunId The Id of the software update + * configuration run. + * + * @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. + */ + getByIdWithHttpOperationResponse(softwareUpdateConfigurationRunId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getById(softwareUpdateConfigurationRunId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get a single software update configuration Run by Id. + * + * @param {uuid} softwareUpdateConfigurationRunId The Id of the software update + * configuration run. + * + * @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 {SoftwareUpdateConfigurationRun} - 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 SoftwareUpdateConfigurationRun} 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. + */ + getById(softwareUpdateConfigurationRunId, 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._getById(softwareUpdateConfigurationRunId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getById(softwareUpdateConfigurationRunId, options, optionalCallback); + } + } + + /** + * Return list of software update configuration runs + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. You + * can use the following filters: 'properties/osType', 'properties/status', + * 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' + * + * @param {string} [options.skip] number of entries you skip before returning + * results + * + * @param {string} [options.top] Maximum number of entries returned in the + * results collection + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Return list of software update configuration runs + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. You + * can use the following filters: 'properties/osType', 'properties/status', + * 'properties/startTime', and 'properties/softwareUpdateConfiguration/name' + * + * @param {string} [options.skip] number of entries you skip before returning + * results + * + * @param {string} [options.top] Maximum number of entries returned in the + * results collection + * + * @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 {SoftwareUpdateConfigurationRunListResult} - 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 SoftwareUpdateConfigurationRunListResult} + * for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + +} + +module.exports = SoftwareUpdateConfigurationRuns; diff --git a/lib/services/automationManagement/lib/operations/softwareUpdateConfigurations.js b/lib/services/automationManagement/lib/operations/softwareUpdateConfigurations.js new file mode 100644 index 0000000000..2bac5ec8b4 --- /dev/null +++ b/lib/services/automationManagement/lib/operations/softwareUpdateConfigurations.js @@ -0,0 +1,1334 @@ +/* + * 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; + +/** + * Create a new software update configuration with the name given in the URI. + * + * @param {string} softwareUpdateConfigurationName The name of the software + * update configuration to be created. + * + * @param {object} parameters Request body. + * + * @param {object} parameters.updateConfiguration update specific properties + * for the Software update configuration + * + * @param {string} parameters.updateConfiguration.operatingSystem operating + * system of target machines. Possible values include: 'Windows', 'Linux' + * + * @param {object} [parameters.updateConfiguration.windows] Windows specific + * update configuration. + * + * @param {string} + * [parameters.updateConfiguration.windows.includedUpdateClassifications] + * Update classification included in the software update configuration. A comma + * separated string with required values. Possible values include: + * 'Unclassified', 'Critical', 'Security', 'UpdateRollup', 'FeaturePack', + * 'ServicePack', 'Definition', 'Tools', 'Updates' + * + * @param {array} [parameters.updateConfiguration.windows.excludedKbNumbers] KB + * numbers excluded from the software update configuration. + * + * @param {object} [parameters.updateConfiguration.linux] Linux specific update + * configuration. + * + * @param {string} + * [parameters.updateConfiguration.linux.includedPackageClassifications] Update + * classifications included in the software update configuration. Possible + * values include: 'Unclassified', 'Critical', 'Security', 'Other' + * + * @param {array} + * [parameters.updateConfiguration.linux.excludedPackageNameMasks] packages + * excluded from the software update configuration. + * + * @param {moment.duration} [parameters.updateConfiguration.duration] Maximum + * time allowed for the software update configuration run. Duration needs to be + * specified using the format PT[n]H[n]M[n]S as per ISO8601 + * + * @param {array} [parameters.updateConfiguration.azureVirtualMachines] List of + * azure resource Ids for azure virtual machines targeted by the software + * update configuration. + * + * @param {array} [parameters.updateConfiguration.nonAzureComputerNames] List + * of names of non-azure machines targeted by the software update + * configuration. + * + * @param {object} parameters.scheduleInfo Schedule information for the + * Software update configuration + * + * @param {date} [parameters.scheduleInfo.startTime] Gets or sets the start + * time of the schedule. + * + * @param {date} [parameters.scheduleInfo.expiryTime] Gets or sets the end time + * of the schedule. + * + * @param {number} [parameters.scheduleInfo.expiryTimeOffsetMinutes] Gets or + * sets the expiry time's offset in minutes. + * + * @param {boolean} [parameters.scheduleInfo.isEnabled] Gets or sets a value + * indicating whether this schedule is enabled. + * + * @param {date} [parameters.scheduleInfo.nextRun] Gets or sets the next run + * time of the schedule. + * + * @param {number} [parameters.scheduleInfo.nextRunOffsetMinutes] Gets or sets + * the next run time's offset in minutes. + * + * @param {object} [parameters.scheduleInfo.interval] Gets or sets the interval + * of the schedule. + * + * @param {string} [parameters.scheduleInfo.frequency] Gets or sets the + * frequency of the schedule. Possible values include: 'OneTime', 'Day', + * 'Hour', 'Week', 'Month' + * + * @param {string} [parameters.scheduleInfo.timeZone] Gets or sets the time + * zone of the schedule. + * + * @param {object} [parameters.scheduleInfo.advancedSchedule] Gets or sets the + * advanced schedule. + * + * @param {array} [parameters.scheduleInfo.advancedSchedule.weekDays] Days of + * the week that the job should execute on. + * + * @param {array} [parameters.scheduleInfo.advancedSchedule.monthDays] Days of + * the month that the job should execute on. Must be between 1 and 31. + * + * @param {array} [parameters.scheduleInfo.advancedSchedule.monthlyOccurrences] + * Occurrences of days within a month. + * + * @param {date} [parameters.scheduleInfo.creationTime] Gets or sets the + * creation time. + * + * @param {date} [parameters.scheduleInfo.lastModifiedTime] Gets or sets the + * last modified time. + * + * @param {string} [parameters.scheduleInfo.description] Gets or sets the + * description. + * + * @param {object} [parameters.error] detailes of provisioning error + * + * @param {string} [parameters.error.code] Error code + * + * @param {string} [parameters.error.message] Error message indicating why the + * operation failed. + * + * @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 SoftwareUpdateConfiguration} 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 _create(softwareUpdateConfigurationName, 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 = '2017-05-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (this.client.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (softwareUpdateConfigurationName === null || softwareUpdateConfigurationName === undefined || typeof softwareUpdateConfigurationName.valueOf() !== 'string') { + throw new Error('softwareUpdateConfigurationName cannot be null or undefined and it must be of type string.'); + } + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + requestUrl = requestUrl.replace('{softwareUpdateConfigurationName}', encodeURIComponent(softwareUpdateConfigurationName)); + 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.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } + 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['SoftwareUpdateConfiguration']().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 && statusCode !== 400 && statusCode !== 404 && statusCode !== 409) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SoftwareUpdateConfiguration']().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['SoftwareUpdateConfiguration']().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); + }); +} + +/** + * Get a single software update configuration by name. + * + * @param {string} softwareUpdateConfigurationName The name of the software + * update configuration to be created. + * + * @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 SoftwareUpdateConfiguration} 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 _getByName(softwareUpdateConfigurationName, 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 = '2017-05-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (this.client.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (softwareUpdateConfigurationName === null || softwareUpdateConfigurationName === undefined || typeof softwareUpdateConfigurationName.valueOf() !== 'string') { + throw new Error('softwareUpdateConfigurationName cannot be null or undefined and it must be of type string.'); + } + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + requestUrl = requestUrl.replace('{softwareUpdateConfigurationName}', encodeURIComponent(softwareUpdateConfigurationName)); + 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.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } + 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 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SoftwareUpdateConfiguration']().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); + }); +} + +/** + * delete a specific software update configuration. + * + * @param {string} softwareUpdateConfigurationName The name of the software + * update configuration to be created. + * + * @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(softwareUpdateConfigurationName, 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 = '2017-05-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (this.client.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (softwareUpdateConfigurationName === null || softwareUpdateConfigurationName === undefined || typeof softwareUpdateConfigurationName.valueOf() !== 'string') { + throw new Error('softwareUpdateConfigurationName cannot be null or undefined and it must be of type string.'); + } + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId 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}/softwareUpdateConfigurations/{softwareUpdateConfigurationName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + requestUrl = requestUrl.replace('{softwareUpdateConfigurationName}', encodeURIComponent(softwareUpdateConfigurationName)); + 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.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } + 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 && statusCode !== 204 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Get all software update configurations for the account. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @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 SoftwareUpdateConfigurationListResult} 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 _list(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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2017-05-15-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (this.client.automationAccountName === null || this.client.automationAccountName === undefined || typeof this.client.automationAccountName.valueOf() !== 'string') { + throw new Error('this.client.automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (this.client.clientRequestId !== null && this.client.clientRequestId !== undefined && typeof this.client.clientRequestId.valueOf() !== 'string') { + throw new Error('this.client.clientRequestId must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter 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}/softwareUpdateConfigurations'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(this.client.automationAccountName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + 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.clientRequestId !== undefined && this.client.clientRequestId !== null) { + httpRequest.headers['clientRequestId'] = this.client.clientRequestId; + } + 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 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SoftwareUpdateConfigurationListResult']().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 SoftwareUpdateConfigurations. */ +class SoftwareUpdateConfigurations { + /** + * Create a SoftwareUpdateConfigurations. + * @param {AutomationClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._create = _create; + this._getByName = _getByName; + this._deleteMethod = _deleteMethod; + this._list = _list; + } + + /** + * Create a new software update configuration with the name given in the URI. + * + * @param {string} softwareUpdateConfigurationName The name of the software + * update configuration to be created. + * + * @param {object} parameters Request body. + * + * @param {object} parameters.updateConfiguration update specific properties + * for the Software update configuration + * + * @param {string} parameters.updateConfiguration.operatingSystem operating + * system of target machines. Possible values include: 'Windows', 'Linux' + * + * @param {object} [parameters.updateConfiguration.windows] Windows specific + * update configuration. + * + * @param {string} + * [parameters.updateConfiguration.windows.includedUpdateClassifications] + * Update classification included in the software update configuration. A comma + * separated string with required values. Possible values include: + * 'Unclassified', 'Critical', 'Security', 'UpdateRollup', 'FeaturePack', + * 'ServicePack', 'Definition', 'Tools', 'Updates' + * + * @param {array} [parameters.updateConfiguration.windows.excludedKbNumbers] KB + * numbers excluded from the software update configuration. + * + * @param {object} [parameters.updateConfiguration.linux] Linux specific update + * configuration. + * + * @param {string} + * [parameters.updateConfiguration.linux.includedPackageClassifications] Update + * classifications included in the software update configuration. Possible + * values include: 'Unclassified', 'Critical', 'Security', 'Other' + * + * @param {array} + * [parameters.updateConfiguration.linux.excludedPackageNameMasks] packages + * excluded from the software update configuration. + * + * @param {moment.duration} [parameters.updateConfiguration.duration] Maximum + * time allowed for the software update configuration run. Duration needs to be + * specified using the format PT[n]H[n]M[n]S as per ISO8601 + * + * @param {array} [parameters.updateConfiguration.azureVirtualMachines] List of + * azure resource Ids for azure virtual machines targeted by the software + * update configuration. + * + * @param {array} [parameters.updateConfiguration.nonAzureComputerNames] List + * of names of non-azure machines targeted by the software update + * configuration. + * + * @param {object} parameters.scheduleInfo Schedule information for the + * Software update configuration + * + * @param {date} [parameters.scheduleInfo.startTime] Gets or sets the start + * time of the schedule. + * + * @param {date} [parameters.scheduleInfo.expiryTime] Gets or sets the end time + * of the schedule. + * + * @param {number} [parameters.scheduleInfo.expiryTimeOffsetMinutes] Gets or + * sets the expiry time's offset in minutes. + * + * @param {boolean} [parameters.scheduleInfo.isEnabled] Gets or sets a value + * indicating whether this schedule is enabled. + * + * @param {date} [parameters.scheduleInfo.nextRun] Gets or sets the next run + * time of the schedule. + * + * @param {number} [parameters.scheduleInfo.nextRunOffsetMinutes] Gets or sets + * the next run time's offset in minutes. + * + * @param {object} [parameters.scheduleInfo.interval] Gets or sets the interval + * of the schedule. + * + * @param {string} [parameters.scheduleInfo.frequency] Gets or sets the + * frequency of the schedule. Possible values include: 'OneTime', 'Day', + * 'Hour', 'Week', 'Month' + * + * @param {string} [parameters.scheduleInfo.timeZone] Gets or sets the time + * zone of the schedule. + * + * @param {object} [parameters.scheduleInfo.advancedSchedule] Gets or sets the + * advanced schedule. + * + * @param {array} [parameters.scheduleInfo.advancedSchedule.weekDays] Days of + * the week that the job should execute on. + * + * @param {array} [parameters.scheduleInfo.advancedSchedule.monthDays] Days of + * the month that the job should execute on. Must be between 1 and 31. + * + * @param {array} [parameters.scheduleInfo.advancedSchedule.monthlyOccurrences] + * Occurrences of days within a month. + * + * @param {date} [parameters.scheduleInfo.creationTime] Gets or sets the + * creation time. + * + * @param {date} [parameters.scheduleInfo.lastModifiedTime] Gets or sets the + * last modified time. + * + * @param {string} [parameters.scheduleInfo.description] Gets or sets the + * description. + * + * @param {object} [parameters.error] detailes of provisioning error + * + * @param {string} [parameters.error.code] Error code + * + * @param {string} [parameters.error.message] Error message indicating why the + * operation failed. + * + * @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. + */ + createWithHttpOperationResponse(softwareUpdateConfigurationName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(softwareUpdateConfigurationName, 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 a new software update configuration with the name given in the URI. + * + * @param {string} softwareUpdateConfigurationName The name of the software + * update configuration to be created. + * + * @param {object} parameters Request body. + * + * @param {object} parameters.updateConfiguration update specific properties + * for the Software update configuration + * + * @param {string} parameters.updateConfiguration.operatingSystem operating + * system of target machines. Possible values include: 'Windows', 'Linux' + * + * @param {object} [parameters.updateConfiguration.windows] Windows specific + * update configuration. + * + * @param {string} + * [parameters.updateConfiguration.windows.includedUpdateClassifications] + * Update classification included in the software update configuration. A comma + * separated string with required values. Possible values include: + * 'Unclassified', 'Critical', 'Security', 'UpdateRollup', 'FeaturePack', + * 'ServicePack', 'Definition', 'Tools', 'Updates' + * + * @param {array} [parameters.updateConfiguration.windows.excludedKbNumbers] KB + * numbers excluded from the software update configuration. + * + * @param {object} [parameters.updateConfiguration.linux] Linux specific update + * configuration. + * + * @param {string} + * [parameters.updateConfiguration.linux.includedPackageClassifications] Update + * classifications included in the software update configuration. Possible + * values include: 'Unclassified', 'Critical', 'Security', 'Other' + * + * @param {array} + * [parameters.updateConfiguration.linux.excludedPackageNameMasks] packages + * excluded from the software update configuration. + * + * @param {moment.duration} [parameters.updateConfiguration.duration] Maximum + * time allowed for the software update configuration run. Duration needs to be + * specified using the format PT[n]H[n]M[n]S as per ISO8601 + * + * @param {array} [parameters.updateConfiguration.azureVirtualMachines] List of + * azure resource Ids for azure virtual machines targeted by the software + * update configuration. + * + * @param {array} [parameters.updateConfiguration.nonAzureComputerNames] List + * of names of non-azure machines targeted by the software update + * configuration. + * + * @param {object} parameters.scheduleInfo Schedule information for the + * Software update configuration + * + * @param {date} [parameters.scheduleInfo.startTime] Gets or sets the start + * time of the schedule. + * + * @param {date} [parameters.scheduleInfo.expiryTime] Gets or sets the end time + * of the schedule. + * + * @param {number} [parameters.scheduleInfo.expiryTimeOffsetMinutes] Gets or + * sets the expiry time's offset in minutes. + * + * @param {boolean} [parameters.scheduleInfo.isEnabled] Gets or sets a value + * indicating whether this schedule is enabled. + * + * @param {date} [parameters.scheduleInfo.nextRun] Gets or sets the next run + * time of the schedule. + * + * @param {number} [parameters.scheduleInfo.nextRunOffsetMinutes] Gets or sets + * the next run time's offset in minutes. + * + * @param {object} [parameters.scheduleInfo.interval] Gets or sets the interval + * of the schedule. + * + * @param {string} [parameters.scheduleInfo.frequency] Gets or sets the + * frequency of the schedule. Possible values include: 'OneTime', 'Day', + * 'Hour', 'Week', 'Month' + * + * @param {string} [parameters.scheduleInfo.timeZone] Gets or sets the time + * zone of the schedule. + * + * @param {object} [parameters.scheduleInfo.advancedSchedule] Gets or sets the + * advanced schedule. + * + * @param {array} [parameters.scheduleInfo.advancedSchedule.weekDays] Days of + * the week that the job should execute on. + * + * @param {array} [parameters.scheduleInfo.advancedSchedule.monthDays] Days of + * the month that the job should execute on. Must be between 1 and 31. + * + * @param {array} [parameters.scheduleInfo.advancedSchedule.monthlyOccurrences] + * Occurrences of days within a month. + * + * @param {date} [parameters.scheduleInfo.creationTime] Gets or sets the + * creation time. + * + * @param {date} [parameters.scheduleInfo.lastModifiedTime] Gets or sets the + * last modified time. + * + * @param {string} [parameters.scheduleInfo.description] Gets or sets the + * description. + * + * @param {object} [parameters.error] detailes of provisioning error + * + * @param {string} [parameters.error.code] Error code + * + * @param {string} [parameters.error.message] Error message indicating why the + * operation failed. + * + * @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 {SoftwareUpdateConfiguration} - 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 SoftwareUpdateConfiguration} 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. + */ + create(softwareUpdateConfigurationName, 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._create(softwareUpdateConfigurationName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(softwareUpdateConfigurationName, parameters, options, optionalCallback); + } + } + + /** + * Get a single software update configuration by name. + * + * @param {string} softwareUpdateConfigurationName The name of the software + * update configuration to be created. + * + * @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. + */ + getByNameWithHttpOperationResponse(softwareUpdateConfigurationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getByName(softwareUpdateConfigurationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get a single software update configuration by name. + * + * @param {string} softwareUpdateConfigurationName The name of the software + * update configuration to be created. + * + * @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 {SoftwareUpdateConfiguration} - 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 SoftwareUpdateConfiguration} 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. + */ + getByName(softwareUpdateConfigurationName, 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._getByName(softwareUpdateConfigurationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getByName(softwareUpdateConfigurationName, options, optionalCallback); + } + } + + /** + * delete a specific software update configuration. + * + * @param {string} softwareUpdateConfigurationName The name of the software + * update configuration to be created. + * + * @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(softwareUpdateConfigurationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(softwareUpdateConfigurationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * delete a specific software update configuration. + * + * @param {string} softwareUpdateConfigurationName The name of the software + * update configuration to be created. + * + * @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(softwareUpdateConfigurationName, 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(softwareUpdateConfigurationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(softwareUpdateConfigurationName, options, optionalCallback); + } + } + + /** + * Get all software update configurations for the account. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get all software update configurations for the account. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @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 {SoftwareUpdateConfigurationListResult} - 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 SoftwareUpdateConfigurationListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + +} + +module.exports = SoftwareUpdateConfigurations; diff --git a/lib/services/automationManagement/lib/operations/sourceControlOperations.js b/lib/services/automationManagement/lib/operations/sourceControlOperations.js new file mode 100644 index 0000000000..cc165f3f21 --- /dev/null +++ b/lib/services/automationManagement/lib/operations/sourceControlOperations.js @@ -0,0 +1,1633 @@ +/* + * 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; + +/** + * Create a source control. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. + * + * @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.branch] Gets or sets 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 {boolean} [parameters.autoSync] Gets or sets 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 {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 {string} [parameters.description] Gets or sets the user description + * of the source control. + * + * @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 SourceControl} 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(automationAccountName, sourceControlName, 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 = '2017-05-15-preview'; + // Validate + try { + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.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 (sourceControlName === null || sourceControlName === undefined || typeof sourceControlName.valueOf() !== 'string') { + throw new Error('sourceControlName 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}/sourceControls/{sourceControlName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{sourceControlName}', encodeURIComponent(sourceControlName)); + 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['SourceControlCreateOrUpdateParameters']().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['SourceControl']().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['SourceControl']().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 a source control. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. + * + * @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.folderPath] Gets or sets 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.publishRunbook] Gets or sets 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 {string} [parameters.description] Gets or sets the user description + * of the source control. + * + * @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 SourceControl} 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(automationAccountName, sourceControlName, 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 = '2017-05-15-preview'; + // Validate + try { + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.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 (sourceControlName === null || sourceControlName === undefined || typeof sourceControlName.valueOf() !== 'string') { + throw new Error('sourceControlName 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}/sourceControls/{sourceControlName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{sourceControlName}', encodeURIComponent(sourceControlName)); + 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['SourceControlUpdateParameters']().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['SourceControl']().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); + }); +} + +/** + * Delete the source control. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The name of source control. + * + * @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(automationAccountName, sourceControlName, 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 = '2017-05-15-preview'; + // Validate + try { + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.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 (sourceControlName === null || sourceControlName === undefined || typeof sourceControlName.valueOf() !== 'string') { + throw new Error('sourceControlName 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}/sourceControls/{sourceControlName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{sourceControlName}', encodeURIComponent(sourceControlName)); + 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 source control identified by source control name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The name of source control. + * + * @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 SourceControl} 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(automationAccountName, sourceControlName, 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 = '2017-05-15-preview'; + // Validate + try { + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.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 (sourceControlName === null || sourceControlName === undefined || typeof sourceControlName.valueOf() !== 'string') { + throw new Error('sourceControlName 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}/sourceControls/{sourceControlName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{sourceControlName}', encodeURIComponent(sourceControlName)); + 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['SourceControl']().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 source controls. + * + * @param {string} automationAccountName The automation account name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @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 SourceControlListResult} 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(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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2017-05-15-preview'; + // Validate + try { + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter 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}/sourceControls'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + 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['SourceControlListResult']().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 source controls. + * + * @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 SourceControlListResult} 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['SourceControlListResult']().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 SourceControlOperations. */ +class SourceControlOperations { + /** + * Create a SourceControlOperations. + * @param {AutomationClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._listByAutomationAccount = _listByAutomationAccount; + this._listByAutomationAccountNext = _listByAutomationAccountNext; + } + + /** + * Create a source control. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. + * + * @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.branch] Gets or sets 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 {boolean} [parameters.autoSync] Gets or sets 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 {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 {string} [parameters.description] Gets or sets the user description + * of the source control. + * + * @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(automationAccountName, sourceControlName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(automationAccountName, sourceControlName, 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 a source control. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. + * + * @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.branch] Gets or sets 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 {boolean} [parameters.autoSync] Gets or sets 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 {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 {string} [parameters.description] Gets or sets the user description + * of the source control. + * + * @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 {SourceControl} - 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 SourceControl} 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(automationAccountName, sourceControlName, 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(automationAccountName, sourceControlName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(automationAccountName, sourceControlName, parameters, options, optionalCallback); + } + } + + /** + * Update a source control. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. + * + * @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.folderPath] Gets or sets 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.publishRunbook] Gets or sets 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 {string} [parameters.description] Gets or sets the user description + * of the source control. + * + * @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(automationAccountName, sourceControlName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(automationAccountName, sourceControlName, 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 a source control. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. + * + * @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.folderPath] Gets or sets 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.publishRunbook] Gets or sets 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 {string} [parameters.description] Gets or sets the user description + * of the source control. + * + * @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 {SourceControl} - 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 SourceControl} 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(automationAccountName, sourceControlName, 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(automationAccountName, sourceControlName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(automationAccountName, sourceControlName, parameters, options, optionalCallback); + } + } + + /** + * Delete the source control. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The name of source control. + * + * @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(automationAccountName, sourceControlName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(automationAccountName, sourceControlName, 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 source control. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The name of source control. + * + * @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(automationAccountName, sourceControlName, 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(automationAccountName, sourceControlName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(automationAccountName, sourceControlName, options, optionalCallback); + } + } + + /** + * Retrieve the source control identified by source control name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The name of source control. + * + * @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(automationAccountName, sourceControlName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(automationAccountName, sourceControlName, 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 source control identified by source control name. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The name of source control. + * + * @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 {SourceControl} - 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 SourceControl} 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(automationAccountName, sourceControlName, 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(automationAccountName, sourceControlName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(automationAccountName, sourceControlName, options, optionalCallback); + } + } + + /** + * Retrieve a list of source controls. + * + * @param {string} automationAccountName The automation account name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @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(automationAccountName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByAutomationAccount(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 source controls. + * + * @param {string} automationAccountName The automation account name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @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 {SourceControlListResult} - 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 SourceControlListResult} 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(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(automationAccountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); + } + } + + /** + * Retrieve a list of source controls. + * + * @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 source controls. + * + * @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 {SourceControlListResult} - 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 SourceControlListResult} 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 = SourceControlOperations; diff --git a/lib/services/automationManagement/lib/operations/sourceControlSyncJobOperations.js b/lib/services/automationManagement/lib/operations/sourceControlSyncJobOperations.js new file mode 100644 index 0000000000..9c083f2028 --- /dev/null +++ b/lib/services/automationManagement/lib/operations/sourceControlSyncJobOperations.js @@ -0,0 +1,1004 @@ +/* + * 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; + +/** + * Creates the sync job for a source control. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. + * + * @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 SourceControlSyncJob} 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 _create(automationAccountName, sourceControlName, sourceControlSyncJobId, 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 = '2017-05-15-preview'; + // Validate + try { + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.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 (sourceControlName === null || sourceControlName === undefined || typeof sourceControlName.valueOf() !== 'string') { + throw new Error('sourceControlName cannot be null or undefined and it must be of type string.'); + } + if (sourceControlSyncJobId === null || sourceControlSyncJobId === undefined || typeof sourceControlSyncJobId.valueOf() !== 'string' || !msRest.isValidUuid(sourceControlSyncJobId)) { + throw new Error('sourceControlSyncJobId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + 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}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{sourceControlName}', encodeURIComponent(sourceControlName)); + requestUrl = requestUrl.replace('{sourceControlSyncJobId}', encodeURIComponent(sourceControlSyncJobId.toString())); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (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 === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SourceControlSyncJob']().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 the source control sync job identified by job id. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. + * + * @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 SourceControlSyncJobById} 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(automationAccountName, sourceControlName, sourceControlSyncJobId, 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 = '2017-05-15-preview'; + // Validate + try { + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.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 (sourceControlName === null || sourceControlName === undefined || typeof sourceControlName.valueOf() !== 'string') { + throw new Error('sourceControlName cannot be null or undefined and it must be of type string.'); + } + if (sourceControlSyncJobId === null || sourceControlSyncJobId === undefined || typeof sourceControlSyncJobId.valueOf() !== 'string' || !msRest.isValidUuid(sourceControlSyncJobId)) { + throw new Error('sourceControlSyncJobId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + 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}/sourceControls/{sourceControlName}/sourceControlSyncJobs/{sourceControlSyncJobId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{sourceControlName}', encodeURIComponent(sourceControlName)); + requestUrl = requestUrl.replace('{sourceControlSyncJobId}', encodeURIComponent(sourceControlSyncJobId.toString())); + 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['SourceControlSyncJobById']().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 source control sync jobs. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @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 SourceControlSyncJobListResult} 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(automationAccountName, sourceControlName, 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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2017-05-15-preview'; + // Validate + try { + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.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 (sourceControlName === null || sourceControlName === undefined || typeof sourceControlName.valueOf() !== 'string') { + throw new Error('sourceControlName cannot be null or undefined and it must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter 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}/sourceControls/{sourceControlName}/sourceControlSyncJobs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{sourceControlName}', encodeURIComponent(sourceControlName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + 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['SourceControlSyncJobListResult']().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 source control sync jobs. + * + * @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 SourceControlSyncJobListResult} 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['SourceControlSyncJobListResult']().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 SourceControlSyncJobOperations. */ +class SourceControlSyncJobOperations { + /** + * Create a SourceControlSyncJobOperations. + * @param {AutomationClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._create = _create; + this._get = _get; + this._listByAutomationAccount = _listByAutomationAccount; + this._listByAutomationAccountNext = _listByAutomationAccountNext; + } + + /** + * Creates the sync job for a source control. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createWithHttpOperationResponse(automationAccountName, sourceControlName, sourceControlSyncJobId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(automationAccountName, sourceControlName, sourceControlSyncJobId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates the sync job for a source control. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SourceControlSyncJob} - 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 SourceControlSyncJob} 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. + */ + create(automationAccountName, sourceControlName, sourceControlSyncJobId, 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._create(automationAccountName, sourceControlName, sourceControlSyncJobId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(automationAccountName, sourceControlName, sourceControlSyncJobId, options, optionalCallback); + } + } + + /** + * Retrieve the source control sync job identified by job id. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(automationAccountName, sourceControlName, sourceControlSyncJobId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(automationAccountName, sourceControlName, sourceControlSyncJobId, 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 source control sync job identified by job id. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SourceControlSyncJobById} - 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 SourceControlSyncJobById} 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(automationAccountName, sourceControlName, sourceControlSyncJobId, 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(automationAccountName, sourceControlName, sourceControlSyncJobId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(automationAccountName, sourceControlName, sourceControlSyncJobId, options, optionalCallback); + } + } + + /** + * Retrieve a list of source control sync jobs. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @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(automationAccountName, sourceControlName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByAutomationAccount(automationAccountName, sourceControlName, 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 source control sync jobs. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} sourceControlName The source control name. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The filter to apply on the operation. + * + * @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 {SourceControlSyncJobListResult} - 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 SourceControlSyncJobListResult} 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(automationAccountName, sourceControlName, 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(automationAccountName, sourceControlName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByAutomationAccount(automationAccountName, sourceControlName, options, optionalCallback); + } + } + + /** + * Retrieve a list of source control sync jobs. + * + * @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 source control sync jobs. + * + * @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 {SourceControlSyncJobListResult} - 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 SourceControlSyncJobListResult} 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 = SourceControlSyncJobOperations; diff --git a/lib/services/automationManagement/lib/operations/statisticsOperations.js b/lib/services/automationManagement/lib/operations/statisticsOperations.js index 272e88b58b..2d55cd9c03 100644 --- a/lib/services/automationManagement/lib/operations/statisticsOperations.js +++ b/lib/services/automationManagement/lib/operations/statisticsOperations.js @@ -52,6 +52,7 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2015-10-31'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -72,9 +73,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -92,7 +90,7 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/automationManagement/lib/operations/testJobOperations.js b/lib/services/automationManagement/lib/operations/testJobOperations.js new file mode 100644 index 0000000000..fe584dc175 --- /dev/null +++ b/lib/services/automationManagement/lib/operations/testJobOperations.js @@ -0,0 +1,1224 @@ +/* + * 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; + +/** + * Create a test job of the runbook. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The parameters supplied to the create test job + * operation. + * + * @param {object} parameters The parameters supplied to the create test job + * operation. + * + * @param {object} [parameters.parameters] Gets or sets the parameters of the + * test job. + * + * @param {string} [parameters.runOn] Gets or sets the runOn which specifies + * the group name where the job is to be executed. + * + * @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 TestJob} 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 _create(automationAccountName, runbookName, 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 = '2015-10-31'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.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 (runbookName === null || runbookName === undefined || typeof runbookName.valueOf() !== 'string') { + throw new Error('runbookName 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.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}/runbooks/{runbookName}/draft/testJob'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); + 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['TestJobCreateParameters']().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 !== 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 === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['TestJob']().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 the test job for the specified runbook. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook 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 TestJob} 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(automationAccountName, runbookName, 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 = '2015-10-31'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.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 (runbookName === null || runbookName === undefined || typeof runbookName.valueOf() !== 'string') { + throw new Error('runbookName 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}/runbooks/{runbookName}/draft/testJob'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); + 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['TestJob']().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); + }); +} + +/** + * Resume the test job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook 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 _resume(automationAccountName, runbookName, 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 = '2015-10-31'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.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 (runbookName === null || runbookName === undefined || typeof runbookName.valueOf() !== 'string') { + throw new Error('runbookName 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}/runbooks/{runbookName}/draft/testJob/resume'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); + 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 = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Stop the test job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook 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 _stop(automationAccountName, runbookName, 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 = '2015-10-31'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.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 (runbookName === null || runbookName === undefined || typeof runbookName.valueOf() !== 'string') { + throw new Error('runbookName 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}/runbooks/{runbookName}/draft/testJob/stop'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); + 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 = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Suspend the test job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook 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 _suspend(automationAccountName, runbookName, 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 = '2015-10-31'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"this.client.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 (runbookName === null || runbookName === undefined || typeof runbookName.valueOf() !== 'string') { + throw new Error('runbookName 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}/runbooks/{runbookName}/draft/testJob/suspend'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); + 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 = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a TestJobOperations. */ +class TestJobOperations { + /** + * Create a TestJobOperations. + * @param {AutomationClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._create = _create; + this._get = _get; + this._resume = _resume; + this._stop = _stop; + this._suspend = _suspend; + } + + /** + * Create a test job of the runbook. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The parameters supplied to the create test job + * operation. + * + * @param {object} parameters The parameters supplied to the create test job + * operation. + * + * @param {object} [parameters.parameters] Gets or sets the parameters of the + * test job. + * + * @param {string} [parameters.runOn] Gets or sets the runOn which specifies + * the group name where the job is to be executed. + * + * @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. + */ + createWithHttpOperationResponse(automationAccountName, runbookName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(automationAccountName, runbookName, 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 a test job of the runbook. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The parameters supplied to the create test job + * operation. + * + * @param {object} parameters The parameters supplied to the create test job + * operation. + * + * @param {object} [parameters.parameters] Gets or sets the parameters of the + * test job. + * + * @param {string} [parameters.runOn] Gets or sets the runOn which specifies + * the group name where the job is to be executed. + * + * @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 {TestJob} - 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 TestJob} 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. + */ + create(automationAccountName, runbookName, 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._create(automationAccountName, runbookName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(automationAccountName, runbookName, parameters, options, optionalCallback); + } + } + + /** + * Retrieve the test job for the specified runbook. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook 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(automationAccountName, runbookName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(automationAccountName, runbookName, 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 test job for the specified runbook. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook 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 {TestJob} - 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 TestJob} 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(automationAccountName, runbookName, 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(automationAccountName, runbookName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(automationAccountName, runbookName, options, optionalCallback); + } + } + + /** + * Resume the test job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook 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. + */ + resumeWithHttpOperationResponse(automationAccountName, runbookName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._resume(automationAccountName, runbookName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Resume the test job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook 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. + */ + resume(automationAccountName, runbookName, 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._resume(automationAccountName, runbookName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resume(automationAccountName, runbookName, options, optionalCallback); + } + } + + /** + * Stop the test job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook 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. + */ + stopWithHttpOperationResponse(automationAccountName, runbookName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stop(automationAccountName, runbookName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Stop the test job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook 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. + */ + stop(automationAccountName, runbookName, 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._stop(automationAccountName, runbookName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stop(automationAccountName, runbookName, options, optionalCallback); + } + } + + /** + * Suspend the test job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook 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. + */ + suspendWithHttpOperationResponse(automationAccountName, runbookName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._suspend(automationAccountName, runbookName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Suspend the test job. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} runbookName The runbook 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. + */ + suspend(automationAccountName, runbookName, 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._suspend(automationAccountName, runbookName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._suspend(automationAccountName, runbookName, options, optionalCallback); + } + } + +} + +module.exports = TestJobOperations; diff --git a/lib/services/automationManagement/lib/operations/testJobStreams.js b/lib/services/automationManagement/lib/operations/testJobStreams.js index a63bd58c06..028a130fda 100644 --- a/lib/services/automationManagement/lib/operations/testJobStreams.js +++ b/lib/services/automationManagement/lib/operations/testJobStreams.js @@ -15,9 +15,8 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * Retrieve a test job streams identified by runbook name and stream id. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a test job stream of the test job identified by runbook name and + * stream id. * * @param {string} automationAccountName The automation account name. * @@ -43,7 +42,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, runbookName, jobStreamId, options, callback) { +function _get(automationAccountName, runbookName, jobStreamId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53,15 +52,19 @@ function _get(resourceGroupName, automationAccountName, runbookName, jobStreamId if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -73,12 +76,6 @@ function _get(resourceGroupName, automationAccountName, runbookName, jobStreamId if (jobStreamId === null || jobStreamId === undefined || typeof jobStreamId.valueOf() !== 'string') { throw new Error('jobStreamId 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -89,13 +86,13 @@ function _get(resourceGroupName, automationAccountName, runbookName, jobStreamId // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams/{jobStreamId}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); requestUrl = requestUrl.replace('{jobStreamId}', encodeURIComponent(jobStreamId)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -181,8 +178,6 @@ function _get(resourceGroupName, automationAccountName, runbookName, jobStreamId /** * Retrieve a list of test job streams identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -207,7 +202,7 @@ function _get(resourceGroupName, automationAccountName, runbookName, jobStreamId * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByTestJob(resourceGroupName, automationAccountName, runbookName, options, callback) { +function _listByTestJob(automationAccountName, runbookName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -218,15 +213,19 @@ function _listByTestJob(resourceGroupName, automationAccountName, runbookName, o throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2015-10-31'; // 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 (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.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -238,12 +237,6 @@ function _listByTestJob(resourceGroupName, automationAccountName, runbookName, o if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { throw new Error('filter 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -254,15 +247,15 @@ function _listByTestJob(resourceGroupName, automationAccountName, runbookName, o // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/runbooks/{runbookName}/draft/testJob/streams'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{runbookName}', encodeURIComponent(runbookName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -487,9 +480,8 @@ class TestJobStreams { } /** - * Retrieve a test job streams identified by runbook name and stream id. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a test job stream of the test job identified by runbook name and + * stream id. * * @param {string} automationAccountName The automation account name. * @@ -508,11 +500,11 @@ class TestJobStreams { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, runbookName, jobStreamId, options) { + getWithHttpOperationResponse(automationAccountName, runbookName, jobStreamId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, runbookName, jobStreamId, options, (err, result, request, response) => { + self._get(automationAccountName, runbookName, jobStreamId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -523,9 +515,8 @@ class TestJobStreams { } /** - * Retrieve a test job streams identified by runbook name and stream id. - * - * @param {string} resourceGroupName The resource group name. + * Retrieve a test job stream of the test job identified by runbook name and + * stream id. * * @param {string} automationAccountName The automation account name. * @@ -560,7 +551,7 @@ class TestJobStreams { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, runbookName, jobStreamId, options, optionalCallback) { + get(automationAccountName, runbookName, jobStreamId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -569,22 +560,20 @@ class TestJobStreams { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, runbookName, jobStreamId, options, (err, result, request, response) => { + self._get(automationAccountName, runbookName, jobStreamId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, runbookName, jobStreamId, options, optionalCallback); + return self._get(automationAccountName, runbookName, jobStreamId, options, optionalCallback); } } /** * Retrieve a list of test job streams identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -602,11 +591,11 @@ class TestJobStreams { * * @reject {Error} - The error object. */ - listByTestJobWithHttpOperationResponse(resourceGroupName, automationAccountName, runbookName, options) { + listByTestJobWithHttpOperationResponse(automationAccountName, runbookName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByTestJob(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._listByTestJob(automationAccountName, runbookName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -619,8 +608,6 @@ class TestJobStreams { /** * Retrieve a list of test job streams identified by runbook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} runbookName The runbook name. @@ -654,7 +641,7 @@ class TestJobStreams { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByTestJob(resourceGroupName, automationAccountName, runbookName, options, optionalCallback) { + listByTestJob(automationAccountName, runbookName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -663,14 +650,14 @@ class TestJobStreams { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByTestJob(resourceGroupName, automationAccountName, runbookName, options, (err, result, request, response) => { + self._listByTestJob(automationAccountName, runbookName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByTestJob(resourceGroupName, automationAccountName, runbookName, options, optionalCallback); + return self._listByTestJob(automationAccountName, runbookName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/usages.js b/lib/services/automationManagement/lib/operations/usages.js index 8cde8acc71..b68cfaf78b 100644 --- a/lib/services/automationManagement/lib/operations/usages.js +++ b/lib/services/automationManagement/lib/operations/usages.js @@ -49,6 +49,7 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -66,9 +67,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -83,7 +81,7 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } diff --git a/lib/services/automationManagement/lib/operations/variableOperations.js b/lib/services/automationManagement/lib/operations/variableOperations.js index aae112202b..704a306729 100644 --- a/lib/services/automationManagement/lib/operations/variableOperations.js +++ b/lib/services/automationManagement/lib/operations/variableOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Create a variable. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} variableName The variable name. @@ -54,7 +52,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, automationAccountName, variableName, parameters, options, callback) { +function _createOrUpdate(automationAccountName, variableName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -64,15 +62,16 @@ function _createOrUpdate(resourceGroupName, automationAccountName, variableName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -87,9 +86,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, variableName, 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -100,12 +96,12 @@ function _createOrUpdate(resourceGroupName, automationAccountName, variableName, // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{variableName}', encodeURIComponent(variableName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -222,8 +218,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, variableName, /** * Update a variable. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} variableName The variable name. @@ -231,7 +225,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, variableName, * @param {object} parameters The parameters supplied to the update variable * operation. * - * @param {string} parameters.name Gets or sets the name of the variable. + * @param {string} [parameters.name] Gets or sets the name of the variable. * * @param {string} [parameters.value] Gets or sets the value of the variable. * @@ -256,7 +250,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, variableName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _update(resourceGroupName, automationAccountName, variableName, parameters, options, callback) { +function _update(automationAccountName, variableName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -266,15 +260,16 @@ function _update(resourceGroupName, automationAccountName, variableName, paramet if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -289,9 +284,6 @@ function _update(resourceGroupName, automationAccountName, variableName, paramet 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -302,12 +294,12 @@ function _update(resourceGroupName, automationAccountName, variableName, paramet // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{variableName}', encodeURIComponent(variableName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -407,8 +399,6 @@ function _update(resourceGroupName, automationAccountName, variableName, paramet /** * Delete the variable. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} variableName The name of variable. @@ -430,7 +420,7 @@ function _update(resourceGroupName, automationAccountName, variableName, paramet * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, automationAccountName, variableName, options, callback) { +function _deleteMethod(automationAccountName, variableName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -440,15 +430,16 @@ function _deleteMethod(resourceGroupName, automationAccountName, variableName, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -460,9 +451,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, variableName, o 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -473,12 +461,12 @@ function _deleteMethod(resourceGroupName, automationAccountName, variableName, o // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{variableName}', encodeURIComponent(variableName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -547,8 +535,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, variableName, o /** * Retrieve the variable identified by variable name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} variableName The name of variable. @@ -571,7 +557,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, variableName, o * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, variableName, options, callback) { +function _get(automationAccountName, variableName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -581,15 +567,16 @@ function _get(resourceGroupName, automationAccountName, variableName, options, c if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -601,9 +588,6 @@ function _get(resourceGroupName, automationAccountName, variableName, options, c 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -614,12 +598,12 @@ function _get(resourceGroupName, automationAccountName, variableName, options, c // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables/{variableName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{variableName}', encodeURIComponent(variableName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -705,8 +689,6 @@ function _get(resourceGroupName, automationAccountName, variableName, options, c /** * Retrieve a list of variables. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -727,7 +709,7 @@ function _get(resourceGroupName, automationAccountName, variableName, options, c * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { +function _listByAutomationAccount(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -737,15 +719,16 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -754,9 +737,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -767,11 +747,11 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/variables'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1001,8 +981,6 @@ class VariableOperations { /** * Create a variable. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} variableName The variable name. @@ -1031,11 +1009,11 @@ class VariableOperations { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, automationAccountName, variableName, parameters, options) { + createOrUpdateWithHttpOperationResponse(automationAccountName, variableName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, variableName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, variableName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1048,8 +1026,6 @@ class VariableOperations { /** * Create a variable. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} variableName The variable name. @@ -1094,7 +1070,7 @@ class VariableOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, automationAccountName, variableName, parameters, options, optionalCallback) { + createOrUpdate(automationAccountName, variableName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1103,22 +1079,20 @@ class VariableOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, variableName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, variableName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, automationAccountName, variableName, parameters, options, optionalCallback); + return self._createOrUpdate(automationAccountName, variableName, parameters, options, optionalCallback); } } /** * Update a variable. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} variableName The variable name. @@ -1126,7 +1100,7 @@ class VariableOperations { * @param {object} parameters The parameters supplied to the update variable * operation. * - * @param {string} parameters.name Gets or sets the name of the variable. + * @param {string} [parameters.name] Gets or sets the name of the variable. * * @param {string} [parameters.value] Gets or sets the value of the variable. * @@ -1144,11 +1118,11 @@ class VariableOperations { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, automationAccountName, variableName, parameters, options) { + updateWithHttpOperationResponse(automationAccountName, variableName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, variableName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, variableName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1161,8 +1135,6 @@ class VariableOperations { /** * Update a variable. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} variableName The variable name. @@ -1170,7 +1142,7 @@ class VariableOperations { * @param {object} parameters The parameters supplied to the update variable * operation. * - * @param {string} parameters.name Gets or sets the name of the variable. + * @param {string} [parameters.name] Gets or sets the name of the variable. * * @param {string} [parameters.value] Gets or sets the value of the variable. * @@ -1204,7 +1176,7 @@ class VariableOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, automationAccountName, variableName, parameters, options, optionalCallback) { + update(automationAccountName, variableName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1213,22 +1185,20 @@ class VariableOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, variableName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, variableName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, automationAccountName, variableName, parameters, options, optionalCallback); + return self._update(automationAccountName, variableName, parameters, options, optionalCallback); } } /** * Delete the variable. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} variableName The name of variable. @@ -1244,11 +1214,11 @@ class VariableOperations { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, variableName, options) { + deleteMethodWithHttpOperationResponse(automationAccountName, variableName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, variableName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, variableName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1261,8 +1231,6 @@ class VariableOperations { /** * Delete the variable. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} variableName The name of variable. @@ -1293,7 +1261,7 @@ class VariableOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, automationAccountName, variableName, options, optionalCallback) { + deleteMethod(automationAccountName, variableName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1302,22 +1270,20 @@ class VariableOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, variableName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, variableName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, automationAccountName, variableName, options, optionalCallback); + return self._deleteMethod(automationAccountName, variableName, options, optionalCallback); } } /** * Retrieve the variable identified by variable name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} variableName The name of variable. @@ -1333,11 +1299,11 @@ class VariableOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, variableName, options) { + getWithHttpOperationResponse(automationAccountName, variableName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, variableName, options, (err, result, request, response) => { + self._get(automationAccountName, variableName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1350,8 +1316,6 @@ class VariableOperations { /** * Retrieve the variable identified by variable name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} variableName The name of variable. @@ -1383,7 +1347,7 @@ class VariableOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, variableName, options, optionalCallback) { + get(automationAccountName, variableName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1392,22 +1356,20 @@ class VariableOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, variableName, options, (err, result, request, response) => { + self._get(automationAccountName, variableName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, variableName, options, optionalCallback); + return self._get(automationAccountName, variableName, options, optionalCallback); } } /** * Retrieve a list of variables. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1421,11 +1383,11 @@ class VariableOperations { * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1438,8 +1400,6 @@ class VariableOperations { /** * Retrieve a list of variables. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1469,7 +1429,7 @@ class VariableOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + listByAutomationAccount(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1478,14 +1438,14 @@ class VariableOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); } } diff --git a/lib/services/automationManagement/lib/operations/webhookOperations.js b/lib/services/automationManagement/lib/operations/webhookOperations.js index 1de71658e3..b10646ad9d 100644 --- a/lib/services/automationManagement/lib/operations/webhookOperations.js +++ b/lib/services/automationManagement/lib/operations/webhookOperations.js @@ -17,8 +17,6 @@ const WebResource = msRest.WebResource; /** * Generates a Uri for use in creating a webhook. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -38,7 +36,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _generateUri(resourceGroupName, automationAccountName, options, callback) { +function _generateUri(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -48,15 +46,16 @@ function _generateUri(resourceGroupName, automationAccountName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -65,9 +64,6 @@ function _generateUri(resourceGroupName, automationAccountName, options, callbac 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -78,11 +74,11 @@ function _generateUri(resourceGroupName, automationAccountName, options, callbac // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/generateUri'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -174,8 +170,6 @@ function _generateUri(resourceGroupName, automationAccountName, options, callbac /** * Delete the webhook by name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} webhookName The webhook name. @@ -197,7 +191,7 @@ function _generateUri(resourceGroupName, automationAccountName, options, callbac * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, automationAccountName, webhookName, options, callback) { +function _deleteMethod(automationAccountName, webhookName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -207,15 +201,16 @@ function _deleteMethod(resourceGroupName, automationAccountName, webhookName, op if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -227,9 +222,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, webhookName, op 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -240,12 +232,12 @@ function _deleteMethod(resourceGroupName, automationAccountName, webhookName, op // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{webhookName}', encodeURIComponent(webhookName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -314,8 +306,6 @@ function _deleteMethod(resourceGroupName, automationAccountName, webhookName, op /** * Retrieve the webhook identified by webhook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} webhookName The webhook name. @@ -338,7 +328,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, webhookName, op * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, automationAccountName, webhookName, options, callback) { +function _get(automationAccountName, webhookName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -348,15 +338,16 @@ function _get(resourceGroupName, automationAccountName, webhookName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -368,9 +359,6 @@ function _get(resourceGroupName, automationAccountName, webhookName, options, ca 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -381,12 +369,12 @@ function _get(resourceGroupName, automationAccountName, webhookName, options, ca // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{webhookName}', encodeURIComponent(webhookName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -472,8 +460,6 @@ function _get(resourceGroupName, automationAccountName, webhookName, options, ca /** * Create the webhook identified by webhook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} webhookName The webhook name. @@ -518,7 +504,7 @@ function _get(resourceGroupName, automationAccountName, webhookName, options, ca * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, automationAccountName, webhookName, parameters, options, callback) { +function _createOrUpdate(automationAccountName, webhookName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -528,15 +514,16 @@ function _createOrUpdate(resourceGroupName, automationAccountName, webhookName, if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -551,9 +538,6 @@ function _createOrUpdate(resourceGroupName, automationAccountName, webhookName, 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -564,12 +548,12 @@ function _createOrUpdate(resourceGroupName, automationAccountName, webhookName, // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{webhookName}', encodeURIComponent(webhookName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -686,15 +670,13 @@ function _createOrUpdate(resourceGroupName, automationAccountName, webhookName, /** * Update the webhook identified by webhook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} webhookName The webhook name. * * @param {object} parameters The update parameters for webhook. * - * @param {string} parameters.name Gets or sets the name of the webhook. + * @param {string} [parameters.name] Gets or sets the name of the webhook. * * @param {boolean} [parameters.isEnabled] Gets or sets the value of the * enabled flag of webhook. @@ -726,7 +708,7 @@ function _createOrUpdate(resourceGroupName, automationAccountName, webhookName, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _update(resourceGroupName, automationAccountName, webhookName, parameters, options, callback) { +function _update(automationAccountName, webhookName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -736,15 +718,16 @@ function _update(resourceGroupName, automationAccountName, webhookName, paramete if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -759,9 +742,6 @@ function _update(resourceGroupName, automationAccountName, webhookName, paramete 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -772,12 +752,12 @@ function _update(resourceGroupName, automationAccountName, webhookName, paramete // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks/{webhookName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{webhookName}', encodeURIComponent(webhookName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -877,8 +857,6 @@ function _update(resourceGroupName, automationAccountName, webhookName, paramete /** * Retrieve a list of webhooks. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -901,7 +879,7 @@ function _update(resourceGroupName, automationAccountName, webhookName, paramete * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { +function _listByAutomationAccount(automationAccountName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -912,15 +890,16 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2015-10-31'; // 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 (this.client.resourceGroupName === null || this.client.resourceGroupName === undefined || typeof this.client.resourceGroupName.valueOf() !== 'string') { + throw new Error('this.client.resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.match(/^[-\w\._]+$/) === null) + if (this.client.resourceGroupName !== null && this.client.resourceGroupName !== undefined) { + if (this.client.resourceGroupName.match(/^[-\w\._]+$/) === null) { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + throw new Error('"this.client.resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); } } if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { @@ -932,9 +911,6 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti 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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -945,14 +921,14 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/webhooks'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.client.resourceGroupName)); requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; if (filter !== null && filter !== undefined) { queryParameters.push('$filter=' + encodeURIComponent(filter)); } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1183,8 +1159,6 @@ class WebhookOperations { /** * Generates a Uri for use in creating a webhook. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1198,11 +1172,11 @@ class WebhookOperations { * * @reject {Error} - The error object. */ - generateUriWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + generateUriWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._generateUri(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._generateUri(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1215,8 +1189,6 @@ class WebhookOperations { /** * Generates a Uri for use in creating a webhook. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1245,7 +1217,7 @@ class WebhookOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - generateUri(resourceGroupName, automationAccountName, options, optionalCallback) { + generateUri(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1254,22 +1226,20 @@ class WebhookOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._generateUri(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._generateUri(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._generateUri(resourceGroupName, automationAccountName, options, optionalCallback); + return self._generateUri(automationAccountName, options, optionalCallback); } } /** * Delete the webhook by name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} webhookName The webhook name. @@ -1285,11 +1255,11 @@ class WebhookOperations { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, webhookName, options) { + deleteMethodWithHttpOperationResponse(automationAccountName, webhookName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, webhookName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, webhookName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1302,8 +1272,6 @@ class WebhookOperations { /** * Delete the webhook by name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} webhookName The webhook name. @@ -1334,7 +1302,7 @@ class WebhookOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, automationAccountName, webhookName, options, optionalCallback) { + deleteMethod(automationAccountName, webhookName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1343,22 +1311,20 @@ class WebhookOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, automationAccountName, webhookName, options, (err, result, request, response) => { + self._deleteMethod(automationAccountName, webhookName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, automationAccountName, webhookName, options, optionalCallback); + return self._deleteMethod(automationAccountName, webhookName, options, optionalCallback); } } /** * Retrieve the webhook identified by webhook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} webhookName The webhook name. @@ -1374,11 +1340,11 @@ class WebhookOperations { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, automationAccountName, webhookName, options) { + getWithHttpOperationResponse(automationAccountName, webhookName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, webhookName, options, (err, result, request, response) => { + self._get(automationAccountName, webhookName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1391,8 +1357,6 @@ class WebhookOperations { /** * Retrieve the webhook identified by webhook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} webhookName The webhook name. @@ -1424,7 +1388,7 @@ class WebhookOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, automationAccountName, webhookName, options, optionalCallback) { + get(automationAccountName, webhookName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1433,22 +1397,20 @@ class WebhookOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, automationAccountName, webhookName, options, (err, result, request, response) => { + self._get(automationAccountName, webhookName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, automationAccountName, webhookName, options, optionalCallback); + return self._get(automationAccountName, webhookName, options, optionalCallback); } } /** * Create the webhook identified by webhook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} webhookName The webhook name. @@ -1486,11 +1448,11 @@ class WebhookOperations { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, automationAccountName, webhookName, parameters, options) { + createOrUpdateWithHttpOperationResponse(automationAccountName, webhookName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, webhookName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, webhookName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1503,8 +1465,6 @@ class WebhookOperations { /** * Create the webhook identified by webhook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} webhookName The webhook name. @@ -1558,7 +1518,7 @@ class WebhookOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, automationAccountName, webhookName, parameters, options, optionalCallback) { + createOrUpdate(automationAccountName, webhookName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1567,29 +1527,27 @@ class WebhookOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, automationAccountName, webhookName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(automationAccountName, webhookName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, automationAccountName, webhookName, parameters, options, optionalCallback); + return self._createOrUpdate(automationAccountName, webhookName, parameters, options, optionalCallback); } } /** * Update the webhook identified by webhook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} webhookName The webhook name. * * @param {object} parameters The update parameters for webhook. * - * @param {string} parameters.name Gets or sets the name of the webhook. + * @param {string} [parameters.name] Gets or sets the name of the webhook. * * @param {boolean} [parameters.isEnabled] Gets or sets the value of the * enabled flag of webhook. @@ -1614,11 +1572,11 @@ class WebhookOperations { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, automationAccountName, webhookName, parameters, options) { + updateWithHttpOperationResponse(automationAccountName, webhookName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, webhookName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, webhookName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1631,15 +1589,13 @@ class WebhookOperations { /** * Update the webhook identified by webhook name. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {string} webhookName The webhook name. * * @param {object} parameters The update parameters for webhook. * - * @param {string} parameters.name Gets or sets the name of the webhook. + * @param {string} [parameters.name] Gets or sets the name of the webhook. * * @param {boolean} [parameters.isEnabled] Gets or sets the value of the * enabled flag of webhook. @@ -1680,7 +1636,7 @@ class WebhookOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, automationAccountName, webhookName, parameters, options, optionalCallback) { + update(automationAccountName, webhookName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1689,22 +1645,20 @@ class WebhookOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, automationAccountName, webhookName, parameters, options, (err, result, request, response) => { + self._update(automationAccountName, webhookName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, automationAccountName, webhookName, parameters, options, optionalCallback); + return self._update(automationAccountName, webhookName, parameters, options, optionalCallback); } } /** * Retrieve a list of webhooks. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1720,11 +1674,11 @@ class WebhookOperations { * * @reject {Error} - The error object. */ - listByAutomationAccountWithHttpOperationResponse(resourceGroupName, automationAccountName, options) { + listByAutomationAccountWithHttpOperationResponse(automationAccountName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1737,8 +1691,6 @@ class WebhookOperations { /** * Retrieve a list of webhooks. * - * @param {string} resourceGroupName The resource group name. - * * @param {string} automationAccountName The automation account name. * * @param {object} [options] Optional Parameters. @@ -1770,7 +1722,7 @@ class WebhookOperations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + listByAutomationAccount(automationAccountName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1779,14 +1731,14 @@ class WebhookOperations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + self._listByAutomationAccount(automationAccountName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + return self._listByAutomationAccount(automationAccountName, options, optionalCallback); } }