diff --git a/lib/services/automationManagement/lib/automationClient.d.ts b/lib/services/automationManagement/lib/automationClient.d.ts index 27ddad23f6..f1d8dc4cac 100644 --- a/lib/services/automationManagement/lib/automationClient.d.ts +++ b/lib/services/automationManagement/lib/automationClient.d.ts @@ -83,6 +83,7 @@ export default class AutomationClient extends AzureServiceClient { softwareUpdateConfigurationMachineRuns: operations.SoftwareUpdateConfigurationMachineRuns; sourceControlOperations: operations.SourceControlOperations; sourceControlSyncJobOperations: operations.SourceControlSyncJobOperations; + sourceControlSyncJobStreams: operations.SourceControlSyncJobStreams; jobOperations: operations.JobOperations; jobStreamOperations: operations.JobStreamOperations; agentRegistrationInformation: operations.AgentRegistrationInformation; diff --git a/lib/services/automationManagement/lib/automationClient.js b/lib/services/automationManagement/lib/automationClient.js index 569bd56c6e..ccbbfeef5e 100644 --- a/lib/services/automationManagement/lib/automationClient.js +++ b/lib/services/automationManagement/lib/automationClient.js @@ -100,6 +100,7 @@ class AutomationClient extends ServiceClient { this.softwareUpdateConfigurationMachineRuns = new operations.SoftwareUpdateConfigurationMachineRuns(this); this.sourceControlOperations = new operations.SourceControlOperations(this); this.sourceControlSyncJobOperations = new operations.SourceControlSyncJobOperations(this); + this.sourceControlSyncJobStreams = new operations.SourceControlSyncJobStreams(this); this.jobOperations = new operations.JobOperations(this); this.jobStreamOperations = new operations.JobStreamOperations(this); this.agentRegistrationInformation = new operations.AgentRegistrationInformation(this); diff --git a/lib/services/automationManagement/lib/models/dscNodeConfigurationCreateOrUpdateParameters.js b/lib/services/automationManagement/lib/models/dscNodeConfigurationCreateOrUpdateParameters.js index 7b95ae3cac..385da63714 100644 --- a/lib/services/automationManagement/lib/models/dscNodeConfigurationCreateOrUpdateParameters.js +++ b/lib/services/automationManagement/lib/models/dscNodeConfigurationCreateOrUpdateParameters.js @@ -31,31 +31,12 @@ class DscNodeConfigurationCreateOrUpdateParameters { * @member {string} [source.value] Gets or sets the value of the content. * This is based on the content source type. * @member {string} [source.version] Gets or sets the version of the content. - * @member {string} name Name of the node configuration. * @member {object} configuration Gets or sets the configuration of the node. * @member {string} [configuration.name] Gets or sets the name of the Dsc * configuration. - * @member {boolean} [newNodeConfigurationBuildVersionRequired] If a new - * build version of NodeConfiguration is required. - * @member {object} source1 Gets or sets the source. - * @member {object} [source1.hash] Gets or sets the hash. - * @member {string} [source1.hash.algorithm] Gets or sets the content hash - * algorithm used to hash the content. - * @member {string} [source1.hash.value] Gets or sets expected hash value of - * the content. - * @member {string} [source1.type] Gets or sets the content source type. - * Possible values include: 'embeddedContent', 'uri' - * @member {string} [source1.value] Gets or sets the value of the content. - * This is based on the content source type. - * @member {string} [source1.version] Gets or sets the version of the - * content. - * @member {string} name1 Gets or sets the type of the parameter. - * @member {object} configuration1 Gets or sets the configuration of the - * node. - * @member {string} [configuration1.name] Gets or sets the name of the Dsc - * configuration. * @member {boolean} [incrementNodeConfigurationBuild] If a new build version * of NodeConfiguration is required. + * @member {string} [name] Name of the node configuration. * @member {object} [tags] Gets or sets the tags attached to the resource. */ constructor() { @@ -77,62 +58,32 @@ class DscNodeConfigurationCreateOrUpdateParameters { modelProperties: { source: { required: true, - serializedName: 'source', + serializedName: 'properties.source', type: { name: 'Composite', className: 'ContentSource' } }, - name: { - required: true, - serializedName: 'name', - type: { - name: 'String' - } - }, configuration: { required: true, - serializedName: 'configuration', + serializedName: 'properties.configuration', type: { name: 'Composite', className: 'DscConfigurationAssociationProperty' } }, - newNodeConfigurationBuildVersionRequired: { + incrementNodeConfigurationBuild: { required: false, - serializedName: 'newNodeConfigurationBuildVersionRequired', + serializedName: 'properties.incrementNodeConfigurationBuild', type: { name: 'Boolean' } }, - source1: { - required: true, - serializedName: 'properties.source', - type: { - name: 'Composite', - className: 'ContentSource' - } - }, - name1: { - required: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, - configuration1: { - required: true, - serializedName: 'properties.configuration', - type: { - name: 'Composite', - className: 'DscConfigurationAssociationProperty' - } - }, - incrementNodeConfigurationBuild: { + name: { required: false, - serializedName: 'properties.incrementNodeConfigurationBuild', + serializedName: 'name', type: { - name: 'Boolean' + name: 'String' } }, tags: { diff --git a/lib/services/automationManagement/lib/models/index.d.ts b/lib/services/automationManagement/lib/models/index.d.ts index 60e57de9f5..f72abda39d 100644 --- a/lib/services/automationManagement/lib/models/index.d.ts +++ b/lib/services/automationManagement/lib/models/index.d.ts @@ -1315,61 +1315,6 @@ export interface DscMetaConfiguration { allowModuleOverwrite?: boolean; } -/** - * @class - * Initializes a new instance of the DscNodeConfigurationCreateOrUpdateParameters class. - * @constructor - * The parameters supplied to the create or update node configuration - * operation. - * - * @member {object} source Gets or sets the source. - * @member {object} [source.hash] Gets or sets the hash. - * @member {string} [source.hash.algorithm] Gets or sets the content hash - * algorithm used to hash the content. - * @member {string} [source.hash.value] Gets or sets expected hash value of the - * content. - * @member {string} [source.type] Gets or sets the content source type. - * Possible values include: 'embeddedContent', 'uri' - * @member {string} [source.value] Gets or sets the value of the content. This - * is based on the content source type. - * @member {string} [source.version] Gets or sets the version of the content. - * @member {string} name Name of the node configuration. - * @member {object} configuration Gets or sets the configuration of the node. - * @member {string} [configuration.name] Gets or sets the name of the Dsc - * configuration. - * @member {boolean} [newNodeConfigurationBuildVersionRequired] If a new build - * version of NodeConfiguration is required. - * @member {object} source1 Gets or sets the source. - * @member {object} [source1.hash] Gets or sets the hash. - * @member {string} [source1.hash.algorithm] Gets or sets the content hash - * algorithm used to hash the content. - * @member {string} [source1.hash.value] Gets or sets expected hash value of - * the content. - * @member {string} [source1.type] Gets or sets the content source type. - * Possible values include: 'embeddedContent', 'uri' - * @member {string} [source1.value] Gets or sets the value of the content. This - * is based on the content source type. - * @member {string} [source1.version] Gets or sets the version of the content. - * @member {string} name1 Gets or sets the type of the parameter. - * @member {object} configuration1 Gets or sets the configuration of the node. - * @member {string} [configuration1.name] Gets or sets the name of the Dsc - * configuration. - * @member {boolean} [incrementNodeConfigurationBuild] If a new build version - * of NodeConfiguration is required. - * @member {object} [tags] Gets or sets the tags attached to the resource. - */ -export interface DscNodeConfigurationCreateOrUpdateParameters { - source: ContentSource; - name: string; - configuration: DscConfigurationAssociationProperty; - newNodeConfigurationBuildVersionRequired?: boolean; - source1: ContentSource; - name1: string; - configuration1: DscConfigurationAssociationProperty; - incrementNodeConfigurationBuild?: boolean; - tags?: { [propertyName: string]: string }; -} - /** * @class * Initializes a new instance of the DscNodeConfigurationAssociationProperty class. @@ -3004,6 +2949,52 @@ 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 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. @@ -3064,6 +3055,40 @@ export interface DscNodeConfiguration extends ProxyResource { incrementNodeConfigurationBuild?: boolean; } +/** + * @class + * Initializes a new instance of the DscNodeConfigurationCreateOrUpdateParameters class. + * @constructor + * The parameters supplied to the create or update node configuration + * operation. + * + * @member {object} source Gets or sets the source. + * @member {object} [source.hash] Gets or sets the hash. + * @member {string} [source.hash.algorithm] Gets or sets the content hash + * algorithm used to hash the content. + * @member {string} [source.hash.value] Gets or sets expected hash value of the + * content. + * @member {string} [source.type] Gets or sets the content source type. + * Possible values include: 'embeddedContent', 'uri' + * @member {string} [source.value] Gets or sets the value of the content. This + * is based on the content source type. + * @member {string} [source.version] Gets or sets the version of the content. + * @member {object} configuration Gets or sets the configuration of the node. + * @member {string} [configuration.name] Gets or sets the name of the Dsc + * configuration. + * @member {boolean} [incrementNodeConfigurationBuild] If a new build version + * of NodeConfiguration is required. + * @member {string} [name] Name of the node configuration. + * @member {object} [tags] Gets or sets the tags attached to the resource. + */ +export interface DscNodeConfigurationCreateOrUpdateParameters { + source: ContentSource; + configuration: DscConfigurationAssociationProperty; + incrementNodeConfigurationBuild?: boolean; + name?: string; + tags?: { [propertyName: string]: string }; +} + /** * @class @@ -3319,6 +3344,18 @@ export interface SourceControlSyncJobListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the JobListResultV2 class. diff --git a/lib/services/automationManagement/lib/models/index.js b/lib/services/automationManagement/lib/models/index.js index 67610d8ee5..2a90aceae7 100644 --- a/lib/services/automationManagement/lib/models/index.js +++ b/lib/services/automationManagement/lib/models/index.js @@ -74,7 +74,6 @@ exports.DscCompilationJobCreateParameters = require('./dscCompilationJobCreatePa exports.DscConfigurationCreateOrUpdateParameters = require('./dscConfigurationCreateOrUpdateParameters'); exports.DscConfigurationUpdateParameters = require('./dscConfigurationUpdateParameters'); exports.DscMetaConfiguration = require('./dscMetaConfiguration'); -exports.DscNodeConfigurationCreateOrUpdateParameters = require('./dscNodeConfigurationCreateOrUpdateParameters'); exports.DscNodeConfigurationAssociationProperty = require('./dscNodeConfigurationAssociationProperty'); exports.DscNodeExtensionHandlerAssociationProperty = require('./dscNodeExtensionHandlerAssociationProperty'); exports.DscNodeUpdateParametersProperties = require('./dscNodeUpdateParametersProperties'); @@ -134,8 +133,11 @@ exports.SourceControlUpdateParameters = require('./sourceControlUpdateParameters exports.SourceControlSyncJob = require('./sourceControlSyncJob'); exports.SourceControlSyncJobCreateParameters = require('./sourceControlSyncJobCreateParameters'); exports.SourceControlSyncJobById = require('./sourceControlSyncJobById'); +exports.SourceControlSyncJobStream = require('./sourceControlSyncJobStream'); +exports.SourceControlSyncJobStreamById = require('./sourceControlSyncJobStreamById'); exports.DscNode = require('./dscNode'); exports.DscNodeConfiguration = require('./dscNodeConfiguration'); +exports.DscNodeConfigurationCreateOrUpdateParameters = require('./dscNodeConfigurationCreateOrUpdateParameters'); exports.AutomationAccountListResult = require('./automationAccountListResult'); exports.OperationListResult = require('./operationListResult'); exports.StatisticsListResult = require('./statisticsListResult'); @@ -158,6 +160,7 @@ exports.VariableListResult = require('./variableListResult'); exports.WebhookListResult = require('./webhookListResult'); exports.SourceControlListResult = require('./sourceControlListResult'); exports.SourceControlSyncJobListResult = require('./sourceControlSyncJobListResult'); +exports.SourceControlSyncJobStreamsListBySyncJob = require('./sourceControlSyncJobStreamsListBySyncJob'); exports.JobListResultV2 = require('./jobListResultV2'); exports.DscNodeListResult = require('./dscNodeListResult'); exports.DscNodeReportListResult = require('./dscNodeReportListResult'); 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..1bd26279c6 --- /dev/null +++ b/lib/services/automationManagement/lib/models/sourceControlSyncJobStreamsListBySyncJob.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The response model for the list source control sync job streams operation. + */ +class SourceControlSyncJobStreamsListBySyncJob extends Array { + /** + * Create a SourceControlSyncJobStreamsListBySyncJob. + * @member {string} [nextLink] Gets or sets the next link. + */ + constructor() { + super(); + } + + /** + * 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: '', + 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/operations/dscNodeConfigurationOperations.js b/lib/services/automationManagement/lib/operations/dscNodeConfigurationOperations.js index 788298eb6b..92be1691db 100644 --- a/lib/services/automationManagement/lib/operations/dscNodeConfigurationOperations.js +++ b/lib/services/automationManagement/lib/operations/dscNodeConfigurationOperations.js @@ -339,44 +339,34 @@ function _get(resourceGroupName, automationAccountName, nodeConfigurationName, o * * @param {object} parameters.source Gets or sets the source. * - * @param {string} parameters.name Name of the node configuration. + * @param {object} [parameters.source.hash] Gets or sets the hash. * - * @param {object} parameters.configuration Gets or sets the configuration of - * the node. - * - * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a - * new build version of NodeConfiguration is required. - * - * @param {object} parameters.source1 Gets or sets the source. - * - * @param {object} [parameters.source1.hash] Gets or sets the hash. - * - * @param {string} parameters.source1.hash.algorithm Gets or sets the content + * @param {string} parameters.source.hash.algorithm Gets or sets the content * hash algorithm used to hash the content. * - * @param {string} parameters.source1.hash.value Gets or sets expected hash + * @param {string} parameters.source.hash.value Gets or sets expected hash * value of the content. * - * @param {string} [parameters.source1.type] Gets or sets the content source + * @param {string} [parameters.source.type] Gets or sets the content source * type. Possible values include: 'embeddedContent', 'uri' * - * @param {string} [parameters.source1.value] Gets or sets the value of the + * @param {string} [parameters.source.value] Gets or sets the value of the * content. This is based on the content source type. * - * @param {string} [parameters.source1.version] Gets or sets the version of the + * @param {string} [parameters.source.version] Gets or sets the version of the * content. * - * @param {string} parameters.name1 Gets or sets the type of the parameter. - * - * @param {object} parameters.configuration1 Gets or sets the configuration of + * @param {object} parameters.configuration Gets or sets the configuration of * the node. * - * @param {string} [parameters.configuration1.name] Gets or sets the name of - * the Dsc configuration. + * @param {string} [parameters.configuration.name] Gets or sets the name of the + * Dsc configuration. * * @param {boolean} [parameters.incrementNodeConfigurationBuild] If a new build * version of NodeConfiguration is required. * + * @param {string} [parameters.name] Name of the node configuration. + * * @param {object} [parameters.tags] Gets or sets the tags attached to the * resource. * @@ -659,44 +649,34 @@ function _listByAutomationAccount(resourceGroupName, automationAccountName, opti * * @param {object} parameters.source Gets or sets the source. * - * @param {string} parameters.name Name of the node configuration. - * - * @param {object} parameters.configuration Gets or sets the configuration of - * the node. - * - * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a - * new build version of NodeConfiguration is required. - * - * @param {object} parameters.source1 Gets or sets the source. + * @param {object} [parameters.source.hash] Gets or sets the hash. * - * @param {object} [parameters.source1.hash] Gets or sets the hash. - * - * @param {string} parameters.source1.hash.algorithm Gets or sets the content + * @param {string} parameters.source.hash.algorithm Gets or sets the content * hash algorithm used to hash the content. * - * @param {string} parameters.source1.hash.value Gets or sets expected hash + * @param {string} parameters.source.hash.value Gets or sets expected hash * value of the content. * - * @param {string} [parameters.source1.type] Gets or sets the content source + * @param {string} [parameters.source.type] Gets or sets the content source * type. Possible values include: 'embeddedContent', 'uri' * - * @param {string} [parameters.source1.value] Gets or sets the value of the + * @param {string} [parameters.source.value] Gets or sets the value of the * content. This is based on the content source type. * - * @param {string} [parameters.source1.version] Gets or sets the version of the + * @param {string} [parameters.source.version] Gets or sets the version of the * content. * - * @param {string} parameters.name1 Gets or sets the type of the parameter. - * - * @param {object} parameters.configuration1 Gets or sets the configuration of + * @param {object} parameters.configuration Gets or sets the configuration of * the node. * - * @param {string} [parameters.configuration1.name] Gets or sets the name of - * the Dsc configuration. + * @param {string} [parameters.configuration.name] Gets or sets the name of the + * Dsc configuration. * * @param {boolean} [parameters.incrementNodeConfigurationBuild] If a new build * version of NodeConfiguration is required. * + * @param {string} [parameters.name] Name of the node configuration. + * * @param {object} [parameters.tags] Gets or sets the tags attached to the * resource. * @@ -1210,44 +1190,34 @@ class DscNodeConfigurationOperations { * * @param {object} parameters.source Gets or sets the source. * - * @param {string} parameters.name Name of the node configuration. - * - * @param {object} parameters.configuration Gets or sets the configuration of - * the node. + * @param {object} [parameters.source.hash] Gets or sets the hash. * - * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a - * new build version of NodeConfiguration is required. - * - * @param {object} parameters.source1 Gets or sets the source. - * - * @param {object} [parameters.source1.hash] Gets or sets the hash. - * - * @param {string} parameters.source1.hash.algorithm Gets or sets the content + * @param {string} parameters.source.hash.algorithm Gets or sets the content * hash algorithm used to hash the content. * - * @param {string} parameters.source1.hash.value Gets or sets expected hash + * @param {string} parameters.source.hash.value Gets or sets expected hash * value of the content. * - * @param {string} [parameters.source1.type] Gets or sets the content source + * @param {string} [parameters.source.type] Gets or sets the content source * type. Possible values include: 'embeddedContent', 'uri' * - * @param {string} [parameters.source1.value] Gets or sets the value of the + * @param {string} [parameters.source.value] Gets or sets the value of the * content. This is based on the content source type. * - * @param {string} [parameters.source1.version] Gets or sets the version of the + * @param {string} [parameters.source.version] Gets or sets the version of the * content. * - * @param {string} parameters.name1 Gets or sets the type of the parameter. - * - * @param {object} parameters.configuration1 Gets or sets the configuration of + * @param {object} parameters.configuration Gets or sets the configuration of * the node. * - * @param {string} [parameters.configuration1.name] Gets or sets the name of - * the Dsc configuration. + * @param {string} [parameters.configuration.name] Gets or sets the name of the + * Dsc configuration. * * @param {boolean} [parameters.incrementNodeConfigurationBuild] If a new build * version of NodeConfiguration is required. * + * @param {string} [parameters.name] Name of the node configuration. + * * @param {object} [parameters.tags] Gets or sets the tags attached to the * resource. * @@ -1290,44 +1260,34 @@ class DscNodeConfigurationOperations { * * @param {object} parameters.source Gets or sets the source. * - * @param {string} parameters.name Name of the node configuration. + * @param {object} [parameters.source.hash] Gets or sets the hash. * - * @param {object} parameters.configuration Gets or sets the configuration of - * the node. - * - * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a - * new build version of NodeConfiguration is required. - * - * @param {object} parameters.source1 Gets or sets the source. - * - * @param {object} [parameters.source1.hash] Gets or sets the hash. - * - * @param {string} parameters.source1.hash.algorithm Gets or sets the content + * @param {string} parameters.source.hash.algorithm Gets or sets the content * hash algorithm used to hash the content. * - * @param {string} parameters.source1.hash.value Gets or sets expected hash + * @param {string} parameters.source.hash.value Gets or sets expected hash * value of the content. * - * @param {string} [parameters.source1.type] Gets or sets the content source + * @param {string} [parameters.source.type] Gets or sets the content source * type. Possible values include: 'embeddedContent', 'uri' * - * @param {string} [parameters.source1.value] Gets or sets the value of the + * @param {string} [parameters.source.value] Gets or sets the value of the * content. This is based on the content source type. * - * @param {string} [parameters.source1.version] Gets or sets the version of the + * @param {string} [parameters.source.version] Gets or sets the version of the * content. * - * @param {string} parameters.name1 Gets or sets the type of the parameter. - * - * @param {object} parameters.configuration1 Gets or sets the configuration of + * @param {object} parameters.configuration Gets or sets the configuration of * the node. * - * @param {string} [parameters.configuration1.name] Gets or sets the name of - * the Dsc configuration. + * @param {string} [parameters.configuration.name] Gets or sets the name of the + * Dsc configuration. * * @param {boolean} [parameters.incrementNodeConfigurationBuild] If a new build * version of NodeConfiguration is required. * + * @param {string} [parameters.name] Name of the node configuration. + * * @param {object} [parameters.tags] Gets or sets the tags attached to the * resource. * @@ -1495,44 +1455,34 @@ class DscNodeConfigurationOperations { * * @param {object} parameters.source Gets or sets the source. * - * @param {string} parameters.name Name of the node configuration. - * - * @param {object} parameters.configuration Gets or sets the configuration of - * the node. - * - * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a - * new build version of NodeConfiguration is required. - * - * @param {object} parameters.source1 Gets or sets the source. + * @param {object} [parameters.source.hash] Gets or sets the hash. * - * @param {object} [parameters.source1.hash] Gets or sets the hash. - * - * @param {string} parameters.source1.hash.algorithm Gets or sets the content + * @param {string} parameters.source.hash.algorithm Gets or sets the content * hash algorithm used to hash the content. * - * @param {string} parameters.source1.hash.value Gets or sets expected hash + * @param {string} parameters.source.hash.value Gets or sets expected hash * value of the content. * - * @param {string} [parameters.source1.type] Gets or sets the content source + * @param {string} [parameters.source.type] Gets or sets the content source * type. Possible values include: 'embeddedContent', 'uri' * - * @param {string} [parameters.source1.value] Gets or sets the value of the + * @param {string} [parameters.source.value] Gets or sets the value of the * content. This is based on the content source type. * - * @param {string} [parameters.source1.version] Gets or sets the version of the + * @param {string} [parameters.source.version] Gets or sets the version of the * content. * - * @param {string} parameters.name1 Gets or sets the type of the parameter. - * - * @param {object} parameters.configuration1 Gets or sets the configuration of + * @param {object} parameters.configuration Gets or sets the configuration of * the node. * - * @param {string} [parameters.configuration1.name] Gets or sets the name of - * the Dsc configuration. + * @param {string} [parameters.configuration.name] Gets or sets the name of the + * Dsc configuration. * * @param {boolean} [parameters.incrementNodeConfigurationBuild] If a new build * version of NodeConfiguration is required. * + * @param {string} [parameters.name] Name of the node configuration. + * * @param {object} [parameters.tags] Gets or sets the tags attached to the * resource. * @@ -1575,44 +1525,34 @@ class DscNodeConfigurationOperations { * * @param {object} parameters.source Gets or sets the source. * - * @param {string} parameters.name Name of the node configuration. - * - * @param {object} parameters.configuration Gets or sets the configuration of - * the node. + * @param {object} [parameters.source.hash] Gets or sets the hash. * - * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a - * new build version of NodeConfiguration is required. - * - * @param {object} parameters.source1 Gets or sets the source. - * - * @param {object} [parameters.source1.hash] Gets or sets the hash. - * - * @param {string} parameters.source1.hash.algorithm Gets or sets the content + * @param {string} parameters.source.hash.algorithm Gets or sets the content * hash algorithm used to hash the content. * - * @param {string} parameters.source1.hash.value Gets or sets expected hash + * @param {string} parameters.source.hash.value Gets or sets expected hash * value of the content. * - * @param {string} [parameters.source1.type] Gets or sets the content source + * @param {string} [parameters.source.type] Gets or sets the content source * type. Possible values include: 'embeddedContent', 'uri' * - * @param {string} [parameters.source1.value] Gets or sets the value of the + * @param {string} [parameters.source.value] Gets or sets the value of the * content. This is based on the content source type. * - * @param {string} [parameters.source1.version] Gets or sets the version of the + * @param {string} [parameters.source.version] Gets or sets the version of the * content. * - * @param {string} parameters.name1 Gets or sets the type of the parameter. - * - * @param {object} parameters.configuration1 Gets or sets the configuration of + * @param {object} parameters.configuration Gets or sets the configuration of * the node. * - * @param {string} [parameters.configuration1.name] Gets or sets the name of - * the Dsc configuration. + * @param {string} [parameters.configuration.name] Gets or sets the name of the + * Dsc configuration. * * @param {boolean} [parameters.incrementNodeConfigurationBuild] If a new build * version of NodeConfiguration is required. * + * @param {string} [parameters.name] Name of the node configuration. + * * @param {object} [parameters.tags] Gets or sets the tags attached to the * resource. * diff --git a/lib/services/automationManagement/lib/operations/index.d.ts b/lib/services/automationManagement/lib/operations/index.d.ts index 9839e76a37..dfc15b7143 100644 --- a/lib/services/automationManagement/lib/operations/index.d.ts +++ b/lib/services/automationManagement/lib/operations/index.d.ts @@ -9396,6 +9396,217 @@ export interface SourceControlSyncJobOperations { listByAutomationAccountNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * SourceControlSyncJobStreams + * __NOTE__: An instance of this class is automatically created for an + * instance of the AutomationClient. + */ +export interface SourceControlSyncJobStreams { + + + /** + * 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|ServiceError} - The error object. + */ + listBySyncJobWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, sourceControlName: string, sourceControlSyncJobId: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {SourceControlSyncJobStreamsListBySyncJob} - 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. + * + * {SourceControlSyncJobStreamsListBySyncJob} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControlSyncJobStreamsListBySyncJob} + * 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. + */ + listBySyncJob(resourceGroupName: string, automationAccountName: string, sourceControlName: string, sourceControlSyncJobId: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listBySyncJob(resourceGroupName: string, automationAccountName: string, sourceControlName: string, sourceControlSyncJobId: string, callback: ServiceCallback): void; + listBySyncJob(resourceGroupName: string, automationAccountName: string, sourceControlName: string, sourceControlSyncJobId: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * 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|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, automationAccountName: string, sourceControlName: string, sourceControlSyncJobId: string, streamId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {SourceControlSyncJobStreamById} - 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. + * + * {SourceControlSyncJobStreamById} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControlSyncJobStreamById} 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, sourceControlName: string, sourceControlSyncJobId: string, streamId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, automationAccountName: string, sourceControlName: string, sourceControlSyncJobId: string, streamId: string, callback: ServiceCallback): void; + get(resourceGroupName: string, automationAccountName: string, sourceControlName: string, sourceControlSyncJobId: string, streamId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * 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|ServiceError} - The error object. + */ + listBySyncJobNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {SourceControlSyncJobStreamsListBySyncJob} - 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. + * + * {SourceControlSyncJobStreamsListBySyncJob} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControlSyncJobStreamsListBySyncJob} + * 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. + */ + listBySyncJobNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySyncJobNext(nextPageLink: string, callback: ServiceCallback): void; + listBySyncJobNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * JobOperations @@ -11743,44 +11954,34 @@ export interface DscNodeConfigurationOperations { * * @param {object} parameters.source Gets or sets the source. * - * @param {string} parameters.name Name of the node configuration. - * - * @param {object} parameters.configuration Gets or sets the configuration of - * the node. - * - * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a - * new build version of NodeConfiguration is required. - * - * @param {object} parameters.source1 Gets or sets the source. - * - * @param {object} [parameters.source1.hash] Gets or sets the hash. + * @param {object} [parameters.source.hash] Gets or sets the hash. * - * @param {string} parameters.source1.hash.algorithm Gets or sets the content + * @param {string} parameters.source.hash.algorithm Gets or sets the content * hash algorithm used to hash the content. * - * @param {string} parameters.source1.hash.value Gets or sets expected hash + * @param {string} parameters.source.hash.value Gets or sets expected hash * value of the content. * - * @param {string} [parameters.source1.type] Gets or sets the content source + * @param {string} [parameters.source.type] Gets or sets the content source * type. Possible values include: 'embeddedContent', 'uri' * - * @param {string} [parameters.source1.value] Gets or sets the value of the + * @param {string} [parameters.source.value] Gets or sets the value of the * content. This is based on the content source type. * - * @param {string} [parameters.source1.version] Gets or sets the version of the + * @param {string} [parameters.source.version] Gets or sets the version of the * content. * - * @param {string} parameters.name1 Gets or sets the type of the parameter. - * - * @param {object} parameters.configuration1 Gets or sets the configuration of + * @param {object} parameters.configuration Gets or sets the configuration of * the node. * - * @param {string} [parameters.configuration1.name] Gets or sets the name of - * the Dsc configuration. + * @param {string} [parameters.configuration.name] Gets or sets the name of the + * Dsc configuration. * * @param {boolean} [parameters.incrementNodeConfigurationBuild] If a new build * version of NodeConfiguration is required. * + * @param {string} [parameters.name] Name of the node configuration. + * * @param {object} [parameters.tags] Gets or sets the tags attached to the * resource. * @@ -11811,44 +12012,34 @@ export interface DscNodeConfigurationOperations { * * @param {object} parameters.source Gets or sets the source. * - * @param {string} parameters.name Name of the node configuration. - * - * @param {object} parameters.configuration Gets or sets the configuration of - * the node. - * - * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a - * new build version of NodeConfiguration is required. - * - * @param {object} parameters.source1 Gets or sets the source. - * - * @param {object} [parameters.source1.hash] Gets or sets the hash. + * @param {object} [parameters.source.hash] Gets or sets the hash. * - * @param {string} parameters.source1.hash.algorithm Gets or sets the content + * @param {string} parameters.source.hash.algorithm Gets or sets the content * hash algorithm used to hash the content. * - * @param {string} parameters.source1.hash.value Gets or sets expected hash + * @param {string} parameters.source.hash.value Gets or sets expected hash * value of the content. * - * @param {string} [parameters.source1.type] Gets or sets the content source + * @param {string} [parameters.source.type] Gets or sets the content source * type. Possible values include: 'embeddedContent', 'uri' * - * @param {string} [parameters.source1.value] Gets or sets the value of the + * @param {string} [parameters.source.value] Gets or sets the value of the * content. This is based on the content source type. * - * @param {string} [parameters.source1.version] Gets or sets the version of the + * @param {string} [parameters.source.version] Gets or sets the version of the * content. * - * @param {string} parameters.name1 Gets or sets the type of the parameter. - * - * @param {object} parameters.configuration1 Gets or sets the configuration of + * @param {object} parameters.configuration Gets or sets the configuration of * the node. * - * @param {string} [parameters.configuration1.name] Gets or sets the name of - * the Dsc configuration. + * @param {string} [parameters.configuration.name] Gets or sets the name of the + * Dsc configuration. * * @param {boolean} [parameters.incrementNodeConfigurationBuild] If a new build * version of NodeConfiguration is required. * + * @param {string} [parameters.name] Name of the node configuration. + * * @param {object} [parameters.tags] Gets or sets the tags attached to the * resource. * @@ -11974,44 +12165,34 @@ export interface DscNodeConfigurationOperations { * * @param {object} parameters.source Gets or sets the source. * - * @param {string} parameters.name Name of the node configuration. - * - * @param {object} parameters.configuration Gets or sets the configuration of - * the node. - * - * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a - * new build version of NodeConfiguration is required. - * - * @param {object} parameters.source1 Gets or sets the source. - * - * @param {object} [parameters.source1.hash] Gets or sets the hash. + * @param {object} [parameters.source.hash] Gets or sets the hash. * - * @param {string} parameters.source1.hash.algorithm Gets or sets the content + * @param {string} parameters.source.hash.algorithm Gets or sets the content * hash algorithm used to hash the content. * - * @param {string} parameters.source1.hash.value Gets or sets expected hash + * @param {string} parameters.source.hash.value Gets or sets expected hash * value of the content. * - * @param {string} [parameters.source1.type] Gets or sets the content source + * @param {string} [parameters.source.type] Gets or sets the content source * type. Possible values include: 'embeddedContent', 'uri' * - * @param {string} [parameters.source1.value] Gets or sets the value of the + * @param {string} [parameters.source.value] Gets or sets the value of the * content. This is based on the content source type. * - * @param {string} [parameters.source1.version] Gets or sets the version of the + * @param {string} [parameters.source.version] Gets or sets the version of the * content. * - * @param {string} parameters.name1 Gets or sets the type of the parameter. - * - * @param {object} parameters.configuration1 Gets or sets the configuration of + * @param {object} parameters.configuration Gets or sets the configuration of * the node. * - * @param {string} [parameters.configuration1.name] Gets or sets the name of - * the Dsc configuration. + * @param {string} [parameters.configuration.name] Gets or sets the name of the + * Dsc configuration. * * @param {boolean} [parameters.incrementNodeConfigurationBuild] If a new build * version of NodeConfiguration is required. * + * @param {string} [parameters.name] Name of the node configuration. + * * @param {object} [parameters.tags] Gets or sets the tags attached to the * resource. * @@ -12042,44 +12223,34 @@ export interface DscNodeConfigurationOperations { * * @param {object} parameters.source Gets or sets the source. * - * @param {string} parameters.name Name of the node configuration. - * - * @param {object} parameters.configuration Gets or sets the configuration of - * the node. - * - * @param {boolean} [parameters.newNodeConfigurationBuildVersionRequired] If a - * new build version of NodeConfiguration is required. - * - * @param {object} parameters.source1 Gets or sets the source. - * - * @param {object} [parameters.source1.hash] Gets or sets the hash. + * @param {object} [parameters.source.hash] Gets or sets the hash. * - * @param {string} parameters.source1.hash.algorithm Gets or sets the content + * @param {string} parameters.source.hash.algorithm Gets or sets the content * hash algorithm used to hash the content. * - * @param {string} parameters.source1.hash.value Gets or sets expected hash + * @param {string} parameters.source.hash.value Gets or sets expected hash * value of the content. * - * @param {string} [parameters.source1.type] Gets or sets the content source + * @param {string} [parameters.source.type] Gets or sets the content source * type. Possible values include: 'embeddedContent', 'uri' * - * @param {string} [parameters.source1.value] Gets or sets the value of the + * @param {string} [parameters.source.value] Gets or sets the value of the * content. This is based on the content source type. * - * @param {string} [parameters.source1.version] Gets or sets the version of the + * @param {string} [parameters.source.version] Gets or sets the version of the * content. * - * @param {string} parameters.name1 Gets or sets the type of the parameter. - * - * @param {object} parameters.configuration1 Gets or sets the configuration of + * @param {object} parameters.configuration Gets or sets the configuration of * the node. * - * @param {string} [parameters.configuration1.name] Gets or sets the name of - * the Dsc configuration. + * @param {string} [parameters.configuration.name] Gets or sets the name of the + * Dsc configuration. * * @param {boolean} [parameters.incrementNodeConfigurationBuild] If a new build * version of NodeConfiguration is required. * + * @param {string} [parameters.name] Name of the node configuration. + * * @param {object} [parameters.tags] Gets or sets the tags attached to the * resource. * diff --git a/lib/services/automationManagement/lib/operations/index.js b/lib/services/automationManagement/lib/operations/index.js index 63aeffd32f..5c9e82b603 100644 --- a/lib/services/automationManagement/lib/operations/index.js +++ b/lib/services/automationManagement/lib/operations/index.js @@ -43,6 +43,7 @@ exports.SoftwareUpdateConfigurationRuns = require('./softwareUpdateConfiguration exports.SoftwareUpdateConfigurationMachineRuns = require('./softwareUpdateConfigurationMachineRuns'); exports.SourceControlOperations = require('./sourceControlOperations'); exports.SourceControlSyncJobOperations = require('./sourceControlSyncJobOperations'); +exports.SourceControlSyncJobStreams = require('./sourceControlSyncJobStreams'); exports.JobOperations = require('./jobOperations'); exports.JobStreamOperations = require('./jobStreamOperations'); exports.AgentRegistrationInformation = require('./agentRegistrationInformation'); diff --git a/lib/services/automationManagement/lib/operations/softwareUpdateConfigurationMachineRuns.js b/lib/services/automationManagement/lib/operations/softwareUpdateConfigurationMachineRuns.js index dd36c0ac40..8cc0d121b6 100644 --- a/lib/services/automationManagement/lib/operations/softwareUpdateConfigurationMachineRuns.js +++ b/lib/services/automationManagement/lib/operations/softwareUpdateConfigurationMachineRuns.js @@ -149,12 +149,13 @@ function _getById(resourceGroupName, automationAccountName, softwareUpdateConfig try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + 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['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -349,12 +350,13 @@ function _list(resourceGroupName, automationAccountName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + 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['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/automationManagement/lib/operations/softwareUpdateConfigurationRuns.js b/lib/services/automationManagement/lib/operations/softwareUpdateConfigurationRuns.js index 825c7c999e..e4a7cf8515 100644 --- a/lib/services/automationManagement/lib/operations/softwareUpdateConfigurationRuns.js +++ b/lib/services/automationManagement/lib/operations/softwareUpdateConfigurationRuns.js @@ -149,12 +149,13 @@ function _getById(resourceGroupName, automationAccountName, softwareUpdateConfig try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + 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['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -348,12 +349,13 @@ function _list(resourceGroupName, automationAccountName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + 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['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/automationManagement/lib/operations/softwareUpdateConfigurations.js b/lib/services/automationManagement/lib/operations/softwareUpdateConfigurations.js index 60620e732a..fced67c954 100644 --- a/lib/services/automationManagement/lib/operations/softwareUpdateConfigurations.js +++ b/lib/services/automationManagement/lib/operations/softwareUpdateConfigurations.js @@ -273,7 +273,7 @@ function _create(resourceGroupName, automationAccountName, softwareUpdateConfigu return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 400 && statusCode !== 404 && statusCode !== 409) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -283,12 +283,13 @@ function _create(resourceGroupName, automationAccountName, softwareUpdateConfigu try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + 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['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -475,12 +476,13 @@ function _getByName(resourceGroupName, automationAccountName, softwareUpdateConf try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + 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['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -638,7 +640,7 @@ function _deleteMethod(resourceGroupName, automationAccountName, softwareUpdateC return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -648,12 +650,13 @@ function _deleteMethod(resourceGroupName, automationAccountName, softwareUpdateC try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + 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['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -808,12 +811,13 @@ function _list(resourceGroupName, automationAccountName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + 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['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { 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/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",