diff --git a/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.d.ts b/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.d.ts index 0bc7fd95cf..404e18ea5d 100644 --- a/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.d.ts +++ b/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.d.ts @@ -34,11 +34,11 @@ export default class ContainerRegistryManagementClient extends AzureServiceClien * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -58,9 +58,8 @@ export default class ContainerRegistryManagementClient extends AzureServiceClien operations: operations.Operations; replications: operations.Replications; webhooks: operations.Webhooks; - builds: operations.Builds; - buildSteps: operations.BuildSteps; - buildTasks: operations.BuildTasks; + runs: operations.Runs; + tasks: operations.Tasks; } export { ContainerRegistryManagementClient, models as ContainerRegistryManagementModels }; diff --git a/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.js b/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.js index e7a2b2b65a..c8cd8b8aeb 100644 --- a/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.js +++ b/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.js @@ -34,9 +34,9 @@ class ContainerRegistryManagementClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -75,9 +75,8 @@ class ContainerRegistryManagementClient extends ServiceClient { this.operations = new operations.Operations(this); this.replications = new operations.Replications(this); this.webhooks = new operations.Webhooks(this); - this.builds = new operations.Builds(this); - this.buildSteps = new operations.BuildSteps(this); - this.buildTasks = new operations.BuildTasks(this); + this.runs = new operations.Runs(this); + this.tasks = new operations.Tasks(this); this.models = models; msRest.addSerializationMixin(this); } diff --git a/lib/services/containerRegistryManagement/lib/models/agentProperties.js b/lib/services/containerRegistryManagement/lib/models/agentProperties.js new file mode 100644 index 0000000000..54ca08b66b --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/agentProperties.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The properties that determine the run agent configuration. + * + */ +class AgentProperties { + /** + * Create a AgentProperties. + * @member {number} [cpu] The CPU configuration in terms of number of cores + * required for the run. + */ + constructor() { + } + + /** + * Defines the metadata of AgentProperties + * + * @returns {object} metadata of AgentProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'AgentProperties', + type: { + name: 'Composite', + className: 'AgentProperties', + modelProperties: { + cpu: { + required: false, + serializedName: 'cpu', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = AgentProperties; diff --git a/lib/services/containerRegistryManagement/lib/models/argument.js b/lib/services/containerRegistryManagement/lib/models/argument.js new file mode 100644 index 0000000000..292d0d83d9 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/argument.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The properties of a run argument. + * + */ +class Argument { + /** + * Create a Argument. + * @member {string} name The name of the argument. + * @member {string} value The value of the argument. + * @member {boolean} [isSecret] Flag to indicate whether the argument + * represents a secret and want to be removed from build logs. Default value: + * false . + */ + constructor() { + } + + /** + * Defines the metadata of Argument + * + * @returns {object} metadata of Argument + * + */ + mapper() { + return { + required: false, + serializedName: 'Argument', + type: { + name: 'Composite', + className: 'Argument', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: true, + serializedName: 'value', + type: { + name: 'String' + } + }, + isSecret: { + required: false, + serializedName: 'isSecret', + defaultValue: false, + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = Argument; diff --git a/lib/services/containerRegistryManagement/lib/models/authInfo.js b/lib/services/containerRegistryManagement/lib/models/authInfo.js new file mode 100644 index 0000000000..0303c4f789 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/authInfo.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'; + +/** + * The authorization properties for accessing the source code repository. + * + */ +class AuthInfo { + /** + * Create a AuthInfo. + * @member {string} tokenType The type of Auth token. Possible values + * include: 'PAT', 'OAuth' + * @member {string} token The access token used to access the source control + * provider. + * @member {string} [refreshToken] The refresh token used to refresh the + * access token. + * @member {string} [scope] The scope of the access token. + * @member {number} [expiresIn] Time in seconds that the token remains valid + */ + constructor() { + } + + /** + * Defines the metadata of AuthInfo + * + * @returns {object} metadata of AuthInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'AuthInfo', + type: { + name: 'Composite', + className: 'AuthInfo', + modelProperties: { + tokenType: { + required: true, + serializedName: 'tokenType', + type: { + name: 'String' + } + }, + token: { + required: true, + serializedName: 'token', + type: { + name: 'String' + } + }, + refreshToken: { + required: false, + serializedName: 'refreshToken', + type: { + name: 'String' + } + }, + scope: { + required: false, + serializedName: 'scope', + type: { + name: 'String' + } + }, + expiresIn: { + required: false, + serializedName: 'expiresIn', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = AuthInfo; diff --git a/lib/services/containerRegistryManagement/lib/models/authInfoUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/authInfoUpdateParameters.js new file mode 100644 index 0000000000..df1896032b --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/authInfoUpdateParameters.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'; + +/** + * The authorization properties for accessing the source code repository. + * + */ +class AuthInfoUpdateParameters { + /** + * Create a AuthInfoUpdateParameters. + * @member {string} [tokenType] The type of Auth token. Possible values + * include: 'PAT', 'OAuth' + * @member {string} [token] The access token used to access the source + * control provider. + * @member {string} [refreshToken] The refresh token used to refresh the + * access token. + * @member {string} [scope] The scope of the access token. + * @member {number} [expiresIn] Time in seconds that the token remains valid + */ + constructor() { + } + + /** + * Defines the metadata of AuthInfoUpdateParameters + * + * @returns {object} metadata of AuthInfoUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'AuthInfoUpdateParameters', + type: { + name: 'Composite', + className: 'AuthInfoUpdateParameters', + modelProperties: { + tokenType: { + required: false, + serializedName: 'tokenType', + type: { + name: 'String' + } + }, + token: { + required: false, + serializedName: 'token', + type: { + name: 'String' + } + }, + refreshToken: { + required: false, + serializedName: 'refreshToken', + type: { + name: 'String' + } + }, + scope: { + required: false, + serializedName: 'scope', + type: { + name: 'String' + } + }, + expiresIn: { + required: false, + serializedName: 'expiresIn', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = AuthInfoUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/baseImageTrigger.js b/lib/services/containerRegistryManagement/lib/models/baseImageTrigger.js new file mode 100644 index 0000000000..08c97f3e0e --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/baseImageTrigger.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The trigger based on base image dependency. + * + */ +class BaseImageTrigger { + /** + * Create a BaseImageTrigger. + * @member {string} baseImageTriggerType The type of the auto trigger for + * base image dependency updates. Possible values include: 'All', 'Runtime' + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ + constructor() { + } + + /** + * Defines the metadata of BaseImageTrigger + * + * @returns {object} metadata of BaseImageTrigger + * + */ + mapper() { + return { + required: false, + serializedName: 'BaseImageTrigger', + type: { + name: 'Composite', + className: 'BaseImageTrigger', + modelProperties: { + baseImageTriggerType: { + required: true, + serializedName: 'baseImageTriggerType', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BaseImageTrigger; diff --git a/lib/services/containerRegistryManagement/lib/models/baseImageTriggerUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/baseImageTriggerUpdateParameters.js new file mode 100644 index 0000000000..51f8a76de6 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/baseImageTriggerUpdateParameters.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The properties for updating base image dependency trigger. + * + */ +class BaseImageTriggerUpdateParameters { + /** + * Create a BaseImageTriggerUpdateParameters. + * @member {string} [baseImageTriggerType] The type of the auto trigger for + * base image dependency updates. Possible values include: 'All', 'Runtime' + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ + constructor() { + } + + /** + * Defines the metadata of BaseImageTriggerUpdateParameters + * + * @returns {object} metadata of BaseImageTriggerUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'BaseImageTriggerUpdateParameters', + type: { + name: 'Composite', + className: 'BaseImageTriggerUpdateParameters', + modelProperties: { + baseImageTriggerType: { + required: false, + serializedName: 'baseImageTriggerType', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BaseImageTriggerUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/buildTaskRequest.js b/lib/services/containerRegistryManagement/lib/models/buildTaskRequest.js new file mode 100644 index 0000000000..73fc2a4855 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/buildTaskRequest.js @@ -0,0 +1,157 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The request parameters for a quick task build. + * + * @extends models['RunRequest'] + */ +class BuildTaskRequest extends models['RunRequest'] { + /** + * Create a BuildTaskRequest. + * @member {string} definitionFilePath The template/definition file path + * relative to the source. + * @member {string} [valuesFilePath] The values/parameters file path relative + * to the source. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {string} sourceLocation The URL(absolute or relative) of the + * source that needs to be built. For Docker build, it can be an URL to a tar + * or github repoistory as supported by Docker. + * If it is relative URL, the relative path should be obtained from calling + * getSourceUploadUrl API. + * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . + * @member {object} platform The platform properties against which the build + * will happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the + * build agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms + * of number of cores required for the run. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BuildTaskRequest + * + * @returns {object} metadata of BuildTaskRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'BuildTaskRequest', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'RunRequest', + className: 'BuildTaskRequest', + modelProperties: { + isArchiveEnabled: { + required: false, + serializedName: 'isArchiveEnabled', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + definitionFilePath: { + required: true, + serializedName: 'definitionFilePath', + type: { + name: 'String' + } + }, + valuesFilePath: { + required: false, + serializedName: 'valuesFilePath', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } + }, + sourceLocation: { + required: true, + serializedName: 'sourceLocation', + type: { + name: 'String' + } + }, + timeout: { + required: false, + serializedName: 'timeout', + defaultValue: 3600, + constraints: { + InclusiveMaximum: 28800, + InclusiveMinimum: 300 + }, + type: { + name: 'Number' + } + }, + platform: { + required: true, + serializedName: 'platform', + type: { + name: 'Composite', + className: 'PlatformProperties' + } + }, + agentConfiguration: { + required: false, + serializedName: 'agentConfiguration', + type: { + name: 'Composite', + className: 'AgentProperties' + } + } + } + } + }; + } +} + +module.exports = BuildTaskRequest; diff --git a/lib/services/containerRegistryManagement/lib/models/buildTaskStep.js b/lib/services/containerRegistryManagement/lib/models/buildTaskStep.js new file mode 100644 index 0000000000..cb8ca03e01 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/buildTaskStep.js @@ -0,0 +1,123 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties of a build task step. + * + * @extends models['TaskStepProperties'] + */ +class BuildTaskStep extends models['TaskStepProperties'] { + /** + * Create a BuildTaskStep. + * @member {string} definitionFilePath The build task template/definition + * file path relative to the source context. + * @member {string} [valuesFilePath] The task values/parameters file path + * relative to the source context. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository + * URL of the build task. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BuildTaskStep + * + * @returns {object} metadata of BuildTaskStep + * + */ + mapper() { + return { + required: false, + serializedName: 'BuildTask', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepProperties', + className: 'BuildTaskStep', + modelProperties: { + baseImageDependencies: { + required: false, + readOnly: true, + serializedName: 'baseImageDependencies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BaseImageDependencyElementType', + type: { + name: 'Composite', + className: 'BaseImageDependency' + } + } + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + definitionFilePath: { + required: true, + serializedName: 'definitionFilePath', + type: { + name: 'String' + } + }, + valuesFilePath: { + required: false, + serializedName: 'valuesFilePath', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } + }, + contextPath: { + required: false, + serializedName: 'contextPath', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BuildTaskStep; diff --git a/lib/services/containerRegistryManagement/lib/models/buildTaskStepUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/buildTaskStepUpdateParameters.js new file mode 100644 index 0000000000..093d1d7c7f --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/buildTaskStepUpdateParameters.js @@ -0,0 +1,107 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties of updating a build task step. + * + * @extends models['TaskStepUpdateParameters'] + */ +class BuildTaskStepUpdateParameters extends models['TaskStepUpdateParameters'] { + /** + * Create a BuildTaskStepUpdateParameters. + * @member {string} [definitionFilePath] The build task template/definition + * file path relative to the source context. + * @member {string} [valuesFilePath] The task values/parameters file path + * relative to the source context. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository + * URL of the build task. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BuildTaskStepUpdateParameters + * + * @returns {object} metadata of BuildTaskStepUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'BuildTask', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepUpdateParameters', + className: 'BuildTaskStepUpdateParameters', + modelProperties: { + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + definitionFilePath: { + required: false, + serializedName: 'definitionFilePath', + type: { + name: 'String' + } + }, + valuesFilePath: { + required: false, + serializedName: 'valuesFilePath', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } + }, + contextPath: { + required: false, + serializedName: 'contextPath', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BuildTaskStepUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/dockerBuildRequest.js b/lib/services/containerRegistryManagement/lib/models/dockerBuildRequest.js new file mode 100644 index 0000000000..d719942893 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/dockerBuildRequest.js @@ -0,0 +1,185 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The parameters for a docker quick build. + * + * @extends models['RunRequest'] + */ +class DockerBuildRequest extends models['RunRequest'] { + /** + * Create a DockerBuildRequest. + * @member {array} [imageNames] The fully qualified image names including the + * repository and tag. + * @member {boolean} [isPushEnabled] The value of this property indicates + * whether the image built should be pushed to the registry or not. Default + * value: true . + * @member {boolean} [noCache] The value of this property indicates whether + * the image cache is enabled or not. Default value: false . + * @member {string} dockerFilePath The Docker file path relative to the + * source location. + * @member {array} [argumentsProperty] The collection of override arguments + * to be used when executing the run. + * @member {string} sourceLocation The URL(absolute or relative) of the + * source that needs to be built. For Docker build, it can be an URL to a tar + * or github repoistory as supported by Docker. + * If it is relative URL, the relative path should be obtained from calling + * getSourceUploadUrl API. + * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . + * @member {object} platform The platform properties against which the build + * will happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the + * build agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms + * of number of cores required for the run. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DockerBuildRequest + * + * @returns {object} metadata of DockerBuildRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'DockerBuildRequest', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'RunRequest', + className: 'DockerBuildRequest', + modelProperties: { + isArchiveEnabled: { + required: false, + serializedName: 'isArchiveEnabled', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + imageNames: { + required: false, + serializedName: 'imageNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + isPushEnabled: { + required: false, + serializedName: 'isPushEnabled', + defaultValue: true, + type: { + name: 'Boolean' + } + }, + noCache: { + required: false, + serializedName: 'noCache', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + dockerFilePath: { + required: true, + serializedName: 'dockerFilePath', + type: { + name: 'String' + } + }, + argumentsProperty: { + required: false, + serializedName: 'arguments', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ArgumentElementType', + type: { + name: 'Composite', + className: 'Argument' + } + } + } + }, + sourceLocation: { + required: true, + serializedName: 'sourceLocation', + type: { + name: 'String' + } + }, + timeout: { + required: false, + serializedName: 'timeout', + defaultValue: 3600, + constraints: { + InclusiveMaximum: 28800, + InclusiveMinimum: 300 + }, + type: { + name: 'Number' + } + }, + platform: { + required: true, + serializedName: 'platform', + type: { + name: 'Composite', + className: 'PlatformProperties' + } + }, + agentConfiguration: { + required: false, + serializedName: 'agentConfiguration', + type: { + name: 'Composite', + className: 'AgentProperties' + } + } + } + } + }; + } +} + +module.exports = DockerBuildRequest; diff --git a/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js b/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js index 84bef7d173..5cd17b7d78 100644 --- a/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js +++ b/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js @@ -15,12 +15,11 @@ const models = require('./index'); /** * The Docker build step. * - * @extends models['BuildStepProperties'] + * @extends models['TaskStepProperties'] */ -class DockerBuildStep extends models['BuildStepProperties'] { +class DockerBuildStep extends models['TaskStepProperties'] { /** * Create a DockerBuildStep. - * @member {string} [branch] The repository branch name. * @member {array} [imageNames] The fully qualified image names including the * repository and tag. * @member {boolean} [isPushEnabled] The value of this property indicates @@ -28,17 +27,14 @@ class DockerBuildStep extends models['BuildStepProperties'] { * value: true . * @member {boolean} [noCache] The value of this property indicates whether * the image cache is enabled or not. Default value: false . - * @member {string} [dockerFilePath] The Docker file path relative to the - * source control root. - * @member {string} [contextPath] The relative context path for a docker - * build in the source. - * @member {array} [buildArguments] The custom arguments for building this - * build step. - * @member {array} [baseImageDependencies] List of base image dependencies - * for a step. - * @member {string} [baseImageTrigger] The type of the auto trigger for base - * image dependency updates. Possible values include: 'All', 'Runtime', - * 'None' + * @member {string} dockerFilePath The Docker file path relative to the + * source context. + * @member {array} [argumentsProperty] The collection of override arguments + * to be used when executing this build step. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository + * URL of the build task. */ constructor() { super(); @@ -60,15 +56,23 @@ class DockerBuildStep extends models['BuildStepProperties'] { serializedName: 'type', clientName: 'type' }, - uberParent: 'BuildStepProperties', + uberParent: 'TaskStepProperties', className: 'DockerBuildStep', modelProperties: { - provisioningState: { + baseImageDependencies: { required: false, readOnly: true, - serializedName: 'provisioningState', + serializedName: 'baseImageDependencies', type: { - name: 'String' + name: 'Sequence', + element: { + required: false, + serializedName: 'BaseImageDependencyElementType', + type: { + name: 'Composite', + className: 'BaseImageDependency' + } + } } }, type: { @@ -79,13 +83,6 @@ class DockerBuildStep extends models['BuildStepProperties'] { name: 'String' } }, - branch: { - required: false, - serializedName: 'branch', - type: { - name: 'String' - } - }, imageNames: { required: false, serializedName: 'imageNames', @@ -117,53 +114,30 @@ class DockerBuildStep extends models['BuildStepProperties'] { } }, dockerFilePath: { - required: false, + required: true, serializedName: 'dockerFilePath', type: { name: 'String' } }, - contextPath: { - required: false, - serializedName: 'contextPath', - type: { - name: 'String' - } - }, - buildArguments: { - required: false, - serializedName: 'buildArguments', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'BuildArgumentElementType', - type: { - name: 'Composite', - className: 'BuildArgument' - } - } - } - }, - baseImageDependencies: { + argumentsProperty: { required: false, - readOnly: true, - serializedName: 'baseImageDependencies', + serializedName: 'arguments', type: { name: 'Sequence', element: { required: false, - serializedName: 'BaseImageDependencyElementType', + serializedName: 'ArgumentElementType', type: { name: 'Composite', - className: 'BaseImageDependency' + className: 'Argument' } } } }, - baseImageTrigger: { + contextPath: { required: false, - serializedName: 'baseImageTrigger', + serializedName: 'contextPath', type: { name: 'String' } diff --git a/lib/services/containerRegistryManagement/lib/models/dockerBuildStepUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/dockerBuildStepUpdateParameters.js index 20db8e9d98..700e9af7e3 100644 --- a/lib/services/containerRegistryManagement/lib/models/dockerBuildStepUpdateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/dockerBuildStepUpdateParameters.js @@ -15,12 +15,11 @@ const models = require('./index'); /** * The properties for updating a docker build step. * - * @extends models['BuildStepPropertiesUpdateParameters'] + * @extends models['TaskStepUpdateParameters'] */ -class DockerBuildStepUpdateParameters extends models['BuildStepPropertiesUpdateParameters'] { +class DockerBuildStepUpdateParameters extends models['TaskStepUpdateParameters'] { /** * Create a DockerBuildStepUpdateParameters. - * @member {string} [branch] The repository branch name. * @member {array} [imageNames] The fully qualified image names including the * repository and tag. * @member {boolean} [isPushEnabled] The value of this property indicates @@ -28,14 +27,13 @@ class DockerBuildStepUpdateParameters extends models['BuildStepPropertiesUpdateP * @member {boolean} [noCache] The value of this property indicates whether * the image cache is enabled or not. * @member {string} [dockerFilePath] The Docker file path relative to the - * source control root. - * @member {string} [contextPath] The relative context path for a docker - * build in the source. - * @member {array} [buildArguments] The custom arguments for building this - * build step. - * @member {string} [baseImageTrigger] The type of the auto trigger for base - * image dependency updates. Possible values include: 'All', 'Runtime', - * 'None' + * source context. + * @member {array} [argumentsProperty] The collection of override arguments + * to be used when executing this build step. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository + * URL of the build task. */ constructor() { super(); @@ -57,7 +55,7 @@ class DockerBuildStepUpdateParameters extends models['BuildStepPropertiesUpdateP serializedName: 'type', clientName: 'type' }, - uberParent: 'BuildStepPropertiesUpdateParameters', + uberParent: 'TaskStepUpdateParameters', className: 'DockerBuildStepUpdateParameters', modelProperties: { type: { @@ -68,13 +66,6 @@ class DockerBuildStepUpdateParameters extends models['BuildStepPropertiesUpdateP name: 'String' } }, - branch: { - required: false, - serializedName: 'branch', - type: { - name: 'String' - } - }, imageNames: { required: false, serializedName: 'imageNames', @@ -110,31 +101,24 @@ class DockerBuildStepUpdateParameters extends models['BuildStepPropertiesUpdateP name: 'String' } }, - contextPath: { - required: false, - serializedName: 'contextPath', - type: { - name: 'String' - } - }, - buildArguments: { + argumentsProperty: { required: false, - serializedName: 'buildArguments', + serializedName: 'arguments', type: { name: 'Sequence', element: { required: false, - serializedName: 'BuildArgumentElementType', + serializedName: 'ArgumentElementType', type: { name: 'Composite', - className: 'BuildArgument' + className: 'Argument' } } } }, - baseImageTrigger: { + contextPath: { required: false, - serializedName: 'baseImageTrigger', + serializedName: 'contextPath', type: { name: 'String' } diff --git a/lib/services/containerRegistryManagement/lib/models/dockerRegistryCredentials.js b/lib/services/containerRegistryManagement/lib/models/dockerRegistryCredentials.js new file mode 100644 index 0000000000..8b0e5d45cc --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/dockerRegistryCredentials.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 properties of a docker registry credentials. + * + */ +class DockerRegistryCredentials { + /** + * Create a DockerRegistryCredentials. + * @member {string} [loginServer] The registry login server. + * @member {string} userName The username of the registry. + * @member {string} password The password to the registry. + */ + constructor() { + } + + /** + * Defines the metadata of DockerRegistryCredentials + * + * @returns {object} metadata of DockerRegistryCredentials + * + */ + mapper() { + return { + required: false, + serializedName: 'DockerRegistryCredentials', + type: { + name: 'Composite', + className: 'DockerRegistryCredentials', + modelProperties: { + loginServer: { + required: false, + serializedName: 'loginServer', + type: { + name: 'String' + } + }, + userName: { + required: true, + serializedName: 'userName', + type: { + name: 'String' + } + }, + password: { + required: true, + serializedName: 'password', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DockerRegistryCredentials; diff --git a/lib/services/containerRegistryManagement/lib/models/importImageParameters.js b/lib/services/containerRegistryManagement/lib/models/importImageParameters.js index 191b46a8a9..5e93c9c8cc 100644 --- a/lib/services/containerRegistryManagement/lib/models/importImageParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/importImageParameters.js @@ -19,8 +19,9 @@ class ImportImageParameters { /** * Create a ImportImageParameters. * @member {object} source The source of the image. - * @member {string} [source.resourceId] The resource identifier of the target + * @member {string} [source.resourceId] The resource identifier of the source * Azure Container Registry. + * @member {string} [source.registryUri] The address of the source registry. * @member {string} [source.sourceImage] Repository name of the source image. * Specify an image by repository ('hello-world'). This will use the 'latest' * tag. diff --git a/lib/services/containerRegistryManagement/lib/models/importSource.js b/lib/services/containerRegistryManagement/lib/models/importSource.js index 43a81fbb5e..171a3d18d4 100644 --- a/lib/services/containerRegistryManagement/lib/models/importSource.js +++ b/lib/services/containerRegistryManagement/lib/models/importSource.js @@ -16,8 +16,9 @@ class ImportSource { /** * Create a ImportSource. - * @member {string} resourceId The resource identifier of the target Azure + * @member {string} [resourceId] The resource identifier of the source Azure * Container Registry. + * @member {string} [registryUri] The address of the source registry. * @member {string} sourceImage Repository name of the source image. * Specify an image by repository ('hello-world'). This will use the 'latest' * tag. @@ -43,12 +44,19 @@ class ImportSource { className: 'ImportSource', modelProperties: { resourceId: { - required: true, + required: false, serializedName: 'resourceId', type: { name: 'String' } }, + registryUri: { + required: false, + serializedName: 'registryUri', + type: { + name: 'String' + } + }, sourceImage: { required: true, serializedName: 'sourceImage', diff --git a/lib/services/containerRegistryManagement/lib/models/index.d.ts b/lib/services/containerRegistryManagement/lib/models/index.d.ts index fecb9c6c9f..03ac2f6701 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/models/index.d.ts @@ -20,8 +20,9 @@ export { CloudError } from 'ms-rest-azure'; * @class * Initializes a new instance of the ImportSource class. * @constructor - * @member {string} resourceId The resource identifier of the target Azure + * @member {string} [resourceId] The resource identifier of the source Azure * Container Registry. + * @member {string} [registryUri] The address of the source registry. * @member {string} sourceImage Repository name of the source image. * Specify an image by repository ('hello-world'). This will use the 'latest' * tag. @@ -30,7 +31,8 @@ export { CloudError } from 'ms-rest-azure'; * ('hello-world@sha256:abc123'). */ export interface ImportSource { - resourceId: string; + resourceId?: string; + registryUri?: string; sourceImage: string; } @@ -39,8 +41,9 @@ export interface ImportSource { * Initializes a new instance of the ImportImageParameters class. * @constructor * @member {object} source The source of the image. - * @member {string} [source.resourceId] The resource identifier of the target + * @member {string} [source.resourceId] The resource identifier of the source * Azure Container Registry. + * @member {string} [source.registryUri] The address of the source registry. * @member {string} [source.sourceImage] Repository name of the source image. * Specify an image by repository ('hello-world'). This will use the 'latest' * tag. @@ -115,12 +118,49 @@ export interface OperationDisplayDefinition { description?: string; } +/** + * @class + * Initializes a new instance of the OperationMetricSpecificationDefinition class. + * @constructor + * The definition of Azure Monitoring metric. + * + * @member {string} [name] Metric name. + * @member {string} [displayName] Metric display name. + * @member {string} [displayDescription] Metric description. + * @member {string} [unit] Metric unit. + * @member {string} [aggregationType] Metric aggregation type. + * @member {string} [internalMetricName] Internal metric name. + */ +export interface OperationMetricSpecificationDefinition { + name?: string; + displayName?: string; + displayDescription?: string; + unit?: string; + aggregationType?: string; + internalMetricName?: string; +} + +/** + * @class + * Initializes a new instance of the OperationServiceSpecificationDefinition class. + * @constructor + * The definition of Azure Monitoring metrics list. + * + * @member {array} [metricSpecifications] A list of Azure Monitoring metrics + * definition. + */ +export interface OperationServiceSpecificationDefinition { + metricSpecifications?: OperationMetricSpecificationDefinition[]; +} + /** * @class * Initializes a new instance of the OperationDefinition class. * @constructor * The definition of a container registry operation. * + * @member {string} [origin] The origin information of the container registry + * operation. * @member {string} [name] Operation name: {provider}/{resource}/{operation}. * @member {object} [display] The display information for the container * registry operation. @@ -130,10 +170,16 @@ export interface OperationDisplayDefinition { * performed. * @member {string} [display.operation] The operation that users can perform. * @member {string} [display.description] The description for the operation. + * @member {object} [serviceSpecification] The definition of Azure Monitoring + * service. + * @member {array} [serviceSpecification.metricSpecifications] A list of Azure + * Monitoring metrics definition. */ export interface OperationDefinition { + origin?: string; name?: string; display?: OperationDisplayDefinition; + serviceSpecification?: OperationServiceSpecificationDefinition; } /** @@ -349,6 +395,57 @@ export interface RegistryUsageListResult { value?: RegistryUsage[]; } +/** + * @class + * Initializes a new instance of the QuarantinePolicy class. + * @constructor + * An object that represents quarantine policy for a container registry. + * + * @member {string} [status] The value that indicates whether the policy is + * enabled or not. Possible values include: 'enabled', 'disabled' + */ +export interface QuarantinePolicy { + status?: string; +} + +/** + * @class + * Initializes a new instance of the TrustPolicy class. + * @constructor + * An object that represents content trust policy for a container registry. + * + * @member {string} [type] The type of trust policy. Possible values include: + * 'Notary' + * @member {string} [status] The value that indicates whether the policy is + * enabled or not. Possible values include: 'enabled', 'disabled' + */ +export interface TrustPolicy { + type?: string; + status?: string; +} + +/** + * @class + * Initializes a new instance of the RegistryPolicies class. + * @constructor + * An object that represents policies for a container registry. + * + * @member {object} [quarantinePolicy] An object that represents quarantine + * policy for a container registry. + * @member {string} [quarantinePolicy.status] The value that indicates whether + * the policy is enabled or not. Possible values include: 'enabled', 'disabled' + * @member {object} [trustPolicy] An object that represents content trust + * policy for a container registry. + * @member {string} [trustPolicy.type] The type of trust policy. Possible + * values include: 'Notary' + * @member {string} [trustPolicy.status] The value that indicates whether the + * policy is enabled or not. Possible values include: 'enabled', 'disabled' + */ +export interface RegistryPolicies { + quarantinePolicy?: QuarantinePolicy; + trustPolicy?: TrustPolicy; +} + /** * @class * Initializes a new instance of the Replication class. @@ -800,6 +897,21 @@ export interface Event extends EventInfo { eventResponseMessage?: EventResponseMessage; } +/** + * @class + * Initializes a new instance of the RunRequest class. + * @constructor + * The request parameters for scheduling a run. + * + * @member {boolean} [isArchiveEnabled] The value that indicates whether + * archiving is enabled for the run or not. Default value: false . + * @member {string} type Polymorphic Discriminator + */ +export interface RunRequest { + isArchiveEnabled?: boolean; + type: string; +} + /** * @class * Initializes a new instance of the ImageDescriptor class. @@ -836,19 +948,23 @@ export interface ImageUpdateTrigger { /** * @class - * Initializes a new instance of the GitCommitTrigger class. + * Initializes a new instance of the SourceTriggerDescriptor class. * @constructor - * The git commit trigger that caused a build. + * The source trigger that caused a run. * * @member {string} [id] The unique ID of the trigger. + * @member {string} [eventType] The event type of the trigger. * @member {string} [commitId] The unique ID that identifies a commit. + * @member {string} [pullRequestId] The unique ID that identifies pull request. * @member {string} [repositoryUrl] The repository URL. * @member {string} [branchName] The branch name in the repository. * @member {string} [providerType] The source control provider type. */ -export interface GitCommitTrigger { +export interface SourceTriggerDescriptor { id?: string; + eventType?: string; commitId?: string; + pullRequestId?: string; repositoryUrl?: string; branchName?: string; providerType?: string; @@ -858,15 +974,31 @@ export interface GitCommitTrigger { * @class * Initializes a new instance of the PlatformProperties class. * @constructor - * The platform properties against which the build has to happen. + * The platform properties against which the run has to happen. * - * @member {string} osType The operating system type required for the build. - * Possible values include: 'Windows', 'Linux' - * @member {number} [cpu] The CPU configuration in terms of number of cores - * required for the build. + * @member {string} os The operating system type required for the run. Possible + * values include: 'Windows', 'Linux' + * @member {string} architecture The OS architecture. Possible values include: + * 'amd64', 'x86', 'arm' + * @member {string} [variant] Variant of the CPU. Possible values include: + * 'v6', 'v7', 'v8' */ export interface PlatformProperties { - osType: string; + os: string; + architecture: string; + variant?: string; +} + +/** + * @class + * Initializes a new instance of the AgentProperties class. + * @constructor + * The properties that determine the run agent configuration. + * + * @member {number} [cpu] The CPU configuration in terms of number of cores + * required for the run. + */ +export interface AgentProperties { cpu?: number; } @@ -889,213 +1021,197 @@ export interface ProxyResource extends BaseResource { /** * @class - * Initializes a new instance of the Build class. + * Initializes a new instance of the Run class. * @constructor - * Build resource properties + * Run resource properties * - * @member {string} [buildId] The unique identifier for the build. - * @member {string} [status] The current status of the build. Possible values + * @member {string} [runId] The unique identifier for the run. + * @member {string} [status] The current status of the run. Possible values * include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', * 'Error', 'Timeout' - * @member {date} [lastUpdatedTime] The last updated time for the build. - * @member {string} [buildType] The type of build. Possible values include: - * 'AutoBuild', 'QuickBuild' - * @member {date} [createTime] The time the build was created. - * @member {date} [startTime] The time the build started. - * @member {date} [finishTime] The time the build finished. + * @member {date} [lastUpdatedTime] The last updated time for the run. + * @member {string} [runType] The type of run. Possible values include: + * 'QuickBuild', 'AutoBuild' + * @member {date} [createTime] The time the run was scheduled. + * @member {date} [startTime] The time the run started. + * @member {date} [finishTime] The time the run finished. * @member {array} [outputImages] The list of all images that were generated - * from the build. - * @member {string} [buildTask] The build task with which the build was - * started. + * from the run. This is applicable if the run is of type Build. + * @member {string} [task] The task against which run was scheduled. * @member {object} [imageUpdateTrigger] The image update trigger that caused - * the build. + * the run. This is applicable if the task is of build type. * @member {string} [imageUpdateTrigger.id] The unique ID of the trigger. * @member {date} [imageUpdateTrigger.timestamp] The timestamp when the image * update happened. * @member {array} [imageUpdateTrigger.images] The list of image updates that * caused the build. - * @member {object} [gitCommitTrigger] The git commit trigger that caused the - * build. - * @member {string} [gitCommitTrigger.id] The unique ID of the trigger. - * @member {string} [gitCommitTrigger.commitId] The unique ID that identifies a + * @member {object} [sourceTrigger] The source trigger that caused the run. + * @member {string} [sourceTrigger.id] The unique ID of the trigger. + * @member {string} [sourceTrigger.eventType] The event type of the trigger. + * @member {string} [sourceTrigger.commitId] The unique ID that identifies a * commit. - * @member {string} [gitCommitTrigger.repositoryUrl] The repository URL. - * @member {string} [gitCommitTrigger.branchName] The branch name in the + * @member {string} [sourceTrigger.pullRequestId] The unique ID that identifies + * pull request. + * @member {string} [sourceTrigger.repositoryUrl] The repository URL. + * @member {string} [sourceTrigger.branchName] The branch name in the * repository. - * @member {string} [gitCommitTrigger.providerType] The source control provider + * @member {string} [sourceTrigger.providerType] The source control provider * type. * @member {boolean} [isArchiveEnabled] The value that indicates whether * archiving is enabled or not. Default value: false . - * @member {object} [platform] The platform properties against which the build + * @member {object} [platform] The platform properties against which the run * will happen. - * @member {string} [platform.osType] The operating system type required for - * the build. Possible values include: 'Windows', 'Linux' - * @member {number} [platform.cpu] The CPU configuration in terms of number of - * cores required for the build. - * @member {string} [provisioningState] The provisioning state of a build. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the run + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms of + * number of cores required for the run. + * @member {string} [provisioningState] The provisioning state of a run. * Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', * 'Failed', 'Canceled' */ -export interface Build extends ProxyResource { - buildId?: string; +export interface Run extends ProxyResource { + runId?: string; status?: string; lastUpdatedTime?: Date; - buildType?: string; + runType?: string; createTime?: Date; startTime?: Date; finishTime?: Date; outputImages?: ImageDescriptor[]; - buildTask?: string; + task?: string; imageUpdateTrigger?: ImageUpdateTrigger; - gitCommitTrigger?: GitCommitTrigger; + sourceTrigger?: SourceTriggerDescriptor; isArchiveEnabled?: boolean; platform?: PlatformProperties; + agentConfiguration?: AgentProperties; provisioningState?: string; } /** * @class - * Initializes a new instance of the BuildFilter class. + * Initializes a new instance of the SourceUploadDefinition class. * @constructor - * Properties that are enabled for Odata querying. + * The properties of a response to source upload request. * - * @member {string} [buildId] The unique identifier for the build. - * @member {string} [buildType] The type of build. Possible values include: - * 'AutoBuild', 'QuickBuild' - * @member {string} [status] The current status of the build. Possible values + * @member {string} [uploadUrl] The URL where the client can upload the source. + * @member {string} [relativePath] The relative path to the source. This is + * used to submit the subsequent queue build request. + */ +export interface SourceUploadDefinition { + uploadUrl?: string; + relativePath?: string; +} + +/** + * @class + * Initializes a new instance of the RunFilter class. + * @constructor + * Properties that are enabled for Odata querying on runs. + * + * @member {string} [runId] The unique identifier for the run. + * @member {string} [runType] The type of run. Possible values include: + * 'QuickBuild', 'AutoBuild' + * @member {string} [status] The current status of the run. Possible values * include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', * 'Error', 'Timeout' - * @member {date} [createTime] The create time for a build. - * @member {date} [finishTime] The time the build finished. + * @member {date} [createTime] The create time for a run. + * @member {date} [finishTime] The time the run finished. * @member {string} [outputImageManifests] The list of comma-separated image - * manifests that were generated from the build. + * manifests that were generated from the run. This is applicable if the run is + * of + * build type. * @member {boolean} [isArchiveEnabled] The value that indicates whether * archiving is enabled or not. - * @member {string} [buildTaskName] The name of the build task that the build - * corresponds to. + * @member {string} [taskName] The name of the task that the run corresponds + * to. */ -export interface BuildFilter { - buildId?: string; - buildType?: string; +export interface RunFilter { + runId?: string; + runType?: string; status?: string; createTime?: Date; finishTime?: Date; outputImageManifests?: string; isArchiveEnabled?: boolean; - buildTaskName?: string; + taskName?: string; } /** * @class - * Initializes a new instance of the BuildUpdateParameters class. + * Initializes a new instance of the RunUpdateParameters class. * @constructor - * The set of build properties that can be updated. + * The set of run properties that can be updated. * * @member {boolean} [isArchiveEnabled] The value that indicates whether * archiving is enabled or not. */ -export interface BuildUpdateParameters { +export interface RunUpdateParameters { isArchiveEnabled?: boolean; } /** * @class - * Initializes a new instance of the BuildGetLogResult class. + * Initializes a new instance of the RunGetLogResult class. * @constructor * The result of get log link operation. * - * @member {string} [logLink] The link to logs for a azure container registry - * build. + * @member {string} [logLink] The link to logs for a run on a azure container + * registry. */ -export interface BuildGetLogResult { +export interface RunGetLogResult { logLink?: string; } /** * @class - * Initializes a new instance of the BuildStepProperties class. - * @constructor - * Base properties for any build step. - * - * @member {string} [provisioningState] The provisioning state of the build - * step. Possible values include: 'Creating', 'Updating', 'Deleting', - * 'Succeeded', 'Failed', 'Canceled' - * @member {string} type Polymorphic Discriminator - */ -export interface BuildStepProperties { - readonly provisioningState?: string; - type: string; -} - -/** - * @class - * Initializes a new instance of the BuildStep class. + * Initializes a new instance of the BaseImageDependency class. * @constructor - * Build step resource properties + * Properties that describe a base image dependency. * - * @member {object} [properties] The properties of a build step. - * @member {string} [properties.provisioningState] The provisioning state of - * the build step. Possible values include: 'Creating', 'Updating', 'Deleting', - * 'Succeeded', 'Failed', 'Canceled' - * @member {string} [properties.type] Polymorphic Discriminator + * @member {string} [type] The type of the base image dependency. Possible + * values include: 'BuildTime', 'RunTime' + * @member {string} [registry] The registry login server. + * @member {string} [repository] The repository name. + * @member {string} [tag] The tag name. + * @member {string} [digest] The sha256-based digest of the image manifest. */ -export interface BuildStep extends ProxyResource { - properties?: BuildStepProperties; +export interface BaseImageDependency { + type?: string; + registry?: string; + repository?: string; + tag?: string; + digest?: string; } /** * @class - * Initializes a new instance of the BuildStepPropertiesUpdateParameters class. + * Initializes a new instance of the TaskStepProperties class. * @constructor - * The properties for updating a build step. + * Base properties for any task step. * + * @member {array} [baseImageDependencies] List of base image dependencies for + * a step. * @member {string} type Polymorphic Discriminator */ -export interface BuildStepPropertiesUpdateParameters { +export interface TaskStepProperties { + readonly baseImageDependencies?: BaseImageDependency[]; type: string; } /** * @class - * Initializes a new instance of the BuildStepUpdateParameters class. - * @constructor - * The parameters for updating a build step. - * - * @member {object} [properties] The properties for updating a build step. - * @member {string} [properties.type] Polymorphic Discriminator - * @member {object} [tags] The ARM resource tags. - */ -export interface BuildStepUpdateParameters { - properties?: BuildStepPropertiesUpdateParameters; - tags?: { [propertyName: string]: string }; -} - -/** - * @class - * Initializes a new instance of the BuildArgument class. - * @constructor - * Properties of a build argument. - * - * @member {string} name The name of the argument. - * @member {string} value The value of the argument. - * @member {boolean} [isSecret] Flag to indicate whether the argument - * represents a secret and want to be removed from build logs. Default value: - * false . - */ -export interface BuildArgument { - name: string; - value: string; - isSecret?: boolean; -} - -/** - * @class - * Initializes a new instance of the SourceControlAuthInfo class. + * Initializes a new instance of the AuthInfo class. * @constructor * The authorization properties for accessing the source code repository. * - * @member {string} [tokenType] The type of Auth token. Possible values - * include: 'PAT', 'OAuth' + * @member {string} tokenType The type of Auth token. Possible values include: + * 'PAT', 'OAuth' * @member {string} token The access token used to access the source control * provider. * @member {string} [refreshToken] The refresh token used to refresh the access @@ -1103,8 +1219,8 @@ export interface BuildArgument { * @member {string} [scope] The scope of the access token. * @member {number} [expiresIn] Time in seconds that the token remains valid */ -export interface SourceControlAuthInfo { - tokenType?: string; +export interface AuthInfo { + tokenType: string; token: string; refreshToken?: string; scope?: string; @@ -1113,18 +1229,17 @@ export interface SourceControlAuthInfo { /** * @class - * Initializes a new instance of the SourceRepositoryProperties class. + * Initializes a new instance of the SourceProperties class. * @constructor * The properties of the source code repository. * * @member {string} sourceControlType The type of source control service. * Possible values include: 'Github', 'VisualStudioTeamService' * @member {string} repositoryUrl The full URL to the source code respository - * @member {boolean} [isCommitTriggerEnabled] The value of this property - * indicates whether the source control commit trigger is enabled or not. - * Default value: false . + * @member {string} [branch] The branch name of the source code. * @member {object} [sourceControlAuthProperties] The authorization properties - * for accessing the source code repository. + * for accessing the source code repository and to set up + * webhooks for notifications. * @member {string} [sourceControlAuthProperties.tokenType] The type of Auth * token. Possible values include: 'PAT', 'OAuth' * @member {string} [sourceControlAuthProperties.token] The access token used @@ -1136,39 +1251,32 @@ export interface SourceControlAuthInfo { * @member {number} [sourceControlAuthProperties.expiresIn] Time in seconds * that the token remains valid */ -export interface SourceRepositoryProperties { +export interface SourceProperties { sourceControlType: string; repositoryUrl: string; - isCommitTriggerEnabled?: boolean; - sourceControlAuthProperties?: SourceControlAuthInfo; + branch?: string; + sourceControlAuthProperties?: AuthInfo; } /** * @class - * Initializes a new instance of the BuildTask class. + * Initializes a new instance of the SourceTrigger class. * @constructor - * The build task that has the resource properties and all build items. The - * build task will have all information to schedule a build against it. + * The properties of a source based trigger. * - * @member {string} [provisioningState] The provisioning state of the build - * task. Possible values include: 'Creating', 'Updating', 'Deleting', - * 'Succeeded', 'Failed', 'Canceled' - * @member {date} [creationDate] The creation date of build task. - * @member {string} alias The alternative updatable name for a build task. - * @member {string} [status] The current status of build task. Possible values - * include: 'Disabled', 'Enabled' * @member {object} sourceRepository The properties that describes the - * source(code) for the build task. + * source(code) for the task. * @member {string} [sourceRepository.sourceControlType] The type of source * control service. Possible values include: 'Github', * 'VisualStudioTeamService' * @member {string} [sourceRepository.repositoryUrl] The full URL to the source * code respository - * @member {boolean} [sourceRepository.isCommitTriggerEnabled] The value of - * this property indicates whether the source control commit trigger is enabled - * or not. + * @member {string} [sourceRepository.branch] The branch name of the source + * code. * @member {object} [sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. + * authorization properties for accessing the source code repository and to set + * up + * webhooks for notifications. * @member {string} [sourceRepository.sourceControlAuthProperties.tokenType] * The type of Auth token. Possible values include: 'PAT', 'OAuth' * @member {string} [sourceRepository.sourceControlAuthProperties.token] The @@ -1179,44 +1287,180 @@ export interface SourceRepositoryProperties { * scope of the access token. * @member {number} [sourceRepository.sourceControlAuthProperties.expiresIn] * Time in seconds that the token remains valid - * @member {object} platform The platform properties against which the build - * has to happen. - * @member {string} [platform.osType] The operating system type required for - * the build. Possible values include: 'Windows', 'Linux' - * @member {number} [platform.cpu] The CPU configuration in terms of number of - * cores required for the build. - * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . + * @member {array} sourceTriggerEvents The source event corresponding to the + * trigger. + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ +export interface SourceTrigger { + sourceRepository: SourceProperties; + sourceTriggerEvents: string[]; + status?: string; + name: string; +} + +/** + * @class + * Initializes a new instance of the BaseImageTrigger class. + * @constructor + * The trigger based on base image dependency. + * + * @member {string} baseImageTriggerType The type of the auto trigger for base + * image dependency updates. Possible values include: 'All', 'Runtime' + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ +export interface BaseImageTrigger { + baseImageTriggerType: string; + status?: string; + name: string; +} + +/** + * @class + * Initializes a new instance of the TriggerProperties class. + * @constructor + * The properties of a build trigger. + * + * @member {array} [sourceTriggers] The collection of triggers based on source + * code repository. + * @member {object} [baseImageTrigger] The trigger based on base image + * dependencies. + * @member {string} [baseImageTrigger.baseImageTriggerType] The type of the + * auto trigger for base image dependency updates. Possible values include: + * 'All', 'Runtime' + * @member {string} [baseImageTrigger.status] The current status of build + * trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [baseImageTrigger.name] The name of the trigger. */ -export interface BuildTask extends Resource { +export interface TriggerProperties { + sourceTriggers?: SourceTrigger[]; + baseImageTrigger?: BaseImageTrigger; +} + +/** + * @class + * Initializes a new instance of the Task class. + * @constructor + * The task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it. + * + * @member {string} [provisioningState] The provisioning state of the task. + * Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + * 'Failed', 'Canceled' + * @member {date} [creationDate] The creation date of task. + * @member {string} [status] The current status of task. Possible values + * include: 'Disabled', 'Enabled' + * @member {object} platform The platform properties against which the run has + * to happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the run + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms of + * number of cores required for the run. + * @member {number} [timeout] Run timeout in seconds. Default value: 3600 . + * @member {object} step The properties of a task step. + * @member {array} [step.baseImageDependencies] List of base image dependencies + * for a step. + * @member {string} [step.type] Polymorphic Discriminator + * @member {object} [trigger] The properties that describe all triggers for the + * task. + * @member {array} [trigger.sourceTriggers] The collection of triggers based on + * source code repository. + * @member {object} [trigger.baseImageTrigger] The trigger based on base image + * dependencies. + * @member {string} [trigger.baseImageTrigger.baseImageTriggerType] The type of + * the auto trigger for base image dependency updates. Possible values include: + * 'All', 'Runtime' + * @member {string} [trigger.baseImageTrigger.status] The current status of + * build trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [trigger.baseImageTrigger.name] The name of the trigger. + */ +export interface Task extends Resource { readonly provisioningState?: string; readonly creationDate?: Date; - alias: string; status?: string; - sourceRepository: SourceRepositoryProperties; platform: PlatformProperties; + agentConfiguration?: AgentProperties; timeout?: number; + step: TaskStepProperties; + trigger?: TriggerProperties; } /** * @class - * Initializes a new instance of the BuildTaskFilter class. + * Initializes a new instance of the PlatformUpdateParameters class. * @constructor - * The filter that can be used for listing build tasks. + * The properties for updating the platform configuration. * - * @member {string} [alias] The alternative name for build task. + * @member {string} [os] The operating system type required for the run. + * Possible values include: 'Windows', 'Linux' + * @member {string} [architecture] The OS architecture. Possible values + * include: 'amd64', 'x86', 'arm' + * @member {string} [variant] Variant of the CPU. Possible values include: + * 'v6', 'v7', 'v8' */ -export interface BuildTaskFilter { - alias?: string; +export interface PlatformUpdateParameters { + os?: string; + architecture?: string; + variant?: string; } /** * @class - * Initializes a new instance of the SourceRepositoryUpdateParameters class. + * Initializes a new instance of the TaskStepUpdateParameters class. * @constructor - * The properties for updating the source code repository configuration. + * Base properties for updating any task step. * + * @member {string} type Polymorphic Discriminator + */ +export interface TaskStepUpdateParameters { + type: string; +} + +/** + * @class + * Initializes a new instance of the AuthInfoUpdateParameters class. + * @constructor + * The authorization properties for accessing the source code repository. + * + * @member {string} [tokenType] The type of Auth token. Possible values + * include: 'PAT', 'OAuth' + * @member {string} [token] The access token used to access the source control + * provider. + * @member {string} [refreshToken] The refresh token used to refresh the access + * token. + * @member {string} [scope] The scope of the access token. + * @member {number} [expiresIn] Time in seconds that the token remains valid + */ +export interface AuthInfoUpdateParameters { + tokenType?: string; + token?: string; + refreshToken?: string; + scope?: string; + expiresIn?: number; +} + +/** + * @class + * Initializes a new instance of the SourceUpdateParameters class. + * @constructor + * The properties for updating the source code repository. + * + * @member {string} [sourceControlType] The type of source control service. + * Possible values include: 'Github', 'VisualStudioTeamService' + * @member {string} [repositoryUrl] The full URL to the source code respository + * @member {string} [branch] The branch name of the source code. * @member {object} [sourceControlAuthProperties] The authorization properties - * for accessing the source code repository. + * for accessing the source code repository and to set up + * webhooks for notifications. * @member {string} [sourceControlAuthProperties.tokenType] The type of Auth * token. Possible values include: 'PAT', 'OAuth' * @member {string} [sourceControlAuthProperties.token] The access token used @@ -1227,34 +1471,33 @@ export interface BuildTaskFilter { * token. * @member {number} [sourceControlAuthProperties.expiresIn] Time in seconds * that the token remains valid - * @member {boolean} [isCommitTriggerEnabled] The value of this property - * indicates whether the source control commit trigger is enabled or not. */ -export interface SourceRepositoryUpdateParameters { - sourceControlAuthProperties?: SourceControlAuthInfo; - isCommitTriggerEnabled?: boolean; +export interface SourceUpdateParameters { + sourceControlType?: string; + repositoryUrl?: string; + branch?: string; + sourceControlAuthProperties?: AuthInfoUpdateParameters; } /** * @class - * Initializes a new instance of the BuildTaskUpdateParameters class. + * Initializes a new instance of the SourceTriggerUpdateParameters class. * @constructor - * The parameters for updating a build task. + * The properties for updating a source based trigger. * - * @member {string} [alias] The alternative updatable name for a build task. - * @member {string} [status] The current status of build task. Possible values - * include: 'Disabled', 'Enabled' - * @member {object} [platform] The platform properties against which the build - * has to happen. - * @member {string} [platform.osType] The operating system type required for - * the build. Possible values include: 'Windows', 'Linux' - * @member {number} [platform.cpu] The CPU configuration in terms of number of - * cores required for the build. - * @member {number} [timeout] Build timeout in seconds. * @member {object} [sourceRepository] The properties that describes the - * source(code) for the build task. + * source(code) for the task. + * @member {string} [sourceRepository.sourceControlType] The type of source + * control service. Possible values include: 'Github', + * 'VisualStudioTeamService' + * @member {string} [sourceRepository.repositoryUrl] The full URL to the source + * code respository + * @member {string} [sourceRepository.branch] The branch name of the source + * code. * @member {object} [sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. + * authorization properties for accessing the source code repository and to set + * up + * webhooks for notifications. * @member {string} [sourceRepository.sourceControlAuthProperties.tokenType] * The type of Auth token. Possible values include: 'PAT', 'OAuth' * @member {string} [sourceRepository.sourceControlAuthProperties.token] The @@ -1265,66 +1508,278 @@ export interface SourceRepositoryUpdateParameters { * scope of the access token. * @member {number} [sourceRepository.sourceControlAuthProperties.expiresIn] * Time in seconds that the token remains valid - * @member {boolean} [sourceRepository.isCommitTriggerEnabled] The value of - * this property indicates whether the source control commit trigger is enabled - * or not. + * @member {array} [sourceTriggerEvents] The source event corresponding to the + * trigger. + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ +export interface SourceTriggerUpdateParameters { + sourceRepository?: SourceUpdateParameters; + sourceTriggerEvents?: string[]; + status?: string; + name: string; +} + +/** + * @class + * Initializes a new instance of the BaseImageTriggerUpdateParameters class. + * @constructor + * The properties for updating base image dependency trigger. + * + * @member {string} [baseImageTriggerType] The type of the auto trigger for + * base image dependency updates. Possible values include: 'All', 'Runtime' + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ +export interface BaseImageTriggerUpdateParameters { + baseImageTriggerType?: string; + status?: string; + name: string; +} + +/** + * @class + * Initializes a new instance of the TriggerUpdateParameters class. + * @constructor + * The properties for updating build triggers. + * + * @member {array} [sourceTriggers] The collection of triggers based on source + * code repository. + * @member {object} [baseImageTrigger] The trigger based on base image + * dependencies. + * @member {string} [baseImageTrigger.baseImageTriggerType] The type of the + * auto trigger for base image dependency updates. Possible values include: + * 'All', 'Runtime' + * @member {string} [baseImageTrigger.status] The current status of build + * trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [baseImageTrigger.name] The name of the trigger. + */ +export interface TriggerUpdateParameters { + sourceTriggers?: SourceTriggerUpdateParameters[]; + baseImageTrigger?: BaseImageTriggerUpdateParameters; +} + +/** + * @class + * Initializes a new instance of the TaskUpdateParameters class. + * @constructor + * The parameters for updating a task. + * + * @member {string} [status] The current status of task. Possible values + * include: 'Disabled', 'Enabled' + * @member {object} [platform] The platform properties against which the run + * has to happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the run + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms of + * number of cores required for the run. + * @member {number} [timeout] Run timeout in seconds. + * @member {object} [step] The properties for updating a task step. + * @member {string} [step.type] Polymorphic Discriminator + * @member {object} [trigger] The properties for updating trigger properties. + * @member {array} [trigger.sourceTriggers] The collection of triggers based on + * source code repository. + * @member {object} [trigger.baseImageTrigger] The trigger based on base image + * dependencies. + * @member {string} [trigger.baseImageTrigger.baseImageTriggerType] The type of + * the auto trigger for base image dependency updates. Possible values include: + * 'All', 'Runtime' + * @member {string} [trigger.baseImageTrigger.status] The current status of + * build trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [trigger.baseImageTrigger.name] The name of the trigger. * @member {object} [tags] The ARM resource tags. */ -export interface BuildTaskUpdateParameters { - alias?: string; +export interface TaskUpdateParameters { status?: string; - platform?: PlatformProperties; + platform?: PlatformUpdateParameters; + agentConfiguration?: AgentProperties; timeout?: number; - sourceRepository?: SourceRepositoryUpdateParameters; + step?: TaskStepUpdateParameters; + trigger?: TriggerUpdateParameters; tags?: { [propertyName: string]: string }; } /** * @class - * Initializes a new instance of the QueueBuildRequest class. + * Initializes a new instance of the Argument class. * @constructor - * The queue build request parameters. + * The properties of a run argument. * - * @member {string} type Polymorphic Discriminator + * @member {string} name The name of the argument. + * @member {string} value The value of the argument. + * @member {boolean} [isSecret] Flag to indicate whether the argument + * represents a secret and want to be removed from build logs. Default value: + * false . */ -export interface QueueBuildRequest { - type: string; +export interface Argument { + name: string; + value: string; + isSecret?: boolean; } /** * @class - * Initializes a new instance of the SourceUploadDefinition class. + * Initializes a new instance of the DockerBuildRequest class. * @constructor - * The properties of a response to source upload request. + * The parameters for a docker quick build. * - * @member {string} [uploadUrl] The URL where the client can upload the source. - * @member {string} [relativePath] The relative path to the source. This is - * used to submit the subsequent queue build request. + * @member {array} [imageNames] The fully qualified image names including the + * repository and tag. + * @member {boolean} [isPushEnabled] The value of this property indicates + * whether the image built should be pushed to the registry or not. Default + * value: true . + * @member {boolean} [noCache] The value of this property indicates whether the + * image cache is enabled or not. Default value: false . + * @member {string} dockerFilePath The Docker file path relative to the source + * location. + * @member {array} [argumentsProperty] The collection of override arguments to + * be used when executing the run. + * @member {string} sourceLocation The URL(absolute or relative) of the source + * that needs to be built. For Docker build, it can be an URL to a tar or + * github repoistory as supported by Docker. + * If it is relative URL, the relative path should be obtained from calling + * getSourceUploadUrl API. + * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . + * @member {object} platform The platform properties against which the build + * will happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the build + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms of + * number of cores required for the run. + */ +export interface DockerBuildRequest extends RunRequest { + imageNames?: string[]; + isPushEnabled?: boolean; + noCache?: boolean; + dockerFilePath: string; + argumentsProperty?: Argument[]; + sourceLocation: string; + timeout?: number; + platform: PlatformProperties; + agentConfiguration?: AgentProperties; +} + +/** + * @class + * Initializes a new instance of the SetValue class. + * @constructor + * The properties of a overridable value that can be passed to a task template. + * + * @member {string} name The name of the overridable value. + * @member {string} value The overridable value. + * @member {boolean} [isSecret] Flag to indicate whether the value represents a + * secret or not. Default value: false . */ -export interface SourceUploadDefinition { - uploadUrl?: string; - relativePath?: string; +export interface SetValue { + name: string; + value: string; + isSecret?: boolean; } /** * @class - * Initializes a new instance of the BaseImageDependency class. + * Initializes a new instance of the BuildTaskRequest class. * @constructor - * Properties that describe a base image dependency. + * The request parameters for a quick task build. * - * @member {string} [type] The type of the base image dependency. Possible - * values include: 'BuildTime', 'RunTime' - * @member {string} [registry] The registry login server. - * @member {string} [repository] The repository name. - * @member {string} [tag] The tag name. - * @member {string} [digest] The sha256-based digest of the image manifest. + * @member {string} definitionFilePath The template/definition file path + * relative to the source. + * @member {string} [valuesFilePath] The values/parameters file path relative + * to the source. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {string} sourceLocation The URL(absolute or relative) of the source + * that needs to be built. For Docker build, it can be an URL to a tar or + * github repoistory as supported by Docker. + * If it is relative URL, the relative path should be obtained from calling + * getSourceUploadUrl API. + * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . + * @member {object} platform The platform properties against which the build + * will happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the build + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms of + * number of cores required for the run. + */ +export interface BuildTaskRequest extends RunRequest { + definitionFilePath: string; + valuesFilePath?: string; + values?: SetValue[]; + sourceLocation: string; + timeout?: number; + platform: PlatformProperties; + agentConfiguration?: AgentProperties; +} + +/** + * @class + * Initializes a new instance of the TaskRunRequest class. + * @constructor + * The parameters for a task run request. + * + * @member {string} taskName The name of task against which run has to be + * queued. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. */ -export interface BaseImageDependency { - type?: string; - registry?: string; - repository?: string; - tag?: string; - digest?: string; +export interface TaskRunRequest extends RunRequest { + taskName: string; + values?: SetValue[]; +} + +/** + * @class + * Initializes a new instance of the QuickTaskRunRequest class. + * @constructor + * The parameters for a quick task run request. + * + * @member {string} taskDefinitionContent Base64 encoded value of the + * template/definition file content. + * @member {string} [valuesContent] Base64 encoded value of the + * parameters/values file content. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . + * @member {object} platform The platform properties against which the build + * will happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the build + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms of + * number of cores required for the run. + */ +export interface QuickTaskRunRequest extends RunRequest { + taskDefinitionContent: string; + valuesContent?: string; + values?: SetValue[]; + timeout?: number; + platform: PlatformProperties; + agentConfiguration?: AgentProperties; } /** @@ -1333,7 +1788,6 @@ export interface BaseImageDependency { * @constructor * The Docker build step. * - * @member {string} [branch] The repository branch name. * @member {array} [imageNames] The fully qualified image names including the * repository and tag. * @member {boolean} [isPushEnabled] The value of this property indicates @@ -1341,27 +1795,65 @@ export interface BaseImageDependency { * value: true . * @member {boolean} [noCache] The value of this property indicates whether the * image cache is enabled or not. Default value: false . - * @member {string} [dockerFilePath] The Docker file path relative to the - * source control root. - * @member {string} [contextPath] The relative context path for a docker build - * in the source. - * @member {array} [buildArguments] The custom arguments for building this - * build step. - * @member {array} [baseImageDependencies] List of base image dependencies for - * a step. - * @member {string} [baseImageTrigger] The type of the auto trigger for base - * image dependency updates. Possible values include: 'All', 'Runtime', 'None' - */ -export interface DockerBuildStep extends BuildStepProperties { - branch?: string; + * @member {string} dockerFilePath The Docker file path relative to the source + * context. + * @member {array} [argumentsProperty] The collection of override arguments to + * be used when executing this build step. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository URL + * of the build task. + */ +export interface DockerBuildStep extends TaskStepProperties { imageNames?: string[]; isPushEnabled?: boolean; noCache?: boolean; - dockerFilePath?: string; + dockerFilePath: string; + argumentsProperty?: Argument[]; + contextPath?: string; +} + +/** + * @class + * Initializes a new instance of the BuildTaskStep class. + * @constructor + * The properties of a build task step. + * + * @member {string} definitionFilePath The build task template/definition file + * path relative to the source context. + * @member {string} [valuesFilePath] The task values/parameters file path + * relative to the source context. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository URL + * of the build task. + */ +export interface BuildTaskStep extends TaskStepProperties { + definitionFilePath: string; + valuesFilePath?: string; + values?: SetValue[]; contextPath?: string; - buildArguments?: BuildArgument[]; - readonly baseImageDependencies?: BaseImageDependency[]; - baseImageTrigger?: string; +} + +/** + * @class + * Initializes a new instance of the RunTaskStep class. + * @constructor + * The properties of a generic task run step. + * + * @member {string} taskDefinitionContent Base64 encoded value of the + * template/definition file content. + * @member {string} [valuesContent] Base64 encoded value of the + * parameters/values file content. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + */ +export interface RunTaskStep extends TaskStepProperties { + taskDefinitionContent: string; + valuesContent?: string; + values?: SetValue[]; } /** @@ -1370,7 +1862,6 @@ export interface DockerBuildStep extends BuildStepProperties { * @constructor * The properties for updating a docker build step. * - * @member {string} [branch] The repository branch name. * @member {array} [imageNames] The fully qualified image names including the * repository and tag. * @member {boolean} [isPushEnabled] The value of this property indicates @@ -1378,77 +1869,64 @@ export interface DockerBuildStep extends BuildStepProperties { * @member {boolean} [noCache] The value of this property indicates whether the * image cache is enabled or not. * @member {string} [dockerFilePath] The Docker file path relative to the - * source control root. - * @member {string} [contextPath] The relative context path for a docker build - * in the source. - * @member {array} [buildArguments] The custom arguments for building this - * build step. - * @member {string} [baseImageTrigger] The type of the auto trigger for base - * image dependency updates. Possible values include: 'All', 'Runtime', 'None' - */ -export interface DockerBuildStepUpdateParameters extends BuildStepPropertiesUpdateParameters { - branch?: string; + * source context. + * @member {array} [argumentsProperty] The collection of override arguments to + * be used when executing this build step. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository URL + * of the build task. + */ +export interface DockerBuildStepUpdateParameters extends TaskStepUpdateParameters { imageNames?: string[]; isPushEnabled?: boolean; noCache?: boolean; dockerFilePath?: string; + argumentsProperty?: Argument[]; contextPath?: string; - buildArguments?: BuildArgument[]; - baseImageTrigger?: string; } /** * @class - * Initializes a new instance of the BuildTaskBuildRequest class. + * Initializes a new instance of the BuildTaskStepUpdateParameters class. * @constructor - * The queue build parameters based on a build task. + * The properties of updating a build task step. * - * @member {string} buildTaskName The name of build task against which build - * has to be queued. + * @member {string} [definitionFilePath] The build task template/definition + * file path relative to the source context. + * @member {string} [valuesFilePath] The task values/parameters file path + * relative to the source context. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository URL + * of the build task. */ -export interface BuildTaskBuildRequest extends QueueBuildRequest { - buildTaskName: string; +export interface BuildTaskStepUpdateParameters extends TaskStepUpdateParameters { + definitionFilePath?: string; + valuesFilePath?: string; + values?: SetValue[]; + contextPath?: string; } /** * @class - * Initializes a new instance of the QuickBuildRequest class. + * Initializes a new instance of the RunTaskStepUpdateParameters class. * @constructor - * The queue build request parameters for a quick build. + * The properties for updating generic task run step. * - * @member {array} [imageNames] The fully qualified image names including the - * repository and tag. - * @member {string} sourceLocation The URL(absolute or relative) of the source - * that needs to be built. For Docker build, it can be an URL to a tar or - * github repoistory as supported by Docker. - * If it is relative URL, the relative path should be obtained from calling - * getSourceUploadUrl API. - * @member {array} [buildArguments] The collection of build arguments to be - * used. - * @member {boolean} [isPushEnabled] The value of this property indicates - * whether the image built should be pushed to the registry or not. Default - * value: true . - * @member {boolean} [noCache] The value of this property indicates whether the - * image cache is enabled or not. Default value: false . - * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . - * @member {object} platform The platform properties against which the build - * will happen. - * @member {string} [platform.osType] The operating system type required for - * the build. Possible values include: 'Windows', 'Linux' - * @member {number} [platform.cpu] The CPU configuration in terms of number of - * cores required for the build. - * @member {string} dockerFilePath The Docker file path relative to the source - * location. + * @member {string} [taskDefinitionContent] Base64 encoded value of the + * template/definition file content. + * @member {string} [valuesContent] Base64 encoded value of the + * parameters/values file content. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. */ -export interface QuickBuildRequest extends QueueBuildRequest { - imageNames?: string[]; - sourceLocation: string; - buildArguments?: BuildArgument[]; - isPushEnabled?: boolean; - noCache?: boolean; - timeout?: number; - platform: PlatformProperties; - dockerFilePath: string; +export interface RunTaskStepUpdateParameters extends TaskStepUpdateParameters { + taskDefinitionContent?: string; + valuesContent?: string; + values?: SetValue[]; } @@ -1519,52 +1997,26 @@ export interface EventListResult extends Array { /** * @class - * Initializes a new instance of the BuildListResult class. - * @constructor - * Collection of builds. - * - * @member {string} [nextLink] The URI that can be used to request the next set - * of paged results. - */ -export interface BuildListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the BuildStepList class. - * @constructor - * The collection of build items. - * - * @member {string} [nextLink] The URI that can be used to request the next set - * of paged results. - */ -export interface BuildStepList extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the BuildArgumentList class. + * Initializes a new instance of the RunListResult class. * @constructor - * The list of build arguments for a build step. + * Collection of runs. * * @member {string} [nextLink] The URI that can be used to request the next set * of paged results. */ -export interface BuildArgumentList extends Array { +export interface RunListResult extends Array { nextLink?: string; } /** * @class - * Initializes a new instance of the BuildTaskListResult class. + * Initializes a new instance of the TaskListResult class. * @constructor - * The collection of build tasks. + * The collection of tasks. * * @member {string} [nextLink] The URI that can be used to request the next set * of paged results. */ -export interface BuildTaskListResult extends Array { +export interface TaskListResult extends Array { nextLink?: string; } diff --git a/lib/services/containerRegistryManagement/lib/models/index.js b/lib/services/containerRegistryManagement/lib/models/index.js index cb2d81152f..807e775833 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.js +++ b/lib/services/containerRegistryManagement/lib/models/index.js @@ -23,6 +23,8 @@ exports.ImportImageParameters = require('./importImageParameters'); exports.RegistryNameCheckRequest = require('./registryNameCheckRequest'); exports.RegistryNameStatus = require('./registryNameStatus'); exports.OperationDisplayDefinition = require('./operationDisplayDefinition'); +exports.OperationMetricSpecificationDefinition = require('./operationMetricSpecificationDefinition'); +exports.OperationServiceSpecificationDefinition = require('./operationServiceSpecificationDefinition'); exports.OperationDefinition = require('./operationDefinition'); exports.Sku = require('./sku'); exports.Status = require('./status'); @@ -35,6 +37,9 @@ exports.RegistryListCredentialsResult = require('./registryListCredentialsResult exports.RegenerateCredentialParameters = require('./regenerateCredentialParameters'); exports.RegistryUsage = require('./registryUsage'); exports.RegistryUsageListResult = require('./registryUsageListResult'); +exports.QuarantinePolicy = require('./quarantinePolicy'); +exports.TrustPolicy = require('./trustPolicy'); +exports.RegistryPolicies = require('./registryPolicies'); exports.Replication = require('./replication'); exports.ReplicationUpdateParameters = require('./replicationUpdateParameters'); exports.Webhook = require('./webhook'); @@ -50,48 +55,65 @@ exports.EventContent = require('./eventContent'); exports.EventRequestMessage = require('./eventRequestMessage'); exports.EventResponseMessage = require('./eventResponseMessage'); exports.Event = require('./event'); +exports.RunRequest = require('./runRequest'); exports.ImageDescriptor = require('./imageDescriptor'); exports.ImageUpdateTrigger = require('./imageUpdateTrigger'); -exports.GitCommitTrigger = require('./gitCommitTrigger'); +exports.SourceTriggerDescriptor = require('./sourceTriggerDescriptor'); exports.PlatformProperties = require('./platformProperties'); +exports.AgentProperties = require('./agentProperties'); exports.ProxyResource = require('./proxyResource'); -exports.Build = require('./build'); -exports.BuildFilter = require('./buildFilter'); -exports.BuildUpdateParameters = require('./buildUpdateParameters'); -exports.BuildGetLogResult = require('./buildGetLogResult'); -exports.BuildStepProperties = require('./buildStepProperties'); -exports.BuildStep = require('./buildStep'); -exports.BuildStepPropertiesUpdateParameters = require('./buildStepPropertiesUpdateParameters'); -exports.BuildStepUpdateParameters = require('./buildStepUpdateParameters'); -exports.BuildArgument = require('./buildArgument'); -exports.SourceControlAuthInfo = require('./sourceControlAuthInfo'); -exports.SourceRepositoryProperties = require('./sourceRepositoryProperties'); -exports.BuildTask = require('./buildTask'); -exports.BuildTaskFilter = require('./buildTaskFilter'); -exports.SourceRepositoryUpdateParameters = require('./sourceRepositoryUpdateParameters'); -exports.BuildTaskUpdateParameters = require('./buildTaskUpdateParameters'); -exports.QueueBuildRequest = require('./queueBuildRequest'); +exports.Run = require('./run'); exports.SourceUploadDefinition = require('./sourceUploadDefinition'); +exports.RunFilter = require('./runFilter'); +exports.RunUpdateParameters = require('./runUpdateParameters'); +exports.RunGetLogResult = require('./runGetLogResult'); exports.BaseImageDependency = require('./baseImageDependency'); +exports.TaskStepProperties = require('./taskStepProperties'); +exports.AuthInfo = require('./authInfo'); +exports.SourceProperties = require('./sourceProperties'); +exports.SourceTrigger = require('./sourceTrigger'); +exports.BaseImageTrigger = require('./baseImageTrigger'); +exports.TriggerProperties = require('./triggerProperties'); +exports.Task = require('./task'); +exports.PlatformUpdateParameters = require('./platformUpdateParameters'); +exports.TaskStepUpdateParameters = require('./taskStepUpdateParameters'); +exports.AuthInfoUpdateParameters = require('./authInfoUpdateParameters'); +exports.SourceUpdateParameters = require('./sourceUpdateParameters'); +exports.SourceTriggerUpdateParameters = require('./sourceTriggerUpdateParameters'); +exports.BaseImageTriggerUpdateParameters = require('./baseImageTriggerUpdateParameters'); +exports.TriggerUpdateParameters = require('./triggerUpdateParameters'); +exports.TaskUpdateParameters = require('./taskUpdateParameters'); +exports.Argument = require('./argument'); +exports.DockerBuildRequest = require('./dockerBuildRequest'); +exports.SetValue = require('./setValue'); +exports.BuildTaskRequest = require('./buildTaskRequest'); +exports.TaskRunRequest = require('./taskRunRequest'); +exports.QuickTaskRunRequest = require('./quickTaskRunRequest'); exports.DockerBuildStep = require('./dockerBuildStep'); +exports.BuildTaskStep = require('./buildTaskStep'); +exports.RunTaskStep = require('./runTaskStep'); exports.DockerBuildStepUpdateParameters = require('./dockerBuildStepUpdateParameters'); -exports.BuildTaskBuildRequest = require('./buildTaskBuildRequest'); -exports.QuickBuildRequest = require('./quickBuildRequest'); +exports.BuildTaskStepUpdateParameters = require('./buildTaskStepUpdateParameters'); +exports.RunTaskStepUpdateParameters = require('./runTaskStepUpdateParameters'); exports.RegistryListResult = require('./registryListResult'); exports.OperationListResult = require('./operationListResult'); exports.ReplicationListResult = require('./replicationListResult'); exports.WebhookListResult = require('./webhookListResult'); exports.EventListResult = require('./eventListResult'); -exports.BuildListResult = require('./buildListResult'); -exports.BuildStepList = require('./buildStepList'); -exports.BuildArgumentList = require('./buildArgumentList'); -exports.BuildTaskListResult = require('./buildTaskListResult'); +exports.RunListResult = require('./runListResult'); +exports.TaskListResult = require('./taskListResult'); exports.discriminators = { - 'BuildStepProperties' : exports.BuildStepProperties, - 'BuildStepPropertiesUpdateParameters' : exports.BuildStepPropertiesUpdateParameters, - 'QueueBuildRequest' : exports.QueueBuildRequest, - 'BuildStepProperties.Docker' : exports.DockerBuildStep, - 'BuildStepPropertiesUpdateParameters.Docker' : exports.DockerBuildStepUpdateParameters, - 'QueueBuildRequest.BuildTask' : exports.BuildTaskBuildRequest, - 'QueueBuildRequest.QuickBuild' : exports.QuickBuildRequest + 'RunRequest' : exports.RunRequest, + 'TaskStepProperties' : exports.TaskStepProperties, + 'TaskStepUpdateParameters' : exports.TaskStepUpdateParameters, + 'RunRequest.DockerBuildRequest' : exports.DockerBuildRequest, + 'RunRequest.BuildTaskRequest' : exports.BuildTaskRequest, + 'RunRequest.TaskRunRequest' : exports.TaskRunRequest, + 'RunRequest.QuickTaskRunRequest' : exports.QuickTaskRunRequest, + 'TaskStepProperties.Docker' : exports.DockerBuildStep, + 'TaskStepProperties.BuildTask' : exports.BuildTaskStep, + 'TaskStepProperties.RunTask' : exports.RunTaskStep, + 'TaskStepUpdateParameters.Docker' : exports.DockerBuildStepUpdateParameters, + 'TaskStepUpdateParameters.BuildTask' : exports.BuildTaskStepUpdateParameters, + 'TaskStepUpdateParameters.RunTask' : exports.RunTaskStepUpdateParameters }; diff --git a/lib/services/containerRegistryManagement/lib/models/operationDefinition.js b/lib/services/containerRegistryManagement/lib/models/operationDefinition.js index 7b3239ce82..a26c639849 100644 --- a/lib/services/containerRegistryManagement/lib/models/operationDefinition.js +++ b/lib/services/containerRegistryManagement/lib/models/operationDefinition.js @@ -19,6 +19,8 @@ const models = require('./index'); class OperationDefinition { /** * Create a OperationDefinition. + * @member {string} [origin] The origin information of the container registry + * operation. * @member {string} [name] Operation name: {provider}/{resource}/{operation}. * @member {object} [display] The display information for the container * registry operation. @@ -28,6 +30,10 @@ class OperationDefinition { * performed. * @member {string} [display.operation] The operation that users can perform. * @member {string} [display.description] The description for the operation. + * @member {object} [serviceSpecification] The definition of Azure Monitoring + * service. + * @member {array} [serviceSpecification.metricSpecifications] A list of + * Azure Monitoring metrics definition. */ constructor() { } @@ -46,6 +52,13 @@ class OperationDefinition { name: 'Composite', className: 'OperationDefinition', modelProperties: { + origin: { + required: false, + serializedName: 'origin', + type: { + name: 'String' + } + }, name: { required: false, serializedName: 'name', @@ -60,6 +73,14 @@ class OperationDefinition { name: 'Composite', className: 'OperationDisplayDefinition' } + }, + serviceSpecification: { + required: false, + serializedName: 'properties.serviceSpecification', + type: { + name: 'Composite', + className: 'OperationServiceSpecificationDefinition' + } } } } diff --git a/lib/services/containerRegistryManagement/lib/models/operationMetricSpecificationDefinition.js b/lib/services/containerRegistryManagement/lib/models/operationMetricSpecificationDefinition.js new file mode 100644 index 0000000000..7b071e928f --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/operationMetricSpecificationDefinition.js @@ -0,0 +1,92 @@ +/* + * 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 definition of Azure Monitoring metric. + * + */ +class OperationMetricSpecificationDefinition { + /** + * Create a OperationMetricSpecificationDefinition. + * @member {string} [name] Metric name. + * @member {string} [displayName] Metric display name. + * @member {string} [displayDescription] Metric description. + * @member {string} [unit] Metric unit. + * @member {string} [aggregationType] Metric aggregation type. + * @member {string} [internalMetricName] Internal metric name. + */ + constructor() { + } + + /** + * Defines the metadata of OperationMetricSpecificationDefinition + * + * @returns {object} metadata of OperationMetricSpecificationDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationMetricSpecificationDefinition', + type: { + name: 'Composite', + className: 'OperationMetricSpecificationDefinition', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + displayName: { + required: false, + serializedName: 'displayName', + type: { + name: 'String' + } + }, + displayDescription: { + required: false, + serializedName: 'displayDescription', + type: { + name: 'String' + } + }, + unit: { + required: false, + serializedName: 'unit', + type: { + name: 'String' + } + }, + aggregationType: { + required: false, + serializedName: 'aggregationType', + type: { + name: 'String' + } + }, + internalMetricName: { + required: false, + serializedName: 'internalMetricName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationMetricSpecificationDefinition; diff --git a/lib/services/containerRegistryManagement/lib/models/operationServiceSpecificationDefinition.js b/lib/services/containerRegistryManagement/lib/models/operationServiceSpecificationDefinition.js new file mode 100644 index 0000000000..d8698d8644 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/operationServiceSpecificationDefinition.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The definition of Azure Monitoring metrics list. + * + */ +class OperationServiceSpecificationDefinition { + /** + * Create a OperationServiceSpecificationDefinition. + * @member {array} [metricSpecifications] A list of Azure Monitoring metrics + * definition. + */ + constructor() { + } + + /** + * Defines the metadata of OperationServiceSpecificationDefinition + * + * @returns {object} metadata of OperationServiceSpecificationDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationServiceSpecificationDefinition', + type: { + name: 'Composite', + className: 'OperationServiceSpecificationDefinition', + modelProperties: { + metricSpecifications: { + required: false, + serializedName: 'metricSpecifications', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationMetricSpecificationDefinitionElementType', + type: { + name: 'Composite', + className: 'OperationMetricSpecificationDefinition' + } + } + } + } + } + } + }; + } +} + +module.exports = OperationServiceSpecificationDefinition; diff --git a/lib/services/containerRegistryManagement/lib/models/platformProperties.js b/lib/services/containerRegistryManagement/lib/models/platformProperties.js index 1199942297..ee8e516fbd 100644 --- a/lib/services/containerRegistryManagement/lib/models/platformProperties.js +++ b/lib/services/containerRegistryManagement/lib/models/platformProperties.js @@ -11,16 +11,18 @@ 'use strict'; /** - * The platform properties against which the build has to happen. + * The platform properties against which the run has to happen. * */ class PlatformProperties { /** * Create a PlatformProperties. - * @member {string} osType The operating system type required for the build. + * @member {string} os The operating system type required for the run. * Possible values include: 'Windows', 'Linux' - * @member {number} [cpu] The CPU configuration in terms of number of cores - * required for the build. + * @member {string} architecture The OS architecture. Possible values + * include: 'amd64', 'x86', 'arm' + * @member {string} [variant] Variant of the CPU. Possible values include: + * 'v6', 'v7', 'v8' */ constructor() { } @@ -39,18 +41,25 @@ class PlatformProperties { name: 'Composite', className: 'PlatformProperties', modelProperties: { - osType: { + os: { required: true, - serializedName: 'osType', + serializedName: 'os', type: { name: 'String' } }, - cpu: { + architecture: { + required: true, + serializedName: 'architecture', + type: { + name: 'String' + } + }, + variant: { required: false, - serializedName: 'cpu', + serializedName: 'variant', type: { - name: 'Number' + name: 'String' } } } diff --git a/lib/services/containerRegistryManagement/lib/models/platformUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/platformUpdateParameters.js new file mode 100644 index 0000000000..df811ebf64 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/platformUpdateParameters.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The properties for updating the platform configuration. + * + */ +class PlatformUpdateParameters { + /** + * Create a PlatformUpdateParameters. + * @member {string} [os] The operating system type required for the run. + * Possible values include: 'Windows', 'Linux' + * @member {string} [architecture] The OS architecture. Possible values + * include: 'amd64', 'x86', 'arm' + * @member {string} [variant] Variant of the CPU. Possible values include: + * 'v6', 'v7', 'v8' + */ + constructor() { + } + + /** + * Defines the metadata of PlatformUpdateParameters + * + * @returns {object} metadata of PlatformUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'PlatformUpdateParameters', + type: { + name: 'Composite', + className: 'PlatformUpdateParameters', + modelProperties: { + os: { + required: false, + serializedName: 'os', + type: { + name: 'String' + } + }, + architecture: { + required: false, + serializedName: 'architecture', + type: { + name: 'String' + } + }, + variant: { + required: false, + serializedName: 'variant', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PlatformUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/quarantinePolicy.js b/lib/services/containerRegistryManagement/lib/models/quarantinePolicy.js new file mode 100644 index 0000000000..1157c77a09 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/quarantinePolicy.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * An object that represents quarantine policy for a container registry. + * + */ +class QuarantinePolicy { + /** + * Create a QuarantinePolicy. + * @member {string} [status] The value that indicates whether the policy is + * enabled or not. Possible values include: 'enabled', 'disabled' + */ + constructor() { + } + + /** + * Defines the metadata of QuarantinePolicy + * + * @returns {object} metadata of QuarantinePolicy + * + */ + mapper() { + return { + required: false, + serializedName: 'QuarantinePolicy', + type: { + name: 'Composite', + className: 'QuarantinePolicy', + modelProperties: { + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = QuarantinePolicy; diff --git a/lib/services/containerRegistryManagement/lib/models/quickTaskRunRequest.js b/lib/services/containerRegistryManagement/lib/models/quickTaskRunRequest.js new file mode 100644 index 0000000000..682f50bace --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/quickTaskRunRequest.js @@ -0,0 +1,145 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The parameters for a quick task run request. + * + * @extends models['RunRequest'] + */ +class QuickTaskRunRequest extends models['RunRequest'] { + /** + * Create a QuickTaskRunRequest. + * @member {string} taskDefinitionContent Base64 encoded value of the + * template/definition file content. + * @member {string} [valuesContent] Base64 encoded value of the + * parameters/values file content. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . + * @member {object} platform The platform properties against which the build + * will happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the + * build agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms + * of number of cores required for the run. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of QuickTaskRunRequest + * + * @returns {object} metadata of QuickTaskRunRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'QuickTaskRunRequest', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'RunRequest', + className: 'QuickTaskRunRequest', + modelProperties: { + isArchiveEnabled: { + required: false, + serializedName: 'isArchiveEnabled', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + taskDefinitionContent: { + required: true, + serializedName: 'taskDefinitionContent', + type: { + name: 'String' + } + }, + valuesContent: { + required: false, + serializedName: 'valuesContent', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } + }, + timeout: { + required: false, + serializedName: 'timeout', + defaultValue: 3600, + constraints: { + InclusiveMaximum: 28800, + InclusiveMinimum: 300 + }, + type: { + name: 'Number' + } + }, + platform: { + required: true, + serializedName: 'platform', + type: { + name: 'Composite', + className: 'PlatformProperties' + } + }, + agentConfiguration: { + required: false, + serializedName: 'agentConfiguration', + type: { + name: 'Composite', + className: 'AgentProperties' + } + } + } + } + }; + } +} + +module.exports = QuickTaskRunRequest; diff --git a/lib/services/containerRegistryManagement/lib/models/registryPolicies.js b/lib/services/containerRegistryManagement/lib/models/registryPolicies.js new file mode 100644 index 0000000000..0289e07d8e --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/registryPolicies.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * An object that represents policies for a container registry. + * + */ +class RegistryPolicies { + /** + * Create a RegistryPolicies. + * @member {object} [quarantinePolicy] An object that represents quarantine + * policy for a container registry. + * @member {string} [quarantinePolicy.status] The value that indicates + * whether the policy is enabled or not. Possible values include: 'enabled', + * 'disabled' + * @member {object} [trustPolicy] An object that represents content trust + * policy for a container registry. + * @member {string} [trustPolicy.type] The type of trust policy. Possible + * values include: 'Notary' + * @member {string} [trustPolicy.status] The value that indicates whether the + * policy is enabled or not. Possible values include: 'enabled', 'disabled' + */ + constructor() { + } + + /** + * Defines the metadata of RegistryPolicies + * + * @returns {object} metadata of RegistryPolicies + * + */ + mapper() { + return { + required: false, + serializedName: 'RegistryPolicies', + type: { + name: 'Composite', + className: 'RegistryPolicies', + modelProperties: { + quarantinePolicy: { + required: false, + serializedName: 'quarantinePolicy', + type: { + name: 'Composite', + className: 'QuarantinePolicy' + } + }, + trustPolicy: { + required: false, + serializedName: 'trustPolicy', + type: { + name: 'Composite', + className: 'TrustPolicy' + } + } + } + } + }; + } +} + +module.exports = RegistryPolicies; diff --git a/lib/services/containerRegistryManagement/lib/models/run.js b/lib/services/containerRegistryManagement/lib/models/run.js new file mode 100644 index 0000000000..d7de25ecfa --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/run.js @@ -0,0 +1,239 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Run resource properties + * + * @extends models['ProxyResource'] + */ +class Run extends models['ProxyResource'] { + /** + * Create a Run. + * @member {string} [runId] The unique identifier for the run. + * @member {string} [status] The current status of the run. Possible values + * include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', + * 'Canceled', 'Error', 'Timeout' + * @member {date} [lastUpdatedTime] The last updated time for the run. + * @member {string} [runType] The type of run. Possible values include: + * 'QuickBuild', 'AutoBuild' + * @member {date} [createTime] The time the run was scheduled. + * @member {date} [startTime] The time the run started. + * @member {date} [finishTime] The time the run finished. + * @member {array} [outputImages] The list of all images that were generated + * from the run. This is applicable if the run is of type Build. + * @member {string} [task] The task against which run was scheduled. + * @member {object} [imageUpdateTrigger] The image update trigger that caused + * the run. This is applicable if the task is of build type. + * @member {string} [imageUpdateTrigger.id] The unique ID of the trigger. + * @member {date} [imageUpdateTrigger.timestamp] The timestamp when the image + * update happened. + * @member {array} [imageUpdateTrigger.images] The list of image updates that + * caused the build. + * @member {object} [sourceTrigger] The source trigger that caused the run. + * @member {string} [sourceTrigger.id] The unique ID of the trigger. + * @member {string} [sourceTrigger.eventType] The event type of the trigger. + * @member {string} [sourceTrigger.commitId] The unique ID that identifies a + * commit. + * @member {string} [sourceTrigger.pullRequestId] The unique ID that + * identifies pull request. + * @member {string} [sourceTrigger.repositoryUrl] The repository URL. + * @member {string} [sourceTrigger.branchName] The branch name in the + * repository. + * @member {string} [sourceTrigger.providerType] The source control provider + * type. + * @member {boolean} [isArchiveEnabled] The value that indicates whether + * archiving is enabled or not. Default value: false . + * @member {object} [platform] The platform properties against which the run + * will happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the run + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms + * of number of cores required for the run. + * @member {string} [provisioningState] The provisioning state of a run. + * Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + * 'Failed', 'Canceled' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Run + * + * @returns {object} metadata of Run + * + */ + mapper() { + return { + required: false, + serializedName: 'Run', + type: { + name: 'Composite', + className: 'Run', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + runId: { + required: false, + serializedName: 'properties.runId', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + lastUpdatedTime: { + required: false, + serializedName: 'properties.lastUpdatedTime', + type: { + name: 'DateTime' + } + }, + runType: { + required: false, + serializedName: 'properties.runType', + type: { + name: 'String' + } + }, + createTime: { + required: false, + serializedName: 'properties.createTime', + type: { + name: 'DateTime' + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + finishTime: { + required: false, + serializedName: 'properties.finishTime', + type: { + name: 'DateTime' + } + }, + outputImages: { + required: false, + serializedName: 'properties.outputImages', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ImageDescriptorElementType', + type: { + name: 'Composite', + className: 'ImageDescriptor' + } + } + } + }, + task: { + required: false, + serializedName: 'properties.task', + type: { + name: 'String' + } + }, + imageUpdateTrigger: { + required: false, + serializedName: 'properties.imageUpdateTrigger', + type: { + name: 'Composite', + className: 'ImageUpdateTrigger' + } + }, + sourceTrigger: { + required: false, + serializedName: 'properties.sourceTrigger', + type: { + name: 'Composite', + className: 'SourceTriggerDescriptor' + } + }, + isArchiveEnabled: { + required: false, + serializedName: 'properties.isArchiveEnabled', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + platform: { + required: false, + serializedName: 'properties.platform', + type: { + name: 'Composite', + className: 'PlatformProperties' + } + }, + agentConfiguration: { + required: false, + serializedName: 'properties.agentConfiguration', + type: { + name: 'Composite', + className: 'AgentProperties' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Run; diff --git a/lib/services/containerRegistryManagement/lib/models/runFilter.js b/lib/services/containerRegistryManagement/lib/models/runFilter.js new file mode 100644 index 0000000000..3a4434f1ab --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/runFilter.js @@ -0,0 +1,116 @@ +/* + * 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'; + +/** + * Properties that are enabled for Odata querying on runs. + * + */ +class RunFilter { + /** + * Create a RunFilter. + * @member {string} [runId] The unique identifier for the run. + * @member {string} [runType] The type of run. Possible values include: + * 'QuickBuild', 'AutoBuild' + * @member {string} [status] The current status of the run. Possible values + * include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', + * 'Canceled', 'Error', 'Timeout' + * @member {date} [createTime] The create time for a run. + * @member {date} [finishTime] The time the run finished. + * @member {string} [outputImageManifests] The list of comma-separated image + * manifests that were generated from the run. This is applicable if the run + * is of + * build type. + * @member {boolean} [isArchiveEnabled] The value that indicates whether + * archiving is enabled or not. + * @member {string} [taskName] The name of the task that the run corresponds + * to. + */ + constructor() { + } + + /** + * Defines the metadata of RunFilter + * + * @returns {object} metadata of RunFilter + * + */ + mapper() { + return { + required: false, + serializedName: 'RunFilter', + type: { + name: 'Composite', + className: 'RunFilter', + modelProperties: { + runId: { + required: false, + serializedName: 'runId', + type: { + name: 'String' + } + }, + runType: { + required: false, + serializedName: 'runType', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + createTime: { + required: false, + serializedName: 'createTime', + type: { + name: 'DateTime' + } + }, + finishTime: { + required: false, + serializedName: 'finishTime', + type: { + name: 'DateTime' + } + }, + outputImageManifests: { + required: false, + serializedName: 'outputImageManifests', + type: { + name: 'String' + } + }, + isArchiveEnabled: { + required: false, + serializedName: 'isArchiveEnabled', + type: { + name: 'Boolean' + } + }, + taskName: { + required: false, + serializedName: 'taskName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RunFilter; diff --git a/lib/services/containerRegistryManagement/lib/models/runGetLogResult.js b/lib/services/containerRegistryManagement/lib/models/runGetLogResult.js new file mode 100644 index 0000000000..afe8df834e --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/runGetLogResult.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The result of get log link operation. + * + */ +class RunGetLogResult { + /** + * Create a RunGetLogResult. + * @member {string} [logLink] The link to logs for a run on a azure container + * registry. + */ + constructor() { + } + + /** + * Defines the metadata of RunGetLogResult + * + * @returns {object} metadata of RunGetLogResult + * + */ + mapper() { + return { + required: false, + serializedName: 'RunGetLogResult', + type: { + name: 'Composite', + className: 'RunGetLogResult', + modelProperties: { + logLink: { + required: false, + serializedName: 'logLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RunGetLogResult; diff --git a/lib/services/containerRegistryManagement/lib/models/runListResult.js b/lib/services/containerRegistryManagement/lib/models/runListResult.js new file mode 100644 index 0000000000..6052c64db3 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/runListResult.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'; + +/** + * Collection of runs. + */ +class RunListResult extends Array { + /** + * Create a RunListResult. + * @member {string} [nextLink] The URI that can be used to request the next + * set of paged results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RunListResult + * + * @returns {object} metadata of RunListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'RunListResult', + type: { + name: 'Composite', + className: 'RunListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RunElementType', + type: { + name: 'Composite', + className: 'Run' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RunListResult; diff --git a/lib/services/containerRegistryManagement/lib/models/runRequest.js b/lib/services/containerRegistryManagement/lib/models/runRequest.js new file mode 100644 index 0000000000..c5cb76253c --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/runRequest.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 request parameters for scheduling a run. + * + */ +class RunRequest { + /** + * Create a RunRequest. + * @member {boolean} [isArchiveEnabled] The value that indicates whether + * archiving is enabled for the run or not. Default value: false . + * @member {string} type Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of RunRequest + * + * @returns {object} metadata of RunRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'RunRequest', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'RunRequest', + className: 'RunRequest', + modelProperties: { + isArchiveEnabled: { + required: false, + serializedName: 'isArchiveEnabled', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RunRequest; diff --git a/lib/services/containerRegistryManagement/lib/models/runTaskStep.js b/lib/services/containerRegistryManagement/lib/models/runTaskStep.js new file mode 100644 index 0000000000..61248c819c --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/runTaskStep.js @@ -0,0 +1,112 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties of a generic task run step. + * + * @extends models['TaskStepProperties'] + */ +class RunTaskStep extends models['TaskStepProperties'] { + /** + * Create a RunTaskStep. + * @member {string} taskDefinitionContent Base64 encoded value of the + * template/definition file content. + * @member {string} [valuesContent] Base64 encoded value of the + * parameters/values file content. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RunTaskStep + * + * @returns {object} metadata of RunTaskStep + * + */ + mapper() { + return { + required: false, + serializedName: 'RunTask', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepProperties', + className: 'RunTaskStep', + modelProperties: { + baseImageDependencies: { + required: false, + readOnly: true, + serializedName: 'baseImageDependencies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BaseImageDependencyElementType', + type: { + name: 'Composite', + className: 'BaseImageDependency' + } + } + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + taskDefinitionContent: { + required: true, + serializedName: 'taskDefinitionContent', + type: { + name: 'String' + } + }, + valuesContent: { + required: false, + serializedName: 'valuesContent', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } + } + } + } + }; + } +} + +module.exports = RunTaskStep; diff --git a/lib/services/containerRegistryManagement/lib/models/runTaskStepUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/runTaskStepUpdateParameters.js new file mode 100644 index 0000000000..113e6e5c84 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/runTaskStepUpdateParameters.js @@ -0,0 +1,96 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties for updating generic task run step. + * + * @extends models['TaskStepUpdateParameters'] + */ +class RunTaskStepUpdateParameters extends models['TaskStepUpdateParameters'] { + /** + * Create a RunTaskStepUpdateParameters. + * @member {string} [taskDefinitionContent] Base64 encoded value of the + * template/definition file content. + * @member {string} [valuesContent] Base64 encoded value of the + * parameters/values file content. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RunTaskStepUpdateParameters + * + * @returns {object} metadata of RunTaskStepUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'RunTask', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepUpdateParameters', + className: 'RunTaskStepUpdateParameters', + modelProperties: { + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + taskDefinitionContent: { + required: false, + serializedName: 'taskDefinitionContent', + type: { + name: 'String' + } + }, + valuesContent: { + required: false, + serializedName: 'valuesContent', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } + } + } + } + }; + } +} + +module.exports = RunTaskStepUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/runUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/runUpdateParameters.js new file mode 100644 index 0000000000..1ebbe3fff1 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/runUpdateParameters.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The set of run properties that can be updated. + * + */ +class RunUpdateParameters { + /** + * Create a RunUpdateParameters. + * @member {boolean} [isArchiveEnabled] The value that indicates whether + * archiving is enabled or not. + */ + constructor() { + } + + /** + * Defines the metadata of RunUpdateParameters + * + * @returns {object} metadata of RunUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'RunUpdateParameters', + type: { + name: 'Composite', + className: 'RunUpdateParameters', + modelProperties: { + isArchiveEnabled: { + required: false, + serializedName: 'isArchiveEnabled', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = RunUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/setValue.js b/lib/services/containerRegistryManagement/lib/models/setValue.js new file mode 100644 index 0000000000..c0937b1aea --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/setValue.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The properties of a overridable value that can be passed to a task template. + * + */ +class SetValue { + /** + * Create a SetValue. + * @member {string} name The name of the overridable value. + * @member {string} value The overridable value. + * @member {boolean} [isSecret] Flag to indicate whether the value represents + * a secret or not. Default value: false . + */ + constructor() { + } + + /** + * Defines the metadata of SetValue + * + * @returns {object} metadata of SetValue + * + */ + mapper() { + return { + required: false, + serializedName: 'SetValue', + type: { + name: 'Composite', + className: 'SetValue', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: true, + serializedName: 'value', + type: { + name: 'String' + } + }, + isSecret: { + required: false, + serializedName: 'isSecret', + defaultValue: false, + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = SetValue; diff --git a/lib/services/containerRegistryManagement/lib/models/sourceProperties.js b/lib/services/containerRegistryManagement/lib/models/sourceProperties.js new file mode 100644 index 0000000000..fb0c311ee6 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/sourceProperties.js @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties of the source code repository. + * + */ +class SourceProperties { + /** + * Create a SourceProperties. + * @member {string} sourceControlType The type of source control service. + * Possible values include: 'Github', 'VisualStudioTeamService' + * @member {string} repositoryUrl The full URL to the source code respository + * @member {string} [branch] The branch name of the source code. + * @member {object} [sourceControlAuthProperties] The authorization + * properties for accessing the source code repository and to set up + * webhooks for notifications. + * @member {string} [sourceControlAuthProperties.tokenType] The type of Auth + * token. Possible values include: 'PAT', 'OAuth' + * @member {string} [sourceControlAuthProperties.token] The access token used + * to access the source control provider. + * @member {string} [sourceControlAuthProperties.refreshToken] The refresh + * token used to refresh the access token. + * @member {string} [sourceControlAuthProperties.scope] The scope of the + * access token. + * @member {number} [sourceControlAuthProperties.expiresIn] Time in seconds + * that the token remains valid + */ + constructor() { + } + + /** + * Defines the metadata of SourceProperties + * + * @returns {object} metadata of SourceProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceProperties', + type: { + name: 'Composite', + className: 'SourceProperties', + modelProperties: { + sourceControlType: { + required: true, + serializedName: 'sourceControlType', + type: { + name: 'String' + } + }, + repositoryUrl: { + required: true, + serializedName: 'repositoryUrl', + type: { + name: 'String' + } + }, + branch: { + required: false, + serializedName: 'branch', + type: { + name: 'String' + } + }, + sourceControlAuthProperties: { + required: false, + serializedName: 'sourceControlAuthProperties', + type: { + name: 'Composite', + className: 'AuthInfo' + } + } + } + } + }; + } +} + +module.exports = SourceProperties; diff --git a/lib/services/containerRegistryManagement/lib/models/sourceRepositoryProperties.js b/lib/services/containerRegistryManagement/lib/models/sourceRepositoryProperties.js index d1165ef2f3..863870ef7c 100644 --- a/lib/services/containerRegistryManagement/lib/models/sourceRepositoryProperties.js +++ b/lib/services/containerRegistryManagement/lib/models/sourceRepositoryProperties.js @@ -22,11 +22,10 @@ class SourceRepositoryProperties { * @member {string} sourceControlType The type of source control service. * Possible values include: 'Github', 'VisualStudioTeamService' * @member {string} repositoryUrl The full URL to the source code respository - * @member {boolean} [isCommitTriggerEnabled] The value of this property - * indicates whether the source control commit trigger is enabled or not. - * Default value: false . + * @member {string} [branch] The branch name of the source code. * @member {object} [sourceControlAuthProperties] The authorization - * properties for accessing the source code repository. + * properties for accessing the source code repository and to set up + * webhooks for notifications. * @member {string} [sourceControlAuthProperties.tokenType] The type of Auth * token. Possible values include: 'PAT', 'OAuth' * @member {string} [sourceControlAuthProperties.token] The access token used @@ -69,12 +68,11 @@ class SourceRepositoryProperties { name: 'String' } }, - isCommitTriggerEnabled: { + branch: { required: false, - serializedName: 'isCommitTriggerEnabled', - defaultValue: false, + serializedName: 'branch', type: { - name: 'Boolean' + name: 'String' } }, sourceControlAuthProperties: { diff --git a/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js b/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js new file mode 100644 index 0000000000..44436f1fb2 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js @@ -0,0 +1,111 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties of a source based trigger. + * + */ +class SourceTrigger { + /** + * Create a SourceTrigger. + * @member {object} sourceRepository The properties that describes the + * source(code) for the task. + * @member {string} [sourceRepository.sourceControlType] The type of source + * control service. Possible values include: 'Github', + * 'VisualStudioTeamService' + * @member {string} [sourceRepository.repositoryUrl] The full URL to the + * source code respository + * @member {string} [sourceRepository.branch] The branch name of the source + * code. + * @member {object} [sourceRepository.sourceControlAuthProperties] The + * authorization properties for accessing the source code repository and to + * set up + * webhooks for notifications. + * @member {string} [sourceRepository.sourceControlAuthProperties.tokenType] + * The type of Auth token. Possible values include: 'PAT', 'OAuth' + * @member {string} [sourceRepository.sourceControlAuthProperties.token] The + * access token used to access the source control provider. + * @member {string} + * [sourceRepository.sourceControlAuthProperties.refreshToken] The refresh + * token used to refresh the access token. + * @member {string} [sourceRepository.sourceControlAuthProperties.scope] The + * scope of the access token. + * @member {number} [sourceRepository.sourceControlAuthProperties.expiresIn] + * Time in seconds that the token remains valid + * @member {array} sourceTriggerEvents The source event corresponding to the + * trigger. + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ + constructor() { + } + + /** + * Defines the metadata of SourceTrigger + * + * @returns {object} metadata of SourceTrigger + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceTrigger', + type: { + name: 'Composite', + className: 'SourceTrigger', + modelProperties: { + sourceRepository: { + required: true, + serializedName: 'sourceRepository', + type: { + name: 'Composite', + className: 'SourceProperties' + } + }, + sourceTriggerEvents: { + required: true, + serializedName: 'sourceTriggerEvents', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SourceTriggerEventElementType', + type: { + name: 'String' + } + } + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceTrigger; diff --git a/lib/services/containerRegistryManagement/lib/models/sourceTriggerDescriptor.js b/lib/services/containerRegistryManagement/lib/models/sourceTriggerDescriptor.js new file mode 100644 index 0000000000..6bf83c3d08 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/sourceTriggerDescriptor.js @@ -0,0 +1,101 @@ +/* + * 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 source trigger that caused a run. + * + */ +class SourceTriggerDescriptor { + /** + * Create a SourceTriggerDescriptor. + * @member {string} [id] The unique ID of the trigger. + * @member {string} [eventType] The event type of the trigger. + * @member {string} [commitId] The unique ID that identifies a commit. + * @member {string} [pullRequestId] The unique ID that identifies pull + * request. + * @member {string} [repositoryUrl] The repository URL. + * @member {string} [branchName] The branch name in the repository. + * @member {string} [providerType] The source control provider type. + */ + constructor() { + } + + /** + * Defines the metadata of SourceTriggerDescriptor + * + * @returns {object} metadata of SourceTriggerDescriptor + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceTriggerDescriptor', + type: { + name: 'Composite', + className: 'SourceTriggerDescriptor', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + eventType: { + required: false, + serializedName: 'eventType', + type: { + name: 'String' + } + }, + commitId: { + required: false, + serializedName: 'commitId', + type: { + name: 'String' + } + }, + pullRequestId: { + required: false, + serializedName: 'pullRequestId', + type: { + name: 'String' + } + }, + repositoryUrl: { + required: false, + serializedName: 'repositoryUrl', + type: { + name: 'String' + } + }, + branchName: { + required: false, + serializedName: 'branchName', + type: { + name: 'String' + } + }, + providerType: { + required: false, + serializedName: 'providerType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceTriggerDescriptor; diff --git a/lib/services/containerRegistryManagement/lib/models/sourceTriggerUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/sourceTriggerUpdateParameters.js new file mode 100644 index 0000000000..ce53fb72cc --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/sourceTriggerUpdateParameters.js @@ -0,0 +1,111 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties for updating a source based trigger. + * + */ +class SourceTriggerUpdateParameters { + /** + * Create a SourceTriggerUpdateParameters. + * @member {object} [sourceRepository] The properties that describes the + * source(code) for the task. + * @member {string} [sourceRepository.sourceControlType] The type of source + * control service. Possible values include: 'Github', + * 'VisualStudioTeamService' + * @member {string} [sourceRepository.repositoryUrl] The full URL to the + * source code respository + * @member {string} [sourceRepository.branch] The branch name of the source + * code. + * @member {object} [sourceRepository.sourceControlAuthProperties] The + * authorization properties for accessing the source code repository and to + * set up + * webhooks for notifications. + * @member {string} [sourceRepository.sourceControlAuthProperties.tokenType] + * The type of Auth token. Possible values include: 'PAT', 'OAuth' + * @member {string} [sourceRepository.sourceControlAuthProperties.token] The + * access token used to access the source control provider. + * @member {string} + * [sourceRepository.sourceControlAuthProperties.refreshToken] The refresh + * token used to refresh the access token. + * @member {string} [sourceRepository.sourceControlAuthProperties.scope] The + * scope of the access token. + * @member {number} [sourceRepository.sourceControlAuthProperties.expiresIn] + * Time in seconds that the token remains valid + * @member {array} [sourceTriggerEvents] The source event corresponding to + * the trigger. + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ + constructor() { + } + + /** + * Defines the metadata of SourceTriggerUpdateParameters + * + * @returns {object} metadata of SourceTriggerUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceTriggerUpdateParameters', + type: { + name: 'Composite', + className: 'SourceTriggerUpdateParameters', + modelProperties: { + sourceRepository: { + required: false, + serializedName: 'sourceRepository', + type: { + name: 'Composite', + className: 'SourceUpdateParameters' + } + }, + sourceTriggerEvents: { + required: false, + serializedName: 'sourceTriggerEvents', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SourceTriggerEventElementType', + type: { + name: 'String' + } + } + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceTriggerUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/sourceUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/sourceUpdateParameters.js new file mode 100644 index 0000000000..cdd92ccf5c --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/sourceUpdateParameters.js @@ -0,0 +1,93 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties for updating the source code repository. + * + */ +class SourceUpdateParameters { + /** + * Create a SourceUpdateParameters. + * @member {string} [sourceControlType] The type of source control service. + * Possible values include: 'Github', 'VisualStudioTeamService' + * @member {string} [repositoryUrl] The full URL to the source code + * respository + * @member {string} [branch] The branch name of the source code. + * @member {object} [sourceControlAuthProperties] The authorization + * properties for accessing the source code repository and to set up + * webhooks for notifications. + * @member {string} [sourceControlAuthProperties.tokenType] The type of Auth + * token. Possible values include: 'PAT', 'OAuth' + * @member {string} [sourceControlAuthProperties.token] The access token used + * to access the source control provider. + * @member {string} [sourceControlAuthProperties.refreshToken] The refresh + * token used to refresh the access token. + * @member {string} [sourceControlAuthProperties.scope] The scope of the + * access token. + * @member {number} [sourceControlAuthProperties.expiresIn] Time in seconds + * that the token remains valid + */ + constructor() { + } + + /** + * Defines the metadata of SourceUpdateParameters + * + * @returns {object} metadata of SourceUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceUpdateParameters', + type: { + name: 'Composite', + className: 'SourceUpdateParameters', + modelProperties: { + sourceControlType: { + required: false, + serializedName: 'sourceControlType', + type: { + name: 'String' + } + }, + repositoryUrl: { + required: false, + serializedName: 'repositoryUrl', + type: { + name: 'String' + } + }, + branch: { + required: false, + serializedName: 'branch', + type: { + name: 'String' + } + }, + sourceControlAuthProperties: { + required: false, + serializedName: 'sourceControlAuthProperties', + type: { + name: 'Composite', + className: 'AuthInfoUpdateParameters' + } + } + } + } + }; + } +} + +module.exports = SourceUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/task.js b/lib/services/containerRegistryManagement/lib/models/task.js new file mode 100644 index 0000000000..b75b307fcc --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/task.js @@ -0,0 +1,201 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it. + * + * @extends models['Resource'] + */ +class Task extends models['Resource'] { + /** + * Create a Task. + * @member {string} [provisioningState] The provisioning state of the task. + * Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + * 'Failed', 'Canceled' + * @member {date} [creationDate] The creation date of task. + * @member {string} [status] The current status of task. Possible values + * include: 'Disabled', 'Enabled' + * @member {object} platform The platform properties against which the run + * has to happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the run + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms + * of number of cores required for the run. + * @member {number} [timeout] Run timeout in seconds. Default value: 3600 . + * @member {object} step The properties of a task step. + * @member {array} [step.baseImageDependencies] List of base image + * dependencies for a step. + * @member {string} [step.type] Polymorphic Discriminator + * @member {object} [trigger] The properties that describe all triggers for + * the task. + * @member {array} [trigger.sourceTriggers] The collection of triggers based + * on source code repository. + * @member {object} [trigger.baseImageTrigger] The trigger based on base + * image dependencies. + * @member {string} [trigger.baseImageTrigger.baseImageTriggerType] The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * @member {string} [trigger.baseImageTrigger.status] The current status of + * build trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [trigger.baseImageTrigger.name] The name of the trigger. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Task + * + * @returns {object} metadata of Task + * + */ + mapper() { + return { + required: false, + serializedName: 'Task', + type: { + name: 'Composite', + className: 'Task', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + creationDate: { + required: false, + readOnly: true, + serializedName: 'properties.creationDate', + type: { + name: 'DateTime' + } + }, + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + platform: { + required: true, + serializedName: 'properties.platform', + type: { + name: 'Composite', + className: 'PlatformProperties' + } + }, + agentConfiguration: { + required: false, + serializedName: 'properties.agentConfiguration', + type: { + name: 'Composite', + className: 'AgentProperties' + } + }, + timeout: { + required: false, + serializedName: 'properties.timeout', + defaultValue: 3600, + constraints: { + InclusiveMaximum: 28800, + InclusiveMinimum: 300 + }, + type: { + name: 'Number' + } + }, + step: { + required: true, + serializedName: 'properties.step', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepProperties', + className: 'TaskStepProperties' + } + }, + trigger: { + required: false, + serializedName: 'properties.trigger', + type: { + name: 'Composite', + className: 'TriggerProperties' + } + } + } + } + }; + } +} + +module.exports = Task; diff --git a/lib/services/containerRegistryManagement/lib/models/taskFilter.js b/lib/services/containerRegistryManagement/lib/models/taskFilter.js new file mode 100644 index 0000000000..a89d624ddd --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/taskFilter.js @@ -0,0 +1,52 @@ +/* + * 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 filter that can be used for listing tasks. + * + */ +class TaskFilter { + /** + * Create a TaskFilter. + * @member {string} [alias] The alternative name for task. + */ + constructor() { + } + + /** + * Defines the metadata of TaskFilter + * + * @returns {object} metadata of TaskFilter + * + */ + mapper() { + return { + required: false, + serializedName: 'TaskFilter', + type: { + name: 'Composite', + className: 'TaskFilter', + modelProperties: { + alias: { + required: false, + serializedName: 'alias', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TaskFilter; diff --git a/lib/services/containerRegistryManagement/lib/models/taskListResult.js b/lib/services/containerRegistryManagement/lib/models/taskListResult.js new file mode 100644 index 0000000000..3b5f4ac383 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/taskListResult.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 collection of tasks. + */ +class TaskListResult extends Array { + /** + * Create a TaskListResult. + * @member {string} [nextLink] The URI that can be used to request the next + * set of paged results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TaskListResult + * + * @returns {object} metadata of TaskListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'TaskListResult', + type: { + name: 'Composite', + className: 'TaskListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TaskElementType', + type: { + name: 'Composite', + className: 'Task' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TaskListResult; diff --git a/lib/services/containerRegistryManagement/lib/models/taskRunRequest.js b/lib/services/containerRegistryManagement/lib/models/taskRunRequest.js new file mode 100644 index 0000000000..0d65fa1d5f --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/taskRunRequest.js @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The parameters for a task run request. + * + * @extends models['RunRequest'] + */ +class TaskRunRequest extends models['RunRequest'] { + /** + * Create a TaskRunRequest. + * @member {string} taskName The name of task against which run has to be + * queued. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TaskRunRequest + * + * @returns {object} metadata of TaskRunRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'TaskRunRequest', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'RunRequest', + className: 'TaskRunRequest', + modelProperties: { + isArchiveEnabled: { + required: false, + serializedName: 'isArchiveEnabled', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + taskName: { + required: true, + serializedName: 'taskName', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } + } + } + } + }; + } +} + +module.exports = TaskRunRequest; diff --git a/lib/services/containerRegistryManagement/lib/models/taskSecret.js b/lib/services/containerRegistryManagement/lib/models/taskSecret.js new file mode 100644 index 0000000000..a928e544ae --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/taskSecret.js @@ -0,0 +1,69 @@ +/* + * 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 properties of a task secret object. + * + */ +class TaskSecret { + /** + * Create a TaskSecret. + * @member {string} name The name of the secret. + * @member {string} valueJson The serialized Json value of the secret. + */ + constructor() { + } + + /** + * Defines the metadata of TaskSecret + * + * @returns {object} metadata of TaskSecret + * + */ + mapper() { + return { + required: false, + serializedName: 'TaskSecret', + type: { + name: 'Composite', + className: 'TaskSecret', + modelProperties: { + type: { + required: true, + isConstant: true, + serializedName: 'type', + defaultValue: 'DockerCredentials', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + valueJson: { + required: true, + serializedName: 'valueJson', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TaskSecret; diff --git a/lib/services/containerRegistryManagement/lib/models/taskStepProperties.js b/lib/services/containerRegistryManagement/lib/models/taskStepProperties.js new file mode 100644 index 0000000000..275e033e12 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/taskStepProperties.js @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Base properties for any task step. + * + */ +class TaskStepProperties { + /** + * Create a TaskStepProperties. + * @member {array} [baseImageDependencies] List of base image dependencies + * for a step. + * @member {string} type Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of TaskStepProperties + * + * @returns {object} metadata of TaskStepProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'TaskStepProperties', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepProperties', + className: 'TaskStepProperties', + modelProperties: { + baseImageDependencies: { + required: false, + readOnly: true, + serializedName: 'baseImageDependencies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BaseImageDependencyElementType', + type: { + name: 'Composite', + className: 'BaseImageDependency' + } + } + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TaskStepProperties; diff --git a/lib/services/containerRegistryManagement/lib/models/taskStepUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/taskStepUpdateParameters.js new file mode 100644 index 0000000000..5801fd946d --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/taskStepUpdateParameters.js @@ -0,0 +1,58 @@ +/* + * 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'; + +/** + * Base properties for updating any task step. + * + */ +class TaskStepUpdateParameters { + /** + * Create a TaskStepUpdateParameters. + * @member {string} type Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of TaskStepUpdateParameters + * + * @returns {object} metadata of TaskStepUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'TaskStepUpdateParameters', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepUpdateParameters', + className: 'TaskStepUpdateParameters', + modelProperties: { + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TaskStepUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js new file mode 100644 index 0000000000..5b82cf8a85 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js @@ -0,0 +1,140 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The parameters for updating a task. + * + */ +class TaskUpdateParameters { + /** + * Create a TaskUpdateParameters. + * @member {string} [status] The current status of task. Possible values + * include: 'Disabled', 'Enabled' + * @member {object} [platform] The platform properties against which the run + * has to happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the run + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms + * of number of cores required for the run. + * @member {number} [timeout] Run timeout in seconds. + * @member {object} [step] The properties for updating a task step. + * @member {string} [step.type] Polymorphic Discriminator + * @member {object} [trigger] The properties for updating trigger properties. + * @member {array} [trigger.sourceTriggers] The collection of triggers based + * on source code repository. + * @member {object} [trigger.baseImageTrigger] The trigger based on base + * image dependencies. + * @member {string} [trigger.baseImageTrigger.baseImageTriggerType] The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * @member {string} [trigger.baseImageTrigger.status] The current status of + * build trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [trigger.baseImageTrigger.name] The name of the trigger. + * @member {object} [tags] The ARM resource tags. + */ + constructor() { + } + + /** + * Defines the metadata of TaskUpdateParameters + * + * @returns {object} metadata of TaskUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'TaskUpdateParameters', + type: { + name: 'Composite', + className: 'TaskUpdateParameters', + modelProperties: { + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + platform: { + required: false, + serializedName: 'properties.platform', + type: { + name: 'Composite', + className: 'PlatformUpdateParameters' + } + }, + agentConfiguration: { + required: false, + serializedName: 'properties.agentConfiguration', + type: { + name: 'Composite', + className: 'AgentProperties' + } + }, + timeout: { + required: false, + serializedName: 'properties.timeout', + type: { + name: 'Number' + } + }, + step: { + required: false, + serializedName: 'properties.step', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepUpdateParameters', + className: 'TaskStepUpdateParameters' + } + }, + trigger: { + required: false, + serializedName: 'properties.trigger', + type: { + name: 'Composite', + className: 'TriggerUpdateParameters' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = TaskUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/triggerProperties.js b/lib/services/containerRegistryManagement/lib/models/triggerProperties.js new file mode 100644 index 0000000000..7b366694ae --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/triggerProperties.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties of a build trigger. + * + */ +class TriggerProperties { + /** + * Create a TriggerProperties. + * @member {array} [sourceTriggers] The collection of triggers based on + * source code repository. + * @member {object} [baseImageTrigger] The trigger based on base image + * dependencies. + * @member {string} [baseImageTrigger.baseImageTriggerType] The type of the + * auto trigger for base image dependency updates. Possible values include: + * 'All', 'Runtime' + * @member {string} [baseImageTrigger.status] The current status of build + * trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [baseImageTrigger.name] The name of the trigger. + */ + constructor() { + } + + /** + * Defines the metadata of TriggerProperties + * + * @returns {object} metadata of TriggerProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'TriggerProperties', + type: { + name: 'Composite', + className: 'TriggerProperties', + modelProperties: { + sourceTriggers: { + required: false, + serializedName: 'sourceTriggers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SourceTriggerElementType', + type: { + name: 'Composite', + className: 'SourceTrigger' + } + } + } + }, + baseImageTrigger: { + required: false, + serializedName: 'baseImageTrigger', + type: { + name: 'Composite', + className: 'BaseImageTrigger' + } + } + } + } + }; + } +} + +module.exports = TriggerProperties; diff --git a/lib/services/containerRegistryManagement/lib/models/triggerUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/triggerUpdateParameters.js new file mode 100644 index 0000000000..42414d8727 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/triggerUpdateParameters.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties for updating build triggers. + * + */ +class TriggerUpdateParameters { + /** + * Create a TriggerUpdateParameters. + * @member {array} [sourceTriggers] The collection of triggers based on + * source code repository. + * @member {object} [baseImageTrigger] The trigger based on base image + * dependencies. + * @member {string} [baseImageTrigger.baseImageTriggerType] The type of the + * auto trigger for base image dependency updates. Possible values include: + * 'All', 'Runtime' + * @member {string} [baseImageTrigger.status] The current status of build + * trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [baseImageTrigger.name] The name of the trigger. + */ + constructor() { + } + + /** + * Defines the metadata of TriggerUpdateParameters + * + * @returns {object} metadata of TriggerUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'TriggerUpdateParameters', + type: { + name: 'Composite', + className: 'TriggerUpdateParameters', + modelProperties: { + sourceTriggers: { + required: false, + serializedName: 'sourceTriggers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SourceTriggerUpdateParametersElementType', + type: { + name: 'Composite', + className: 'SourceTriggerUpdateParameters' + } + } + } + }, + baseImageTrigger: { + required: false, + serializedName: 'baseImageTrigger', + type: { + name: 'Composite', + className: 'BaseImageTriggerUpdateParameters' + } + } + } + } + }; + } +} + +module.exports = TriggerUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/trustPolicy.js b/lib/services/containerRegistryManagement/lib/models/trustPolicy.js new file mode 100644 index 0000000000..ceeff24eab --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/trustPolicy.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * An object that represents content trust policy for a container registry. + * + */ +class TrustPolicy { + /** + * Create a TrustPolicy. + * @member {string} [type] The type of trust policy. Possible values include: + * 'Notary' + * @member {string} [status] The value that indicates whether the policy is + * enabled or not. Possible values include: 'enabled', 'disabled' + */ + constructor() { + } + + /** + * Defines the metadata of TrustPolicy + * + * @returns {object} metadata of TrustPolicy + * + */ + mapper() { + return { + required: false, + serializedName: 'TrustPolicy', + type: { + name: 'Composite', + className: 'TrustPolicy', + modelProperties: { + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TrustPolicy; diff --git a/lib/services/containerRegistryManagement/lib/models/webhook.js b/lib/services/containerRegistryManagement/lib/models/webhook.js index a4081efafd..c1b8c0801f 100644 --- a/lib/services/containerRegistryManagement/lib/models/webhook.js +++ b/lib/services/containerRegistryManagement/lib/models/webhook.js @@ -116,7 +116,7 @@ class Webhook extends models['Resource'] { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'WebhookActionElementType', type: { name: 'String' } diff --git a/lib/services/containerRegistryManagement/lib/models/webhookCreateParameters.js b/lib/services/containerRegistryManagement/lib/models/webhookCreateParameters.js index 4fff23fe37..3e161be847 100644 --- a/lib/services/containerRegistryManagement/lib/models/webhookCreateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/webhookCreateParameters.js @@ -113,7 +113,7 @@ class WebhookCreateParameters { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'WebhookActionElementType', type: { name: 'String' } diff --git a/lib/services/containerRegistryManagement/lib/models/webhookUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/webhookUpdateParameters.js index c1fe7547dc..577ae2a0b0 100644 --- a/lib/services/containerRegistryManagement/lib/models/webhookUpdateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/webhookUpdateParameters.js @@ -104,7 +104,7 @@ class WebhookUpdateParameters { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'WebhookActionElementType', type: { name: 'String' } diff --git a/lib/services/containerRegistryManagement/lib/operations/index.d.ts b/lib/services/containerRegistryManagement/lib/operations/index.d.ts index e1d57a4040..06cdfc0956 100644 --- a/lib/services/containerRegistryManagement/lib/operations/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/operations/index.d.ts @@ -35,8 +35,11 @@ export interface Registries { * * @param {object} parameters.source The source of the image. * - * @param {string} parameters.source.resourceId The resource identifier of the - * target Azure Container Registry. + * @param {string} [parameters.source.resourceId] The resource identifier of + * the source Azure Container Registry. + * + * @param {string} [parameters.source.registryUri] The address of the source + * registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -85,8 +88,11 @@ export interface Registries { * * @param {object} parameters.source The source of the image. * - * @param {string} parameters.source.resourceId The resource identifier of the - * target Azure Container Registry. + * @param {string} [parameters.source.resourceId] The resource identifier of + * the source Azure Container Registry. + * + * @param {string} [parameters.source.registryUri] The address of the source + * registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -852,7 +858,169 @@ export interface Registries { /** - * Creates a new build based on the request parameters and add it to the build + * Lists the policies for the specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @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. + */ + listPoliciesWithHttpOperationResponse(resourceGroupName: string, registryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the policies for the specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @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 {RegistryPolicies} - 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. + * + * {RegistryPolicies} [result] - The deserialized result object if an error did not occur. + * See {@link RegistryPolicies} 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. + */ + listPolicies(resourceGroupName: string, registryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPolicies(resourceGroupName: string, registryName: string, callback: ServiceCallback): void; + listPolicies(resourceGroupName: string, registryName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates the policies for the specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} registryPoliciesUpdateParameters The parameters for updating + * policies of a container registry. + * + * @param {object} [registryPoliciesUpdateParameters.quarantinePolicy] An + * object that represents quarantine policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.quarantinePolicy.status] + * The value that indicates whether the policy is enabled or not. Possible + * values include: 'enabled', 'disabled' + * + * @param {object} [registryPoliciesUpdateParameters.trustPolicy] An object + * that represents content trust policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.type] The type + * of trust policy. Possible values include: 'Notary' + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.status] The + * value that indicates whether the policy is enabled or not. Possible values + * include: 'enabled', 'disabled' + * + * @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. + */ + updatePoliciesWithHttpOperationResponse(resourceGroupName: string, registryName: string, registryPoliciesUpdateParameters: models.RegistryPolicies, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the policies for the specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} registryPoliciesUpdateParameters The parameters for updating + * policies of a container registry. + * + * @param {object} [registryPoliciesUpdateParameters.quarantinePolicy] An + * object that represents quarantine policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.quarantinePolicy.status] + * The value that indicates whether the policy is enabled or not. Possible + * values include: 'enabled', 'disabled' + * + * @param {object} [registryPoliciesUpdateParameters.trustPolicy] An object + * that represents content trust policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.type] The type + * of trust policy. Possible values include: 'Notary' + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.status] The + * value that indicates whether the policy is enabled or not. Possible values + * include: 'enabled', 'disabled' + * + * @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 {RegistryPolicies} - 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. + * + * {RegistryPolicies} [result] - The deserialized result object if an error did not occur. + * See {@link RegistryPolicies} 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. + */ + updatePolicies(resourceGroupName: string, registryName: string, registryPoliciesUpdateParameters: models.RegistryPolicies, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updatePolicies(resourceGroupName: string, registryName: string, registryPoliciesUpdateParameters: models.RegistryPolicies, callback: ServiceCallback): void; + updatePolicies(resourceGroupName: string, registryName: string, registryPoliciesUpdateParameters: models.RegistryPolicies, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Schedules a new run based on the request parameters and add it to the run * queue. * * @param {string} resourceGroupName The name of the resource group to which @@ -860,9 +1028,12 @@ export interface Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. + * + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -871,14 +1042,14 @@ export interface Registries { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - queueBuildWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + scheduleRunWithHttpOperationResponse(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new build based on the request parameters and add it to the build + * Schedules a new run based on the request parameters and add it to the run * queue. * * @param {string} resourceGroupName The name of the resource group to which @@ -886,9 +1057,12 @@ export interface Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. + * + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -902,7 +1076,7 @@ export interface Registries { * * {Promise} A promise is returned. * - * @resolve {Build} - The deserialized result object. + * @resolve {Run} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -910,16 +1084,16 @@ export interface Registries { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Build} [result] - The deserialized result object if an error did not occur. - * See {@link Build} for more information. + * {Run} [result] - The deserialized result object if an error did not occur. + * See {@link Run} 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. */ - queueBuild(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - queueBuild(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, callback: ServiceCallback): void; - queueBuild(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + scheduleRun(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + scheduleRun(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, callback: ServiceCallback): void; + scheduleRun(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -998,8 +1172,11 @@ export interface Registries { * * @param {object} parameters.source The source of the image. * - * @param {string} parameters.source.resourceId The resource identifier of the - * target Azure Container Registry. + * @param {string} [parameters.source.resourceId] The resource identifier of + * the source Azure Container Registry. + * + * @param {string} [parameters.source.registryUri] The address of the source + * registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -1048,8 +1225,11 @@ export interface Registries { * * @param {object} parameters.source The source of the image. * - * @param {string} parameters.source.resourceId The resource identifier of the - * target Azure Container Registry. + * @param {string} [parameters.source.resourceId] The resource identifier of + * the source Azure Container Registry. + * + * @param {string} [parameters.source.registryUri] The address of the source + * registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -1377,7 +1557,108 @@ export interface Registries { /** - * Creates a new build based on the request parameters and add it to the build + * Updates the policies for the specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} registryPoliciesUpdateParameters The parameters for updating + * policies of a container registry. + * + * @param {object} [registryPoliciesUpdateParameters.quarantinePolicy] An + * object that represents quarantine policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.quarantinePolicy.status] + * The value that indicates whether the policy is enabled or not. Possible + * values include: 'enabled', 'disabled' + * + * @param {object} [registryPoliciesUpdateParameters.trustPolicy] An object + * that represents content trust policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.type] The type + * of trust policy. Possible values include: 'Notary' + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.status] The + * value that indicates whether the policy is enabled or not. Possible values + * include: 'enabled', 'disabled' + * + * @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. + */ + beginUpdatePoliciesWithHttpOperationResponse(resourceGroupName: string, registryName: string, registryPoliciesUpdateParameters: models.RegistryPolicies, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the policies for the specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} registryPoliciesUpdateParameters The parameters for updating + * policies of a container registry. + * + * @param {object} [registryPoliciesUpdateParameters.quarantinePolicy] An + * object that represents quarantine policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.quarantinePolicy.status] + * The value that indicates whether the policy is enabled or not. Possible + * values include: 'enabled', 'disabled' + * + * @param {object} [registryPoliciesUpdateParameters.trustPolicy] An object + * that represents content trust policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.type] The type + * of trust policy. Possible values include: 'Notary' + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.status] The + * value that indicates whether the policy is enabled or not. Possible values + * include: 'enabled', 'disabled' + * + * @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 {RegistryPolicies} - 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. + * + * {RegistryPolicies} [result] - The deserialized result object if an error did not occur. + * See {@link RegistryPolicies} 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. + */ + beginUpdatePolicies(resourceGroupName: string, registryName: string, registryPoliciesUpdateParameters: models.RegistryPolicies, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdatePolicies(resourceGroupName: string, registryName: string, registryPoliciesUpdateParameters: models.RegistryPolicies, callback: ServiceCallback): void; + beginUpdatePolicies(resourceGroupName: string, registryName: string, registryPoliciesUpdateParameters: models.RegistryPolicies, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Schedules a new run based on the request parameters and add it to the run * queue. * * @param {string} resourceGroupName The name of the resource group to which @@ -1385,9 +1666,12 @@ export interface Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. + * + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -1396,14 +1680,14 @@ export interface Registries { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginQueueBuildWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginScheduleRunWithHttpOperationResponse(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new build based on the request parameters and add it to the build + * Schedules a new run based on the request parameters and add it to the run * queue. * * @param {string} resourceGroupName The name of the resource group to which @@ -1411,9 +1695,12 @@ export interface Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. + * + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -1427,7 +1714,7 @@ export interface Registries { * * {Promise} A promise is returned. * - * @resolve {Build} - The deserialized result object. + * @resolve {Run} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1435,16 +1722,16 @@ export interface Registries { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Build} [result] - The deserialized result object if an error did not occur. - * See {@link Build} for more information. + * {Run} [result] - The deserialized result object if an error did not occur. + * See {@link Run} 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. */ - beginQueueBuild(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginQueueBuild(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, callback: ServiceCallback): void; - beginQueueBuild(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginScheduleRun(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginScheduleRun(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, callback: ServiceCallback): void; + beginScheduleRun(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -3348,15 +3635,15 @@ export interface Webhooks { /** * @class - * Builds + * Runs * __NOTE__: An instance of this class is automatically created for an * instance of the ContainerRegistryManagementClient. */ -export interface Builds { +export interface Runs { /** - * Gets all the builds for a registry. + * Gets all the runs for a registry. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. @@ -3365,28 +3652,26 @@ export interface Builds { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The builds filter to apply on the - * operation. - * - * @param {number} [options.top] $top is supported for get list of builds, - * which limits the maximum number of builds to return. + * @param {string} [options.filter] The runs filter to apply on the operation. + * Arithmetic operators are not supported. The allowed string function is + * 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * builds, which provides the next page in the list of builds. + * @param {number} [options.top] $top is supported for get list of runs, which + * limits the maximum number of runs to return. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, registryName: string, options?: { filter? : string, top? : number, skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, registryName: string, options?: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the builds for a registry. + * Gets all the runs for a registry. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. @@ -3395,14 +3680,12 @@ export interface Builds { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The builds filter to apply on the - * operation. + * @param {string} [options.filter] The runs filter to apply on the operation. + * Arithmetic operators are not supported. The allowed string function is + * 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. * - * @param {number} [options.top] $top is supported for get list of builds, - * which limits the maximum number of builds to return. - * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * builds, which provides the next page in the list of builds. + * @param {number} [options.top] $top is supported for get list of runs, which + * limits the maximum number of runs to return. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3414,7 +3697,7 @@ export interface Builds { * * {Promise} A promise is returned. * - * @resolve {BuildListResult} - The deserialized result object. + * @resolve {RunListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3422,27 +3705,27 @@ export interface Builds { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BuildListResult} for more information. + * {RunListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunListResult} 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. */ - list(resourceGroupName: string, registryName: string, options?: { filter? : string, top? : number, skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, registryName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, registryName: string, options: { filter? : string, top? : number, skipToken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, registryName: string, options?: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, registryName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, registryName: string, options: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the detailed information for a given build. + * Gets the detailed information for a given run. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -3451,21 +3734,21 @@ export interface Builds { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the detailed information for a given build. + * Gets the detailed information for a given run. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -3479,7 +3762,7 @@ export interface Builds { * * {Promise} A promise is returned. * - * @resolve {Build} - The deserialized result object. + * @resolve {Run} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3487,31 +3770,31 @@ export interface Builds { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Build} [result] - The deserialized result object if an error did not occur. - * See {@link Build} for more information. + * {Run} [result] - The deserialized result object if an error did not occur. + * See {@link Run} 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, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, registryName: string, buildId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, registryName: string, buildId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, registryName: string, runId: string, callback: ServiceCallback): void; + get(resourceGroupName: string, registryName: string, runId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Patch the build properties. + * Patch the run properties. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * - * @param {object} buildUpdateParameters The build update properties. + * @param {object} runUpdateParameters The run update properties. * - * @param {boolean} [buildUpdateParameters.isArchiveEnabled] The value that + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that * indicates whether archiving is enabled or not. * * @param {object} [options] Optional Parameters. @@ -3521,25 +3804,25 @@ export interface Builds { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Patch the build properties. + * Patch the run properties. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * - * @param {object} buildUpdateParameters The build update properties. + * @param {object} runUpdateParameters The run update properties. * - * @param {boolean} [buildUpdateParameters.isArchiveEnabled] The value that + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that * indicates whether archiving is enabled or not. * * @param {object} [options] Optional Parameters. @@ -3554,7 +3837,7 @@ export interface Builds { * * {Promise} A promise is returned. * - * @resolve {Build} - The deserialized result object. + * @resolve {Run} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3562,27 +3845,27 @@ export interface Builds { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Build} [result] - The deserialized result object if an error did not occur. - * See {@link Build} for more information. + * {Run} [result] - The deserialized result object if an error did not occur. + * See {@link Run} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, callback: ServiceCallback): void; + update(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a link to download the build logs. + * Gets a link to download the run logs. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -3591,21 +3874,21 @@ export interface Builds { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getLogLinkWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getLogSasUrlWithHttpOperationResponse(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a link to download the build logs. + * Gets a link to download the run logs. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -3619,7 +3902,7 @@ export interface Builds { * * {Promise} A promise is returned. * - * @resolve {BuildGetLogResult} - The deserialized result object. + * @resolve {RunGetLogResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3627,27 +3910,27 @@ export interface Builds { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildGetLogResult} [result] - The deserialized result object if an error did not occur. - * See {@link BuildGetLogResult} for more information. + * {RunGetLogResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunGetLogResult} 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. */ - getLogLink(resourceGroupName: string, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getLogLink(resourceGroupName: string, registryName: string, buildId: string, callback: ServiceCallback): void; - getLogLink(resourceGroupName: string, registryName: string, buildId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getLogSasUrl(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getLogSasUrl(resourceGroupName: string, registryName: string, runId: string, callback: ServiceCallback): void; + getLogSasUrl(resourceGroupName: string, registryName: string, runId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Cancel an existing build. + * Cancel an existing run. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -3660,17 +3943,17 @@ export interface Builds { * * @reject {Error|ServiceError} - The error object. */ - cancelWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelWithHttpOperationResponse(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancel an existing build. + * Cancel an existing run. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -3698,24 +3981,24 @@ export interface Builds { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - cancel(resourceGroupName: string, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - cancel(resourceGroupName: string, registryName: string, buildId: string, callback: ServiceCallback): void; - cancel(resourceGroupName: string, registryName: string, buildId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + cancel(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancel(resourceGroupName: string, registryName: string, runId: string, callback: ServiceCallback): void; + cancel(resourceGroupName: string, registryName: string, runId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Patch the build properties. + * Patch the run properties. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * - * @param {object} buildUpdateParameters The build update properties. + * @param {object} runUpdateParameters The run update properties. * - * @param {boolean} [buildUpdateParameters.isArchiveEnabled] The value that + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that * indicates whether archiving is enabled or not. * * @param {object} [options] Optional Parameters. @@ -3725,25 +4008,25 @@ export interface Builds { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Patch the build properties. + * Patch the run properties. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * - * @param {object} buildUpdateParameters The build update properties. + * @param {object} runUpdateParameters The run update properties. * - * @param {boolean} [buildUpdateParameters.isArchiveEnabled] The value that + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that * indicates whether archiving is enabled or not. * * @param {object} [options] Optional Parameters. @@ -3758,7 +4041,7 @@ export interface Builds { * * {Promise} A promise is returned. * - * @resolve {Build} - The deserialized result object. + * @resolve {Run} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3766,27 +4049,27 @@ export interface Builds { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Build} [result] - The deserialized result object if an error did not occur. - * See {@link Build} for more information. + * {Run} [result] - The deserialized result object if an error did not occur. + * See {@link Run} 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. */ - beginUpdate(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Cancel an existing build. + * Cancel an existing run. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -3799,17 +4082,17 @@ export interface Builds { * * @reject {Error|ServiceError} - The error object. */ - beginCancelWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCancelWithHttpOperationResponse(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancel an existing build. + * Cancel an existing run. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -3837,13 +4120,13 @@ export interface Builds { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCancel(resourceGroupName: string, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCancel(resourceGroupName: string, registryName: string, buildId: string, callback: ServiceCallback): void; - beginCancel(resourceGroupName: string, registryName: string, buildId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCancel(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCancel(resourceGroupName: string, registryName: string, runId: string, callback: ServiceCallback): void; + beginCancel(resourceGroupName: string, registryName: string, runId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the builds for a registry. + * Gets all the runs for a registry. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -3855,14 +4138,14 @@ export interface Builds { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the builds for a registry. + * Gets all the runs for a registry. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -3879,7 +4162,7 @@ export interface Builds { * * {Promise} A promise is returned. * - * @resolve {BuildListResult} - The deserialized result object. + * @resolve {RunListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3887,37 +4170,35 @@ export interface Builds { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BuildListResult} for more information. + * {RunListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunListResult} 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. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * BuildSteps + * Tasks * __NOTE__: An instance of this class is automatically created for an * instance of the ContainerRegistryManagementClient. */ -export interface BuildSteps { +export interface Tasks { /** - * List all the build steps for a given build task. + * Lists all the tasks for a specified container registry. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3925,22 +4206,20 @@ export interface BuildSteps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, registryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * List all the build steps for a given build task. + * Lists all the tasks for a specified container registry. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3953,7 +4232,7 @@ export interface BuildSteps { * * {Promise} A promise is returned. * - * @resolve {BuildStepList} - The deserialized result object. + * @resolve {TaskListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3961,30 +4240,27 @@ export interface BuildSteps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildStepList} [result] - The deserialized result object if an error did not occur. - * See {@link BuildStepList} for more information. + * {TaskListResult} [result] - The deserialized result object if an error did not occur. + * See {@link TaskListResult} 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. */ - list(resourceGroupName: string, registryName: string, buildTaskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, registryName: string, buildTaskName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, registryName: string, buildTaskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, registryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, registryName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, registryName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the build step for a build task. + * Get the properties of a specified task. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {string} stepName The name of a build step for a container registry - * build task. + * @param {string} taskName The name of the container registry task. * * @param {object} [options] Optional Parameters. * @@ -3993,24 +4269,21 @@ export interface BuildSteps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the build step for a build task. + * Get the properties of a specified task. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {string} stepName The name of a build step for a container registry - * build task. + * @param {string} taskName The name of the container registry task. * * @param {object} [options] Optional Parameters. * @@ -4024,7 +4297,7 @@ export interface BuildSteps { * * {Promise} A promise is returned. * - * @resolve {BuildStep} - The deserialized result object. + * @resolve {Task} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4032,39 +4305,82 @@ export interface BuildSteps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildStep} [result] - The deserialized result object if an error did not occur. - * See {@link BuildStep} for more information. + * {Task} [result] - The deserialized result object if an error did not occur. + * See {@link Task} 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, registryName: string, buildTaskName: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, registryName: string, taskName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, registryName: string, taskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a build step for a build task. + * Creates a task for a container registry with the specified parameters. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskCreateParameters The parameters for creating a task. + * + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. + * + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} taskCreateParameters.platform.architecture The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. + * + * @param {object} taskCreateParameters.step The properties of a task step. + * + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. * - * @param {string} stepName The name of a build step for a container registry - * build task. + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. * - * @param {object} buildStepCreateParameters The parameters for creating a - * build step. + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * @param {object} [buildStepCreateParameters.properties] The properties of a - * build step. + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * @param {string} buildStepCreateParameters.properties.type Polymorphic - * Discriminator + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskCreateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -4073,33 +4389,76 @@ export interface BuildSteps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepCreateParameters: models.BuildStep, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskCreateParameters: models.Task, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a build step for a build task. + * Creates a task for a container registry with the specified parameters. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskCreateParameters The parameters for creating a task. + * + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. + * + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} taskCreateParameters.platform.architecture The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. + * + * @param {object} taskCreateParameters.step The properties of a task step. + * + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. * - * @param {string} stepName The name of a build step for a container registry - * build task. + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. * - * @param {object} buildStepCreateParameters The parameters for creating a - * build step. + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * @param {object} [buildStepCreateParameters.properties] The properties of a - * build step. + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * @param {string} buildStepCreateParameters.properties.type Polymorphic - * Discriminator + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskCreateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -4113,7 +4472,7 @@ export interface BuildSteps { * * {Promise} A promise is returned. * - * @resolve {BuildStep} - The deserialized result object. + * @resolve {Task} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4121,30 +4480,27 @@ export interface BuildSteps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildStep} [result] - The deserialized result object if an error did not occur. - * See {@link BuildStep} for more information. + * {Task} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - create(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepCreateParameters: models.BuildStep, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - create(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepCreateParameters: models.BuildStep, callback: ServiceCallback): void; - create(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepCreateParameters: models.BuildStep, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(resourceGroupName: string, registryName: string, taskName: string, taskCreateParameters: models.Task, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, registryName: string, taskName: string, taskCreateParameters: models.Task, callback: ServiceCallback): void; + create(resourceGroupName: string, registryName: string, taskName: string, taskCreateParameters: models.Task, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a build step from the build task. + * Deletes a specified task. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {string} stepName The name of a build step for a container registry - * build task. + * @param {string} taskName The name of the container registry task. * * @param {object} [options] Optional Parameters. * @@ -4157,20 +4513,17 @@ export interface BuildSteps { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a build step from the build task. + * Deletes a specified task. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {string} stepName The name of a build step for a container registry - * build task. + * @param {string} taskName The name of the container registry task. * * @param {object} [options] Optional Parameters. * @@ -4198,34 +4551,73 @@ export interface BuildSteps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, registryName: string, taskName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, registryName: string, taskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a build step in a build task. + * Updates a task with the specified parameters. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskUpdateParameters The parameters for updating a task. + * + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. + * + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. + * + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. + * + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {string} stepName The name of a build step for a container registry - * build task. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * - * @param {object} buildStepUpdateParameters The parameters for updating a - * build step. + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. * - * @param {object} [buildStepUpdateParameters.properties] The properties for - * updating a build step. + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. * - * @param {string} buildStepUpdateParameters.properties.type Polymorphic - * Discriminator + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * @param {object} [buildStepUpdateParameters.tags] The ARM resource tags. + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -4234,816 +4626,74 @@ export interface BuildSteps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepUpdateParameters: models.BuildStepUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a build step in a build task. + * Updates a task with the specified parameters. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {string} taskName The name of the container registry task. * - * @param {string} stepName The name of a build step for a container registry - * build task. + * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {object} buildStepUpdateParameters The parameters for updating a - * build step. + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [buildStepUpdateParameters.properties] The properties for - * updating a build step. + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. * - * @param {string} buildStepUpdateParameters.properties.type Polymorphic - * Discriminator + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' * - * @param {object} [buildStepUpdateParameters.tags] The ARM resource tags. + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' * - * @param {object} [options] Optional Parameters. + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * {Promise} A promise is returned. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * - * @resolve {BuildStep} - The deserialized result object. + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @reject {Error|ServiceError} - The error object. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. * - * {BuildStep} [result] - The deserialized result object if an error did not occur. - * See {@link BuildStep} for more information. + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - update(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepUpdateParameters: models.BuildStepUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepUpdateParameters: models.BuildStepUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepUpdateParameters: models.BuildStepUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * List the build arguments for a step including the secret arguments. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {string} stepName The name of a build step for a container registry - * build task. - * - * @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. - */ - listBuildArgumentsWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * List the build arguments for a step including the secret arguments. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {string} stepName The name of a build step for a container registry - * build task. - * - * @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 {BuildArgumentList} - 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. - * - * {BuildArgumentList} [result] - The deserialized result object if an error did not occur. - * See {@link BuildArgumentList} 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. - */ - listBuildArguments(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBuildArguments(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, callback: ServiceCallback): void; - listBuildArguments(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a build step for a build task. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {string} stepName The name of a build step for a container registry - * build task. - * - * @param {object} buildStepCreateParameters The parameters for creating a - * build step. - * - * @param {object} [buildStepCreateParameters.properties] The properties of a - * build step. - * - * @param {string} buildStepCreateParameters.properties.type Polymorphic - * Discriminator - * - * @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. - */ - beginCreateWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepCreateParameters: models.BuildStep, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a build step for a build task. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {string} stepName The name of a build step for a container registry - * build task. - * - * @param {object} buildStepCreateParameters The parameters for creating a - * build step. - * - * @param {object} [buildStepCreateParameters.properties] The properties of a - * build step. - * - * @param {string} buildStepCreateParameters.properties.type Polymorphic - * Discriminator - * - * @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 {BuildStep} - 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. - * - * {BuildStep} [result] - The deserialized result object if an error did not occur. - * See {@link BuildStep} 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. - */ - beginCreate(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepCreateParameters: models.BuildStep, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreate(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepCreateParameters: models.BuildStep, callback: ServiceCallback): void; - beginCreate(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepCreateParameters: models.BuildStep, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes a build step from the build task. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {string} stepName The name of a build step for a container registry - * build task. - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a build step from the build task. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {string} stepName The name of a build step for a container registry - * build task. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates a build step in a build task. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {string} stepName The name of a build step for a container registry - * build task. - * - * @param {object} buildStepUpdateParameters The parameters for updating a - * build step. - * - * @param {object} [buildStepUpdateParameters.properties] The properties for - * updating a build step. - * - * @param {string} buildStepUpdateParameters.properties.type Polymorphic - * Discriminator - * - * @param {object} [buildStepUpdateParameters.tags] The ARM resource tags. - * - * @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. - */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepUpdateParameters: models.BuildStepUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a build step in a build task. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {string} stepName The name of a build step for a container registry - * build task. - * - * @param {object} buildStepUpdateParameters The parameters for updating a - * build step. - * - * @param {object} [buildStepUpdateParameters.properties] The properties for - * updating a build step. - * - * @param {string} buildStepUpdateParameters.properties.type Polymorphic - * Discriminator - * - * @param {object} [buildStepUpdateParameters.tags] The ARM resource tags. - * - * @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 {BuildStep} - 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. - * - * {BuildStep} [result] - The deserialized result object if an error did not occur. - * See {@link BuildStep} 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. - */ - beginUpdate(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepUpdateParameters: models.BuildStepUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepUpdateParameters: models.BuildStepUpdateParameters, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepUpdateParameters: models.BuildStepUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * List all the build steps for a given build task. - * - * @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. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * List all the build steps for a given build task. - * - * @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 {BuildStepList} - 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. - * - * {BuildStepList} [result] - The deserialized result object if an error did not occur. - * See {@link BuildStepList} 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. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * List the build arguments for a step including the secret arguments. - * - * @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. - */ - listBuildArgumentsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * List the build arguments for a step including the secret arguments. - * - * @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 {BuildArgumentList} - 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. - * - * {BuildArgumentList} [result] - The deserialized result object if an error did not occur. - * See {@link BuildArgumentList} 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. - */ - listBuildArgumentsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBuildArgumentsNext(nextPageLink: string, callback: ServiceCallback): void; - listBuildArgumentsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * BuildTasks - * __NOTE__: An instance of this class is automatically created for an - * instance of the ContainerRegistryManagementClient. - */ -export interface BuildTasks { - - - /** - * Lists all the build tasks for a specified container registry. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] The build task filter to apply on the - * operation. - * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * build tasks, which provides the next page in the list of tasks. - * - * @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. - */ - listWithHttpOperationResponse(resourceGroupName: string, registryName: string, options?: { filter? : string, skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists all the build tasks for a specified container registry. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] The build task filter to apply on the - * operation. - * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * build tasks, which provides the next page in the list of tasks. - * - * @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 {BuildTaskListResult} - 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. - * - * {BuildTaskListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BuildTaskListResult} 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. - */ - list(resourceGroupName: string, registryName: string, options?: { filter? : string, skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, registryName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, registryName: string, options: { filter? : string, skipToken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the properties of a specified build task. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @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, registryName: string, buildTaskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the properties of a specified build task. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @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 {BuildTask} - 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. - * - * {BuildTask} [result] - The deserialized result object if an error did not occur. - * See {@link BuildTask} 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, registryName: string, buildTaskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, registryName: string, buildTaskName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, registryName: string, buildTaskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates a build task for a container registry with the specified parameters. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {object} buildTaskCreateParameters The parameters for creating a - * build task. - * - * @param {string} buildTaskCreateParameters.alias The alternative updatable - * name for a build task. - * - * @param {string} [buildTaskCreateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' - * - * @param {object} buildTaskCreateParameters.sourceRepository The properties - * that describes the source(code) for the build task. - * - * @param {string} buildTaskCreateParameters.sourceRepository.sourceControlType - * The type of source control service. Possible values include: 'Github', - * 'VisualStudioTeamService' - * - * @param {string} buildTaskCreateParameters.sourceRepository.repositoryUrl The - * full URL to the source code respository - * - * @param {boolean} - * [buildTaskCreateParameters.sourceRepository.isCommitTriggerEnabled] The - * value of this property indicates whether the source control commit trigger - * is enabled or not. - * - * @param {object} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. - * - * @param {string} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.tokenType] - * The type of Auth token. Possible values include: 'PAT', 'OAuth' - * - * @param {string} - * buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.token - * The access token used to access the source control provider. - * - * @param {string} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.refreshToken] - * The refresh token used to refresh the access token. - * - * @param {string} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.scope] - * The scope of the access token. - * - * @param {number} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.expiresIn] - * Time in seconds that the token remains valid - * - * @param {object} buildTaskCreateParameters.platform The platform properties - * against which the build has to happen. - * - * @param {string} buildTaskCreateParameters.platform.osType The operating - * system type required for the build. Possible values include: 'Windows', - * 'Linux' - * - * @param {number} [buildTaskCreateParameters.platform.cpu] The CPU - * configuration in terms of number of cores required for the build. - * - * @param {number} [buildTaskCreateParameters.timeout] Build timeout in - * seconds. - * - * @param {string} buildTaskCreateParameters.location The location of the - * resource. This cannot be changed after the resource is created. - * - * @param {object} [buildTaskCreateParameters.tags] The tags of the resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskCreateParameters: models.BuildTask, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a build task for a container registry with the specified parameters. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {object} buildTaskCreateParameters The parameters for creating a - * build task. - * - * @param {string} buildTaskCreateParameters.alias The alternative updatable - * name for a build task. - * - * @param {string} [buildTaskCreateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' - * - * @param {object} buildTaskCreateParameters.sourceRepository The properties - * that describes the source(code) for the build task. - * - * @param {string} buildTaskCreateParameters.sourceRepository.sourceControlType - * The type of source control service. Possible values include: 'Github', - * 'VisualStudioTeamService' - * - * @param {string} buildTaskCreateParameters.sourceRepository.repositoryUrl The - * full URL to the source code respository - * - * @param {boolean} - * [buildTaskCreateParameters.sourceRepository.isCommitTriggerEnabled] The - * value of this property indicates whether the source control commit trigger - * is enabled or not. - * - * @param {object} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. - * - * @param {string} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.tokenType] - * The type of Auth token. Possible values include: 'PAT', 'OAuth' - * - * @param {string} - * buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.token - * The access token used to access the source control provider. + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * @param {string} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.refreshToken] - * The refresh token used to refresh the access token. - * - * @param {string} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.scope] - * The scope of the access token. - * - * @param {number} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.expiresIn] - * Time in seconds that the token remains valid - * - * @param {object} buildTaskCreateParameters.platform The platform properties - * against which the build has to happen. - * - * @param {string} buildTaskCreateParameters.platform.osType The operating - * system type required for the build. Possible values include: 'Windows', - * 'Linux' - * - * @param {number} [buildTaskCreateParameters.platform.cpu] The CPU - * configuration in terms of number of cores required for the build. - * - * @param {number} [buildTaskCreateParameters.timeout] Build timeout in - * seconds. - * - * @param {string} buildTaskCreateParameters.location The location of the - * resource. This cannot be changed after the resource is created. - * - * @param {object} [buildTaskCreateParameters.tags] The tags of the resource. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -5057,7 +4707,7 @@ export interface BuildTasks { * * {Promise} A promise is returned. * - * @resolve {BuildTask} - The deserialized result object. + * @resolve {Task} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5065,27 +4715,27 @@ export interface BuildTasks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildTask} [result] - The deserialized result object if an error did not occur. - * See {@link BuildTask} for more information. + * {Task} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - create(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskCreateParameters: models.BuildTask, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - create(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskCreateParameters: models.BuildTask, callback: ServiceCallback): void; - create(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskCreateParameters: models.BuildTask, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, callback: ServiceCallback): void; + update(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a specified build task. + * Returns a task with extended information that includes all secrets. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {string} taskName The name of the container registry task. * * @param {object} [options] Optional Parameters. * @@ -5094,21 +4744,21 @@ export interface BuildTasks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getDetailsWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a specified build task. + * Returns a task with extended information that includes all secrets. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {string} taskName The name of the container registry task. * * @param {object} [options] Optional Parameters. * @@ -5122,7 +4772,7 @@ export interface BuildTasks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {Task} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5130,203 +4780,82 @@ export interface BuildTasks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {Task} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, registryName: string, buildTaskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, registryName: string, buildTaskName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, registryName: string, buildTaskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getDetails(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDetails(resourceGroupName: string, registryName: string, taskName: string, callback: ServiceCallback): void; + getDetails(resourceGroupName: string, registryName: string, taskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a build task with the specified parameters. + * Creates a task for a container registry with the specified parameters. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {object} buildTaskUpdateParameters The parameters for updating a - * build task. - * - * @param {string} [buildTaskUpdateParameters.alias] The alternative updatable - * name for a build task. - * - * @param {string} [buildTaskUpdateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' - * - * @param {object} [buildTaskUpdateParameters.platform] The platform properties - * against which the build has to happen. - * - * @param {string} buildTaskUpdateParameters.platform.osType The operating - * system type required for the build. Possible values include: 'Windows', - * 'Linux' - * - * @param {number} [buildTaskUpdateParameters.platform.cpu] The CPU - * configuration in terms of number of cores required for the build. - * - * @param {number} [buildTaskUpdateParameters.timeout] Build timeout in - * seconds. - * - * @param {object} [buildTaskUpdateParameters.sourceRepository] The properties - * that describes the source(code) for the build task. - * - * @param {object} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. - * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.tokenType] - * The type of Auth token. Possible values include: 'PAT', 'OAuth' - * - * @param {string} - * buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.token - * The access token used to access the source control provider. - * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.refreshToken] - * The refresh token used to refresh the access token. - * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.scope] - * The scope of the access token. - * - * @param {number} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.expiresIn] - * Time in seconds that the token remains valid - * - * @param {boolean} - * [buildTaskUpdateParameters.sourceRepository.isCommitTriggerEnabled] The - * value of this property indicates whether the source control commit trigger - * is enabled or not. - * - * @param {object} [buildTaskUpdateParameters.tags] The ARM resource tags. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - updateWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskUpdateParameters: models.BuildTaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a build task with the specified parameters. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. + * @param {string} taskName The name of the container registry task. * - * @param {string} registryName The name of the container registry. + * @param {object} taskCreateParameters The parameters for creating a task. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * @param {object} buildTaskUpdateParameters The parameters for updating a - * build task. + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. * - * @param {string} [buildTaskUpdateParameters.alias] The alternative updatable - * name for a build task. + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' * - * @param {string} [buildTaskUpdateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' + * @param {string} taskCreateParameters.platform.architecture The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' * - * @param {object} [buildTaskUpdateParameters.platform] The platform properties - * against which the build has to happen. + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' * - * @param {string} buildTaskUpdateParameters.platform.osType The operating - * system type required for the build. Possible values include: 'Windows', - * 'Linux' + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * @param {number} [buildTaskUpdateParameters.platform.cpu] The CPU - * configuration in terms of number of cores required for the build. + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. * - * @param {number} [buildTaskUpdateParameters.timeout] Build timeout in - * seconds. + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. * - * @param {object} [buildTaskUpdateParameters.sourceRepository] The properties - * that describes the source(code) for the build task. + * @param {object} taskCreateParameters.step The properties of a task step. * - * @param {object} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.tokenType] - * The type of Auth token. Possible values include: 'PAT', 'OAuth' + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. * - * @param {string} - * buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.token - * The access token used to access the source control provider. + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.refreshToken] - * The refresh token used to refresh the access token. + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. * * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.scope] - * The scope of the access token. - * - * @param {number} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.expiresIn] - * Time in seconds that the token remains valid - * - * @param {boolean} - * [buildTaskUpdateParameters.sourceRepository.isCommitTriggerEnabled] The - * value of this property indicates whether the source control commit trigger - * is enabled or not. - * - * @param {object} [buildTaskUpdateParameters.tags] The ARM resource tags. - * - * @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 {BuildTask} - 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. - * - * {BuildTask} [result] - The deserialized result object if an error did not occur. - * See {@link BuildTask} for more information. + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - update(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskUpdateParameters: models.BuildTaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskUpdateParameters: models.BuildTaskUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskUpdateParameters: models.BuildTaskUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Get the source control properties for a build task. + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * @param {string} registryName The name of the container registry. + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {object} [taskCreateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -5335,219 +4864,76 @@ export interface BuildTasks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listSourceRepositoryPropertiesWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Get the source control properties for a build task. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @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 {SourceRepositoryProperties} - 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. - * - * {SourceRepositoryProperties} [result] - The deserialized result object if an error did not occur. - * See {@link SourceRepositoryProperties} 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. - */ - listSourceRepositoryProperties(resourceGroupName: string, registryName: string, buildTaskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSourceRepositoryProperties(resourceGroupName: string, registryName: string, buildTaskName: string, callback: ServiceCallback): void; - listSourceRepositoryProperties(resourceGroupName: string, registryName: string, buildTaskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + beginCreateWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskCreateParameters: models.Task, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a build task for a container registry with the specified parameters. + * Creates a task for a container registry with the specified parameters. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {object} buildTaskCreateParameters The parameters for creating a - * build task. - * - * @param {string} buildTaskCreateParameters.alias The alternative updatable - * name for a build task. - * - * @param {string} [buildTaskCreateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' - * - * @param {object} buildTaskCreateParameters.sourceRepository The properties - * that describes the source(code) for the build task. - * - * @param {string} buildTaskCreateParameters.sourceRepository.sourceControlType - * The type of source control service. Possible values include: 'Github', - * 'VisualStudioTeamService' - * - * @param {string} buildTaskCreateParameters.sourceRepository.repositoryUrl The - * full URL to the source code respository - * - * @param {boolean} - * [buildTaskCreateParameters.sourceRepository.isCommitTriggerEnabled] The - * value of this property indicates whether the source control commit trigger - * is enabled or not. - * - * @param {object} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. - * - * @param {string} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.tokenType] - * The type of Auth token. Possible values include: 'PAT', 'OAuth' - * - * @param {string} - * buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.token - * The access token used to access the source control provider. - * - * @param {string} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.refreshToken] - * The refresh token used to refresh the access token. - * - * @param {string} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.scope] - * The scope of the access token. - * - * @param {number} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.expiresIn] - * Time in seconds that the token remains valid - * - * @param {object} buildTaskCreateParameters.platform The platform properties - * against which the build has to happen. - * - * @param {string} buildTaskCreateParameters.platform.osType The operating - * system type required for the build. Possible values include: 'Windows', - * 'Linux' - * - * @param {number} [buildTaskCreateParameters.platform.cpu] The CPU - * configuration in terms of number of cores required for the build. - * - * @param {number} [buildTaskCreateParameters.timeout] Build timeout in - * seconds. - * - * @param {string} buildTaskCreateParameters.location The location of the - * resource. This cannot be changed after the resource is created. - * - * @param {object} [buildTaskCreateParameters.tags] The tags of the resource. + * @param {string} taskName The name of the container registry task. * - * @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. - */ - beginCreateWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskCreateParameters: models.BuildTask, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates a build task for a container registry with the specified parameters. + * @param {object} taskCreateParameters The parameters for creating a task. * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * @param {string} buildTaskName The name of the container registry build task. + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. * - * @param {object} buildTaskCreateParameters The parameters for creating a - * build task. + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' * - * @param {string} buildTaskCreateParameters.alias The alternative updatable - * name for a build task. + * @param {string} taskCreateParameters.platform.architecture The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' * - * @param {string} [buildTaskCreateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' * - * @param {object} buildTaskCreateParameters.sourceRepository The properties - * that describes the source(code) for the build task. + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * @param {string} buildTaskCreateParameters.sourceRepository.sourceControlType - * The type of source control service. Possible values include: 'Github', - * 'VisualStudioTeamService' + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. * - * @param {string} buildTaskCreateParameters.sourceRepository.repositoryUrl The - * full URL to the source code respository + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. * - * @param {boolean} - * [buildTaskCreateParameters.sourceRepository.isCommitTriggerEnabled] The - * value of this property indicates whether the source control commit trigger - * is enabled or not. + * @param {object} taskCreateParameters.step The properties of a task step. * - * @param {object} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator * - * @param {string} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.tokenType] - * The type of Auth token. Possible values include: 'PAT', 'OAuth' + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. * - * @param {string} - * buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.token - * The access token used to access the source control provider. + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. * - * @param {string} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.refreshToken] - * The refresh token used to refresh the access token. + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. * * @param {string} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.scope] - * The scope of the access token. - * - * @param {number} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.expiresIn] - * Time in seconds that the token remains valid + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' * - * @param {object} buildTaskCreateParameters.platform The platform properties - * against which the build has to happen. + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * @param {string} buildTaskCreateParameters.platform.osType The operating - * system type required for the build. Possible values include: 'Windows', - * 'Linux' + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * @param {number} [buildTaskCreateParameters.platform.cpu] The CPU - * configuration in terms of number of cores required for the build. + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. * - * @param {number} [buildTaskCreateParameters.timeout] Build timeout in - * seconds. - * - * @param {string} buildTaskCreateParameters.location The location of the - * resource. This cannot be changed after the resource is created. - * - * @param {object} [buildTaskCreateParameters.tags] The tags of the resource. + * @param {object} [taskCreateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -5561,7 +4947,7 @@ export interface BuildTasks { * * {Promise} A promise is returned. * - * @resolve {BuildTask} - The deserialized result object. + * @resolve {Task} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5569,27 +4955,27 @@ export interface BuildTasks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildTask} [result] - The deserialized result object if an error did not occur. - * See {@link BuildTask} for more information. + * {Task} [result] - The deserialized result object if an error did not occur. + * See {@link Task} 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. */ - beginCreate(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskCreateParameters: models.BuildTask, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreate(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskCreateParameters: models.BuildTask, callback: ServiceCallback): void; - beginCreate(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskCreateParameters: models.BuildTask, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, registryName: string, taskName: string, taskCreateParameters: models.Task, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, registryName: string, taskName: string, taskCreateParameters: models.Task, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, registryName: string, taskName: string, taskCreateParameters: models.Task, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a specified build task. + * Deletes a specified task. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {string} taskName The name of the container registry task. * * @param {object} [options] Optional Parameters. * @@ -5602,17 +4988,17 @@ export interface BuildTasks { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a specified build task. + * Deletes a specified task. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {string} taskName The name of the container registry task. * * @param {object} [options] Optional Parameters. * @@ -5640,76 +5026,73 @@ export interface BuildTasks { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, registryName: string, buildTaskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, registryName: string, buildTaskName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, registryName: string, buildTaskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, registryName: string, taskName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, registryName: string, taskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a build task with the specified parameters. + * Updates a task with the specified parameters. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {string} taskName The name of the container registry task. * - * @param {object} buildTaskUpdateParameters The parameters for updating a - * build task. + * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [buildTaskUpdateParameters.alias] The alternative updatable - * name for a build task. + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * @param {string} [buildTaskUpdateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. * - * @param {object} [buildTaskUpdateParameters.platform] The platform properties - * against which the build has to happen. + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' * - * @param {string} buildTaskUpdateParameters.platform.osType The operating - * system type required for the build. Possible values include: 'Windows', - * 'Linux' + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' * - * @param {number} [buildTaskUpdateParameters.platform.cpu] The CPU - * configuration in terms of number of cores required for the build. + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' * - * @param {number} [buildTaskUpdateParameters.timeout] Build timeout in - * seconds. + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * @param {object} [buildTaskUpdateParameters.sourceRepository] The properties - * that describes the source(code) for the build task. + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. * - * @param {object} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.tokenType] - * The type of Auth token. Possible values include: 'PAT', 'OAuth' + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * - * @param {string} - * buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.token - * The access token used to access the source control provider. + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.refreshToken] - * The refresh token used to refresh the access token. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. + * + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. * * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.scope] - * The scope of the access token. + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' * - * @param {number} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.expiresIn] - * Time in seconds that the token remains valid + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * @param {boolean} - * [buildTaskUpdateParameters.sourceRepository.isCommitTriggerEnabled] The - * value of this property indicates whether the source control commit trigger - * is enabled or not. + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * @param {object} [buildTaskUpdateParameters.tags] The ARM resource tags. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -5718,77 +5101,74 @@ export interface BuildTasks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskUpdateParameters: models.BuildTaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a build task with the specified parameters. + * Updates a task with the specified parameters. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {string} taskName The name of the container registry task. * - * @param {object} buildTaskUpdateParameters The parameters for updating a - * build task. + * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [buildTaskUpdateParameters.alias] The alternative updatable - * name for a build task. + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * @param {string} [buildTaskUpdateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. * - * @param {object} [buildTaskUpdateParameters.platform] The platform properties - * against which the build has to happen. + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' * - * @param {string} buildTaskUpdateParameters.platform.osType The operating - * system type required for the build. Possible values include: 'Windows', - * 'Linux' + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' * - * @param {number} [buildTaskUpdateParameters.platform.cpu] The CPU - * configuration in terms of number of cores required for the build. + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' * - * @param {number} [buildTaskUpdateParameters.timeout] Build timeout in - * seconds. + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * @param {object} [buildTaskUpdateParameters.sourceRepository] The properties - * that describes the source(code) for the build task. + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. * - * @param {object} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.tokenType] - * The type of Auth token. Possible values include: 'PAT', 'OAuth' + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * - * @param {string} - * buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.token - * The access token used to access the source control provider. + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.refreshToken] - * The refresh token used to refresh the access token. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. + * + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. * * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.scope] - * The scope of the access token. + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' * - * @param {number} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.expiresIn] - * Time in seconds that the token remains valid + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * @param {boolean} - * [buildTaskUpdateParameters.sourceRepository.isCommitTriggerEnabled] The - * value of this property indicates whether the source control commit trigger - * is enabled or not. + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * @param {object} [buildTaskUpdateParameters.tags] The ARM resource tags. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -5802,7 +5182,7 @@ export interface BuildTasks { * * {Promise} A promise is returned. * - * @resolve {BuildTask} - The deserialized result object. + * @resolve {Task} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5810,20 +5190,20 @@ export interface BuildTasks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildTask} [result] - The deserialized result object if an error did not occur. - * See {@link BuildTask} for more information. + * {Task} [result] - The deserialized result object if an error did not occur. + * See {@link Task} 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. */ - beginUpdate(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskUpdateParameters: models.BuildTaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskUpdateParameters: models.BuildTaskUpdateParameters, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskUpdateParameters: models.BuildTaskUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all the build tasks for a specified container registry. + * Lists all the tasks for a specified container registry. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5835,14 +5215,14 @@ export interface BuildTasks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all the build tasks for a specified container registry. + * Lists all the tasks for a specified container registry. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -5859,7 +5239,7 @@ export interface BuildTasks { * * {Promise} A promise is returned. * - * @resolve {BuildTaskListResult} - The deserialized result object. + * @resolve {TaskListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5867,14 +5247,14 @@ export interface BuildTasks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildTaskListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BuildTaskListResult} for more information. + * {TaskListResult} [result] - The deserialized result object if an error did not occur. + * See {@link TaskListResult} 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. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } diff --git a/lib/services/containerRegistryManagement/lib/operations/index.js b/lib/services/containerRegistryManagement/lib/operations/index.js index 05a68dfdad..e026094c34 100644 --- a/lib/services/containerRegistryManagement/lib/operations/index.js +++ b/lib/services/containerRegistryManagement/lib/operations/index.js @@ -18,6 +18,5 @@ exports.Registries = require('./registries'); exports.Operations = require('./operations'); exports.Replications = require('./replications'); exports.Webhooks = require('./webhooks'); -exports.Builds = require('./builds'); -exports.BuildSteps = require('./buildSteps'); -exports.BuildTasks = require('./buildTasks'); +exports.Runs = require('./runs'); +exports.Tasks = require('./tasks'); diff --git a/lib/services/containerRegistryManagement/lib/operations/registries.js b/lib/services/containerRegistryManagement/lib/operations/registries.js index 8ba49758c9..68be1d6574 100644 --- a/lib/services/containerRegistryManagement/lib/operations/registries.js +++ b/lib/services/containerRegistryManagement/lib/operations/registries.js @@ -29,8 +29,11 @@ const WebResource = msRest.WebResource; * * @param {object} parameters.source The source of the image. * - * @param {string} parameters.source.resourceId The resource identifier of the - * target Azure Container Registry. + * @param {string} [parameters.source.resourceId] The resource identifier of + * the source Azure Container Registry. + * + * @param {string} [parameters.source.registryUri] The address of the source + * registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -1464,9 +1467,266 @@ function _listUsages(resourceGroupName, registryName, options, callback) { }); } +/** + * Lists the policies for the specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @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 RegistryPolicies} 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 _listPolicies(resourceGroupName, registryName, 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-10-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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 (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + 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.ContainerRegistry/registries/{registryName}/listPolicies'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RegistryPolicies']().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); + }); +} + + +/** + * Updates the policies for the specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} registryPoliciesUpdateParameters The parameters for updating + * policies of a container registry. + * + * @param {object} [registryPoliciesUpdateParameters.quarantinePolicy] An + * object that represents quarantine policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.quarantinePolicy.status] + * The value that indicates whether the policy is enabled or not. Possible + * values include: 'enabled', 'disabled' + * + * @param {object} [registryPoliciesUpdateParameters.trustPolicy] An object + * that represents content trust policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.type] The type + * of trust policy. Possible values include: 'Notary' + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.status] The + * value that indicates whether the policy is enabled or not. Possible values + * include: 'enabled', 'disabled' + * + * @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 RegistryPolicies} 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 _updatePolicies(resourceGroupName, registryName, registryPoliciesUpdateParameters, 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.'); + } + + // Send request + this.beginUpdatePolicies(resourceGroupName, registryName, registryPoliciesUpdateParameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RegistryPolicies']().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); + }); + }); +} + /** - * Creates a new build based on the request parameters and add it to the build + * Schedules a new run based on the request parameters and add it to the run * queue. * * @param {string} resourceGroupName The name of the resource group to which @@ -1474,9 +1734,12 @@ function _listUsages(resourceGroupName, registryName, options, callback) { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. + * + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -1490,13 +1753,13 @@ function _listUsages(resourceGroupName, registryName, options, callback) { * {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 Build} for more information. + * See {@link Run} 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 _queueBuild(resourceGroupName, registryName, buildRequest, options, callback) { +function _scheduleRun(resourceGroupName, registryName, runRequest, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1509,7 +1772,7 @@ function _queueBuild(resourceGroupName, registryName, buildRequest, options, cal } // Send request - this.beginQueueBuild(resourceGroupName, registryName, buildRequest, options, (err, parsedResult, httpRequest, response) => { + this.beginScheduleRun(resourceGroupName, registryName, runRequest, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -1533,7 +1796,7 @@ function _queueBuild(resourceGroupName, registryName, buildRequest, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Build']().mapper(); + let resultMapper = new client.models['Run']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1585,7 +1848,7 @@ function _getBuildSourceUploadUrl(resourceGroupName, registryName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01-preview'; + let apiVersion = '2018-09-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1620,7 +1883,7 @@ function _getBuildSourceUploadUrl(resourceGroupName, registryName, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/getBuildSourceUploadUrl'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listBuildSourceUploadUrl'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); @@ -1721,8 +1984,11 @@ function _getBuildSourceUploadUrl(resourceGroupName, registryName, options, call * * @param {object} parameters.source The source of the image. * - * @param {string} parameters.source.resourceId The resource identifier of the - * target Azure Container Registry. + * @param {string} [parameters.source.resourceId] The resource identifier of + * the source Azure Container Registry. + * + * @param {string} [parameters.source.registryUri] The address of the source + * registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -2464,17 +2730,32 @@ function _beginUpdate(resourceGroupName, registryName, registryUpdateParameters, } /** - * Creates a new build based on the request parameters and add it to the build - * queue. + * Updates the policies for the specified container registry. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} registryPoliciesUpdateParameters The parameters for updating + * policies of a container registry. + * + * @param {object} [registryPoliciesUpdateParameters.quarantinePolicy] An + * object that represents quarantine policy for a container registry. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} [registryPoliciesUpdateParameters.quarantinePolicy.status] + * The value that indicates whether the policy is enabled or not. Possible + * values include: 'enabled', 'disabled' + * + * @param {object} [registryPoliciesUpdateParameters.trustPolicy] An object + * that represents content trust policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.type] The type + * of trust policy. Possible values include: 'Notary' + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.status] The + * value that indicates whether the policy is enabled or not. Possible values + * include: 'enabled', 'disabled' * * @param {object} [options] Optional Parameters. * @@ -2488,13 +2769,13 @@ function _beginUpdate(resourceGroupName, registryName, registryUpdateParameters, * {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 Build} for more information. + * See {@link RegistryPolicies} 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 _beginQueueBuild(resourceGroupName, registryName, buildRequest, options, callback) { +function _beginUpdatePolicies(resourceGroupName, registryName, registryPoliciesUpdateParameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2504,7 +2785,7 @@ function _beginQueueBuild(resourceGroupName, registryName, buildRequest, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01-preview'; + let apiVersion = '2017-10-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -2530,8 +2811,8 @@ function _beginQueueBuild(resourceGroupName, registryName, buildRequest, options throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); } } - if (buildRequest === null || buildRequest === undefined) { - throw new Error('buildRequest cannot be null or undefined.'); + if (registryPoliciesUpdateParameters === null || registryPoliciesUpdateParameters === undefined) { + throw new Error('registryPoliciesUpdateParameters cannot be null or undefined.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -2542,7 +2823,7 @@ function _beginQueueBuild(resourceGroupName, registryName, buildRequest, options // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/queueBuild'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/updatePolicies'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); @@ -2576,14 +2857,14 @@ function _beginQueueBuild(resourceGroupName, registryName, buildRequest, options let requestContent = null; let requestModel = null; try { - if (buildRequest !== null && buildRequest !== undefined) { - let requestModelMapper = new client.models['QueueBuildRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, buildRequest, 'buildRequest'); + if (registryPoliciesUpdateParameters !== null && registryPoliciesUpdateParameters !== undefined) { + let requestModelMapper = new client.models['RegistryPolicies']().mapper(); + requestModel = client.serialize(requestModelMapper, registryPoliciesUpdateParameters, 'registryPoliciesUpdateParameters'); requestContent = JSON.stringify(requestModel); } } catch (error) { let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(buildRequest, null, 2)}.`); + `payload - ${JSON.stringify(registryPoliciesUpdateParameters, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -2628,7 +2909,7 @@ function _beginQueueBuild(resourceGroupName, registryName, buildRequest, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Build']().mapper(); + let resultMapper = new client.models['RegistryPolicies']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2644,10 +2925,20 @@ function _beginQueueBuild(resourceGroupName, registryName, buildRequest, options } /** - * Lists all the container registries under the specified resource group. + * Schedules a new run based on the request parameters and add it to the run + * queue. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} runRequest The parameters of a run that needs to scheduled. + * + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. + * + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -2661,7 +2952,180 @@ function _beginQueueBuild(resourceGroupName, registryName, buildRequest, options * {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 RegistryListResult} for more information. + * See {@link Run} 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 _beginScheduleRun(resourceGroupName, registryName, runRequest, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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 (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (runRequest === null || runRequest === undefined) { + throw new Error('runRequest cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (runRequest !== null && runRequest !== undefined) { + let requestModelMapper = new client.models['RunRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, runRequest, 'runRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(runRequest, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Run']().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); + }); +} + +/** + * Lists all the container registries under the specified resource group. + * + * @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 RegistryListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -2916,13 +3380,16 @@ class Registries { this._listCredentials = _listCredentials; this._regenerateCredential = _regenerateCredential; this._listUsages = _listUsages; - this._queueBuild = _queueBuild; + this._listPolicies = _listPolicies; + this._updatePolicies = _updatePolicies; + this._scheduleRun = _scheduleRun; this._getBuildSourceUploadUrl = _getBuildSourceUploadUrl; this._beginImportImage = _beginImportImage; this._beginCreate = _beginCreate; this._beginDeleteMethod = _beginDeleteMethod; this._beginUpdate = _beginUpdate; - this._beginQueueBuild = _beginQueueBuild; + this._beginUpdatePolicies = _beginUpdatePolicies; + this._beginScheduleRun = _beginScheduleRun; this._listByResourceGroupNext = _listByResourceGroupNext; this._listNext = _listNext; } @@ -2941,8 +3408,11 @@ class Registries { * * @param {object} parameters.source The source of the image. * - * @param {string} parameters.source.resourceId The resource identifier of the - * target Azure Container Registry. + * @param {string} [parameters.source.resourceId] The resource identifier of + * the source Azure Container Registry. + * + * @param {string} [parameters.source.registryUri] The address of the source + * registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -3003,8 +3473,11 @@ class Registries { * * @param {object} parameters.source The source of the image. * - * @param {string} parameters.source.resourceId The resource identifier of the - * target Azure Container Registry. + * @param {string} [parameters.source.resourceId] The resource identifier of + * the source Azure Container Registry. + * + * @param {string} [parameters.source.registryUri] The address of the source + * registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -4055,7 +4528,223 @@ class Registries { } /** - * Creates a new build based on the request parameters and add it to the build + * Lists the policies for the specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @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. + */ + listPoliciesWithHttpOperationResponse(resourceGroupName, registryName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPolicies(resourceGroupName, registryName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the policies for the specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @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 {RegistryPolicies} - 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 RegistryPolicies} 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. + */ + listPolicies(resourceGroupName, registryName, 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._listPolicies(resourceGroupName, registryName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPolicies(resourceGroupName, registryName, options, optionalCallback); + } + } + + /** + * Updates the policies for the specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} registryPoliciesUpdateParameters The parameters for updating + * policies of a container registry. + * + * @param {object} [registryPoliciesUpdateParameters.quarantinePolicy] An + * object that represents quarantine policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.quarantinePolicy.status] + * The value that indicates whether the policy is enabled or not. Possible + * values include: 'enabled', 'disabled' + * + * @param {object} [registryPoliciesUpdateParameters.trustPolicy] An object + * that represents content trust policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.type] The type + * of trust policy. Possible values include: 'Notary' + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.status] The + * value that indicates whether the policy is enabled or not. Possible values + * include: 'enabled', 'disabled' + * + * @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. + */ + updatePoliciesWithHttpOperationResponse(resourceGroupName, registryName, registryPoliciesUpdateParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updatePolicies(resourceGroupName, registryName, registryPoliciesUpdateParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates the policies for the specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} registryPoliciesUpdateParameters The parameters for updating + * policies of a container registry. + * + * @param {object} [registryPoliciesUpdateParameters.quarantinePolicy] An + * object that represents quarantine policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.quarantinePolicy.status] + * The value that indicates whether the policy is enabled or not. Possible + * values include: 'enabled', 'disabled' + * + * @param {object} [registryPoliciesUpdateParameters.trustPolicy] An object + * that represents content trust policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.type] The type + * of trust policy. Possible values include: 'Notary' + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.status] The + * value that indicates whether the policy is enabled or not. Possible values + * include: 'enabled', 'disabled' + * + * @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 {RegistryPolicies} - 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 RegistryPolicies} 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. + */ + updatePolicies(resourceGroupName, registryName, registryPoliciesUpdateParameters, 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._updatePolicies(resourceGroupName, registryName, registryPoliciesUpdateParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updatePolicies(resourceGroupName, registryName, registryPoliciesUpdateParameters, options, optionalCallback); + } + } + + /** + * Schedules a new run based on the request parameters and add it to the run * queue. * * @param {string} resourceGroupName The name of the resource group to which @@ -4063,9 +4752,12 @@ class Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. + * + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -4074,15 +4766,15 @@ class Registries { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - queueBuildWithHttpOperationResponse(resourceGroupName, registryName, buildRequest, options) { + scheduleRunWithHttpOperationResponse(resourceGroupName, registryName, runRequest, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._queueBuild(resourceGroupName, registryName, buildRequest, options, (err, result, request, response) => { + self._scheduleRun(resourceGroupName, registryName, runRequest, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4093,7 +4785,7 @@ class Registries { } /** - * Creates a new build based on the request parameters and add it to the build + * Schedules a new run based on the request parameters and add it to the run * queue. * * @param {string} resourceGroupName The name of the resource group to which @@ -4101,9 +4793,12 @@ class Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. + * + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -4117,7 +4812,7 @@ class Registries { * * {Promise} A promise is returned * - * @resolve {Build} - The deserialized result object. + * @resolve {Run} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4126,13 +4821,13 @@ class Registries { * {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 Build} for more information. + * See {@link Run} 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. */ - queueBuild(resourceGroupName, registryName, buildRequest, options, optionalCallback) { + scheduleRun(resourceGroupName, registryName, runRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4141,14 +4836,14 @@ class Registries { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._queueBuild(resourceGroupName, registryName, buildRequest, options, (err, result, request, response) => { + self._scheduleRun(resourceGroupName, registryName, runRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._queueBuild(resourceGroupName, registryName, buildRequest, options, optionalCallback); + return self._scheduleRun(resourceGroupName, registryName, runRequest, options, optionalCallback); } } @@ -4255,8 +4950,11 @@ class Registries { * * @param {object} parameters.source The source of the image. * - * @param {string} parameters.source.resourceId The resource identifier of the - * target Azure Container Registry. + * @param {string} [parameters.source.resourceId] The resource identifier of + * the source Azure Container Registry. + * + * @param {string} [parameters.source.registryUri] The address of the source + * registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -4317,8 +5015,11 @@ class Registries { * * @param {object} parameters.source The source of the image. * - * @param {string} parameters.source.resourceId The resource identifier of the - * target Azure Container Registry. + * @param {string} [parameters.source.resourceId] The resource identifier of + * the source Azure Container Registry. + * + * @param {string} [parameters.source.registryUri] The address of the source + * registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -4742,7 +5443,135 @@ class Registries { } /** - * Creates a new build based on the request parameters and add it to the build + * Updates the policies for the specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} registryPoliciesUpdateParameters The parameters for updating + * policies of a container registry. + * + * @param {object} [registryPoliciesUpdateParameters.quarantinePolicy] An + * object that represents quarantine policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.quarantinePolicy.status] + * The value that indicates whether the policy is enabled or not. Possible + * values include: 'enabled', 'disabled' + * + * @param {object} [registryPoliciesUpdateParameters.trustPolicy] An object + * that represents content trust policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.type] The type + * of trust policy. Possible values include: 'Notary' + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.status] The + * value that indicates whether the policy is enabled or not. Possible values + * include: 'enabled', 'disabled' + * + * @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. + */ + beginUpdatePoliciesWithHttpOperationResponse(resourceGroupName, registryName, registryPoliciesUpdateParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdatePolicies(resourceGroupName, registryName, registryPoliciesUpdateParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates the policies for the specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} registryPoliciesUpdateParameters The parameters for updating + * policies of a container registry. + * + * @param {object} [registryPoliciesUpdateParameters.quarantinePolicy] An + * object that represents quarantine policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.quarantinePolicy.status] + * The value that indicates whether the policy is enabled or not. Possible + * values include: 'enabled', 'disabled' + * + * @param {object} [registryPoliciesUpdateParameters.trustPolicy] An object + * that represents content trust policy for a container registry. + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.type] The type + * of trust policy. Possible values include: 'Notary' + * + * @param {string} [registryPoliciesUpdateParameters.trustPolicy.status] The + * value that indicates whether the policy is enabled or not. Possible values + * include: 'enabled', 'disabled' + * + * @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 {RegistryPolicies} - 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 RegistryPolicies} 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. + */ + beginUpdatePolicies(resourceGroupName, registryName, registryPoliciesUpdateParameters, 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._beginUpdatePolicies(resourceGroupName, registryName, registryPoliciesUpdateParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdatePolicies(resourceGroupName, registryName, registryPoliciesUpdateParameters, options, optionalCallback); + } + } + + /** + * Schedules a new run based on the request parameters and add it to the run * queue. * * @param {string} resourceGroupName The name of the resource group to which @@ -4750,9 +5579,12 @@ class Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. + * + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -4761,15 +5593,15 @@ class Registries { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginQueueBuildWithHttpOperationResponse(resourceGroupName, registryName, buildRequest, options) { + beginScheduleRunWithHttpOperationResponse(resourceGroupName, registryName, runRequest, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginQueueBuild(resourceGroupName, registryName, buildRequest, options, (err, result, request, response) => { + self._beginScheduleRun(resourceGroupName, registryName, runRequest, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4780,7 +5612,7 @@ class Registries { } /** - * Creates a new build based on the request parameters and add it to the build + * Schedules a new run based on the request parameters and add it to the run * queue. * * @param {string} resourceGroupName The name of the resource group to which @@ -4788,9 +5620,12 @@ class Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. + * + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -4804,7 +5639,7 @@ class Registries { * * {Promise} A promise is returned * - * @resolve {Build} - The deserialized result object. + * @resolve {Run} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4813,13 +5648,13 @@ class Registries { * {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 Build} for more information. + * See {@link Run} 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. */ - beginQueueBuild(resourceGroupName, registryName, buildRequest, options, optionalCallback) { + beginScheduleRun(resourceGroupName, registryName, runRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4828,14 +5663,14 @@ class Registries { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginQueueBuild(resourceGroupName, registryName, buildRequest, options, (err, result, request, response) => { + self._beginScheduleRun(resourceGroupName, registryName, runRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginQueueBuild(resourceGroupName, registryName, buildRequest, options, optionalCallback); + return self._beginScheduleRun(resourceGroupName, registryName, runRequest, options, optionalCallback); } } diff --git a/lib/services/containerRegistryManagement/lib/operations/runs.js b/lib/services/containerRegistryManagement/lib/operations/runs.js new file mode 100644 index 0000000000..0175450ea5 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/operations/runs.js @@ -0,0 +1,1928 @@ +/* + * 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; + +/** + * Gets all the runs for a registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The runs filter to apply on the operation. + * Arithmetic operators are not supported. The allowed string function is + * 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * + * @param {number} [options.top] $top is supported for get list of runs, which + * limits the maximum number of runs to return. + * + * @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 RunListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, registryName, 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 top = (options && options.top !== undefined) ? options.top : undefined; + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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 (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + 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.ContainerRegistry/registries/{registryName}/runs'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.toString())); + } + 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RunListResult']().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); + }); +} + +/** + * Gets the detailed information for a given run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Run} 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, registryName, runId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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 (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (runId === null || runId === undefined || typeof runId.valueOf() !== 'string') { + throw new Error('runId 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.ContainerRegistry/registries/{registryName}/runs/{runId}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{runId}', encodeURIComponent(runId)); + 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Run']().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); + }); +} + + +/** + * Patch the run properties. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} runUpdateParameters The run update properties. + * + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that + * indicates whether archiving is enabled or not. + * + * @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 Run} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, registryName, runId, runUpdateParameters, 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.'); + } + + // Send request + this.beginUpdate(resourceGroupName, registryName, runId, runUpdateParameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Run']().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); + }); + }); +} + +/** + * Gets a link to download the run logs. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RunGetLogResult} 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 _getLogSasUrl(resourceGroupName, registryName, runId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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 (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (runId === null || runId === undefined || typeof runId.valueOf() !== 'string') { + throw new Error('runId 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.ContainerRegistry/registries/{registryName}/runs/{runId}/listLogSasUrl'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{runId}', encodeURIComponent(runId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RunGetLogResult']().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); + }); +} + + +/** + * Cancel an existing run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _cancel(resourceGroupName, registryName, runId, 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.'); + } + + // Send request + this.beginCancel(resourceGroupName, registryName, runId, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Patch the run properties. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} runUpdateParameters The run update properties. + * + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that + * indicates whether archiving is enabled or not. + * + * @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 Run} 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 _beginUpdate(resourceGroupName, registryName, runId, runUpdateParameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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 (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (runId === null || runId === undefined || typeof runId.valueOf() !== 'string') { + throw new Error('runId cannot be null or undefined and it must be of type string.'); + } + if (runUpdateParameters === null || runUpdateParameters === undefined) { + throw new Error('runUpdateParameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{runId}', encodeURIComponent(runId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (runUpdateParameters !== null && runUpdateParameters !== undefined) { + let requestModelMapper = new client.models['RunUpdateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, runUpdateParameters, 'runUpdateParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(runUpdateParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Run']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Run']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Cancel an existing run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCancel(resourceGroupName, registryName, runId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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 (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (runId === null || runId === undefined || typeof runId.valueOf() !== 'string') { + throw new Error('runId 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.ContainerRegistry/registries/{registryName}/runs/{runId}/cancel'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{runId}', encodeURIComponent(runId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the runs for a registry. + * + * @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 RunListResult} 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 _listNext(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RunListResult']().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 Runs. */ +class Runs { + /** + * Create a Runs. + * @param {ContainerRegistryManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._update = _update; + this._getLogSasUrl = _getLogSasUrl; + this._cancel = _cancel; + this._beginUpdate = _beginUpdate; + this._beginCancel = _beginCancel; + this._listNext = _listNext; + } + + /** + * Gets all the runs for a registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The runs filter to apply on the operation. + * Arithmetic operators are not supported. The allowed string function is + * 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * + * @param {number} [options.top] $top is supported for get list of runs, which + * limits the maximum number of runs to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, registryName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, registryName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the runs for a registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The runs filter to apply on the operation. + * Arithmetic operators are not supported. The allowed string function is + * 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * + * @param {number} [options.top] $top is supported for get list of runs, which + * limits the maximum number of runs to return. + * + * @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 {RunListResult} - 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 RunListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName, registryName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceGroupName, registryName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, registryName, options, optionalCallback); + } + } + + /** + * Gets the detailed information for a given run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, registryName, runId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the detailed information for a given run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Run} - 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 Run} 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, registryName, runId, 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, registryName, runId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, registryName, runId, options, optionalCallback); + } + } + + /** + * Patch the run properties. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} runUpdateParameters The run update properties. + * + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that + * indicates whether archiving is enabled or not. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, registryName, runId, runUpdateParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, registryName, runId, runUpdateParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Patch the run properties. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} runUpdateParameters The run update properties. + * + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that + * indicates whether archiving is enabled or not. + * + * @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 {Run} - 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 Run} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, registryName, runId, runUpdateParameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, registryName, runId, runUpdateParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, registryName, runId, runUpdateParameters, options, optionalCallback); + } + } + + /** + * Gets a link to download the run logs. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getLogSasUrlWithHttpOperationResponse(resourceGroupName, registryName, runId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getLogSasUrl(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a link to download the run logs. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RunGetLogResult} - 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 RunGetLogResult} 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. + */ + getLogSasUrl(resourceGroupName, registryName, runId, 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._getLogSasUrl(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getLogSasUrl(resourceGroupName, registryName, runId, options, optionalCallback); + } + } + + /** + * Cancel an existing run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + cancelWithHttpOperationResponse(resourceGroupName, registryName, runId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._cancel(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Cancel an existing run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + cancel(resourceGroupName, registryName, runId, 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._cancel(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._cancel(resourceGroupName, registryName, runId, options, optionalCallback); + } + } + + /** + * Patch the run properties. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} runUpdateParameters The run update properties. + * + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that + * indicates whether archiving is enabled or not. + * + * @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. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, registryName, runId, runUpdateParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, registryName, runId, runUpdateParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Patch the run properties. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} runUpdateParameters The run update properties. + * + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that + * indicates whether archiving is enabled or not. + * + * @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 {Run} - 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 Run} 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. + */ + beginUpdate(resourceGroupName, registryName, runId, runUpdateParameters, 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._beginUpdate(resourceGroupName, registryName, runId, runUpdateParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, registryName, runId, runUpdateParameters, options, optionalCallback); + } + } + + /** + * Cancel an existing run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCancelWithHttpOperationResponse(resourceGroupName, registryName, runId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCancel(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Cancel an existing run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCancel(resourceGroupName, registryName, runId, 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._beginCancel(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCancel(resourceGroupName, registryName, runId, options, optionalCallback); + } + } + + /** + * Gets all the runs for a registry. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the runs for a registry. + * + * @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 {RunListResult} - 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 RunListResult} 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. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Runs; diff --git a/lib/services/containerRegistryManagement/lib/operations/tasks.js b/lib/services/containerRegistryManagement/lib/operations/tasks.js new file mode 100644 index 0000000000..d5aaac06fd --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/operations/tasks.js @@ -0,0 +1,3046 @@ +/* + * 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; + +/** + * Lists all the tasks for a specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @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 TaskListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, registryName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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 (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + 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.ContainerRegistry/registries/{registryName}/tasks'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['TaskListResult']().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); + }); +} + +/** + * Get the properties of a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @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 Task} 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, registryName, taskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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 (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (taskName !== null && taskName !== undefined) { + if (taskName.length > 50) + { + throw new Error('"taskName" should satisfy the constraint - "MaxLength": 50'); + } + if (taskName.length < 5) + { + throw new Error('"taskName" should satisfy the constraint - "MinLength": 5'); + } + if (taskName.match(/^[a-zA-Z0-9-_]*$/) === null) + { + throw new Error('"taskName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9-_]*$/'); + } + } + 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.ContainerRegistry/registries/{registryName}/tasks/{taskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().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); + }); +} + + +/** + * Creates a task for a container registry with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskCreateParameters The parameters for creating a task. + * + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. + * + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} taskCreateParameters.platform.architecture The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. + * + * @param {object} taskCreateParameters.step The properties of a task step. + * + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskCreateParameters.tags] The tags of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _create(resourceGroupName, registryName, taskName, taskCreateParameters, 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.'); + } + + // Send request + this.beginCreate(resourceGroupName, registryName, taskName, taskCreateParameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().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); + }); + }); +} + + +/** + * Deletes a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, registryName, taskName, 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.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, registryName, taskName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates a task with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskUpdateParameters The parameters for updating a task. + * + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. + * + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. + * + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. + * + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. + * + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * + * @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 Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, registryName, taskName, taskUpdateParameters, 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.'); + } + + // Send request + this.beginUpdate(resourceGroupName, registryName, taskName, taskUpdateParameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().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); + }); + }); +} + +/** + * Returns a task with extended information that includes all secrets. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @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 Task} 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 _getDetails(resourceGroupName, registryName, taskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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 (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (taskName !== null && taskName !== undefined) { + if (taskName.length > 50) + { + throw new Error('"taskName" should satisfy the constraint - "MaxLength": 50'); + } + if (taskName.length < 5) + { + throw new Error('"taskName" should satisfy the constraint - "MinLength": 5'); + } + if (taskName.match(/^[a-zA-Z0-9-_]*$/) === null) + { + throw new Error('"taskName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9-_]*$/'); + } + } + 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.ContainerRegistry/registries/{registryName}/tasks/{taskName}/listDetails'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().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); + }); +} + +/** + * Creates a task for a container registry with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskCreateParameters The parameters for creating a task. + * + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. + * + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} taskCreateParameters.platform.architecture The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. + * + * @param {object} taskCreateParameters.step The properties of a task step. + * + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskCreateParameters.tags] The tags of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Task} 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 _beginCreate(resourceGroupName, registryName, taskName, taskCreateParameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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 (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (taskName !== null && taskName !== undefined) { + if (taskName.length > 50) + { + throw new Error('"taskName" should satisfy the constraint - "MaxLength": 50'); + } + if (taskName.length < 5) + { + throw new Error('"taskName" should satisfy the constraint - "MinLength": 5'); + } + if (taskName.match(/^[a-zA-Z0-9-_]*$/) === null) + { + throw new Error('"taskName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9-_]*$/'); + } + } + if (taskCreateParameters === null || taskCreateParameters === undefined) { + throw new Error('taskCreateParameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (taskCreateParameters !== null && taskCreateParameters !== undefined) { + let requestModelMapper = new client.models['Task']().mapper(); + requestModel = client.serialize(requestModelMapper, taskCreateParameters, 'taskCreateParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(taskCreateParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(resourceGroupName, registryName, taskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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 (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (taskName !== null && taskName !== undefined) { + if (taskName.length > 50) + { + throw new Error('"taskName" should satisfy the constraint - "MaxLength": 50'); + } + if (taskName.length < 5) + { + throw new Error('"taskName" should satisfy the constraint - "MinLength": 5'); + } + if (taskName.match(/^[a-zA-Z0-9-_]*$/) === null) + { + throw new Error('"taskName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9-_]*$/'); + } + } + 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.ContainerRegistry/registries/{registryName}/tasks/{taskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates a task with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskUpdateParameters The parameters for updating a task. + * + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. + * + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. + * + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. + * + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. + * + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * + * @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 Task} 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 _beginUpdate(resourceGroupName, registryName, taskName, taskUpdateParameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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 (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (taskName !== null && taskName !== undefined) { + if (taskName.length > 50) + { + throw new Error('"taskName" should satisfy the constraint - "MaxLength": 50'); + } + if (taskName.length < 5) + { + throw new Error('"taskName" should satisfy the constraint - "MinLength": 5'); + } + if (taskName.match(/^[a-zA-Z0-9-_]*$/) === null) + { + throw new Error('"taskName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9-_]*$/'); + } + } + if (taskUpdateParameters === null || taskUpdateParameters === undefined) { + throw new Error('taskUpdateParameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (taskUpdateParameters !== null && taskUpdateParameters !== undefined) { + let requestModelMapper = new client.models['TaskUpdateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, taskUpdateParameters, 'taskUpdateParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(taskUpdateParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all the tasks for a specified container registry. + * + * @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 TaskListResult} 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 _listNext(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['TaskListResult']().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 Tasks. */ +class Tasks { + /** + * Create a Tasks. + * @param {ContainerRegistryManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._create = _create; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._getDetails = _getDetails; + this._beginCreate = _beginCreate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginUpdate = _beginUpdate; + this._listNext = _listNext; + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @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. + */ + listWithHttpOperationResponse(resourceGroupName, registryName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, registryName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @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 {TaskListResult} - 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 TaskListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName, registryName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceGroupName, registryName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, registryName, options, optionalCallback); + } + } + + /** + * Get the properties of a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @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, registryName, taskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the properties of a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @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 {Task} - 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 Task} 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, registryName, taskName, 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, registryName, taskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, registryName, taskName, options, optionalCallback); + } + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskCreateParameters The parameters for creating a task. + * + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. + * + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} taskCreateParameters.platform.architecture The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. + * + * @param {object} taskCreateParameters.step The properties of a task step. + * + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskCreateParameters.tags] The tags of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createWithHttpOperationResponse(resourceGroupName, registryName, taskName, taskCreateParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(resourceGroupName, registryName, taskName, taskCreateParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskCreateParameters The parameters for creating a task. + * + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. + * + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} taskCreateParameters.platform.architecture The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. + * + * @param {object} taskCreateParameters.step The properties of a task step. + * + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskCreateParameters.tags] The tags of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Task} - 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 Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + create(resourceGroupName, registryName, taskName, taskCreateParameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._create(resourceGroupName, registryName, taskName, taskCreateParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(resourceGroupName, registryName, taskName, taskCreateParameters, options, optionalCallback); + } + } + + /** + * Deletes a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, registryName, taskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, registryName, taskName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, registryName, taskName, options, optionalCallback); + } + } + + /** + * Updates a task with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskUpdateParameters The parameters for updating a task. + * + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. + * + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. + * + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. + * + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. + * + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, registryName, taskName, taskUpdateParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, registryName, taskName, taskUpdateParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a task with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskUpdateParameters The parameters for updating a task. + * + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. + * + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. + * + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. + * + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. + * + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * + * @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 {Task} - 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 Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, registryName, taskName, taskUpdateParameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, registryName, taskName, taskUpdateParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, registryName, taskName, taskUpdateParameters, options, optionalCallback); + } + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @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. + */ + getDetailsWithHttpOperationResponse(resourceGroupName, registryName, taskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getDetails(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @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 {Task} - 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 Task} 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. + */ + getDetails(resourceGroupName, registryName, taskName, 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._getDetails(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDetails(resourceGroupName, registryName, taskName, options, optionalCallback); + } + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskCreateParameters The parameters for creating a task. + * + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. + * + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} taskCreateParameters.platform.architecture The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. + * + * @param {object} taskCreateParameters.step The properties of a task step. + * + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskCreateParameters.tags] The tags of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateWithHttpOperationResponse(resourceGroupName, registryName, taskName, taskCreateParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, registryName, taskName, taskCreateParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskCreateParameters The parameters for creating a task. + * + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. + * + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} taskCreateParameters.platform.architecture The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. + * + * @param {object} taskCreateParameters.step The properties of a task step. + * + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskCreateParameters.tags] The tags of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Task} - 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 Task} 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. + */ + beginCreate(resourceGroupName, registryName, taskName, taskCreateParameters, 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._beginCreate(resourceGroupName, registryName, taskName, taskCreateParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreate(resourceGroupName, registryName, taskName, taskCreateParameters, options, optionalCallback); + } + } + + /** + * Deletes a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, registryName, taskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName, registryName, taskName, 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._beginDeleteMethod(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, registryName, taskName, options, optionalCallback); + } + } + + /** + * Updates a task with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskUpdateParameters The parameters for updating a task. + * + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. + * + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. + * + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. + * + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. + * + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * + * @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. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, registryName, taskName, taskUpdateParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, registryName, taskName, taskUpdateParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a task with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskUpdateParameters The parameters for updating a task. + * + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. + * + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. + * + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. + * + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. + * + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * + * @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 {Task} - 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 Task} 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. + */ + beginUpdate(resourceGroupName, registryName, taskName, taskUpdateParameters, 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._beginUpdate(resourceGroupName, registryName, taskName, taskUpdateParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, registryName, taskName, taskUpdateParameters, options, optionalCallback); + } + } + + /** + * Lists all the tasks for a specified container registry. + * + * @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. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the tasks for a specified container registry. + * + * @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 {TaskListResult} - 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 TaskListResult} 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. + */ + listNext(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._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Tasks; diff --git a/lib/services/containerRegistryManagement/package.json b/lib/services/containerRegistryManagement/package.json index 49e9835241..094451322e 100644 --- a/lib/services/containerRegistryManagement/package.json +++ b/lib/services/containerRegistryManagement/package.json @@ -2,7 +2,7 @@ "name": "azure-arm-containerregistry", "author": "Microsoft Corporation", "description": "ContainerRegistryManagementClient Library with typescript type definitions for node", - "version": "2.3.0", + "version": "2.4.0", "dependencies": { "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" @@ -14,12 +14,12 @@ "license": "MIT", "main": "./lib/containerRegistryManagementClient.js", "types": "./lib/containerRegistryManagementClient.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } }