diff --git a/lib/services/automationManagement/lib/automationClient.d.ts b/lib/services/automationManagement/lib/automationClient.d.ts index 27ddad23f6..4d554f4038 100644 --- a/lib/services/automationManagement/lib/automationClient.d.ts +++ b/lib/services/automationManagement/lib/automationClient.d.ts @@ -91,6 +91,7 @@ export default class AutomationClient extends AzureServiceClient { dscCompilationJobOperations: operations.DscCompilationJobOperations; dscCompilationJobStream: operations.DscCompilationJobStream; dscNodeConfigurationOperations: operations.DscNodeConfigurationOperations; + watcherOperations: operations.WatcherOperations; } export { AutomationClient, models as AutomationModels }; diff --git a/lib/services/automationManagement/lib/automationClient.js b/lib/services/automationManagement/lib/automationClient.js index 569bd56c6e..7f55d8ca0e 100644 --- a/lib/services/automationManagement/lib/automationClient.js +++ b/lib/services/automationManagement/lib/automationClient.js @@ -108,6 +108,7 @@ class AutomationClient extends ServiceClient { this.dscCompilationJobOperations = new operations.DscCompilationJobOperations(this); this.dscCompilationJobStream = new operations.DscCompilationJobStream(this); this.dscNodeConfigurationOperations = new operations.DscNodeConfigurationOperations(this); + this.watcherOperations = new operations.WatcherOperations(this); this.models = models; msRest.addSerializationMixin(this); } diff --git a/lib/services/automationManagement/lib/models/index.d.ts b/lib/services/automationManagement/lib/models/index.d.ts index 60e57de9f5..35982b10d0 100644 --- a/lib/services/automationManagement/lib/models/index.d.ts +++ b/lib/services/automationManagement/lib/models/index.d.ts @@ -358,6 +358,55 @@ export interface Certificate extends ProxyResource { description?: string; } +/** + * @class + * Initializes a new instance of the TrackedResource class. + * @constructor + * The resource model definition for a ARM tracked top level resource + * + * @member {object} [tags] Resource tags. + * @member {string} [location] The Azure Region where the resource lives + */ +export interface TrackedResource extends Resource { + tags?: { [propertyName: string]: string }; + location?: string; +} + +/** + * @class + * Initializes a new instance of the Watcher class. + * @constructor + * Definition of the watcher type. + * + * @member {number} [executionFrequencyInSeconds] Gets or sets the frequency at + * which the watcher is invoked. + * @member {string} [scriptName] Gets or sets the name of the script the + * watcher is attached to, i.e. the name of an existing runbook. + * @member {object} [scriptParameters] Gets or sets the parameters of the + * script. + * @member {string} [scriptRunOn] Gets or sets the name of the hybrid worker + * group the watcher will run on. + * @member {string} [status] Gets the current status of the watcher. + * @member {date} [creationTime] Gets or sets the creation time. + * @member {date} [lastModifiedTime] Gets or sets the last modified time. + * @member {string} [lastModifiedBy] Details of the user who last modified the + * watcher. + * @member {string} [description] Gets or sets the description. + * @member {string} [etag] Gets or sets the etag of the resource. + */ +export interface Watcher extends TrackedResource { + executionFrequencyInSeconds?: number; + scriptName?: string; + scriptParameters?: { [propertyName: string]: string }; + scriptRunOn?: string; + readonly status?: string; + readonly creationTime?: Date; + readonly lastModifiedTime?: Date; + readonly lastModifiedBy?: string; + description?: string; + etag?: string; +} + /** * @class * Initializes a new instance of the RunbookParameter class. @@ -446,20 +495,6 @@ export interface RunbookDraft { outputTypes?: string[]; } -/** - * @class - * Initializes a new instance of the TrackedResource class. - * @constructor - * The resource model definition for a ARM tracked top level resource - * - * @member {object} [tags] Resource tags. - * @member {string} [location] The Azure Region where the resource lives - */ -export interface TrackedResource extends Resource { - tags?: { [propertyName: string]: string }; - location?: string; -} - /** * @class * Initializes a new instance of the Runbook class. @@ -2356,6 +2391,19 @@ export interface WebhookUpdateParameters { description?: string; } +/** + * @class + * Initializes a new instance of the WatcherUpdateParameters class. + * @constructor + * @member {number} [executionFrequencyInSeconds] Gets or sets the frequency at + * which the watcher is invoked. + * @member {string} [name] Gets or sets the name of the resource. + */ +export interface WatcherUpdateParameters { + executionFrequencyInSeconds?: number; + name?: string; +} + /** * @class * Initializes a new instance of the JobCollectionItem class. @@ -3004,6 +3052,66 @@ export interface SourceControlSyncJobById { exception?: string; } +/** + * @class + * Initializes a new instance of the SourceControlSyncJobStream class. + * @constructor + * Definition of the source control sync job stream. + * + * @member {string} [id] Resource id. + * @member {string} [syncJobStreamId] Gets the sync job stream id. + * @member {string} [summary] Gets the summary of the sync job stream. + * @member {date} [time] Gets the time of the sync job stream. + * @member {string} [streamType] Gets the type of the sync job stream. Possible + * values include: 'Error', 'Output' + */ +export interface SourceControlSyncJobStream { + readonly id?: string; + syncJobStreamId?: string; + summary?: string; + readonly time?: Date; + streamType?: string; +} + +/** + * @class + * Initializes a new instance of the SourceControlSyncJobStreamsListBySyncJob class. + * @constructor + * The response model for the list source control sync job streams operation. + * + * @member {array} [value] Gets a list of source control sync job streams. + * @member {string} [nextLink] Gets or sets the next link. + */ +export interface SourceControlSyncJobStreamsListBySyncJob { + value?: SourceControlSyncJobStream[]; + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the SourceControlSyncJobStreamById class. + * @constructor + * Definition of the source control sync job stream by id. + * + * @member {string} [id] Resource id. + * @member {string} [syncJobStreamId] Gets the sync job stream id. + * @member {string} [summary] Gets the summary of the sync job stream. + * @member {date} [time] Gets the time of the sync job stream. + * @member {string} [streamType] Gets the type of the sync job stream. Possible + * values include: 'Error', 'Output' + * @member {string} [streamText] Gets the text of the sync job stream. + * @member {string} [value] Gets the value of the sync job stream. + */ +export interface SourceControlSyncJobStreamById { + readonly id?: string; + syncJobStreamId?: string; + summary?: string; + readonly time?: Date; + streamType?: string; + streamText?: string; + value?: string; +} + /** * @class * Initializes a new instance of the DscNode class. @@ -3381,3 +3489,15 @@ export interface DscCompilationJobListResult extends Array { export interface DscNodeConfigurationListResult extends Array { nextLink?: string; } + +/** + * @class + * Initializes a new instance of the WatcherListResult class. + * @constructor + * The response model for the list watcher operation. + * + * @member {string} [nextLink] Gets or sets the next link. + */ +export interface WatcherListResult extends Array { + nextLink?: string; +} diff --git a/lib/services/automationManagement/lib/models/index.js b/lib/services/automationManagement/lib/models/index.js index 67610d8ee5..b73d9c7500 100644 --- a/lib/services/automationManagement/lib/models/index.js +++ b/lib/services/automationManagement/lib/models/index.js @@ -35,11 +35,12 @@ exports.Credential = require('./credential'); exports.ConnectionTypeAssociationProperty = require('./connectionTypeAssociationProperty'); exports.Connection = require('./connection'); exports.Certificate = require('./certificate'); +exports.TrackedResource = require('./trackedResource'); +exports.Watcher = require('./watcher'); exports.RunbookParameter = require('./runbookParameter'); exports.ContentHash = require('./contentHash'); exports.ContentLink = require('./contentLink'); exports.RunbookDraft = require('./runbookDraft'); -exports.TrackedResource = require('./trackedResource'); exports.Runbook = require('./runbook'); exports.ModuleErrorInfo = require('./moduleErrorInfo'); exports.Module = require('./module'); @@ -114,6 +115,7 @@ exports.VariableCreateOrUpdateParameters = require('./variableCreateOrUpdatePara exports.VariableUpdateParameters = require('./variableUpdateParameters'); exports.WebhookCreateOrUpdateParameters = require('./webhookCreateOrUpdateParameters'); exports.WebhookUpdateParameters = require('./webhookUpdateParameters'); +exports.WatcherUpdateParameters = require('./watcherUpdateParameters'); exports.JobCollectionItem = require('./jobCollectionItem'); exports.WindowsProperties = require('./windowsProperties'); exports.LinuxProperties = require('./linuxProperties'); @@ -134,6 +136,9 @@ exports.SourceControlUpdateParameters = require('./sourceControlUpdateParameters exports.SourceControlSyncJob = require('./sourceControlSyncJob'); exports.SourceControlSyncJobCreateParameters = require('./sourceControlSyncJobCreateParameters'); exports.SourceControlSyncJobById = require('./sourceControlSyncJobById'); +exports.SourceControlSyncJobStream = require('./sourceControlSyncJobStream'); +exports.SourceControlSyncJobStreamsListBySyncJob = require('./sourceControlSyncJobStreamsListBySyncJob'); +exports.SourceControlSyncJobStreamById = require('./sourceControlSyncJobStreamById'); exports.DscNode = require('./dscNode'); exports.DscNodeConfiguration = require('./dscNodeConfiguration'); exports.AutomationAccountListResult = require('./automationAccountListResult'); @@ -163,3 +168,4 @@ exports.DscNodeListResult = require('./dscNodeListResult'); exports.DscNodeReportListResult = require('./dscNodeReportListResult'); exports.DscCompilationJobListResult = require('./dscCompilationJobListResult'); exports.DscNodeConfigurationListResult = require('./dscNodeConfigurationListResult'); +exports.WatcherListResult = require('./watcherListResult'); diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJobStream.js b/lib/services/automationManagement/lib/models/sourceControlSyncJobStream.js new file mode 100644 index 0000000000..24c9541ca9 --- /dev/null +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobStream.js @@ -0,0 +1,87 @@ +/* + * 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 stream. + * + */ +class SourceControlSyncJobStream { + /** + * Create a SourceControlSyncJobStream. + * @member {string} [id] Resource id. + * @member {string} [syncJobStreamId] Gets the sync job stream id. + * @member {string} [summary] Gets the summary of the sync job stream. + * @member {date} [time] Gets the time of the sync job stream. + * @member {string} [streamType] Gets the type of the sync job stream. + * Possible values include: 'Error', 'Output' + */ + constructor() { + } + + /** + * Defines the metadata of SourceControlSyncJobStream + * + * @returns {object} metadata of SourceControlSyncJobStream + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceControlSyncJobStream', + type: { + name: 'Composite', + className: 'SourceControlSyncJobStream', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + syncJobStreamId: { + required: false, + serializedName: 'properties.syncJobStreamId', + type: { + name: 'String' + } + }, + summary: { + required: false, + serializedName: 'properties.summary', + type: { + name: 'String' + } + }, + time: { + required: false, + readOnly: true, + serializedName: 'properties.time', + type: { + name: 'DateTime' + } + }, + streamType: { + required: false, + serializedName: 'properties.streamType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceControlSyncJobStream; diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamById.js b/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamById.js new file mode 100644 index 0000000000..7899451a0a --- /dev/null +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamById.js @@ -0,0 +1,103 @@ +/* + * 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 stream by id. + * + */ +class SourceControlSyncJobStreamById { + /** + * Create a SourceControlSyncJobStreamById. + * @member {string} [id] Resource id. + * @member {string} [syncJobStreamId] Gets the sync job stream id. + * @member {string} [summary] Gets the summary of the sync job stream. + * @member {date} [time] Gets the time of the sync job stream. + * @member {string} [streamType] Gets the type of the sync job stream. + * Possible values include: 'Error', 'Output' + * @member {string} [streamText] Gets the text of the sync job stream. + * @member {string} [value] Gets the value of the sync job stream. + */ + constructor() { + } + + /** + * Defines the metadata of SourceControlSyncJobStreamById + * + * @returns {object} metadata of SourceControlSyncJobStreamById + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceControlSyncJobStreamById', + type: { + name: 'Composite', + className: 'SourceControlSyncJobStreamById', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + syncJobStreamId: { + required: false, + serializedName: 'properties.syncJobStreamId', + type: { + name: 'String' + } + }, + summary: { + required: false, + serializedName: 'properties.summary', + type: { + name: 'String' + } + }, + time: { + required: false, + readOnly: true, + serializedName: 'properties.time', + type: { + name: 'DateTime' + } + }, + streamType: { + required: false, + serializedName: 'properties.streamType', + type: { + name: 'String' + } + }, + streamText: { + required: false, + serializedName: 'properties.streamText', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: 'properties.value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceControlSyncJobStreamById; diff --git a/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamsListBySyncJob.js b/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamsListBySyncJob.js new file mode 100644 index 0000000000..e8ae1fda5f --- /dev/null +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamsListBySyncJob.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'); + +/** + * The response model for the list source control sync job streams operation. + * + */ +class SourceControlSyncJobStreamsListBySyncJob { + /** + * Create a SourceControlSyncJobStreamsListBySyncJob. + * @member {array} [value] Gets a list of source control sync job streams. + * @member {string} [nextLink] Gets or sets the next link. + */ + constructor() { + } + + /** + * Defines the metadata of SourceControlSyncJobStreamsListBySyncJob + * + * @returns {object} metadata of SourceControlSyncJobStreamsListBySyncJob + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceControlSyncJobStreamsListBySyncJob', + type: { + name: 'Composite', + className: 'SourceControlSyncJobStreamsListBySyncJob', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SourceControlSyncJobStreamElementType', + type: { + name: 'Composite', + className: 'SourceControlSyncJobStream' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceControlSyncJobStreamsListBySyncJob; diff --git a/lib/services/automationManagement/lib/models/watcher.js b/lib/services/automationManagement/lib/models/watcher.js new file mode 100644 index 0000000000..39671ec978 --- /dev/null +++ b/lib/services/automationManagement/lib/models/watcher.js @@ -0,0 +1,189 @@ +/* + * 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 watcher type. + * + * @extends models['TrackedResource'] + */ +class Watcher extends models['TrackedResource'] { + /** + * Create a Watcher. + * @member {number} [executionFrequencyInSeconds] Gets or sets the frequency + * at which the watcher is invoked. + * @member {string} [scriptName] Gets or sets the name of the script the + * watcher is attached to, i.e. the name of an existing runbook. + * @member {object} [scriptParameters] Gets or sets the parameters of the + * script. + * @member {string} [scriptRunOn] Gets or sets the name of the hybrid worker + * group the watcher will run on. + * @member {string} [status] Gets the current status of the watcher. + * @member {date} [creationTime] Gets or sets the creation time. + * @member {date} [lastModifiedTime] Gets or sets the last modified time. + * @member {string} [lastModifiedBy] Details of the user who last modified + * the watcher. + * @member {string} [description] Gets or sets the description. + * @member {string} [etag] Gets or sets the etag of the resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Watcher + * + * @returns {object} metadata of Watcher + * + */ + mapper() { + return { + required: false, + serializedName: 'Watcher', + type: { + name: 'Composite', + className: 'Watcher', + 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' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + executionFrequencyInSeconds: { + required: false, + serializedName: 'properties.executionFrequencyInSeconds', + type: { + name: 'Number' + } + }, + scriptName: { + required: false, + serializedName: 'properties.scriptName', + type: { + name: 'String' + } + }, + scriptParameters: { + required: false, + serializedName: 'properties.scriptParameters', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + scriptRunOn: { + required: false, + serializedName: 'properties.scriptRunOn', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + creationTime: { + required: false, + readOnly: true, + serializedName: 'properties.creationTime', + type: { + name: 'DateTime' + } + }, + lastModifiedTime: { + required: false, + readOnly: true, + serializedName: 'properties.lastModifiedTime', + type: { + name: 'DateTime' + } + }, + lastModifiedBy: { + required: false, + readOnly: true, + serializedName: 'properties.lastModifiedBy', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + etag: { + required: false, + serializedName: 'etag', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Watcher; diff --git a/lib/services/automationManagement/lib/models/watcherCreateOrUpdateParameters.js b/lib/services/automationManagement/lib/models/watcherCreateOrUpdateParameters.js new file mode 100644 index 0000000000..e65fb11333 --- /dev/null +++ b/lib/services/automationManagement/lib/models/watcherCreateOrUpdateParameters.js @@ -0,0 +1,103 @@ +/* + * 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 watcher operation. + * + */ +class WatcherCreateOrUpdateParameters { + /** + * Create a WatcherCreateOrUpdateParameters. + * @member {string} name Gets or sets the name of the watcher. + * @member {number} [executionFrequencyInSeconds] Gets or sets the frequency + * at which the watcher is invoked. + * @member {string} [scriptName] Gets or sets the name of the script the + * watcher is attached to, i.e. the name of an existing runbook. + * @member {object} [scriptParameters] Gets or sets the parameters of the + * script. + * @member {string} [scriptRunOn] Gets or sets the name of the hybrid worker + * group the webhook job will run on. + * @member {string} [description] Gets or sets the watcher's description. + */ + constructor() { + } + + /** + * Defines the metadata of WatcherCreateOrUpdateParameters + * + * @returns {object} metadata of WatcherCreateOrUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'WatcherCreateOrUpdateParameters', + type: { + name: 'Composite', + className: 'WatcherCreateOrUpdateParameters', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + executionFrequencyInSeconds: { + required: false, + serializedName: 'properties.executionFrequencyInSeconds', + type: { + name: 'Number' + } + }, + scriptName: { + required: false, + serializedName: 'properties.scriptName', + type: { + name: 'String' + } + }, + scriptParameters: { + required: false, + serializedName: 'properties.scriptParameters', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + scriptRunOn: { + required: false, + serializedName: 'properties.scriptRunOn', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = WatcherCreateOrUpdateParameters; diff --git a/lib/services/automationManagement/lib/models/watcherListResult.js b/lib/services/automationManagement/lib/models/watcherListResult.js new file mode 100644 index 0000000000..c900c0ef28 --- /dev/null +++ b/lib/services/automationManagement/lib/models/watcherListResult.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 watcher operation. + */ +class WatcherListResult extends Array { + /** + * Create a WatcherListResult. + * @member {string} [nextLink] Gets or sets the next link. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of WatcherListResult + * + * @returns {object} metadata of WatcherListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'WatcherListResult', + type: { + name: 'Composite', + className: 'WatcherListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'WatcherElementType', + type: { + name: 'Composite', + className: 'Watcher' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = WatcherListResult; diff --git a/lib/services/automationManagement/lib/models/watcherUpdateParameters.js b/lib/services/automationManagement/lib/models/watcherUpdateParameters.js new file mode 100644 index 0000000000..30671293e8 --- /dev/null +++ b/lib/services/automationManagement/lib/models/watcherUpdateParameters.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'; + +/** + * Class representing a WatcherUpdateParameters. + */ +class WatcherUpdateParameters { + /** + * Create a WatcherUpdateParameters. + * @member {number} [executionFrequencyInSeconds] Gets or sets the frequency + * at which the watcher is invoked. + * @member {string} [name] Gets or sets the name of the resource. + */ + constructor() { + } + + /** + * Defines the metadata of WatcherUpdateParameters + * + * @returns {object} metadata of WatcherUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'WatcherUpdateParameters', + type: { + name: 'Composite', + className: 'WatcherUpdateParameters', + modelProperties: { + executionFrequencyInSeconds: { + required: false, + serializedName: 'properties.executionFrequencyInSeconds', + type: { + name: 'Number' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = WatcherUpdateParameters; diff --git a/lib/services/automationManagement/lib/operations/index.d.ts b/lib/services/automationManagement/lib/operations/index.d.ts index 9839e76a37..929b06cb2e 100644 --- a/lib/services/automationManagement/lib/operations/index.d.ts +++ b/lib/services/automationManagement/lib/operations/index.d.ts @@ -12172,3 +12172,567 @@ export interface DscNodeConfigurationOperations { listByAutomationAccountNext(nextPageLink: string, callback: ServiceCallback): void; listByAutomationAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } + +/** + * @class + * WatcherOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface WatcherOperations { + + + /** + * Create the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} parameters The create or update parameters for watcher. + * + * @param {number} [parameters.executionFrequencyInSeconds] Gets or sets the + * frequency at which the watcher is invoked. + * + * @param {string} [parameters.scriptName] Gets or sets the name of the script + * the watcher is attached to, i.e. the name of an existing runbook. + * + * @param {object} [parameters.scriptParameters] Gets or sets the parameters of + * the script. + * + * @param {string} [parameters.scriptRunOn] Gets or sets the name of the hybrid + * worker group the watcher will run on. + * + * @param {string} [parameters.description] Gets or sets the description. + * + * @param {string} [parameters.etag] Gets or sets the etag of the resource. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.location] The Azure Region where the resource + * lives + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, watcherName: string, parameters: models.Watcher, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} parameters The create or update parameters for watcher. + * + * @param {number} [parameters.executionFrequencyInSeconds] Gets or sets the + * frequency at which the watcher is invoked. + * + * @param {string} [parameters.scriptName] Gets or sets the name of the script + * the watcher is attached to, i.e. the name of an existing runbook. + * + * @param {object} [parameters.scriptParameters] Gets or sets the parameters of + * the script. + * + * @param {string} [parameters.scriptRunOn] Gets or sets the name of the hybrid + * worker group the watcher will run on. + * + * @param {string} [parameters.description] Gets or sets the description. + * + * @param {string} [parameters.etag] Gets or sets the etag of the resource. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.location] The Azure Region where the resource + * lives + * + * @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 {Watcher} - 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. + * + * {Watcher} [result] - The deserialized result object if an error did not occur. + * See {@link Watcher} 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, watcherName: string, parameters: models.Watcher, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, automationAccountName: string, watcherName: string, parameters: models.Watcher, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, automationAccountName: string, watcherName: string, parameters: models.Watcher, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieve the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, watcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher 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 {Watcher} - 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. + * + * {Watcher} [result] - The deserialized result object if an error did not occur. + * See {@link Watcher} 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, watcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, automationAccountName: string, watcherName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, automationAccountName: string, watcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Update the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} parameters The update parameters for watcher. + * + * @param {number} [parameters.executionFrequencyInSeconds] Gets or sets the + * frequency at which the watcher is invoked. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, watcherName: string, parameters: models.WatcherUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Update the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} parameters The update parameters for watcher. + * + * @param {number} [parameters.executionFrequencyInSeconds] Gets or sets the + * frequency at which the watcher is invoked. + * + * @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 {Watcher} - 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. + * + * {Watcher} [result] - The deserialized result object if an error did not occur. + * See {@link Watcher} 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, watcherName: string, parameters: models.WatcherUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, automationAccountName: string, watcherName: string, parameters: models.WatcherUpdateParameters, callback: ServiceCallback): void; + update(resourceGroupName: string, automationAccountName: string, watcherName: string, parameters: models.WatcherUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Delete the watcher by name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, watcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Delete the watcher by name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, automationAccountName: string, watcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, automationAccountName: string, watcherName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, automationAccountName: string, watcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Resume the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher 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. + */ + startWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, watcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Resume the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher 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. + */ + start(resourceGroupName: string, automationAccountName: string, watcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + start(resourceGroupName: string, automationAccountName: string, watcherName: string, callback: ServiceCallback): void; + start(resourceGroupName: string, automationAccountName: string, watcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Resume the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher 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. + */ + stopWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, watcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Resume the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher 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. + */ + stop(resourceGroupName: string, automationAccountName: string, watcherName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stop(resourceGroupName: string, automationAccountName: string, watcherName: string, callback: ServiceCallback): void; + stop(resourceGroupName: string, automationAccountName: string, watcherName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Retrieve a list of watchers. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @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(resourceGroupName: string, automationAccountName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Retrieve a list of watchers. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @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 {WatcherListResult} - 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. + * + * {WatcherListResult} [result] - The deserialized result object if an error did not occur. + * See {@link WatcherListResult} 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; + + + /** + * Retrieve a list of watchers. + * + * @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 watchers. + * + * @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 {WatcherListResult} - 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. + * + * {WatcherListResult} [result] - The deserialized result object if an error did not occur. + * See {@link WatcherListResult} 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; +} diff --git a/lib/services/automationManagement/lib/operations/index.js b/lib/services/automationManagement/lib/operations/index.js index 63aeffd32f..46a4ceff2f 100644 --- a/lib/services/automationManagement/lib/operations/index.js +++ b/lib/services/automationManagement/lib/operations/index.js @@ -51,3 +51,4 @@ exports.NodeReports = require('./nodeReports'); exports.DscCompilationJobOperations = require('./dscCompilationJobOperations'); exports.DscCompilationJobStream = require('./dscCompilationJobStream'); exports.DscNodeConfigurationOperations = require('./dscNodeConfigurationOperations'); +exports.WatcherOperations = require('./watcherOperations'); diff --git a/lib/services/automationManagement/lib/operations/sourceControlSyncJobStreams.js b/lib/services/automationManagement/lib/operations/sourceControlSyncJobStreams.js new file mode 100644 index 0000000000..b4ca7b0de9 --- /dev/null +++ b/lib/services/automationManagement/lib/operations/sourceControlSyncJobStreams.js @@ -0,0 +1,801 @@ +/* + * 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 a list of sync job streams identified by sync job id. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. + * + * @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 SourceControlSyncJobStreamsListBySyncJob} + * 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 _listBySyncJob(resourceGroupName, 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 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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { + throw new Error('automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (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 (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/{sourceControlSyncJobId}/streams'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(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 = []; + 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['SourceControlSyncJobStreamsListBySyncJob']().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 sync job stream identified by stream id. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. + * + * @param {string} streamId The id of the sync job stream. + * + * @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 SourceControlSyncJobStreamById} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobId, streamId, 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { + throw new Error('automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (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 (streamId === null || streamId === undefined || typeof streamId.valueOf() !== 'string') { + throw new Error('streamId 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}/sourceControlSyncJobs/{sourceControlSyncJobId}/streams/{streamId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{sourceControlName}', encodeURIComponent(sourceControlName)); + requestUrl = requestUrl.replace('{sourceControlSyncJobId}', encodeURIComponent(sourceControlSyncJobId.toString())); + requestUrl = requestUrl.replace('{streamId}', encodeURIComponent(streamId)); + 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['SourceControlSyncJobStreamById']().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 sync job streams identified by sync job id. + * + * @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 SourceControlSyncJobStreamsListBySyncJob} + * 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 _listBySyncJobNext(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['SourceControlSyncJobStreamsListBySyncJob']().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 SourceControlSyncJobStreams. */ +class SourceControlSyncJobStreams { + /** + * Create a SourceControlSyncJobStreams. + * @param {AutomationClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listBySyncJob = _listBySyncJob; + this._get = _get; + this._listBySyncJobNext = _listBySyncJobNext; + } + + /** + * Retrieve a list of sync job streams identified by sync job id. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. + * + * @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. + */ + listBySyncJobWithHttpOperationResponse(resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBySyncJob(resourceGroupName, 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 a list of sync job streams identified by sync job id. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. + * + * @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 {SourceControlSyncJobStreamsListBySyncJob} - 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 SourceControlSyncJobStreamsListBySyncJob} + * 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. + */ + listBySyncJob(resourceGroupName, 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._listBySyncJob(resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBySyncJob(resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobId, options, optionalCallback); + } + } + + /** + * Retrieve a sync job stream identified by stream id. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. + * + * @param {string} streamId The id of the sync job stream. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobId, streamId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobId, streamId, 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 sync job stream identified by stream id. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The name of the automation account. + * + * @param {string} sourceControlName The source control name. + * + * @param {uuid} sourceControlSyncJobId The source control sync job id. + * + * @param {string} streamId The id of the sync job stream. + * + * @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 {SourceControlSyncJobStreamById} - 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 SourceControlSyncJobStreamById} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobId, streamId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobId, streamId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, automationAccountName, sourceControlName, sourceControlSyncJobId, streamId, options, optionalCallback); + } + } + + /** + * Retrieve a list of sync job streams identified by sync job id. + * + * @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. + */ + listBySyncJobNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBySyncJobNext(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 sync job streams identified by sync job id. + * + * @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 {SourceControlSyncJobStreamsListBySyncJob} - 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 SourceControlSyncJobStreamsListBySyncJob} + * 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. + */ + listBySyncJobNext(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._listBySyncJobNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBySyncJobNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = SourceControlSyncJobStreams; diff --git a/lib/services/automationManagement/lib/operations/watcherOperations.js b/lib/services/automationManagement/lib/operations/watcherOperations.js new file mode 100644 index 0000000000..14fba40d13 --- /dev/null +++ b/lib/services/automationManagement/lib/operations/watcherOperations.js @@ -0,0 +1,2114 @@ +/* + * 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 the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} parameters The create or update parameters for watcher. + * + * @param {number} [parameters.executionFrequencyInSeconds] Gets or sets the + * frequency at which the watcher is invoked. + * + * @param {string} [parameters.scriptName] Gets or sets the name of the script + * the watcher is attached to, i.e. the name of an existing runbook. + * + * @param {object} [parameters.scriptParameters] Gets or sets the parameters of + * the script. + * + * @param {string} [parameters.scriptRunOn] Gets or sets the name of the hybrid + * worker group the watcher will run on. + * + * @param {string} [parameters.description] Gets or sets the description. + * + * @param {string} [parameters.etag] Gets or sets the etag of the resource. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.location] The Azure Region where the resource + * lives + * + * @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 Watcher} 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, watcherName, 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { + throw new Error('automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (watcherName === null || watcherName === undefined || typeof watcherName.valueOf() !== 'string') { + throw new Error('watcherName 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}/watchers/{watcherName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{watcherName}', encodeURIComponent(watcherName)); + 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['Watcher']().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['Watcher']().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['Watcher']().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); + }); +} + +/** + * Retrieve the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher 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 Watcher} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, automationAccountName, watcherName, 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { + throw new Error('automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (watcherName === null || watcherName === undefined || typeof watcherName.valueOf() !== 'string') { + throw new Error('watcherName 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}/watchers/{watcherName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{watcherName}', encodeURIComponent(watcherName)); + 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['Watcher']().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); + }); +} + +/** + * Update the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} parameters The update parameters for watcher. + * + * @param {number} [parameters.executionFrequencyInSeconds] Gets or sets the + * frequency at which the watcher is invoked. + * + * @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 {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 Watcher} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, automationAccountName, watcherName, 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { + throw new Error('automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (watcherName === null || watcherName === undefined || typeof watcherName.valueOf() !== 'string') { + throw new Error('watcherName 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}/watchers/{watcherName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{watcherName}', encodeURIComponent(watcherName)); + 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['WatcherUpdateParameters']().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['Watcher']().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 watcher by name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, automationAccountName, watcherName, 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { + throw new Error('automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (watcherName === null || watcherName === undefined || typeof watcherName.valueOf() !== 'string') { + throw new Error('watcherName 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}/watchers/{watcherName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{watcherName}', encodeURIComponent(watcherName)); + 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); + }); +} + +/** + * Resume the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher 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 _start(resourceGroupName, automationAccountName, watcherName, 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { + throw new Error('automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (watcherName === null || watcherName === undefined || typeof watcherName.valueOf() !== 'string') { + throw new Error('watcherName 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}/watchers/{watcherName}/start'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{watcherName}', encodeURIComponent(watcherName)); + 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 = '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); + }); +} + +/** + * Resume the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher 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(resourceGroupName, automationAccountName, watcherName, 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { + throw new Error('automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (watcherName === null || watcherName === undefined || typeof watcherName.valueOf() !== 'string') { + throw new Error('watcherName 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}/watchers/{watcherName}/stop'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{automationAccountName}', encodeURIComponent(automationAccountName)); + requestUrl = requestUrl.replace('{watcherName}', encodeURIComponent(watcherName)); + 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 = '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); + }); +} + +/** + * Retrieve a list of watchers. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @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 WatcherListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByAutomationAccount(resourceGroupName, automationAccountName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let 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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._]+$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._]+$/'); + } + } + if (automationAccountName === null || automationAccountName === undefined || typeof automationAccountName.valueOf() !== 'string') { + throw new Error('automationAccountName cannot be null or undefined and it must be of type string.'); + } + if (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}/watchers'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(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['WatcherListResult']().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 watchers. + * + * @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 WatcherListResult} 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['WatcherListResult']().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 WatcherOperations. */ +class WatcherOperations { + /** + * Create a WatcherOperations. + * @param {AutomationClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._start = _start; + this._stop = _stop; + this._listByAutomationAccount = _listByAutomationAccount; + this._listByAutomationAccountNext = _listByAutomationAccountNext; + } + + /** + * Create the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} parameters The create or update parameters for watcher. + * + * @param {number} [parameters.executionFrequencyInSeconds] Gets or sets the + * frequency at which the watcher is invoked. + * + * @param {string} [parameters.scriptName] Gets or sets the name of the script + * the watcher is attached to, i.e. the name of an existing runbook. + * + * @param {object} [parameters.scriptParameters] Gets or sets the parameters of + * the script. + * + * @param {string} [parameters.scriptRunOn] Gets or sets the name of the hybrid + * worker group the watcher will run on. + * + * @param {string} [parameters.description] Gets or sets the description. + * + * @param {string} [parameters.etag] Gets or sets the etag of the resource. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.location] The Azure Region where the resource + * lives + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, automationAccountName, watcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, automationAccountName, watcherName, 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 the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} parameters The create or update parameters for watcher. + * + * @param {number} [parameters.executionFrequencyInSeconds] Gets or sets the + * frequency at which the watcher is invoked. + * + * @param {string} [parameters.scriptName] Gets or sets the name of the script + * the watcher is attached to, i.e. the name of an existing runbook. + * + * @param {object} [parameters.scriptParameters] Gets or sets the parameters of + * the script. + * + * @param {string} [parameters.scriptRunOn] Gets or sets the name of the hybrid + * worker group the watcher will run on. + * + * @param {string} [parameters.description] Gets or sets the description. + * + * @param {string} [parameters.etag] Gets or sets the etag of the resource. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} [parameters.location] The Azure Region where the resource + * lives + * + * @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 {Watcher} - 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 Watcher} 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, watcherName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, automationAccountName, watcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, automationAccountName, watcherName, parameters, options, optionalCallback); + } + } + + /** + * Retrieve the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, automationAccountName, watcherName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, automationAccountName, watcherName, 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 watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher 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 {Watcher} - 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 Watcher} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, automationAccountName, watcherName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, automationAccountName, watcherName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, automationAccountName, watcherName, options, optionalCallback); + } + } + + /** + * Update the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} parameters The update parameters for watcher. + * + * @param {number} [parameters.executionFrequencyInSeconds] Gets or sets the + * frequency at which the watcher is invoked. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, automationAccountName, watcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, automationAccountName, watcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Update the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} parameters The update parameters for watcher. + * + * @param {number} [parameters.executionFrequencyInSeconds] Gets or sets the + * frequency at which the watcher is invoked. + * + * @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 {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 {Watcher} - 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 Watcher} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, automationAccountName, watcherName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, automationAccountName, watcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, automationAccountName, watcherName, parameters, options, optionalCallback); + } + } + + /** + * Delete the watcher by name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, automationAccountName, watcherName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, automationAccountName, watcherName, 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 watcher by name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, automationAccountName, watcherName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, automationAccountName, watcherName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, automationAccountName, watcherName, options, optionalCallback); + } + } + + /** + * Resume the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher 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. + */ + startWithHttpOperationResponse(resourceGroupName, automationAccountName, watcherName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._start(resourceGroupName, automationAccountName, watcherName, 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 watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher 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. + */ + start(resourceGroupName, automationAccountName, watcherName, 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._start(resourceGroupName, automationAccountName, watcherName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._start(resourceGroupName, automationAccountName, watcherName, options, optionalCallback); + } + } + + /** + * Resume the watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher 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(resourceGroupName, automationAccountName, watcherName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stop(resourceGroupName, automationAccountName, watcherName, 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 watcher identified by watcher name. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @param {string} automationAccountName The automation account name. + * + * @param {string} watcherName The watcher 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(resourceGroupName, automationAccountName, watcherName, 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(resourceGroupName, automationAccountName, watcherName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stop(resourceGroupName, automationAccountName, watcherName, options, optionalCallback); + } + } + + /** + * Retrieve a list of watchers. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @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(resourceGroupName, automationAccountName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieve a list of watchers. + * + * @param {string} resourceGroupName Name of an Azure Resource group. + * + * @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 {WatcherListResult} - 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 WatcherListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByAutomationAccount(resourceGroupName, automationAccountName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByAutomationAccount(resourceGroupName, automationAccountName, options, optionalCallback); + } + } + + /** + * Retrieve a list of watchers. + * + * @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 watchers. + * + * @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 {WatcherListResult} - 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 WatcherListResult} 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 = WatcherOperations; diff --git a/lib/services/automationManagement/package.json b/lib/services/automationManagement/package.json index 316d5d998e..97b4adff35 100644 --- a/lib/services/automationManagement/package.json +++ b/lib/services/automationManagement/package.json @@ -4,10 +4,13 @@ "description": "AutomationClient Library with typescript type definitions for node", "version": "3.0.0-preview", "dependencies": { - "ms-rest": "^2.3.2", + "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" }, - "keywords": [ "node", "azure" ], + "keywords": [ + "node", + "azure" + ], "license": "MIT", "main": "./lib/automationClient.js", "types": "./lib/automationClient.d.ts",