From 4559cd4b736ad1d7ffa928e9daacb8728f51bf5c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 9 Aug 2018 18:24:27 +0000 Subject: [PATCH 1/8] Generated from 9287b2d8d81830b265620ee97d5ca5ddda400d26 Azure container registry build GA API specification and examples. --- .../containerRegistryManagementClient.d.ts | 11 +- .../lib/containerRegistryManagementClient.js | 11 +- .../lib/models/agentProperties.js | 53 + .../lib/models/argument.js | 71 + .../lib/models/baseImageTrigger.js | 70 + .../lib/models/buildTaskRequest.js | 147 + .../lib/models/buildTaskStep.js | 124 + .../lib/models/dockerBuildRequest.js | 175 + .../lib/models/dockerBuildStep.js | 53 +- .../lib/models/dockerRegistryCredentials.js | 68 + .../lib/models/index.d.ts | 901 +++-- .../lib/models/index.js | 68 +- .../lib/models/operationDefinition.js | 21 + .../operationMetricSpecificationDefinition.js | 92 + ...operationServiceSpecificationDefinition.js | 63 + .../lib/models/platformProperties.js | 27 +- .../lib/models/quarantinePolicy.js | 53 + .../lib/models/quickTaskRunRequest.js | 135 + .../lib/models/registryPolicies.js | 73 + .../lib/models/run.js | 237 ++ .../lib/models/runFilter.js | 116 + .../lib/models/runGetLogResult.js | 53 + .../lib/models/runListResult.js | 68 + .../lib/models/runRequest.js | 77 + .../lib/models/runTaskStep.js | 79 + .../lib/models/runUpdateParameters.js | 53 + .../lib/models/sourceRepositoryProperties.js | 14 +- .../lib/models/sourceTrigger.js | 111 + .../lib/models/task.js | 223 ++ .../lib/models/taskFilter.js | 52 + .../lib/models/taskListResult.js | 68 + .../lib/models/taskRunRequest.js | 85 + .../lib/models/taskSecret.js | 69 + .../lib/models/taskStepProperties.js | 58 + .../lib/models/taskUpdateParameters.js | 169 + .../lib/models/triggerProperties.js | 79 + .../lib/models/trustPolicy.js | 62 + .../lib/models/webhook.js | 2 +- .../lib/models/webhookCreateParameters.js | 2 +- .../lib/models/webhookUpdateParameters.js | 2 +- .../lib/operations/index.d.ts | 2358 +++++------- .../lib/operations/index.js | 5 +- .../lib/operations/registries.js | 939 ++++- .../lib/operations/runs.js | 1938 ++++++++++ .../lib/operations/tasks.js | 3147 +++++++++++++++++ .../containerRegistryManagement/package.json | 6 +- 46 files changed, 10317 insertions(+), 1971 deletions(-) create mode 100644 lib/services/containerRegistryManagement/lib/models/agentProperties.js create mode 100644 lib/services/containerRegistryManagement/lib/models/argument.js create mode 100644 lib/services/containerRegistryManagement/lib/models/baseImageTrigger.js create mode 100644 lib/services/containerRegistryManagement/lib/models/buildTaskRequest.js create mode 100644 lib/services/containerRegistryManagement/lib/models/buildTaskStep.js create mode 100644 lib/services/containerRegistryManagement/lib/models/dockerBuildRequest.js create mode 100644 lib/services/containerRegistryManagement/lib/models/dockerRegistryCredentials.js create mode 100644 lib/services/containerRegistryManagement/lib/models/operationMetricSpecificationDefinition.js create mode 100644 lib/services/containerRegistryManagement/lib/models/operationServiceSpecificationDefinition.js create mode 100644 lib/services/containerRegistryManagement/lib/models/quarantinePolicy.js create mode 100644 lib/services/containerRegistryManagement/lib/models/quickTaskRunRequest.js create mode 100644 lib/services/containerRegistryManagement/lib/models/registryPolicies.js create mode 100644 lib/services/containerRegistryManagement/lib/models/run.js create mode 100644 lib/services/containerRegistryManagement/lib/models/runFilter.js create mode 100644 lib/services/containerRegistryManagement/lib/models/runGetLogResult.js create mode 100644 lib/services/containerRegistryManagement/lib/models/runListResult.js create mode 100644 lib/services/containerRegistryManagement/lib/models/runRequest.js create mode 100644 lib/services/containerRegistryManagement/lib/models/runTaskStep.js create mode 100644 lib/services/containerRegistryManagement/lib/models/runUpdateParameters.js create mode 100644 lib/services/containerRegistryManagement/lib/models/sourceTrigger.js create mode 100644 lib/services/containerRegistryManagement/lib/models/task.js create mode 100644 lib/services/containerRegistryManagement/lib/models/taskFilter.js create mode 100644 lib/services/containerRegistryManagement/lib/models/taskListResult.js create mode 100644 lib/services/containerRegistryManagement/lib/models/taskRunRequest.js create mode 100644 lib/services/containerRegistryManagement/lib/models/taskSecret.js create mode 100644 lib/services/containerRegistryManagement/lib/models/taskStepProperties.js create mode 100644 lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js create mode 100644 lib/services/containerRegistryManagement/lib/models/triggerProperties.js create mode 100644 lib/services/containerRegistryManagement/lib/models/trustPolicy.js create mode 100644 lib/services/containerRegistryManagement/lib/operations/runs.js create mode 100644 lib/services/containerRegistryManagement/lib/operations/tasks.js 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/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/buildTaskRequest.js b/lib/services/containerRegistryManagement/lib/models/buildTaskRequest.js new file mode 100644 index 0000000000..ac18d636ae --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/buildTaskRequest.js @@ -0,0 +1,147 @@ +/* + * 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 {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: { + argumentsProperty: { + required: false, + serializedName: 'arguments', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ArgumentElementType', + type: { + name: 'Composite', + className: 'Argument' + } + } + } + }, + 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' + } + }, + 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..b3bbd2a41c --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/buildTaskStep.js @@ -0,0 +1,124 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +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 {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. + * @member {array} [argumentsProperty] The collection of override arguments + * to be used when executing this build step. + * @member {array} [baseImageDependencies] List of base image dependencies + * for a step. + */ + 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: { + 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' + } + }, + contextPath: { + required: false, + serializedName: 'contextPath', + type: { + name: 'String' + } + }, + argumentsProperty: { + required: false, + serializedName: 'arguments', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ArgumentElementType', + type: { + name: 'Composite', + className: 'Argument' + } + } + } + }, + baseImageDependencies: { + required: false, + serializedName: 'baseImageDependencies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BaseImageDependencyElementType', + type: { + name: 'Composite', + className: 'BaseImageDependency' + } + } + } + } + } + } + }; + } +} + +module.exports = BuildTaskStep; diff --git a/lib/services/containerRegistryManagement/lib/models/dockerBuildRequest.js b/lib/services/containerRegistryManagement/lib/models/dockerBuildRequest.js new file mode 100644 index 0000000000..dad9cb7f14 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/dockerBuildRequest.js @@ -0,0 +1,175 @@ +/* + * 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 {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: { + argumentsProperty: { + required: false, + serializedName: 'arguments', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ArgumentElementType', + type: { + name: 'Composite', + className: 'Argument' + } + } + } + }, + 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' + } + }, + 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..2c00fd606d 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 @@ -29,16 +28,15 @@ class DockerBuildStep extends models['BuildStepProperties'] { * @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. + * source context. + * @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. + * @member {array} [argumentsProperty] The collection of override arguments + * to be used when executing 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' */ constructor() { super(); @@ -60,17 +58,9 @@ class DockerBuildStep extends models['BuildStepProperties'] { serializedName: 'type', clientName: 'type' }, - uberParent: 'BuildStepProperties', + uberParent: 'TaskStepProperties', className: 'DockerBuildStep', modelProperties: { - provisioningState: { - required: false, - readOnly: true, - serializedName: 'provisioningState', - type: { - name: 'String' - } - }, type: { required: true, serializedName: 'type', @@ -79,13 +69,6 @@ class DockerBuildStep extends models['BuildStepProperties'] { name: 'String' } }, - branch: { - required: false, - serializedName: 'branch', - type: { - name: 'String' - } - }, imageNames: { required: false, serializedName: 'imageNames', @@ -130,24 +113,23 @@ class DockerBuildStep extends models['BuildStepProperties'] { 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' } } } }, baseImageDependencies: { required: false, - readOnly: true, serializedName: 'baseImageDependencies', type: { name: 'Sequence', @@ -160,13 +142,6 @@ class DockerBuildStep extends models['BuildStepProperties'] { } } } - }, - baseImageTrigger: { - required: false, - serializedName: 'baseImageTrigger', - 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/index.d.ts b/lib/services/containerRegistryManagement/lib/models/index.d.ts index fecb9c6c9f..774770fcee 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/models/index.d.ts @@ -115,12 +115,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 +167,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 +392,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 +894,39 @@ export interface Event extends EventInfo { eventResponseMessage?: EventResponseMessage; } +/** + * @class + * Initializes a new instance of the Argument class. + * @constructor + * The properties of a run 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 Argument { + name: string; + value: string; + isSecret?: boolean; +} + +/** + * @class + * Initializes a new instance of the RunRequest class. + * @constructor + * The request parameters for scheduling a run. + * + * @member {array} [argumentsProperty] The collection of override arguments to + * be used when executing the run. + * @member {string} type Polymorphic Discriminator + */ +export interface RunRequest { + argumentsProperty?: Argument[]; + type: string; +} + /** * @class * Initializes a new instance of the ImageDescriptor class. @@ -858,15 +985,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,33 +1032,32 @@ 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. + * run. * @member {string} [gitCommitTrigger.id] The unique ID of the trigger. * @member {string} [gitCommitTrigger.commitId] The unique ID that identifies a * commit. @@ -926,168 +1068,127 @@ export interface ProxyResource extends BaseResource { * 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; 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. - * @constructor - * Build step resource properties - * - * @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 - */ -export interface BuildStep extends ProxyResource { - properties?: BuildStepProperties; -} - -/** - * @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 {string} type Polymorphic Discriminator */ -export interface BuildStepPropertiesUpdateParameters { +export interface TaskStepProperties { 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. @@ -1120,11 +1221,10 @@ export interface SourceControlAuthInfo { * @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 @@ -1139,36 +1239,29 @@ export interface SourceControlAuthInfo { export interface SourceRepositoryProperties { sourceControlType: string; repositoryUrl: string; - isCommitTriggerEnabled?: boolean; + branch?: string; sourceControlAuthProperties?: SourceControlAuthInfo; } /** * @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,131 +1272,334 @@ 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 BuildTask extends Resource { - readonly provisioningState?: string; - readonly creationDate?: Date; - alias: string; - status?: string; +export interface SourceTrigger { sourceRepository: SourceRepositoryProperties; - platform: PlatformProperties; - timeout?: number; + sourceTriggerEvents: string[]; + status?: string; + name: string; } /** * @class - * Initializes a new instance of the BuildTaskFilter class. + * Initializes a new instance of the BaseImageTrigger class. * @constructor - * The filter that can be used for listing build tasks. + * The trigger based on base image dependency. * - * @member {string} [alias] The alternative name for build task. + * @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 BuildTaskFilter { - alias?: string; +export interface BaseImageTrigger { + baseImageTriggerType: string; + status?: string; + name: string; } /** * @class - * Initializes a new instance of the SourceRepositoryUpdateParameters class. + * Initializes a new instance of the TriggerProperties class. * @constructor - * The properties for updating the source code repository configuration. + * The properties of a build trigger. * - * @member {object} [sourceControlAuthProperties] The authorization properties - * for accessing the source code repository. - * @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 - * @member {boolean} [isCommitTriggerEnabled] The value of this property - * indicates whether the source control commit trigger is enabled or not. + * @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 SourceRepositoryUpdateParameters { - sourceControlAuthProperties?: SourceControlAuthInfo; - isCommitTriggerEnabled?: boolean; +export interface TriggerProperties { + sourceTriggers?: SourceTrigger[]; + baseImageTrigger?: BaseImageTrigger; +} + +/** + * @class + * Initializes a new instance of the TaskSecret class. + * @constructor + * The properties of a task secret object. + * + * @member {string} name The name of the secret. + * @member {string} valueJson The serialized Json value of the secret. + */ +export interface TaskSecret { + name: string; + valueJson: string; } /** * @class - * Initializes a new instance of the BuildTaskUpdateParameters class. + * Initializes a new instance of the Task class. * @constructor - * The parameters for updating a build task. + * The task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it. * - * @member {string} [alias] The alternative updatable name for a build task. - * @member {string} [status] The current status of build task. Possible values + * @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} alias The alternative updatable name for 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. Default value: 3600 . + * @member {object} step The properties of a task 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. + * @member {array} [secrets] The collection of secrets for the task. + */ +export interface Task extends Resource { + readonly provisioningState?: string; + readonly creationDate?: Date; + alias: string; + status?: string; + platform: PlatformProperties; + agentConfiguration?: AgentProperties; + timeout?: number; + step: TaskStepProperties; + trigger?: TriggerProperties; + secrets?: TaskSecret[]; +} + +/** + * @class + * Initializes a new instance of the TaskFilter class. + * @constructor + * The filter that can be used for listing tasks. + * + * @member {string} [alias] The alternative name for task. + */ +export interface TaskFilter { + alias?: string; +} + +/** + * @class + * Initializes a new instance of the TaskUpdateParameters class. + * @constructor + * The parameters for updating a task. + * + * @member {string} [alias] The alternative updatable name for a task. + * @member {string} [status] The current status of task. Possible values * include: 'Disabled', 'Enabled' - * @member {object} [platform] The platform properties against which the build + * @member {object} [platform] The platform properties against which the run * 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. - * @member {object} [sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. - * @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 {boolean} [sourceRepository.isCommitTriggerEnabled] The value of - * this property indicates whether the source control commit trigger is enabled - * or not. + * @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 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. + * @member {array} [secrets] The collection of secrets for the task. * @member {object} [tags] The ARM resource tags. */ -export interface BuildTaskUpdateParameters { +export interface TaskUpdateParameters { alias?: string; status?: string; platform?: PlatformProperties; + agentConfiguration?: AgentProperties; timeout?: number; - sourceRepository?: SourceRepositoryUpdateParameters; + step?: TaskStepProperties; + trigger?: TriggerProperties; + secrets?: TaskSecret[]; tags?: { [propertyName: string]: string }; } /** * @class - * Initializes a new instance of the QueueBuildRequest class. + * Initializes a new instance of the DockerRegistryCredentials class. * @constructor - * The queue build request parameters. + * The properties of a docker registry credentials. * - * @member {string} type Polymorphic Discriminator + * @member {string} [loginServer] The registry login server. + * @member {string} userName The username of the registry. + * @member {string} password The password to the registry. */ -export interface QueueBuildRequest { - type: string; +export interface DockerRegistryCredentials { + loginServer?: string; + userName: string; + password: string; } /** * @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 {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; + sourceLocation: string; + timeout?: number; + platform: PlatformProperties; + agentConfiguration?: AgentProperties; +} + +/** + * @class + * Initializes a new instance of the BuildTaskRequest class. + * @constructor + * The request parameters for a quick task build. + * + * @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 {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; + 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. */ -export interface SourceUploadDefinition { - uploadUrl?: string; - relativePath?: string; +export interface TaskRunRequest extends RunRequest { + taskName: string; +} + +/** + * @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 {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; + timeout?: number; + platform: PlatformProperties; + agentConfiguration?: AgentProperties; } /** @@ -1333,7 +1629,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 @@ -1342,113 +1637,67 @@ export interface BaseImageDependency { * @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. + * source context. + * @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. + * @member {array} [argumentsProperty] The collection of override arguments to + * be used when executing 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; +export interface DockerBuildStep extends TaskStepProperties { imageNames?: string[]; isPushEnabled?: boolean; noCache?: boolean; dockerFilePath?: string; contextPath?: string; - buildArguments?: BuildArgument[]; - readonly baseImageDependencies?: BaseImageDependency[]; - baseImageTrigger?: string; + argumentsProperty?: Argument[]; + baseImageDependencies?: BaseImageDependency[]; } /** * @class - * Initializes a new instance of the DockerBuildStepUpdateParameters class. + * Initializes a new instance of the BuildTaskStep class. * @constructor - * The properties for updating a docker build step. + * The properties of a build task 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 - * whether the image built should be pushed to the registry or not. - * @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; - imageNames?: string[]; - isPushEnabled?: boolean; - noCache?: boolean; - dockerFilePath?: string; + * @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 {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. + * @member {array} [argumentsProperty] The collection of override arguments to + * be used when executing this build step. + * @member {array} [baseImageDependencies] List of base image dependencies for + * a step. + */ +export interface BuildTaskStep extends TaskStepProperties { + definitionFilePath?: string; + valuesFilePath?: string; contextPath?: string; - buildArguments?: BuildArgument[]; - baseImageTrigger?: string; + argumentsProperty?: Argument[]; + baseImageDependencies?: BaseImageDependency[]; } /** * @class - * Initializes a new instance of the BuildTaskBuildRequest class. + * Initializes a new instance of the RunTaskStep class. * @constructor - * The queue build parameters based on a build task. + * The properties of a generic task run step. * - * @member {string} buildTaskName The name of build task against which build - * has to be queued. + * @member {string} taskDefinitionContent Base64 encoded value of the + * template/definition file content. + * @member {string} [valuesContent] Base64 encoded value of the + * parameters/values file content. */ -export interface BuildTaskBuildRequest extends QueueBuildRequest { - buildTaskName: string; -} - -/** - * @class - * Initializes a new instance of the QuickBuildRequest class. - * @constructor - * The queue build request parameters for a quick build. - * - * @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. - */ -export interface QuickBuildRequest extends QueueBuildRequest { - imageNames?: string[]; - sourceLocation: string; - buildArguments?: BuildArgument[]; - isPushEnabled?: boolean; - noCache?: boolean; - timeout?: number; - platform: PlatformProperties; - dockerFilePath: string; +export interface RunTaskStep extends TaskStepProperties { + taskDefinitionContent: string; + valuesContent?: string; } @@ -1519,52 +1768,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..d5f8eab601 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,53 @@ exports.EventContent = require('./eventContent'); exports.EventRequestMessage = require('./eventRequestMessage'); exports.EventResponseMessage = require('./eventResponseMessage'); exports.Event = require('./event'); +exports.Argument = require('./argument'); +exports.RunRequest = require('./runRequest'); exports.ImageDescriptor = require('./imageDescriptor'); exports.ImageUpdateTrigger = require('./imageUpdateTrigger'); exports.GitCommitTrigger = require('./gitCommitTrigger'); 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.Run = require('./run'); +exports.SourceUploadDefinition = require('./sourceUploadDefinition'); +exports.RunFilter = require('./runFilter'); +exports.RunUpdateParameters = require('./runUpdateParameters'); +exports.RunGetLogResult = require('./runGetLogResult'); +exports.TaskStepProperties = require('./taskStepProperties'); 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.SourceUploadDefinition = require('./sourceUploadDefinition'); +exports.SourceTrigger = require('./sourceTrigger'); +exports.BaseImageTrigger = require('./baseImageTrigger'); +exports.TriggerProperties = require('./triggerProperties'); +exports.TaskSecret = require('./taskSecret'); +exports.Task = require('./task'); +exports.TaskFilter = require('./taskFilter'); +exports.TaskUpdateParameters = require('./taskUpdateParameters'); +exports.DockerRegistryCredentials = require('./dockerRegistryCredentials'); +exports.DockerBuildRequest = require('./dockerBuildRequest'); +exports.BuildTaskRequest = require('./buildTaskRequest'); +exports.TaskRunRequest = require('./taskRunRequest'); +exports.QuickTaskRunRequest = require('./quickTaskRunRequest'); exports.BaseImageDependency = require('./baseImageDependency'); exports.DockerBuildStep = require('./dockerBuildStep'); -exports.DockerBuildStepUpdateParameters = require('./dockerBuildStepUpdateParameters'); -exports.BuildTaskBuildRequest = require('./buildTaskBuildRequest'); -exports.QuickBuildRequest = require('./quickBuildRequest'); +exports.BuildTaskStep = require('./buildTaskStep'); +exports.RunTaskStep = require('./runTaskStep'); 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, + '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 }; 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/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..ca1056ab4f --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/quickTaskRunRequest.js @@ -0,0 +1,135 @@ +/* + * 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 {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: { + argumentsProperty: { + required: false, + serializedName: 'arguments', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ArgumentElementType', + type: { + name: 'Composite', + className: 'Argument' + } + } + } + }, + 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' + } + }, + 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..ad38ed9976 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/run.js @@ -0,0 +1,237 @@ +/* + * 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} [gitCommitTrigger] The git commit trigger that caused the + * run. + * @member {string} [gitCommitTrigger.id] The unique ID of the trigger. + * @member {string} [gitCommitTrigger.commitId] The unique ID that identifies + * a commit. + * @member {string} [gitCommitTrigger.repositoryUrl] The repository URL. + * @member {string} [gitCommitTrigger.branchName] The branch name in the + * repository. + * @member {string} [gitCommitTrigger.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' + } + }, + gitCommitTrigger: { + required: false, + serializedName: 'properties.gitCommitTrigger', + type: { + name: 'Composite', + className: 'GitCommitTrigger' + } + }, + 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..25a6f01cf6 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/runRequest.js @@ -0,0 +1,77 @@ +/* + * 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 scheduling a run. + * + */ +class RunRequest { + /** + * Create a RunRequest. + * @member {array} [argumentsProperty] The collection of override arguments + * to be used when executing the run. + * @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: { + argumentsProperty: { + required: false, + serializedName: 'arguments', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ArgumentElementType', + type: { + name: 'Composite', + className: 'Argument' + } + } + } + }, + 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..5f4e020b05 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/runTaskStep.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 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. + */ + 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: { + 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' + } + } + } + } + }; + } +} + +module.exports = RunTaskStep; 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/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..f647ec06aa --- /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: 'SourceRepositoryProperties' + } + }, + 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/task.js b/lib/services/containerRegistryManagement/lib/models/task.js new file mode 100644 index 0000000000..44d796bc42 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/task.js @@ -0,0 +1,223 @@ +/* + * 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} alias The alternative updatable name for 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. Default value: 3600 . + * @member {object} step The properties of a task 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. + * @member {array} [secrets] The collection of secrets for the task. + */ + 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' + } + }, + alias: { + required: true, + serializedName: 'properties.alias', + type: { + name: 'String' + } + }, + 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' + } + }, + secrets: { + required: false, + serializedName: 'properties.secrets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TaskSecretElementType', + type: { + name: 'Composite', + className: 'TaskSecret' + } + } + } + } + } + } + }; + } +} + +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..8ebadf2d6f --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/taskRunRequest.js @@ -0,0 +1,85 @@ +/* + * 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. + */ + 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: { + argumentsProperty: { + required: false, + serializedName: 'arguments', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ArgumentElementType', + type: { + name: 'Composite', + className: 'Argument' + } + } + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + taskName: { + required: true, + serializedName: 'taskName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +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..9a76e630fa --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/taskStepProperties.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 any task step. + * + */ +class TaskStepProperties { + /** + * Create a TaskStepProperties. + * @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: { + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TaskStepProperties; diff --git a/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js new file mode 100644 index 0000000000..b89ac96809 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js @@ -0,0 +1,169 @@ +/* + * 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} [alias] The alternative updatable name for 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 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. + * @member {array} [secrets] The collection of secrets for the task. + * @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: { + alias: { + required: false, + serializedName: 'properties.alias', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + platform: { + required: false, + 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', + constraints: { + InclusiveMaximum: 28800, + InclusiveMinimum: 300 + }, + type: { + name: 'Number' + } + }, + step: { + required: false, + 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' + } + }, + secrets: { + required: false, + serializedName: 'properties.secrets', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TaskSecretElementType', + type: { + name: 'Composite', + className: 'TaskSecret' + } + } + } + }, + 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/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..4b8d44dd60 100644 --- a/lib/services/containerRegistryManagement/lib/operations/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/operations/index.d.ts @@ -852,7 +852,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 +1022,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 {array} [runRequest.argumentsProperty] The collection of override + * arguments to be used when executing the run. + * + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -871,14 +1036,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 +1051,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 {array} [runRequest.argumentsProperty] The collection of override + * arguments to be used when executing the run. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -902,7 +1070,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 +1078,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; /** @@ -1377,7 +1545,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 +1654,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 {array} [runRequest.argumentsProperty] The collection of override + * arguments to be used when executing the run. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -1396,14 +1668,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 +1683,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 {array} [runRequest.argumentsProperty] The collection of override + * arguments to be used when executing the run. + * + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -1427,7 +1702,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 +1710,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 +3623,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 +3640,27 @@ 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. * - * @param {number} [options.top] $top is supported for get list of builds, - * which limits the maximum number of builds to return. + * @param {number} [options.top] $top is supported for get list of runs, which + * limits the maximum number of runs to return. * * @param {string} [options.skipToken] $skipToken is supported on get list of - * builds, which provides the next page in the list of builds. + * runs, which provides the next page in the list of runs. * * @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, skipToken? : string, 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 +3669,13 @@ 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. * - * @param {number} [options.top] $top is supported for get list of builds, - * which limits the maximum number of builds to return. + * @param {number} [options.top] $top is supported for get list of runs, which + * limits the maximum number of runs to return. * * @param {string} [options.skipToken] $skipToken is supported on get list of - * builds, which provides the next page in the list of builds. + * runs, which provides the next page in the list of runs. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3414,7 +3687,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 +3695,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, 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; /** - * 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 +3724,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 +3752,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 +3760,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 +3794,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 +3827,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 +3835,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 +3864,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 +3892,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 +3900,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 +3933,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 +3971,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 +3998,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 +4031,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 +4039,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 +4072,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 +4110,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 +4128,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 +4152,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,62 +4160,68 @@ 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 {string} [options.filter] The task filter to apply on the operation. + * + * @param {string} [options.skipToken] $skipToken is supported on get list of + * 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. + * @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?: { filter? : string, skipToken? : string, 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 {string} [options.filter] The task filter to apply on the operation. + * + * @param {string} [options.skipToken] $skipToken is supported on get list of + * tasks, which provides the next page in the list of tasks. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -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?: { 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; /** - * 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,88 @@ 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} stepName The name of a build step for a container registry - * build task. + * @param {string} taskCreateParameters.alias The alternative updatable name + * for a task. * - * @param {object} buildStepCreateParameters The parameters for creating a - * build step. + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [buildStepCreateParameters.properties] The properties of a - * build step. + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. * - * @param {string} buildStepCreateParameters.properties.type Polymorphic - * Discriminator + * @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 {array} [taskCreateParameters.secrets] The collection of secrets for + * the task. + * + * @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 +4395,82 @@ 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.alias The alternative updatable name + * for 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} stepName The name of a build step for a container registry - * build task. + * @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 The parameters for creating a - * build step. + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * @param {object} [buildStepCreateParameters.properties] The properties of a - * build step. + * @param {array} [taskCreateParameters.secrets] The collection of secrets for + * the task. * - * @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 +4484,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 +4492,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 +4525,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 +4563,79 @@ 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.alias] The alternative updatable name + * for 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} stepName The name of a build step for a container registry - * build task. + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {object} buildStepUpdateParameters The parameters for updating a - * build step. + * @param {object} [taskUpdateParameters.trigger] The properties that describe + * all triggers for the task. * - * @param {object} [buildStepUpdateParameters.properties] The properties for - * updating a build step. + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. * - * @param {string} buildStepUpdateParameters.properties.type Polymorphic - * Discriminator + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. * - * @param {object} [buildStepUpdateParameters.tags] The ARM resource tags. + * @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 {array} [taskUpdateParameters.secrets] The collection of secrets for + * the task. + * + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -4234,816 +4644,80 @@ 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.alias] The alternative updatable name + * for a task. * - * @param {object} [buildStepUpdateParameters.properties] The properties for - * updating a build step. + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * @param {string} buildStepUpdateParameters.properties.type Polymorphic - * Discriminator + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. * - * @param {object} [buildStepUpdateParameters.tags] The ARM resource tags. + * @param {string} taskUpdateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' * - * @param {object} [options] Optional Parameters. + * @param {string} taskUpdateParameters.platform.architecture The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. * - * {Promise} A promise is returned. + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @resolve {BuildStep} - The deserialized result object. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * - * @reject {Error|ServiceError} - The error object. + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [taskUpdateParameters.trigger] The properties that describe + * all triggers for the task. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. * - * {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. - */ - 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} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.refreshToken] - * The refresh token used to refresh the access token. + * @param {object} [taskUpdateParameters.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 + * taskUpdateParameters.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} [taskUpdateParameters.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} taskUpdateParameters.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 {array} [taskUpdateParameters.secrets] The collection of secrets for + * the task. * - * @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 +4731,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 +4739,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 +4768,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>; + listDetailsWithHttpOperationResponse(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 +4796,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 +4804,88 @@ 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; + listDetails(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listDetails(resourceGroupName: string, registryName: string, taskName: string, callback: ServiceCallback): void; + listDetails(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 {string} taskName The name of the container registry task. * - * @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 {object} taskCreateParameters The parameters for creating a task. * - * @param {string} registryName The name of the container registry. + * @param {string} taskCreateParameters.alias The alternative updatable name + * for 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) + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' * - * {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. + * @param {string} [taskCreateParameters.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, 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.name The name + * of the trigger. * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. + * @param {array} [taskCreateParameters.secrets] The collection of secrets for + * the task. * - * @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 +4894,82 @@ 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 {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} taskName The name of the container registry task. * - * @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} taskCreateParameters.alias The alternative updatable name + * for a task. * - * @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. + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' * - * @param {number} - * [buildTaskCreateParameters.sourceRepository.sourceControlAuthProperties.expiresIn] - * Time in seconds that the token remains valid + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * @param {object} buildTaskCreateParameters.platform The platform properties - * against which the build has to happen. + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * @param {string} buildTaskCreateParameters.platform.osType The operating - * system type required for the build. Possible values include: 'Windows', - * 'Linux' + * @param {array} [taskCreateParameters.secrets] The collection of secrets for + * the task. * - * @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 +4983,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 +4991,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 +5024,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 +5062,79 @@ 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.alias] The alternative updatable name + * for a task. * - * @param {string} [buildTaskUpdateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [buildTaskUpdateParameters.platform] The platform properties - * against which the build has to happen. + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. * - * @param {string} buildTaskUpdateParameters.platform.osType The operating - * system type required for the build. Possible values include: 'Windows', - * 'Linux' + * @param {string} taskUpdateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' * - * @param {number} [buildTaskUpdateParameters.platform.cpu] The CPU - * configuration in terms of number of cores required for the build. + * @param {string} taskUpdateParameters.platform.architecture The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' * - * @param {number} [buildTaskUpdateParameters.timeout] Build timeout in - * seconds. + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' * - * @param {object} [buildTaskUpdateParameters.sourceRepository] The properties - * that describes the source(code) for the build task. + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * @param {object} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.tokenType] - * The type of Auth token. Possible values include: 'PAT', 'OAuth' + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {string} - * buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.token - * The access token used to access the source control provider. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.refreshToken] - * The refresh token used to refresh the access token. + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskUpdateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @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 {array} [taskUpdateParameters.secrets] The collection of secrets for + * the task. + * + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -5718,77 +5143,80 @@ 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.alias] The alternative updatable name + * for a task. * - * @param {string} [buildTaskUpdateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [buildTaskUpdateParameters.platform] The platform properties - * against which the build has to happen. + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. * - * @param {string} buildTaskUpdateParameters.platform.osType The operating - * system type required for the build. Possible values include: 'Windows', - * 'Linux' + * @param {string} taskUpdateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' * - * @param {number} [buildTaskUpdateParameters.platform.cpu] The CPU - * configuration in terms of number of cores required for the build. + * @param {string} taskUpdateParameters.platform.architecture The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' * - * @param {number} [buildTaskUpdateParameters.timeout] Build timeout in - * seconds. + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' * - * @param {object} [buildTaskUpdateParameters.sourceRepository] The properties - * that describes the source(code) for the build task. + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * @param {object} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.tokenType] - * The type of Auth token. Possible values include: 'PAT', 'OAuth' + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {string} - * buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.token - * The access token used to access the source control provider. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.refreshToken] - * The refresh token used to refresh the access token. + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskUpdateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @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 {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * @param {number} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.expiresIn] - * Time in seconds that the token remains valid + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * @param {boolean} - * [buildTaskUpdateParameters.sourceRepository.isCommitTriggerEnabled] The - * value of this property indicates whether the source control commit trigger - * is enabled or not. + * @param {array} [taskUpdateParameters.secrets] The collection of secrets for + * the task. * - * @param {object} [buildTaskUpdateParameters.tags] The ARM resource tags. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -5802,7 +5230,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 +5238,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 +5263,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 +5287,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 +5295,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..1543694237 100644 --- a/lib/services/containerRegistryManagement/lib/operations/registries.js +++ b/lib/services/containerRegistryManagement/lib/operations/registries.js @@ -1464,9 +1464,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 +1731,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 {array} [runRequest.argumentsProperty] The collection of override + * arguments to be used when executing the run. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -1490,13 +1750,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 +1769,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 +1793,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 +1845,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') { @@ -2464,17 +2724,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 +2763,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 +2779,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 +2805,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 +2817,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 +2851,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 +2903,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 +2919,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 {array} [runRequest.argumentsProperty] The collection of override + * arguments to be used when executing the run. + * + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -2661,13 +2946,13 @@ 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 _listByResourceGroupNext(nextPageLink, options, callback) { +function _beginScheduleRun(resourceGroupName, registryName, runRequest, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2677,11 +2962,184 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-09-01'; // 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.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. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(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.'); } @@ -2916,13 +3374,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; } @@ -4055,7 +4516,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 +4740,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 {array} [runRequest.argumentsProperty] The collection of override + * arguments to be used when executing the run. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -4074,15 +4754,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 +4773,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 +4781,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 {array} [runRequest.argumentsProperty] The collection of override + * arguments to be used when executing the run. + * + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -4117,7 +4800,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 +4809,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 +4824,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); } } @@ -4742,7 +5425,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 +5561,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 {array} [runRequest.argumentsProperty] The collection of override + * arguments to be used when executing the run. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -4761,15 +5575,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 +5594,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 +5602,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 {array} [runRequest.argumentsProperty] The collection of override + * arguments to be used when executing the run. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -4804,7 +5621,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 +5630,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 +5645,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..5f5199da33 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/operations/runs.js @@ -0,0 +1,1938 @@ +/* + * 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. + * + * @param {number} [options.top] $top is supported for get list of runs, which + * limits the maximum number of runs to return. + * + * @param {string} [options.skipToken] $skipToken is supported on get list of + * runs, which provides the next page in the list of runs. + * + * @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 skipToken = (options && options.skipToken !== undefined) ? options.skipToken : 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 (skipToken !== null && skipToken !== undefined && typeof skipToken.valueOf() !== 'string') { + throw new Error('skipToken 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'; + 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 (skipToken !== null && skipToken !== undefined) { + queryParameters.push('$skipToken=' + encodeURIComponent(skipToken)); + } + 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}/getLogSasUrl'; + 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. + * + * @param {number} [options.top] $top is supported for get list of runs, which + * limits the maximum number of runs to return. + * + * @param {string} [options.skipToken] $skipToken is supported on get list of + * runs, which provides the next page in the list of runs. + * + * @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. + * + * @param {number} [options.top] $top is supported for get list of runs, which + * limits the maximum number of runs to return. + * + * @param {string} [options.skipToken] $skipToken is supported on get list of + * runs, which provides the next page in the list of runs. + * + * @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..6ddaad9edb --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/operations/tasks.js @@ -0,0 +1,3147 @@ +/* + * 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 {string} [options.filter] The task filter to apply on the operation. + * + * @param {string} [options.skipToken] $skipToken is supported on get list of + * tasks, which provides the next page in the list of tasks. + * + * @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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + let skipToken = (options && options.skipToken !== undefined) ? options.skipToken : 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 (skipToken !== null && skipToken !== undefined && typeof skipToken.valueOf() !== 'string') { + throw new Error('skipToken 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}/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 (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (skipToken !== null && skipToken !== undefined) { + queryParameters.push('$skipToken=' + encodeURIComponent(skipToken)); + } + 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.alias The alternative updatable name + * for 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 {array} [taskCreateParameters.secrets] The collection of secrets for + * the task. + * + * @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.alias] The alternative updatable name + * for 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 that describe + * all triggers for the task. + * + * @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 {array} [taskUpdateParameters.secrets] The collection of secrets for + * the task. + * + * @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 _listDetails(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.alias The alternative updatable name + * for 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 {array} [taskCreateParameters.secrets] The collection of secrets for + * the task. + * + * @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.alias] The alternative updatable name + * for 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 that describe + * all triggers for the task. + * + * @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 {array} [taskUpdateParameters.secrets] The collection of secrets for + * the task. + * + * @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._listDetails = _listDetails; + 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 {string} [options.filter] The task filter to apply on the operation. + * + * @param {string} [options.skipToken] $skipToken is supported on get list of + * 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} - 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 {string} [options.filter] The task filter to apply on the operation. + * + * @param {string} [options.skipToken] $skipToken is supported on get list of + * tasks, which provides the next page in the list of tasks. + * + * @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.alias The alternative updatable name + * for 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 {array} [taskCreateParameters.secrets] The collection of secrets for + * the task. + * + * @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.alias The alternative updatable name + * for 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 {array} [taskCreateParameters.secrets] The collection of secrets for + * the task. + * + * @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.alias] The alternative updatable name + * for 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 that describe + * all triggers for the task. + * + * @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 {array} [taskUpdateParameters.secrets] The collection of secrets for + * the task. + * + * @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.alias] The alternative updatable name + * for 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 that describe + * all triggers for the task. + * + * @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 {array} [taskUpdateParameters.secrets] The collection of secrets for + * the task. + * + * @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. + */ + listDetailsWithHttpOperationResponse(resourceGroupName, registryName, taskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listDetails(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. + */ + listDetails(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._listDetails(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listDetails(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.alias The alternative updatable name + * for 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 {array} [taskCreateParameters.secrets] The collection of secrets for + * the task. + * + * @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.alias The alternative updatable name + * for 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 {array} [taskCreateParameters.secrets] The collection of secrets for + * the task. + * + * @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.alias] The alternative updatable name + * for 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 that describe + * all triggers for the task. + * + * @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 {array} [taskUpdateParameters.secrets] The collection of secrets for + * the task. + * + * @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.alias] The alternative updatable name + * for 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 that describe + * all triggers for the task. + * + * @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 {array} [taskUpdateParameters.secrets] The collection of secrets for + * the task. + * + * @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" } } From 45af56bc98f4c72c4c81e3986e45366b2739ce64 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 9 Aug 2018 21:35:50 +0000 Subject: [PATCH 2/8] Generated from f8c09be45c93674a3d0c64d789937548891b7512 Removed secrets from Task properties as this is not yet supported. --- .../lib/models/index.d.ts | 34 ------------------ .../lib/models/index.js | 2 -- .../lib/models/task.js | 16 --------- .../lib/models/taskUpdateParameters.js | 16 --------- .../lib/operations/index.d.ts | 24 ------------- .../lib/operations/tasks.js | 36 ------------------- 6 files changed, 128 deletions(-) diff --git a/lib/services/containerRegistryManagement/lib/models/index.d.ts b/lib/services/containerRegistryManagement/lib/models/index.d.ts index 774770fcee..43599f9163 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/models/index.d.ts @@ -1325,20 +1325,6 @@ export interface TriggerProperties { baseImageTrigger?: BaseImageTrigger; } -/** - * @class - * Initializes a new instance of the TaskSecret class. - * @constructor - * The properties of a task secret object. - * - * @member {string} name The name of the secret. - * @member {string} valueJson The serialized Json value of the secret. - */ -export interface TaskSecret { - name: string; - valueJson: string; -} - /** * @class * Initializes a new instance of the Task class. @@ -1380,7 +1366,6 @@ export interface TaskSecret { * @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 {array} [secrets] The collection of secrets for the task. */ export interface Task extends Resource { readonly provisioningState?: string; @@ -1392,7 +1377,6 @@ export interface Task extends Resource { timeout?: number; step: TaskStepProperties; trigger?: TriggerProperties; - secrets?: TaskSecret[]; } /** @@ -1443,7 +1427,6 @@ export interface TaskFilter { * @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 {array} [secrets] The collection of secrets for the task. * @member {object} [tags] The ARM resource tags. */ export interface TaskUpdateParameters { @@ -1454,26 +1437,9 @@ export interface TaskUpdateParameters { timeout?: number; step?: TaskStepProperties; trigger?: TriggerProperties; - secrets?: TaskSecret[]; tags?: { [propertyName: string]: string }; } -/** - * @class - * Initializes a new instance of the DockerRegistryCredentials class. - * @constructor - * The properties of a docker registry credentials. - * - * @member {string} [loginServer] The registry login server. - * @member {string} userName The username of the registry. - * @member {string} password The password to the registry. - */ -export interface DockerRegistryCredentials { - loginServer?: string; - userName: string; - password: string; -} - /** * @class * Initializes a new instance of the DockerBuildRequest class. diff --git a/lib/services/containerRegistryManagement/lib/models/index.js b/lib/services/containerRegistryManagement/lib/models/index.js index d5f8eab601..7ed9d90584 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.js +++ b/lib/services/containerRegistryManagement/lib/models/index.js @@ -74,11 +74,9 @@ exports.SourceRepositoryProperties = require('./sourceRepositoryProperties'); exports.SourceTrigger = require('./sourceTrigger'); exports.BaseImageTrigger = require('./baseImageTrigger'); exports.TriggerProperties = require('./triggerProperties'); -exports.TaskSecret = require('./taskSecret'); exports.Task = require('./task'); exports.TaskFilter = require('./taskFilter'); exports.TaskUpdateParameters = require('./taskUpdateParameters'); -exports.DockerRegistryCredentials = require('./dockerRegistryCredentials'); exports.DockerBuildRequest = require('./dockerBuildRequest'); exports.BuildTaskRequest = require('./buildTaskRequest'); exports.TaskRunRequest = require('./taskRunRequest'); diff --git a/lib/services/containerRegistryManagement/lib/models/task.js b/lib/services/containerRegistryManagement/lib/models/task.js index 44d796bc42..3a49be7533 100644 --- a/lib/services/containerRegistryManagement/lib/models/task.js +++ b/lib/services/containerRegistryManagement/lib/models/task.js @@ -55,7 +55,6 @@ class Task extends models['Resource'] { * @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 {array} [secrets] The collection of secrets for the task. */ constructor() { super(); @@ -198,21 +197,6 @@ class Task extends models['Resource'] { name: 'Composite', className: 'TriggerProperties' } - }, - secrets: { - required: false, - serializedName: 'properties.secrets', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'TaskSecretElementType', - type: { - name: 'Composite', - className: 'TaskSecret' - } - } - } } } } diff --git a/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js index b89ac96809..39565863f4 100644 --- a/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js @@ -49,7 +49,6 @@ class TaskUpdateParameters { * @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 {array} [secrets] The collection of secrets for the task. * @member {object} [tags] The ARM resource tags. */ constructor() { @@ -131,21 +130,6 @@ class TaskUpdateParameters { className: 'TriggerProperties' } }, - secrets: { - required: false, - serializedName: 'properties.secrets', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'TaskSecretElementType', - type: { - name: 'Composite', - className: 'TaskSecret' - } - } - } - }, tags: { required: false, serializedName: 'tags', diff --git a/lib/services/containerRegistryManagement/lib/operations/index.d.ts b/lib/services/containerRegistryManagement/lib/operations/index.d.ts index 4b8d44dd60..34ecacdf2a 100644 --- a/lib/services/containerRegistryManagement/lib/operations/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/operations/index.d.ts @@ -4380,9 +4380,6 @@ export interface Tasks { * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskCreateParameters.secrets] The collection of secrets for - * the task. - * * @param {string} taskCreateParameters.location The location of the resource. * This cannot be changed after the resource is created. * @@ -4464,9 +4461,6 @@ export interface Tasks { * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskCreateParameters.secrets] The collection of secrets for - * the task. - * * @param {string} taskCreateParameters.location The location of the resource. * This cannot be changed after the resource is created. * @@ -4632,9 +4626,6 @@ export interface Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskUpdateParameters.secrets] The collection of secrets for - * the task. - * * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. @@ -4714,9 +4705,6 @@ export interface Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskUpdateParameters.secrets] The collection of secrets for - * the task. - * * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. @@ -4879,9 +4867,6 @@ export interface Tasks { * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskCreateParameters.secrets] The collection of secrets for - * the task. - * * @param {string} taskCreateParameters.location The location of the resource. * This cannot be changed after the resource is created. * @@ -4963,9 +4948,6 @@ export interface Tasks { * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskCreateParameters.secrets] The collection of secrets for - * the task. - * * @param {string} taskCreateParameters.location The location of the resource. * This cannot be changed after the resource is created. * @@ -5131,9 +5113,6 @@ export interface Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskUpdateParameters.secrets] The collection of secrets for - * the task. - * * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. @@ -5213,9 +5192,6 @@ export interface Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskUpdateParameters.secrets] The collection of secrets for - * the task. - * * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. diff --git a/lib/services/containerRegistryManagement/lib/operations/tasks.js b/lib/services/containerRegistryManagement/lib/operations/tasks.js index 6ddaad9edb..f1fb56d520 100644 --- a/lib/services/containerRegistryManagement/lib/operations/tasks.js +++ b/lib/services/containerRegistryManagement/lib/operations/tasks.js @@ -433,9 +433,6 @@ function _get(resourceGroupName, registryName, taskName, options, callback) { * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskCreateParameters.secrets] The collection of secrets for - * the task. - * * @param {string} taskCreateParameters.location The location of the resource. * This cannot be changed after the resource is created. * @@ -642,9 +639,6 @@ function _deleteMethod(resourceGroupName, registryName, taskName, options, callb * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskUpdateParameters.secrets] The collection of secrets for - * the task. - * * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. @@ -958,9 +952,6 @@ function _listDetails(resourceGroupName, registryName, taskName, options, callba * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskCreateParameters.secrets] The collection of secrets for - * the task. - * * @param {string} taskCreateParameters.location The location of the resource. * This cannot be changed after the resource is created. * @@ -1392,9 +1383,6 @@ function _beginDeleteMethod(resourceGroupName, registryName, taskName, options, * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskUpdateParameters.secrets] The collection of secrets for - * the task. - * * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. @@ -1999,9 +1987,6 @@ class Tasks { * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskCreateParameters.secrets] The collection of secrets for - * the task. - * * @param {string} taskCreateParameters.location The location of the resource. * This cannot be changed after the resource is created. * @@ -2095,9 +2080,6 @@ class Tasks { * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskCreateParameters.secrets] The collection of secrets for - * the task. - * * @param {string} taskCreateParameters.location The location of the resource. * This cannot be changed after the resource is created. * @@ -2305,9 +2287,6 @@ class Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskUpdateParameters.secrets] The collection of secrets for - * the task. - * * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. @@ -2399,9 +2378,6 @@ class Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskUpdateParameters.secrets] The collection of secrets for - * the task. - * * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. @@ -2606,9 +2582,6 @@ class Tasks { * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskCreateParameters.secrets] The collection of secrets for - * the task. - * * @param {string} taskCreateParameters.location The location of the resource. * This cannot be changed after the resource is created. * @@ -2702,9 +2675,6 @@ class Tasks { * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskCreateParameters.secrets] The collection of secrets for - * the task. - * * @param {string} taskCreateParameters.location The location of the resource. * This cannot be changed after the resource is created. * @@ -2912,9 +2882,6 @@ class Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskUpdateParameters.secrets] The collection of secrets for - * the task. - * * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. @@ -3006,9 +2973,6 @@ class Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {array} [taskUpdateParameters.secrets] The collection of secrets for - * the task. - * * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. From ffd428860d78588ed82826c71c1f89f7bad54edc Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 14 Aug 2018 21:08:21 +0000 Subject: [PATCH 3/8] Generated from a3b1cb94eef44835709c9dd5944e76537585831e Removed Alias and secrets property from task. --- .../lib/models/buildTaskStep.js | 4 +- .../lib/models/importImageParameters.js | 3 +- .../lib/models/importSource.js | 12 +- .../lib/models/index.d.ts | 78 ++--------- .../lib/models/index.js | 2 - .../lib/models/task.js | 8 -- .../lib/operations/index.d.ts | 124 ++++++++--------- .../lib/operations/registries.js | 42 ++++-- .../lib/operations/tasks.js | 127 +++++------------- 9 files changed, 145 insertions(+), 255 deletions(-) diff --git a/lib/services/containerRegistryManagement/lib/models/buildTaskStep.js b/lib/services/containerRegistryManagement/lib/models/buildTaskStep.js index b3bbd2a41c..2adff0f858 100644 --- a/lib/services/containerRegistryManagement/lib/models/buildTaskStep.js +++ b/lib/services/containerRegistryManagement/lib/models/buildTaskStep.js @@ -20,7 +20,7 @@ const models = require('./index'); class BuildTaskStep extends models['TaskStepProperties'] { /** * Create a BuildTaskStep. - * @member {string} [definitionFilePath] The build task template/definition + * @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. @@ -65,7 +65,7 @@ class BuildTaskStep extends models['TaskStepProperties'] { } }, definitionFilePath: { - required: false, + required: true, serializedName: 'definitionFilePath', type: { name: 'String' 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 43599f9163..c2ec51268a 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. @@ -1336,7 +1339,6 @@ export interface TriggerProperties { * Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', * 'Failed', 'Canceled' * @member {date} [creationDate] The creation date of task. - * @member {string} alias The alternative updatable name for 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 @@ -1370,7 +1372,6 @@ export interface TriggerProperties { export interface Task extends Resource { readonly provisioningState?: string; readonly creationDate?: Date; - alias: string; status?: string; platform: PlatformProperties; agentConfiguration?: AgentProperties; @@ -1379,67 +1380,6 @@ export interface Task extends Resource { trigger?: TriggerProperties; } -/** - * @class - * Initializes a new instance of the TaskFilter class. - * @constructor - * The filter that can be used for listing tasks. - * - * @member {string} [alias] The alternative name for task. - */ -export interface TaskFilter { - alias?: string; -} - -/** - * @class - * Initializes a new instance of the TaskUpdateParameters class. - * @constructor - * The parameters for updating a task. - * - * @member {string} [alias] The alternative updatable name for 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 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. - * @member {object} [tags] The ARM resource tags. - */ -export interface TaskUpdateParameters { - alias?: string; - status?: string; - platform?: PlatformProperties; - agentConfiguration?: AgentProperties; - timeout?: number; - step?: TaskStepProperties; - trigger?: TriggerProperties; - tags?: { [propertyName: string]: string }; -} - /** * @class * Initializes a new instance of the DockerBuildRequest class. @@ -1629,8 +1569,8 @@ export interface DockerBuildStep extends TaskStepProperties { * @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} 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 {string} [contextPath] The URL(absolute or relative) of the source @@ -1643,7 +1583,7 @@ export interface DockerBuildStep extends TaskStepProperties { * a step. */ export interface BuildTaskStep extends TaskStepProperties { - definitionFilePath?: string; + definitionFilePath: string; valuesFilePath?: string; contextPath?: string; argumentsProperty?: Argument[]; diff --git a/lib/services/containerRegistryManagement/lib/models/index.js b/lib/services/containerRegistryManagement/lib/models/index.js index 7ed9d90584..bade06bdfc 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.js +++ b/lib/services/containerRegistryManagement/lib/models/index.js @@ -75,8 +75,6 @@ exports.SourceTrigger = require('./sourceTrigger'); exports.BaseImageTrigger = require('./baseImageTrigger'); exports.TriggerProperties = require('./triggerProperties'); exports.Task = require('./task'); -exports.TaskFilter = require('./taskFilter'); -exports.TaskUpdateParameters = require('./taskUpdateParameters'); exports.DockerBuildRequest = require('./dockerBuildRequest'); exports.BuildTaskRequest = require('./buildTaskRequest'); exports.TaskRunRequest = require('./taskRunRequest'); diff --git a/lib/services/containerRegistryManagement/lib/models/task.js b/lib/services/containerRegistryManagement/lib/models/task.js index 3a49be7533..d8fa55f714 100644 --- a/lib/services/containerRegistryManagement/lib/models/task.js +++ b/lib/services/containerRegistryManagement/lib/models/task.js @@ -25,7 +25,6 @@ class Task extends models['Resource'] { * Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', * 'Failed', 'Canceled' * @member {date} [creationDate] The creation date of task. - * @member {string} alias The alternative updatable name for 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 @@ -135,13 +134,6 @@ class Task extends models['Resource'] { name: 'DateTime' } }, - alias: { - required: true, - serializedName: 'properties.alias', - type: { - name: 'String' - } - }, status: { required: false, serializedName: 'properties.status', diff --git a/lib/services/containerRegistryManagement/lib/operations/index.d.ts b/lib/services/containerRegistryManagement/lib/operations/index.d.ts index 34ecacdf2a..55cf0ead59 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. @@ -1166,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. @@ -1216,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. @@ -4191,11 +4203,6 @@ export interface Tasks { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The task filter to apply on the operation. - * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * tasks, which provides the next page in the list of tasks. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -4205,7 +4212,7 @@ export interface Tasks { * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, registryName: string, options?: { filter? : string, skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, registryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Lists all the tasks for a specified container registry. @@ -4217,11 +4224,6 @@ export interface Tasks { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The task filter to apply on the operation. - * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * tasks, which provides the next page in the list of tasks. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -4247,9 +4249,9 @@ export interface Tasks { * * {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, options?: { 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; + list(resourceGroupName: string, registryName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -4329,9 +4331,6 @@ export interface Tasks { * * @param {object} taskCreateParameters The parameters for creating a task. * - * @param {string} taskCreateParameters.alias The alternative updatable name - * for a task. - * * @param {string} [taskCreateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * @@ -4410,9 +4409,6 @@ export interface Tasks { * * @param {object} taskCreateParameters The parameters for creating a task. * - * @param {string} taskCreateParameters.alias The alternative updatable name - * for a task. - * * @param {string} [taskCreateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * @@ -4574,13 +4570,10 @@ export interface Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for a task. - * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [taskUpdateParameters.platform] The platform properties + * @param {object} taskUpdateParameters.platform The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -4600,8 +4593,7 @@ export interface Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} [taskUpdateParameters.step] The properties for updating a - * task step. + * @param {object} taskUpdateParameters.step The properties of a task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -4626,7 +4618,10 @@ export interface Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * @param {string} taskUpdateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskUpdateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -4639,7 +4634,7 @@ export interface Tasks { * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Updates a task with the specified parameters. @@ -4653,13 +4648,10 @@ export interface Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for a task. - * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [taskUpdateParameters.platform] The platform properties + * @param {object} taskUpdateParameters.platform The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -4679,8 +4671,7 @@ export interface Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} [taskUpdateParameters.step] The properties for updating a - * task step. + * @param {object} taskUpdateParameters.step The properties of a task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -4705,7 +4696,10 @@ export interface Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * @param {string} taskUpdateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskUpdateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -4734,9 +4728,9 @@ export interface Tasks { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + update(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, callback: ServiceCallback): void; + update(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -4816,9 +4810,6 @@ export interface Tasks { * * @param {object} taskCreateParameters The parameters for creating a task. * - * @param {string} taskCreateParameters.alias The alternative updatable name - * for a task. - * * @param {string} [taskCreateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * @@ -4897,9 +4888,6 @@ export interface Tasks { * * @param {object} taskCreateParameters The parameters for creating a task. * - * @param {string} taskCreateParameters.alias The alternative updatable name - * for a task. - * * @param {string} [taskCreateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * @@ -5061,13 +5049,10 @@ export interface Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for a task. - * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [taskUpdateParameters.platform] The platform properties + * @param {object} taskUpdateParameters.platform The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -5087,8 +5072,7 @@ export interface Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} [taskUpdateParameters.step] The properties for updating a - * task step. + * @param {object} taskUpdateParameters.step The properties of a task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -5113,7 +5097,10 @@ export interface Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * @param {string} taskUpdateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskUpdateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -5126,7 +5113,7 @@ export interface Tasks { * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Updates a task with the specified parameters. @@ -5140,13 +5127,10 @@ export interface Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for a task. - * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [taskUpdateParameters.platform] The platform properties + * @param {object} taskUpdateParameters.platform The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -5166,8 +5150,7 @@ export interface Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} [taskUpdateParameters.step] The properties for updating a - * task step. + * @param {object} taskUpdateParameters.step The properties of a task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -5192,7 +5175,10 @@ export interface Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * @param {string} taskUpdateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskUpdateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -5221,9 +5207,9 @@ export interface Tasks { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + beginUpdate(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** diff --git a/lib/services/containerRegistryManagement/lib/operations/registries.js b/lib/services/containerRegistryManagement/lib/operations/registries.js index 1543694237..e2d302e9d9 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. @@ -1981,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. @@ -3402,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. @@ -3464,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. @@ -4938,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. @@ -5000,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. diff --git a/lib/services/containerRegistryManagement/lib/operations/tasks.js b/lib/services/containerRegistryManagement/lib/operations/tasks.js index f1fb56d520..d62e761574 100644 --- a/lib/services/containerRegistryManagement/lib/operations/tasks.js +++ b/lib/services/containerRegistryManagement/lib/operations/tasks.js @@ -24,11 +24,6 @@ const WebResource = msRest.WebResource; * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The task filter to apply on the operation. - * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * tasks, which provides the next page in the list of tasks. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -55,8 +50,6 @@ function _list(resourceGroupName, registryName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let skipToken = (options && options.skipToken !== undefined) ? options.skipToken : undefined; let apiVersion = '2018-09-01'; // Validate try { @@ -83,12 +76,6 @@ function _list(resourceGroupName, registryName, options, callback) { 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 (skipToken !== null && skipToken !== undefined && typeof skipToken.valueOf() !== 'string') { - throw new Error('skipToken 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.'); } @@ -104,12 +91,6 @@ function _list(resourceGroupName, registryName, options, callback) { 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 (skipToken !== null && skipToken !== undefined) { - queryParameters.push('$skipToken=' + encodeURIComponent(skipToken)); - } if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -382,9 +363,6 @@ function _get(resourceGroupName, registryName, taskName, options, callback) { * * @param {object} taskCreateParameters The parameters for creating a task. * - * @param {string} taskCreateParameters.alias The alternative updatable name - * for a task. - * * @param {string} [taskCreateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * @@ -587,13 +565,10 @@ function _deleteMethod(resourceGroupName, registryName, taskName, options, callb * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for a task. - * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [taskUpdateParameters.platform] The platform properties + * @param {object} taskUpdateParameters.platform The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -613,8 +588,7 @@ function _deleteMethod(resourceGroupName, registryName, taskName, options, callb * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} [taskUpdateParameters.step] The properties for updating a - * task step. + * @param {object} taskUpdateParameters.step The properties of a task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -639,7 +613,10 @@ function _deleteMethod(resourceGroupName, registryName, taskName, options, callb * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * @param {string} taskUpdateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskUpdateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -901,9 +878,6 @@ function _listDetails(resourceGroupName, registryName, taskName, options, callba * * @param {object} taskCreateParameters The parameters for creating a task. * - * @param {string} taskCreateParameters.alias The alternative updatable name - * for a task. - * * @param {string} [taskCreateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * @@ -1331,13 +1305,10 @@ function _beginDeleteMethod(resourceGroupName, registryName, taskName, options, * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for a task. - * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [taskUpdateParameters.platform] The platform properties + * @param {object} taskUpdateParameters.platform The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -1357,8 +1328,7 @@ function _beginDeleteMethod(resourceGroupName, registryName, taskName, options, * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} [taskUpdateParameters.step] The properties for updating a - * task step. + * @param {object} taskUpdateParameters.step The properties of a task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -1383,7 +1353,10 @@ function _beginDeleteMethod(resourceGroupName, registryName, taskName, options, * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * @param {string} taskUpdateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskUpdateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -1504,7 +1477,7 @@ function _beginUpdate(resourceGroupName, registryName, taskName, taskUpdateParam let requestModel = null; try { if (taskUpdateParameters !== null && taskUpdateParameters !== undefined) { - let requestModelMapper = new client.models['TaskUpdateParameters']().mapper(); + let requestModelMapper = new client.models['Task']().mapper(); requestModel = client.serialize(requestModelMapper, taskUpdateParameters, 'taskUpdateParameters'); requestContent = JSON.stringify(requestModel); } @@ -1744,11 +1717,6 @@ class Tasks { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The task filter to apply on the operation. - * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * tasks, which provides the next page in the list of tasks. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1782,11 +1750,6 @@ class Tasks { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The task filter to apply on the operation. - * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * tasks, which provides the next page in the list of tasks. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1936,9 +1899,6 @@ class Tasks { * * @param {object} taskCreateParameters The parameters for creating a task. * - * @param {string} taskCreateParameters.alias The alternative updatable name - * for a task. - * * @param {string} [taskCreateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * @@ -2029,9 +1989,6 @@ class Tasks { * * @param {object} taskCreateParameters The parameters for creating a task. * - * @param {string} taskCreateParameters.alias The alternative updatable name - * for a task. - * * @param {string} [taskCreateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * @@ -2235,13 +2192,10 @@ class Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for a task. - * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [taskUpdateParameters.platform] The platform properties + * @param {object} taskUpdateParameters.platform The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -2261,8 +2215,7 @@ class Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} [taskUpdateParameters.step] The properties for updating a - * task step. + * @param {object} taskUpdateParameters.step The properties of a task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -2287,7 +2240,10 @@ class Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * @param {string} taskUpdateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskUpdateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -2326,13 +2282,10 @@ class Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for a task. - * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [taskUpdateParameters.platform] The platform properties + * @param {object} taskUpdateParameters.platform The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -2352,8 +2305,7 @@ class Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} [taskUpdateParameters.step] The properties for updating a - * task step. + * @param {object} taskUpdateParameters.step The properties of a task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -2378,7 +2330,10 @@ class Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * @param {string} taskUpdateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskUpdateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -2531,9 +2486,6 @@ class Tasks { * * @param {object} taskCreateParameters The parameters for creating a task. * - * @param {string} taskCreateParameters.alias The alternative updatable name - * for a task. - * * @param {string} [taskCreateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * @@ -2624,9 +2576,6 @@ class Tasks { * * @param {object} taskCreateParameters The parameters for creating a task. * - * @param {string} taskCreateParameters.alias The alternative updatable name - * for a task. - * * @param {string} [taskCreateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * @@ -2830,13 +2779,10 @@ class Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for a task. - * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [taskUpdateParameters.platform] The platform properties + * @param {object} taskUpdateParameters.platform The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -2856,8 +2802,7 @@ class Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} [taskUpdateParameters.step] The properties for updating a - * task step. + * @param {object} taskUpdateParameters.step The properties of a task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -2882,7 +2827,10 @@ class Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * @param {string} taskUpdateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskUpdateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -2921,13 +2869,10 @@ class Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for a task. - * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [taskUpdateParameters.platform] The platform properties + * @param {object} taskUpdateParameters.platform The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -2947,8 +2892,7 @@ class Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} [taskUpdateParameters.step] The properties for updating a - * task step. + * @param {object} taskUpdateParameters.step The properties of a task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -2973,7 +2917,10 @@ class Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * @param {string} taskUpdateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskUpdateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * From b6e232a6d406e2450957ac19407c8909bf8526e3 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 14 Aug 2018 22:19:53 +0000 Subject: [PATCH 4/8] Generated from 70d7d7f9c1372d1dc5ae288067fc3fb6d401efe1 Matching the resource schema with that in the Registry swagger --- .../lib/models/index.d.ts | 49 ++++++++++++ .../lib/models/index.js | 1 + .../lib/operations/index.d.ts | 68 ++++++++-------- .../lib/operations/tasks.js | 80 ++++++++++--------- 4 files changed, 129 insertions(+), 69 deletions(-) diff --git a/lib/services/containerRegistryManagement/lib/models/index.d.ts b/lib/services/containerRegistryManagement/lib/models/index.d.ts index c2ec51268a..f35732ccbf 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/models/index.d.ts @@ -1380,6 +1380,55 @@ export interface Task extends Resource { trigger?: TriggerProperties; } +/** + * @class + * Initializes a new instance of the TaskUpdateParameters class. + * @constructor + * The parameters for updating a task. + * + * @member {string} [alias] The alternative updatable name for 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 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. + * @member {object} [tags] The ARM resource tags. + */ +export interface TaskUpdateParameters { + alias?: string; + status?: string; + platform?: PlatformProperties; + agentConfiguration?: AgentProperties; + timeout?: number; + step?: TaskStepProperties; + trigger?: TriggerProperties; + tags?: { [propertyName: string]: string }; +} + /** * @class * Initializes a new instance of the DockerBuildRequest class. diff --git a/lib/services/containerRegistryManagement/lib/models/index.js b/lib/services/containerRegistryManagement/lib/models/index.js index bade06bdfc..336a57bf35 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.js +++ b/lib/services/containerRegistryManagement/lib/models/index.js @@ -75,6 +75,7 @@ exports.SourceTrigger = require('./sourceTrigger'); exports.BaseImageTrigger = require('./baseImageTrigger'); exports.TriggerProperties = require('./triggerProperties'); exports.Task = require('./task'); +exports.TaskUpdateParameters = require('./taskUpdateParameters'); exports.DockerBuildRequest = require('./dockerBuildRequest'); exports.BuildTaskRequest = require('./buildTaskRequest'); exports.TaskRunRequest = require('./taskRunRequest'); diff --git a/lib/services/containerRegistryManagement/lib/operations/index.d.ts b/lib/services/containerRegistryManagement/lib/operations/index.d.ts index 55cf0ead59..5b823e5102 100644 --- a/lib/services/containerRegistryManagement/lib/operations/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/operations/index.d.ts @@ -4570,10 +4570,13 @@ export interface Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * + * @param {string} [taskUpdateParameters.alias] The alternative updatable name + * for a task. + * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} taskUpdateParameters.platform The platform properties + * @param {object} [taskUpdateParameters.platform] The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -4593,7 +4596,8 @@ export interface Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} taskUpdateParameters.step The properties of a task step. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -4618,10 +4622,7 @@ export interface Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {string} taskUpdateParameters.location The location of the resource. - * This cannot be changed after the resource is created. - * - * @param {object} [taskUpdateParameters.tags] The tags of the resource. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -4634,7 +4635,7 @@ export interface Tasks { * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Updates a task with the specified parameters. @@ -4648,10 +4649,13 @@ export interface Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * + * @param {string} [taskUpdateParameters.alias] The alternative updatable name + * for a task. + * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} taskUpdateParameters.platform The platform properties + * @param {object} [taskUpdateParameters.platform] The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -4671,7 +4675,8 @@ export interface Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} taskUpdateParameters.step The properties of a task step. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -4696,10 +4701,7 @@ export interface Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {string} taskUpdateParameters.location The location of the resource. - * This cannot be changed after the resource is created. - * - * @param {object} [taskUpdateParameters.tags] The tags of the resource. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -4728,9 +4730,9 @@ export interface Tasks { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, callback: ServiceCallback): void; - update(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, 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; /** @@ -5049,10 +5051,13 @@ export interface Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * + * @param {string} [taskUpdateParameters.alias] The alternative updatable name + * for a task. + * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} taskUpdateParameters.platform The platform properties + * @param {object} [taskUpdateParameters.platform] The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -5072,7 +5077,8 @@ export interface Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} taskUpdateParameters.step The properties of a task step. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -5097,10 +5103,7 @@ export interface Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {string} taskUpdateParameters.location The location of the resource. - * This cannot be changed after the resource is created. - * - * @param {object} [taskUpdateParameters.tags] The tags of the resource. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -5113,7 +5116,7 @@ export interface Tasks { * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Updates a task with the specified parameters. @@ -5127,10 +5130,13 @@ export interface Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * + * @param {string} [taskUpdateParameters.alias] The alternative updatable name + * for a task. + * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} taskUpdateParameters.platform The platform properties + * @param {object} [taskUpdateParameters.platform] The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -5150,7 +5156,8 @@ export interface Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} taskUpdateParameters.step The properties of a task step. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -5175,10 +5182,7 @@ export interface Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {string} taskUpdateParameters.location The location of the resource. - * This cannot be changed after the resource is created. - * - * @param {object} [taskUpdateParameters.tags] The tags of the resource. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -5207,9 +5211,9 @@ export interface Tasks { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.Task, 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; /** diff --git a/lib/services/containerRegistryManagement/lib/operations/tasks.js b/lib/services/containerRegistryManagement/lib/operations/tasks.js index d62e761574..5834a366d4 100644 --- a/lib/services/containerRegistryManagement/lib/operations/tasks.js +++ b/lib/services/containerRegistryManagement/lib/operations/tasks.js @@ -565,10 +565,13 @@ function _deleteMethod(resourceGroupName, registryName, taskName, options, callb * * @param {object} taskUpdateParameters The parameters for updating a task. * + * @param {string} [taskUpdateParameters.alias] The alternative updatable name + * for a task. + * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} taskUpdateParameters.platform The platform properties + * @param {object} [taskUpdateParameters.platform] The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -588,7 +591,8 @@ function _deleteMethod(resourceGroupName, registryName, taskName, options, callb * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} taskUpdateParameters.step The properties of a task step. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -613,10 +617,7 @@ function _deleteMethod(resourceGroupName, registryName, taskName, options, callb * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {string} taskUpdateParameters.location The location of the resource. - * This cannot be changed after the resource is created. - * - * @param {object} [taskUpdateParameters.tags] The tags of the resource. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -1305,10 +1306,13 @@ function _beginDeleteMethod(resourceGroupName, registryName, taskName, options, * * @param {object} taskUpdateParameters The parameters for updating a task. * + * @param {string} [taskUpdateParameters.alias] The alternative updatable name + * for a task. + * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} taskUpdateParameters.platform The platform properties + * @param {object} [taskUpdateParameters.platform] The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -1328,7 +1332,8 @@ function _beginDeleteMethod(resourceGroupName, registryName, taskName, options, * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} taskUpdateParameters.step The properties of a task step. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -1353,10 +1358,7 @@ function _beginDeleteMethod(resourceGroupName, registryName, taskName, options, * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {string} taskUpdateParameters.location The location of the resource. - * This cannot be changed after the resource is created. - * - * @param {object} [taskUpdateParameters.tags] The tags of the resource. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -1477,7 +1479,7 @@ function _beginUpdate(resourceGroupName, registryName, taskName, taskUpdateParam let requestModel = null; try { if (taskUpdateParameters !== null && taskUpdateParameters !== undefined) { - let requestModelMapper = new client.models['Task']().mapper(); + let requestModelMapper = new client.models['TaskUpdateParameters']().mapper(); requestModel = client.serialize(requestModelMapper, taskUpdateParameters, 'taskUpdateParameters'); requestContent = JSON.stringify(requestModel); } @@ -2192,10 +2194,13 @@ class Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * + * @param {string} [taskUpdateParameters.alias] The alternative updatable name + * for a task. + * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} taskUpdateParameters.platform The platform properties + * @param {object} [taskUpdateParameters.platform] The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -2215,7 +2220,8 @@ class Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} taskUpdateParameters.step The properties of a task step. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -2240,10 +2246,7 @@ class Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {string} taskUpdateParameters.location The location of the resource. - * This cannot be changed after the resource is created. - * - * @param {object} [taskUpdateParameters.tags] The tags of the resource. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -2282,10 +2285,13 @@ class Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * + * @param {string} [taskUpdateParameters.alias] The alternative updatable name + * for a task. + * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} taskUpdateParameters.platform The platform properties + * @param {object} [taskUpdateParameters.platform] The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -2305,7 +2311,8 @@ class Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} taskUpdateParameters.step The properties of a task step. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -2330,10 +2337,7 @@ class Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {string} taskUpdateParameters.location The location of the resource. - * This cannot be changed after the resource is created. - * - * @param {object} [taskUpdateParameters.tags] The tags of the resource. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -2779,10 +2783,13 @@ class Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * + * @param {string} [taskUpdateParameters.alias] The alternative updatable name + * for a task. + * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} taskUpdateParameters.platform The platform properties + * @param {object} [taskUpdateParameters.platform] The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -2802,7 +2809,8 @@ class Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} taskUpdateParameters.step The properties of a task step. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -2827,10 +2835,7 @@ class Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {string} taskUpdateParameters.location The location of the resource. - * This cannot be changed after the resource is created. - * - * @param {object} [taskUpdateParameters.tags] The tags of the resource. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -2869,10 +2874,13 @@ class Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * + * @param {string} [taskUpdateParameters.alias] The alternative updatable name + * for a task. + * * @param {string} [taskUpdateParameters.status] The current status of task. * Possible values include: 'Disabled', 'Enabled' * - * @param {object} taskUpdateParameters.platform The platform properties + * @param {object} [taskUpdateParameters.platform] The platform properties * against which the run has to happen. * * @param {string} taskUpdateParameters.platform.os The operating system type @@ -2892,7 +2900,8 @@ class Tasks { * * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} taskUpdateParameters.step The properties of a task step. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * @@ -2917,10 +2926,7 @@ class Tasks { * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name * of the trigger. * - * @param {string} taskUpdateParameters.location The location of the resource. - * This cannot be changed after the resource is created. - * - * @param {object} [taskUpdateParameters.tags] The tags of the resource. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * From e2111717f64f0f9ac44595226fb8a2992c4eac27 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 15 Aug 2018 23:21:43 +0000 Subject: [PATCH 5/8] Generated from bc8b9e549b34824a8d10d9741d1018318e002b28 added more description to $filer, separated create and update parameters to avoid conflict between required nd patchable properties. --- .../lib/models/authInfo.js | 87 ++++++ .../lib/models/authInfoUpdateParameters.js | 87 ++++++ .../baseImageTriggerUpdateParameters.js | 70 +++++ .../models/buildTaskStepUpdateParameters.js | 107 +++++++ .../lib/models/dockerBuildStep.js | 4 +- .../models/dockerBuildStepUpdateParameters.js | 44 +-- .../lib/models/index.d.ts | 274 ++++++++++++++++-- .../lib/models/index.js | 20 +- .../lib/models/platformUpdateParameters.js | 71 +++++ .../lib/models/runTaskStepUpdateParameters.js | 79 +++++ .../lib/models/sourceProperties.js | 92 ++++++ .../lib/models/sourceTrigger.js | 2 +- .../models/sourceTriggerUpdateParameters.js | 111 +++++++ .../lib/models/sourceUpdateParameters.js | 93 ++++++ .../lib/models/taskStepUpdateParameters.js | 58 ++++ .../lib/models/taskUpdateParameters.js | 23 +- .../lib/models/triggerUpdateParameters.js | 79 +++++ .../lib/operations/index.d.ts | 80 +++-- .../lib/operations/registries.js | 16 +- .../lib/operations/runs.js | 22 +- .../lib/operations/tasks.js | 90 +++--- 21 files changed, 1321 insertions(+), 188 deletions(-) create mode 100644 lib/services/containerRegistryManagement/lib/models/authInfo.js create mode 100644 lib/services/containerRegistryManagement/lib/models/authInfoUpdateParameters.js create mode 100644 lib/services/containerRegistryManagement/lib/models/baseImageTriggerUpdateParameters.js create mode 100644 lib/services/containerRegistryManagement/lib/models/buildTaskStepUpdateParameters.js create mode 100644 lib/services/containerRegistryManagement/lib/models/platformUpdateParameters.js create mode 100644 lib/services/containerRegistryManagement/lib/models/runTaskStepUpdateParameters.js create mode 100644 lib/services/containerRegistryManagement/lib/models/sourceProperties.js create mode 100644 lib/services/containerRegistryManagement/lib/models/sourceTriggerUpdateParameters.js create mode 100644 lib/services/containerRegistryManagement/lib/models/sourceUpdateParameters.js create mode 100644 lib/services/containerRegistryManagement/lib/models/taskStepUpdateParameters.js create mode 100644 lib/services/containerRegistryManagement/lib/models/triggerUpdateParameters.js 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/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/buildTaskStepUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/buildTaskStepUpdateParameters.js new file mode 100644 index 0000000000..a363079c5e --- /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 {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. + * @member {array} [argumentsProperty] The collection of override arguments + * to be used when executing this build step. + */ + 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' + } + }, + contextPath: { + required: false, + serializedName: 'contextPath', + type: { + name: 'String' + } + }, + argumentsProperty: { + required: false, + serializedName: 'arguments', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ArgumentElementType', + type: { + name: 'Composite', + className: 'Argument' + } + } + } + } + } + } + }; + } +} + +module.exports = BuildTaskStepUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js b/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js index 2c00fd606d..e93d4a58ce 100644 --- a/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js +++ b/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js @@ -27,7 +27,7 @@ class DockerBuildStep extends models['TaskStepProperties'] { * 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 + * @member {string} dockerFilePath The Docker file path relative to the * source context. * @member {string} [contextPath] The URL(absolute or relative) of the source * context for the build task. @@ -100,7 +100,7 @@ class DockerBuildStep extends models['TaskStepProperties'] { } }, dockerFilePath: { - required: false, + required: true, serializedName: 'dockerFilePath', type: { name: 'String' diff --git a/lib/services/containerRegistryManagement/lib/models/dockerBuildStepUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/dockerBuildStepUpdateParameters.js index 20db8e9d98..d1cd6cb6c2 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 {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. + * @member {array} [argumentsProperty] The collection of override arguments + * to be used when executing this build step. */ 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', @@ -117,27 +108,20 @@ class DockerBuildStepUpdateParameters extends models['BuildStepPropertiesUpdateP 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: { - required: false, - serializedName: 'baseImageTrigger', - type: { - name: 'String' - } } } } diff --git a/lib/services/containerRegistryManagement/lib/models/index.d.ts b/lib/services/containerRegistryManagement/lib/models/index.d.ts index f35732ccbf..54e1e1250e 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/models/index.d.ts @@ -1194,12 +1194,12 @@ export interface TaskStepProperties { /** * @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 @@ -1207,8 +1207,8 @@ export interface TaskStepProperties { * @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; @@ -1217,7 +1217,7 @@ 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. * @@ -1225,7 +1225,7 @@ export interface SourceControlAuthInfo { * 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 + * @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 @@ -1239,11 +1239,11 @@ 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; branch?: string; - sourceControlAuthProperties?: SourceControlAuthInfo; + sourceControlAuthProperties: AuthInfo; } /** @@ -1282,7 +1282,7 @@ export interface SourceRepositoryProperties { * @member {string} name The name of the trigger. */ export interface SourceTrigger { - sourceRepository: SourceRepositoryProperties; + sourceRepository: SourceProperties; sourceTriggerEvents: string[]; status?: string; name: string; @@ -1380,13 +1380,179 @@ export interface Task extends Resource { trigger?: TriggerProperties; } +/** + * @class + * Initializes a new instance of the PlatformUpdateParameters class. + * @constructor + * The properties for updating the platform configuration. + * + * @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 PlatformUpdateParameters { + os?: string; + architecture?: string; + variant?: string; +} + +/** + * @class + * Initializes a new instance of the TaskStepUpdateParameters class. + * @constructor + * 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 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 + */ +export interface SourceUpdateParameters { + sourceControlType?: string; + repositoryUrl?: string; + branch?: string; + sourceControlAuthProperties?: AuthInfoUpdateParameters; +} + +/** + * @class + * Initializes a new instance of the SourceTriggerUpdateParameters class. + * @constructor + * The properties for updating a source based trigger. + * + * @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. + */ +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} [alias] The alternative updatable name for 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 @@ -1404,8 +1570,7 @@ export interface Task extends Resource { * @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 that describe all triggers for the - * task. + * @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 @@ -1419,13 +1584,12 @@ export interface Task extends Resource { * @member {object} [tags] The ARM resource tags. */ export interface TaskUpdateParameters { - alias?: string; status?: string; - platform?: PlatformProperties; + platform?: PlatformUpdateParameters; agentConfiguration?: AgentProperties; timeout?: number; - step?: TaskStepProperties; - trigger?: TriggerProperties; + step?: TaskStepUpdateParameters; + trigger?: TriggerUpdateParameters; tags?: { [propertyName: string]: string }; } @@ -1591,8 +1755,8 @@ 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 context. + * @member {string} dockerFilePath The Docker file path relative to the source + * context. * @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 @@ -1606,7 +1770,7 @@ export interface DockerBuildStep extends TaskStepProperties { imageNames?: string[]; isPushEnabled?: boolean; noCache?: boolean; - dockerFilePath?: string; + dockerFilePath: string; contextPath?: string; argumentsProperty?: Argument[]; baseImageDependencies?: BaseImageDependency[]; @@ -1655,6 +1819,76 @@ export interface RunTaskStep extends TaskStepProperties { valuesContent?: string; } +/** + * @class + * Initializes a new instance of the DockerBuildStepUpdateParameters class. + * @constructor + * The properties for updating a docker build step. + * + * @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. + * @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 context. + * @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. + * @member {array} [argumentsProperty] The collection of override arguments to + * be used when executing this build step. + */ +export interface DockerBuildStepUpdateParameters extends TaskStepUpdateParameters { + imageNames?: string[]; + isPushEnabled?: boolean; + noCache?: boolean; + dockerFilePath?: string; + contextPath?: string; + argumentsProperty?: Argument[]; +} + +/** + * @class + * Initializes a new instance of the BuildTaskStepUpdateParameters class. + * @constructor + * The properties of updating 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 {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. + * @member {array} [argumentsProperty] The collection of override arguments to + * be used when executing this build step. + */ +export interface BuildTaskStepUpdateParameters extends TaskStepUpdateParameters { + definitionFilePath?: string; + valuesFilePath?: string; + contextPath?: string; + argumentsProperty?: Argument[]; +} + +/** + * @class + * Initializes a new instance of the RunTaskStepUpdateParameters class. + * @constructor + * The properties for updating 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. + */ +export interface RunTaskStepUpdateParameters extends TaskStepUpdateParameters { + taskDefinitionContent?: string; + valuesContent?: string; +} + /** * @class diff --git a/lib/services/containerRegistryManagement/lib/models/index.js b/lib/services/containerRegistryManagement/lib/models/index.js index 336a57bf35..125fbfeae9 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.js +++ b/lib/services/containerRegistryManagement/lib/models/index.js @@ -69,12 +69,19 @@ exports.RunFilter = require('./runFilter'); exports.RunUpdateParameters = require('./runUpdateParameters'); exports.RunGetLogResult = require('./runGetLogResult'); exports.TaskStepProperties = require('./taskStepProperties'); -exports.SourceControlAuthInfo = require('./sourceControlAuthInfo'); -exports.SourceRepositoryProperties = require('./sourceRepositoryProperties'); +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.DockerBuildRequest = require('./dockerBuildRequest'); exports.BuildTaskRequest = require('./buildTaskRequest'); @@ -84,6 +91,9 @@ exports.BaseImageDependency = require('./baseImageDependency'); exports.DockerBuildStep = require('./dockerBuildStep'); exports.BuildTaskStep = require('./buildTaskStep'); exports.RunTaskStep = require('./runTaskStep'); +exports.DockerBuildStepUpdateParameters = require('./dockerBuildStepUpdateParameters'); +exports.BuildTaskStepUpdateParameters = require('./buildTaskStepUpdateParameters'); +exports.RunTaskStepUpdateParameters = require('./runTaskStepUpdateParameters'); exports.RegistryListResult = require('./registryListResult'); exports.OperationListResult = require('./operationListResult'); exports.ReplicationListResult = require('./replicationListResult'); @@ -94,11 +104,15 @@ exports.TaskListResult = require('./taskListResult'); exports.discriminators = { '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 + 'TaskStepProperties.RunTask' : exports.RunTaskStep, + 'TaskStepUpdateParameters.Docker' : exports.DockerBuildStepUpdateParameters, + 'TaskStepUpdateParameters.BuildTask' : exports.BuildTaskStepUpdateParameters, + 'TaskStepUpdateParameters.RunTask' : exports.RunTaskStepUpdateParameters }; 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/runTaskStepUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/runTaskStepUpdateParameters.js new file mode 100644 index 0000000000..442abdb8fc --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/runTaskStepUpdateParameters.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 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. + */ + 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' + } + } + } + } + }; + } +} + +module.exports = RunTaskStepUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/sourceProperties.js b/lib/services/containerRegistryManagement/lib/models/sourceProperties.js new file mode 100644 index 0000000000..4faf7beaac --- /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: true, + serializedName: 'sourceControlAuthProperties', + type: { + name: 'Composite', + className: 'AuthInfo' + } + } + } + } + }; + } +} + +module.exports = SourceProperties; diff --git a/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js b/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js index f647ec06aa..44436f1fb2 100644 --- a/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js +++ b/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js @@ -71,7 +71,7 @@ class SourceTrigger { serializedName: 'sourceRepository', type: { name: 'Composite', - className: 'SourceRepositoryProperties' + className: 'SourceProperties' } }, sourceTriggerEvents: { 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/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 index 39565863f4..5b82cf8a85 100644 --- a/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js @@ -19,7 +19,6 @@ const models = require('./index'); class TaskUpdateParameters { /** * Create a TaskUpdateParameters. - * @member {string} [alias] The alternative updatable name for 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 @@ -37,8 +36,7 @@ class TaskUpdateParameters { * @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 that describe all triggers for - * the task. + * @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 @@ -68,13 +66,6 @@ class TaskUpdateParameters { name: 'Composite', className: 'TaskUpdateParameters', modelProperties: { - alias: { - required: false, - serializedName: 'properties.alias', - type: { - name: 'String' - } - }, status: { required: false, serializedName: 'properties.status', @@ -87,7 +78,7 @@ class TaskUpdateParameters { serializedName: 'properties.platform', type: { name: 'Composite', - className: 'PlatformProperties' + className: 'PlatformUpdateParameters' } }, agentConfiguration: { @@ -101,10 +92,6 @@ class TaskUpdateParameters { timeout: { required: false, serializedName: 'properties.timeout', - constraints: { - InclusiveMaximum: 28800, - InclusiveMinimum: 300 - }, type: { name: 'Number' } @@ -118,8 +105,8 @@ class TaskUpdateParameters { serializedName: 'type', clientName: 'type' }, - uberParent: 'TaskStepProperties', - className: 'TaskStepProperties' + uberParent: 'TaskStepUpdateParameters', + className: 'TaskStepUpdateParameters' } }, trigger: { @@ -127,7 +114,7 @@ class TaskUpdateParameters { serializedName: 'properties.trigger', type: { name: 'Composite', - className: 'TriggerProperties' + className: 'TriggerUpdateParameters' } }, tags: { 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/operations/index.d.ts b/lib/services/containerRegistryManagement/lib/operations/index.d.ts index 5b823e5102..740612e03a 100644 --- a/lib/services/containerRegistryManagement/lib/operations/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/operations/index.d.ts @@ -1115,7 +1115,7 @@ export interface Registries { * * @reject {Error|ServiceError} - The error object. */ - getBuildSourceUploadUrlWithHttpOperationResponse(resourceGroupName: string, registryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listBuildSourceUploadUrlWithHttpOperationResponse(resourceGroupName: string, registryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Get the upload location for the user to be able to upload the source. @@ -1153,9 +1153,9 @@ export interface Registries { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getBuildSourceUploadUrl(resourceGroupName: string, registryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getBuildSourceUploadUrl(resourceGroupName: string, registryName: string, callback: ServiceCallback): void; - getBuildSourceUploadUrl(resourceGroupName: string, registryName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listBuildSourceUploadUrl(resourceGroupName: string, registryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBuildSourceUploadUrl(resourceGroupName: string, registryName: string, callback: ServiceCallback): void; + listBuildSourceUploadUrl(resourceGroupName: string, registryName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -3653,6 +3653,8 @@ export interface Runs { * @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. @@ -3682,6 +3684,8 @@ export interface Runs { * @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. @@ -3880,7 +3884,7 @@ export interface Runs { * * @reject {Error|ServiceError} - The error object. */ - getLogSasUrlWithHttpOperationResponse(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listLogSasUrlWithHttpOperationResponse(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets a link to download the run logs. @@ -3919,9 +3923,9 @@ export interface Runs { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + listLogSasUrl(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listLogSasUrl(resourceGroupName: string, registryName: string, runId: string, callback: ServiceCallback): void; + listLogSasUrl(resourceGroupName: string, registryName: string, runId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -4570,19 +4574,16 @@ export interface Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for 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 + * @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 + * @param {string} [taskUpdateParameters.platform.architecture] The OS * architecture. Possible values include: 'amd64', 'x86', 'arm' * * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. @@ -4601,8 +4602,8 @@ export interface Tasks { * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {object} [taskUpdateParameters.trigger] The properties that describe - * all triggers for the task. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection * of triggers based on source code repository. @@ -4611,8 +4612,8 @@ export interface Tasks { * based on base image dependencies. * * @param {string} - * taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType The type - * of the auto trigger for base image dependency updates. Possible values + * [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 @@ -4649,19 +4650,16 @@ export interface Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for 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 + * @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 + * @param {string} [taskUpdateParameters.platform.architecture] The OS * architecture. Possible values include: 'amd64', 'x86', 'arm' * * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. @@ -4680,8 +4678,8 @@ export interface Tasks { * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {object} [taskUpdateParameters.trigger] The properties that describe - * all triggers for the task. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection * of triggers based on source code repository. @@ -4690,8 +4688,8 @@ export interface Tasks { * based on base image dependencies. * * @param {string} - * taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType The type - * of the auto trigger for base image dependency updates. Possible values + * [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 @@ -5051,19 +5049,16 @@ export interface Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for 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 + * @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 + * @param {string} [taskUpdateParameters.platform.architecture] The OS * architecture. Possible values include: 'amd64', 'x86', 'arm' * * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. @@ -5082,8 +5077,8 @@ export interface Tasks { * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {object} [taskUpdateParameters.trigger] The properties that describe - * all triggers for the task. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection * of triggers based on source code repository. @@ -5092,8 +5087,8 @@ export interface Tasks { * based on base image dependencies. * * @param {string} - * taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType The type - * of the auto trigger for base image dependency updates. Possible values + * [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 @@ -5130,19 +5125,16 @@ export interface Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for 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 + * @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 + * @param {string} [taskUpdateParameters.platform.architecture] The OS * architecture. Possible values include: 'amd64', 'x86', 'arm' * * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. @@ -5161,8 +5153,8 @@ export interface Tasks { * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {object} [taskUpdateParameters.trigger] The properties that describe - * all triggers for the task. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection * of triggers based on source code repository. @@ -5171,8 +5163,8 @@ export interface Tasks { * based on base image dependencies. * * @param {string} - * taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType The type - * of the auto trigger for base image dependency updates. Possible values + * [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 diff --git a/lib/services/containerRegistryManagement/lib/operations/registries.js b/lib/services/containerRegistryManagement/lib/operations/registries.js index e2d302e9d9..15512d156b 100644 --- a/lib/services/containerRegistryManagement/lib/operations/registries.js +++ b/lib/services/containerRegistryManagement/lib/operations/registries.js @@ -1838,7 +1838,7 @@ function _scheduleRun(resourceGroupName, registryName, runRequest, options, call * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getBuildSourceUploadUrl(resourceGroupName, registryName, options, callback) { +function _listBuildSourceUploadUrl(resourceGroupName, registryName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1883,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)); @@ -3383,7 +3383,7 @@ class Registries { this._listPolicies = _listPolicies; this._updatePolicies = _updatePolicies; this._scheduleRun = _scheduleRun; - this._getBuildSourceUploadUrl = _getBuildSourceUploadUrl; + this._listBuildSourceUploadUrl = _listBuildSourceUploadUrl; this._beginImportImage = _beginImportImage; this._beginCreate = _beginCreate; this._beginDeleteMethod = _beginDeleteMethod; @@ -4866,11 +4866,11 @@ class Registries { * * @reject {Error} - The error object. */ - getBuildSourceUploadUrlWithHttpOperationResponse(resourceGroupName, registryName, options) { + listBuildSourceUploadUrlWithHttpOperationResponse(resourceGroupName, registryName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getBuildSourceUploadUrl(resourceGroupName, registryName, options, (err, result, request, response) => { + self._listBuildSourceUploadUrl(resourceGroupName, registryName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4916,7 +4916,7 @@ class Registries { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getBuildSourceUploadUrl(resourceGroupName, registryName, options, optionalCallback) { + listBuildSourceUploadUrl(resourceGroupName, registryName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4925,14 +4925,14 @@ class Registries { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getBuildSourceUploadUrl(resourceGroupName, registryName, options, (err, result, request, response) => { + self._listBuildSourceUploadUrl(resourceGroupName, registryName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getBuildSourceUploadUrl(resourceGroupName, registryName, options, optionalCallback); + return self._listBuildSourceUploadUrl(resourceGroupName, registryName, options, optionalCallback); } } diff --git a/lib/services/containerRegistryManagement/lib/operations/runs.js b/lib/services/containerRegistryManagement/lib/operations/runs.js index 5f5199da33..6fc319b901 100644 --- a/lib/services/containerRegistryManagement/lib/operations/runs.js +++ b/lib/services/containerRegistryManagement/lib/operations/runs.js @@ -25,6 +25,8 @@ const WebResource = msRest.WebResource; * @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. @@ -479,7 +481,7 @@ function _update(resourceGroupName, registryName, runId, runUpdateParameters, op * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getLogSasUrl(resourceGroupName, registryName, runId, options, callback) { +function _listLogSasUrl(resourceGroupName, registryName, runId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -527,7 +529,7 @@ function _getLogSasUrl(resourceGroupName, registryName, runId, options, callback // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/getLogSasUrl'; + 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)); @@ -1168,7 +1170,7 @@ class Runs { this._list = _list; this._get = _get; this._update = _update; - this._getLogSasUrl = _getLogSasUrl; + this._listLogSasUrl = _listLogSasUrl; this._cancel = _cancel; this._beginUpdate = _beginUpdate; this._beginCancel = _beginCancel; @@ -1186,6 +1188,8 @@ class Runs { * @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. @@ -1227,6 +1231,8 @@ class Runs { * @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. @@ -1494,11 +1500,11 @@ class Runs { * * @reject {Error} - The error object. */ - getLogSasUrlWithHttpOperationResponse(resourceGroupName, registryName, runId, options) { + listLogSasUrlWithHttpOperationResponse(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) => { + self._listLogSasUrl(resourceGroupName, registryName, runId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1545,7 +1551,7 @@ class Runs { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getLogSasUrl(resourceGroupName, registryName, runId, options, optionalCallback) { + listLogSasUrl(resourceGroupName, registryName, runId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1554,14 +1560,14 @@ class Runs { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getLogSasUrl(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + self._listLogSasUrl(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); + return self._listLogSasUrl(resourceGroupName, registryName, runId, options, optionalCallback); } } diff --git a/lib/services/containerRegistryManagement/lib/operations/tasks.js b/lib/services/containerRegistryManagement/lib/operations/tasks.js index 5834a366d4..0ed5a02911 100644 --- a/lib/services/containerRegistryManagement/lib/operations/tasks.js +++ b/lib/services/containerRegistryManagement/lib/operations/tasks.js @@ -565,19 +565,16 @@ function _deleteMethod(resourceGroupName, registryName, taskName, options, callb * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for 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 + * @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 + * @param {string} [taskUpdateParameters.platform.architecture] The OS * architecture. Possible values include: 'amd64', 'x86', 'arm' * * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. @@ -596,8 +593,8 @@ function _deleteMethod(resourceGroupName, registryName, taskName, options, callb * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {object} [taskUpdateParameters.trigger] The properties that describe - * all triggers for the task. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection * of triggers based on source code repository. @@ -606,8 +603,8 @@ function _deleteMethod(resourceGroupName, registryName, taskName, options, callb * based on base image dependencies. * * @param {string} - * taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType The type - * of the auto trigger for base image dependency updates. Possible values + * [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 @@ -1306,19 +1303,16 @@ function _beginDeleteMethod(resourceGroupName, registryName, taskName, options, * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for 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 + * @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 + * @param {string} [taskUpdateParameters.platform.architecture] The OS * architecture. Possible values include: 'amd64', 'x86', 'arm' * * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. @@ -1337,8 +1331,8 @@ function _beginDeleteMethod(resourceGroupName, registryName, taskName, options, * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {object} [taskUpdateParameters.trigger] The properties that describe - * all triggers for the task. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection * of triggers based on source code repository. @@ -1347,8 +1341,8 @@ function _beginDeleteMethod(resourceGroupName, registryName, taskName, options, * based on base image dependencies. * * @param {string} - * taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType The type - * of the auto trigger for base image dependency updates. Possible values + * [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 @@ -2194,19 +2188,16 @@ class Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for 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 + * @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 + * @param {string} [taskUpdateParameters.platform.architecture] The OS * architecture. Possible values include: 'amd64', 'x86', 'arm' * * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. @@ -2225,8 +2216,8 @@ class Tasks { * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {object} [taskUpdateParameters.trigger] The properties that describe - * all triggers for the task. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection * of triggers based on source code repository. @@ -2235,8 +2226,8 @@ class Tasks { * based on base image dependencies. * * @param {string} - * taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType The type - * of the auto trigger for base image dependency updates. Possible values + * [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 @@ -2285,19 +2276,16 @@ class Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for 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 + * @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 + * @param {string} [taskUpdateParameters.platform.architecture] The OS * architecture. Possible values include: 'amd64', 'x86', 'arm' * * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. @@ -2316,8 +2304,8 @@ class Tasks { * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {object} [taskUpdateParameters.trigger] The properties that describe - * all triggers for the task. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection * of triggers based on source code repository. @@ -2326,8 +2314,8 @@ class Tasks { * based on base image dependencies. * * @param {string} - * taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType The type - * of the auto trigger for base image dependency updates. Possible values + * [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 @@ -2783,19 +2771,16 @@ class Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for 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 + * @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 + * @param {string} [taskUpdateParameters.platform.architecture] The OS * architecture. Possible values include: 'amd64', 'x86', 'arm' * * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. @@ -2814,8 +2799,8 @@ class Tasks { * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {object} [taskUpdateParameters.trigger] The properties that describe - * all triggers for the task. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection * of triggers based on source code repository. @@ -2824,8 +2809,8 @@ class Tasks { * based on base image dependencies. * * @param {string} - * taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType The type - * of the auto trigger for base image dependency updates. Possible values + * [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 @@ -2874,19 +2859,16 @@ class Tasks { * * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} [taskUpdateParameters.alias] The alternative updatable name - * for 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 + * @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 + * @param {string} [taskUpdateParameters.platform.architecture] The OS * architecture. Possible values include: 'amd64', 'x86', 'arm' * * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. @@ -2905,8 +2887,8 @@ class Tasks { * * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {object} [taskUpdateParameters.trigger] The properties that describe - * all triggers for the task. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection * of triggers based on source code repository. @@ -2915,8 +2897,8 @@ class Tasks { * based on base image dependencies. * * @param {string} - * taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType The type - * of the auto trigger for base image dependency updates. Possible values + * [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 From f52d61032327499dcb1e7682a23bb320176c2d01 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 23 Aug 2018 18:58:05 +0000 Subject: [PATCH 6/8] Generated from d50172797fe291fbdc1aa14e33748279b24c6549 Added isArchiveEnabled as part of Schedule Run request, renamed the arguments property to values for Task type requests and steps --- .../lib/models/buildTaskRequest.js | 32 +-- .../lib/models/buildTaskStep.js | 51 +++-- .../models/buildTaskStepUpdateParameters.js | 26 +-- .../lib/models/dockerBuildRequest.js | 32 +-- .../lib/models/dockerBuildStep.js | 43 ++--- .../models/dockerBuildStepUpdateParameters.js | 18 +- .../lib/models/index.d.ts | 182 +++++++++++------- .../lib/models/index.js | 7 +- .../lib/models/quickTaskRunRequest.js | 32 +-- .../lib/models/run.js | 26 +-- .../lib/models/runRequest.js | 21 +- .../lib/models/runTaskStep.js | 33 ++++ .../lib/models/runTaskStepUpdateParameters.js | 17 ++ .../lib/models/setValue.js | 70 +++++++ .../lib/models/sourceTriggerDescriptor.js | 101 ++++++++++ .../lib/models/task.js | 2 + .../lib/models/taskRunRequest.js | 32 +-- .../lib/models/taskStepProperties.js | 20 ++ .../lib/operations/index.d.ts | 16 +- .../lib/operations/registries.js | 24 +-- 20 files changed, 550 insertions(+), 235 deletions(-) create mode 100644 lib/services/containerRegistryManagement/lib/models/setValue.js create mode 100644 lib/services/containerRegistryManagement/lib/models/sourceTriggerDescriptor.js diff --git a/lib/services/containerRegistryManagement/lib/models/buildTaskRequest.js b/lib/services/containerRegistryManagement/lib/models/buildTaskRequest.js index ac18d636ae..73fc2a4855 100644 --- a/lib/services/containerRegistryManagement/lib/models/buildTaskRequest.js +++ b/lib/services/containerRegistryManagement/lib/models/buildTaskRequest.js @@ -24,6 +24,8 @@ class BuildTaskRequest extends models['RunRequest'] { * 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. @@ -66,19 +68,12 @@ class BuildTaskRequest extends models['RunRequest'] { uberParent: 'RunRequest', className: 'BuildTaskRequest', modelProperties: { - argumentsProperty: { + isArchiveEnabled: { required: false, - serializedName: 'arguments', + serializedName: 'isArchiveEnabled', + defaultValue: false, type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ArgumentElementType', - type: { - name: 'Composite', - className: 'Argument' - } - } + name: 'Boolean' } }, type: { @@ -103,6 +98,21 @@ class BuildTaskRequest extends models['RunRequest'] { 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', diff --git a/lib/services/containerRegistryManagement/lib/models/buildTaskStep.js b/lib/services/containerRegistryManagement/lib/models/buildTaskStep.js index 2adff0f858..cb8ca03e01 100644 --- a/lib/services/containerRegistryManagement/lib/models/buildTaskStep.js +++ b/lib/services/containerRegistryManagement/lib/models/buildTaskStep.js @@ -24,14 +24,12 @@ class BuildTaskStep extends models['TaskStepProperties'] { * 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. - * @member {array} [argumentsProperty] The collection of override arguments - * to be used when executing this build step. - * @member {array} [baseImageDependencies] List of base image dependencies - * for a step. */ constructor() { super(); @@ -56,6 +54,22 @@ class BuildTaskStep extends models['TaskStepProperties'] { 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', @@ -78,41 +92,26 @@ class BuildTaskStep extends models['TaskStepProperties'] { name: 'String' } }, - contextPath: { - required: false, - serializedName: 'contextPath', - type: { - name: 'String' - } - }, - argumentsProperty: { + values: { required: false, - serializedName: 'arguments', + serializedName: 'values', type: { name: 'Sequence', element: { required: false, - serializedName: 'ArgumentElementType', + serializedName: 'SetValueElementType', type: { name: 'Composite', - className: 'Argument' + className: 'SetValue' } } } }, - baseImageDependencies: { + contextPath: { required: false, - serializedName: 'baseImageDependencies', + serializedName: 'contextPath', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'BaseImageDependencyElementType', - type: { - name: 'Composite', - className: 'BaseImageDependency' - } - } + name: 'String' } } } diff --git a/lib/services/containerRegistryManagement/lib/models/buildTaskStepUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/buildTaskStepUpdateParameters.js index a363079c5e..093d1d7c7f 100644 --- a/lib/services/containerRegistryManagement/lib/models/buildTaskStepUpdateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/buildTaskStepUpdateParameters.js @@ -24,12 +24,12 @@ class BuildTaskStepUpdateParameters extends models['TaskStepUpdateParameters'] { * 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. - * @member {array} [argumentsProperty] The collection of override arguments - * to be used when executing this build step. */ constructor() { super(); @@ -76,27 +76,27 @@ class BuildTaskStepUpdateParameters extends models['TaskStepUpdateParameters'] { name: 'String' } }, - contextPath: { - required: false, - serializedName: 'contextPath', - type: { - name: 'String' - } - }, - argumentsProperty: { + values: { required: false, - serializedName: 'arguments', + serializedName: 'values', type: { name: 'Sequence', element: { required: false, - serializedName: 'ArgumentElementType', + serializedName: 'SetValueElementType', type: { name: 'Composite', - className: 'Argument' + className: 'SetValue' } } } + }, + contextPath: { + required: false, + serializedName: 'contextPath', + type: { + name: 'String' + } } } } diff --git a/lib/services/containerRegistryManagement/lib/models/dockerBuildRequest.js b/lib/services/containerRegistryManagement/lib/models/dockerBuildRequest.js index dad9cb7f14..d719942893 100644 --- a/lib/services/containerRegistryManagement/lib/models/dockerBuildRequest.js +++ b/lib/services/containerRegistryManagement/lib/models/dockerBuildRequest.js @@ -29,6 +29,8 @@ class DockerBuildRequest extends models['RunRequest'] { * 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. @@ -71,19 +73,12 @@ class DockerBuildRequest extends models['RunRequest'] { uberParent: 'RunRequest', className: 'DockerBuildRequest', modelProperties: { - argumentsProperty: { + isArchiveEnabled: { required: false, - serializedName: 'arguments', + serializedName: 'isArchiveEnabled', + defaultValue: false, type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ArgumentElementType', - type: { - name: 'Composite', - className: 'Argument' - } - } + name: 'Boolean' } }, type: { @@ -131,6 +126,21 @@ class DockerBuildRequest extends models['RunRequest'] { 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', diff --git a/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js b/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js index e93d4a58ce..5cd17b7d78 100644 --- a/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js +++ b/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js @@ -29,14 +29,12 @@ class DockerBuildStep extends models['TaskStepProperties'] { * the image cache is enabled or not. Default value: false . * @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. - * @member {array} [argumentsProperty] The collection of override arguments - * to be used when executing this build step. - * @member {array} [baseImageDependencies] List of base image dependencies - * for a step. */ constructor() { super(); @@ -61,6 +59,22 @@ class DockerBuildStep extends models['TaskStepProperties'] { uberParent: 'TaskStepProperties', className: 'DockerBuildStep', 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', @@ -106,13 +120,6 @@ class DockerBuildStep extends models['TaskStepProperties'] { name: 'String' } }, - contextPath: { - required: false, - serializedName: 'contextPath', - type: { - name: 'String' - } - }, argumentsProperty: { required: false, serializedName: 'arguments', @@ -128,19 +135,11 @@ class DockerBuildStep extends models['TaskStepProperties'] { } } }, - baseImageDependencies: { + contextPath: { required: false, - serializedName: 'baseImageDependencies', + serializedName: 'contextPath', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'BaseImageDependencyElementType', - type: { - name: 'Composite', - className: 'BaseImageDependency' - } - } + name: 'String' } } } diff --git a/lib/services/containerRegistryManagement/lib/models/dockerBuildStepUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/dockerBuildStepUpdateParameters.js index d1cd6cb6c2..700e9af7e3 100644 --- a/lib/services/containerRegistryManagement/lib/models/dockerBuildStepUpdateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/dockerBuildStepUpdateParameters.js @@ -28,12 +28,12 @@ class DockerBuildStepUpdateParameters extends models['TaskStepUpdateParameters'] * the image cache is enabled or not. * @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. - * @member {array} [argumentsProperty] The collection of override arguments - * to be used when executing this build step. */ constructor() { super(); @@ -101,13 +101,6 @@ class DockerBuildStepUpdateParameters extends models['TaskStepUpdateParameters'] name: 'String' } }, - contextPath: { - required: false, - serializedName: 'contextPath', - type: { - name: 'String' - } - }, argumentsProperty: { required: false, serializedName: 'arguments', @@ -122,6 +115,13 @@ class DockerBuildStepUpdateParameters extends models['TaskStepUpdateParameters'] } } } + }, + contextPath: { + required: false, + serializedName: 'contextPath', + type: { + name: 'String' + } } } } diff --git a/lib/services/containerRegistryManagement/lib/models/index.d.ts b/lib/services/containerRegistryManagement/lib/models/index.d.ts index 54e1e1250e..6742b12c5b 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/models/index.d.ts @@ -897,36 +897,18 @@ export interface Event extends EventInfo { eventResponseMessage?: EventResponseMessage; } -/** - * @class - * Initializes a new instance of the Argument class. - * @constructor - * The properties of a run 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 Argument { - name: string; - value: string; - isSecret?: boolean; -} - /** * @class * Initializes a new instance of the RunRequest class. * @constructor * The request parameters for scheduling a run. * - * @member {array} [argumentsProperty] The collection of override arguments to - * be used when executing the 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 { - argumentsProperty?: Argument[]; + isArchiveEnabled?: boolean; type: string; } @@ -966,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; @@ -1059,15 +1045,17 @@ export interface ProxyResource extends BaseResource { * 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 - * run. - * @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 . @@ -1098,7 +1086,7 @@ export interface Run extends ProxyResource { outputImages?: ImageDescriptor[]; task?: string; imageUpdateTrigger?: ImageUpdateTrigger; - gitCommitTrigger?: GitCommitTrigger; + sourceTrigger?: SourceTriggerDescriptor; isArchiveEnabled?: boolean; platform?: PlatformProperties; agentConfiguration?: AgentProperties; @@ -1180,15 +1168,39 @@ export interface RunGetLogResult { logLink?: string; } +/** + * @class + * Initializes a new instance of the BaseImageDependency class. + * @constructor + * Properties that describe a base image dependency. + * + * @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 BaseImageDependency { + type?: string; + registry?: string; + repository?: string; + tag?: string; + digest?: string; +} + /** * @class * Initializes a new instance of the TaskStepProperties class. * @constructor * Base properties for any task step. * + * @member {array} [baseImageDependencies] List of base image dependencies for + * a step. * @member {string} type Polymorphic Discriminator */ export interface TaskStepProperties { + readonly baseImageDependencies?: BaseImageDependency[]; type: string; } @@ -1355,6 +1367,8 @@ export interface TriggerProperties { * 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. @@ -1593,6 +1607,24 @@ export interface TaskUpdateParameters { tags?: { [propertyName: string]: string }; } +/** + * @class + * Initializes a new instance of the Argument class. + * @constructor + * The properties of a run 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 Argument { + name: string; + value: string; + isSecret?: boolean; +} + /** * @class * Initializes a new instance of the DockerBuildRequest class. @@ -1608,6 +1640,8 @@ export interface TaskUpdateParameters { * 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. @@ -1632,12 +1666,30 @@ export interface DockerBuildRequest extends RunRequest { 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 SetValue { + name: string; + value: string; + isSecret?: boolean; +} + /** * @class * Initializes a new instance of the BuildTaskRequest class. @@ -1648,6 +1700,8 @@ export interface DockerBuildRequest extends RunRequest { * 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. @@ -1670,6 +1724,7 @@ export interface DockerBuildRequest extends RunRequest { export interface BuildTaskRequest extends RunRequest { definitionFilePath: string; valuesFilePath?: string; + values?: SetValue[]; sourceLocation: string; timeout?: number; platform: PlatformProperties; @@ -1684,9 +1739,12 @@ export interface BuildTaskRequest extends RunRequest { * * @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 TaskRunRequest extends RunRequest { taskName: string; + values?: SetValue[]; } /** @@ -1699,6 +1757,8 @@ export interface TaskRunRequest extends RunRequest { * 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. @@ -1716,32 +1776,12 @@ export interface TaskRunRequest extends RunRequest { export interface QuickTaskRunRequest extends RunRequest { taskDefinitionContent: string; valuesContent?: string; + values?: SetValue[]; timeout?: number; platform: PlatformProperties; agentConfiguration?: AgentProperties; } -/** - * @class - * Initializes a new instance of the BaseImageDependency class. - * @constructor - * Properties that describe a base image dependency. - * - * @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 BaseImageDependency { - type?: string; - registry?: string; - repository?: string; - tag?: string; - digest?: string; -} - /** * @class * Initializes a new instance of the DockerBuildStep class. @@ -1757,23 +1797,20 @@ export interface BaseImageDependency { * image cache is enabled or not. Default value: false . * @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. - * @member {array} [argumentsProperty] The collection of override arguments to - * be used when executing this build step. - * @member {array} [baseImageDependencies] List of base image dependencies for - * a step. */ export interface DockerBuildStep extends TaskStepProperties { imageNames?: string[]; isPushEnabled?: boolean; noCache?: boolean; dockerFilePath: string; - contextPath?: string; argumentsProperty?: Argument[]; - baseImageDependencies?: BaseImageDependency[]; + contextPath?: string; } /** @@ -1786,21 +1823,18 @@ export interface DockerBuildStep extends TaskStepProperties { * 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. - * @member {array} [argumentsProperty] The collection of override arguments to - * be used when executing this build step. - * @member {array} [baseImageDependencies] List of base image dependencies for - * a step. */ export interface BuildTaskStep extends TaskStepProperties { definitionFilePath: string; valuesFilePath?: string; + values?: SetValue[]; contextPath?: string; - argumentsProperty?: Argument[]; - baseImageDependencies?: BaseImageDependency[]; } /** @@ -1813,10 +1847,13 @@ export interface BuildTaskStep extends TaskStepProperties { * 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[]; } /** @@ -1833,20 +1870,20 @@ export interface RunTaskStep extends TaskStepProperties { * image cache is enabled or not. * @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. - * @member {array} [argumentsProperty] The collection of override arguments to - * be used when executing this build step. */ export interface DockerBuildStepUpdateParameters extends TaskStepUpdateParameters { imageNames?: string[]; isPushEnabled?: boolean; noCache?: boolean; dockerFilePath?: string; - contextPath?: string; argumentsProperty?: Argument[]; + contextPath?: string; } /** @@ -1859,18 +1896,18 @@ export interface DockerBuildStepUpdateParameters extends TaskStepUpdateParameter * 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. - * @member {array} [argumentsProperty] The collection of override arguments to - * be used when executing this build step. */ export interface BuildTaskStepUpdateParameters extends TaskStepUpdateParameters { definitionFilePath?: string; valuesFilePath?: string; + values?: SetValue[]; contextPath?: string; - argumentsProperty?: Argument[]; } /** @@ -1883,10 +1920,13 @@ export interface BuildTaskStepUpdateParameters extends TaskStepUpdateParameters * 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 RunTaskStepUpdateParameters extends TaskStepUpdateParameters { taskDefinitionContent?: string; valuesContent?: string; + values?: SetValue[]; } diff --git a/lib/services/containerRegistryManagement/lib/models/index.js b/lib/services/containerRegistryManagement/lib/models/index.js index 125fbfeae9..807e775833 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.js +++ b/lib/services/containerRegistryManagement/lib/models/index.js @@ -55,11 +55,10 @@ exports.EventContent = require('./eventContent'); exports.EventRequestMessage = require('./eventRequestMessage'); exports.EventResponseMessage = require('./eventResponseMessage'); exports.Event = require('./event'); -exports.Argument = require('./argument'); 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'); @@ -68,6 +67,7 @@ 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'); @@ -83,11 +83,12 @@ 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.BaseImageDependency = require('./baseImageDependency'); exports.DockerBuildStep = require('./dockerBuildStep'); exports.BuildTaskStep = require('./buildTaskStep'); exports.RunTaskStep = require('./runTaskStep'); diff --git a/lib/services/containerRegistryManagement/lib/models/quickTaskRunRequest.js b/lib/services/containerRegistryManagement/lib/models/quickTaskRunRequest.js index ca1056ab4f..682f50bace 100644 --- a/lib/services/containerRegistryManagement/lib/models/quickTaskRunRequest.js +++ b/lib/services/containerRegistryManagement/lib/models/quickTaskRunRequest.js @@ -24,6 +24,8 @@ class QuickTaskRunRequest extends models['RunRequest'] { * 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. @@ -61,19 +63,12 @@ class QuickTaskRunRequest extends models['RunRequest'] { uberParent: 'RunRequest', className: 'QuickTaskRunRequest', modelProperties: { - argumentsProperty: { + isArchiveEnabled: { required: false, - serializedName: 'arguments', + serializedName: 'isArchiveEnabled', + defaultValue: false, type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ArgumentElementType', - type: { - name: 'Composite', - className: 'Argument' - } - } + name: 'Boolean' } }, type: { @@ -98,6 +93,21 @@ class QuickTaskRunRequest extends models['RunRequest'] { 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', diff --git a/lib/services/containerRegistryManagement/lib/models/run.js b/lib/services/containerRegistryManagement/lib/models/run.js index ad38ed9976..d7de25ecfa 100644 --- a/lib/services/containerRegistryManagement/lib/models/run.js +++ b/lib/services/containerRegistryManagement/lib/models/run.js @@ -40,16 +40,18 @@ class Run extends models['ProxyResource'] { * 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 - * run. - * @member {string} [gitCommitTrigger.id] The unique ID of the trigger. - * @member {string} [gitCommitTrigger.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 {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} [gitCommitTrigger.providerType] The source control - * provider type. + * @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 @@ -189,12 +191,12 @@ class Run extends models['ProxyResource'] { className: 'ImageUpdateTrigger' } }, - gitCommitTrigger: { + sourceTrigger: { required: false, - serializedName: 'properties.gitCommitTrigger', + serializedName: 'properties.sourceTrigger', type: { name: 'Composite', - className: 'GitCommitTrigger' + className: 'SourceTriggerDescriptor' } }, isArchiveEnabled: { diff --git a/lib/services/containerRegistryManagement/lib/models/runRequest.js b/lib/services/containerRegistryManagement/lib/models/runRequest.js index 25a6f01cf6..c5cb76253c 100644 --- a/lib/services/containerRegistryManagement/lib/models/runRequest.js +++ b/lib/services/containerRegistryManagement/lib/models/runRequest.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The request parameters for scheduling a run. * @@ -19,8 +17,8 @@ const models = require('./index'); class RunRequest { /** * Create a RunRequest. - * @member {array} [argumentsProperty] The collection of override arguments - * to be used when executing the 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 */ constructor() { @@ -45,19 +43,12 @@ class RunRequest { uberParent: 'RunRequest', className: 'RunRequest', modelProperties: { - argumentsProperty: { + isArchiveEnabled: { required: false, - serializedName: 'arguments', + serializedName: 'isArchiveEnabled', + defaultValue: false, type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ArgumentElementType', - type: { - name: 'Composite', - className: 'Argument' - } - } + name: 'Boolean' } }, type: { diff --git a/lib/services/containerRegistryManagement/lib/models/runTaskStep.js b/lib/services/containerRegistryManagement/lib/models/runTaskStep.js index 5f4e020b05..61248c819c 100644 --- a/lib/services/containerRegistryManagement/lib/models/runTaskStep.js +++ b/lib/services/containerRegistryManagement/lib/models/runTaskStep.js @@ -24,6 +24,8 @@ class RunTaskStep extends models['TaskStepProperties'] { * 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(); @@ -48,6 +50,22 @@ class RunTaskStep extends models['TaskStepProperties'] { 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', @@ -69,6 +87,21 @@ class RunTaskStep extends models['TaskStepProperties'] { type: { name: 'String' } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } } } } diff --git a/lib/services/containerRegistryManagement/lib/models/runTaskStepUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/runTaskStepUpdateParameters.js index 442abdb8fc..113e6e5c84 100644 --- a/lib/services/containerRegistryManagement/lib/models/runTaskStepUpdateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/runTaskStepUpdateParameters.js @@ -24,6 +24,8 @@ class RunTaskStepUpdateParameters extends models['TaskStepUpdateParameters'] { * 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(); @@ -69,6 +71,21 @@ class RunTaskStepUpdateParameters extends models['TaskStepUpdateParameters'] { type: { name: 'String' } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } } } } 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/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/task.js b/lib/services/containerRegistryManagement/lib/models/task.js index d8fa55f714..b75b307fcc 100644 --- a/lib/services/containerRegistryManagement/lib/models/task.js +++ b/lib/services/containerRegistryManagement/lib/models/task.js @@ -41,6 +41,8 @@ class Task extends models['Resource'] { * 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. diff --git a/lib/services/containerRegistryManagement/lib/models/taskRunRequest.js b/lib/services/containerRegistryManagement/lib/models/taskRunRequest.js index 8ebadf2d6f..0d65fa1d5f 100644 --- a/lib/services/containerRegistryManagement/lib/models/taskRunRequest.js +++ b/lib/services/containerRegistryManagement/lib/models/taskRunRequest.js @@ -22,6 +22,8 @@ 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(); @@ -46,19 +48,12 @@ class TaskRunRequest extends models['RunRequest'] { uberParent: 'RunRequest', className: 'TaskRunRequest', modelProperties: { - argumentsProperty: { + isArchiveEnabled: { required: false, - serializedName: 'arguments', + serializedName: 'isArchiveEnabled', + defaultValue: false, type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ArgumentElementType', - type: { - name: 'Composite', - className: 'Argument' - } - } + name: 'Boolean' } }, type: { @@ -75,6 +70,21 @@ class TaskRunRequest extends models['RunRequest'] { type: { name: 'String' } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } } } } diff --git a/lib/services/containerRegistryManagement/lib/models/taskStepProperties.js b/lib/services/containerRegistryManagement/lib/models/taskStepProperties.js index 9a76e630fa..275e033e12 100644 --- a/lib/services/containerRegistryManagement/lib/models/taskStepProperties.js +++ b/lib/services/containerRegistryManagement/lib/models/taskStepProperties.js @@ -10,6 +10,8 @@ 'use strict'; +const models = require('./index'); + /** * Base properties for any task step. * @@ -17,6 +19,8 @@ class TaskStepProperties { /** * Create a TaskStepProperties. + * @member {array} [baseImageDependencies] List of base image dependencies + * for a step. * @member {string} type Polymorphic Discriminator */ constructor() { @@ -41,6 +45,22 @@ class TaskStepProperties { 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', diff --git a/lib/services/containerRegistryManagement/lib/operations/index.d.ts b/lib/services/containerRegistryManagement/lib/operations/index.d.ts index 740612e03a..fc727288a0 100644 --- a/lib/services/containerRegistryManagement/lib/operations/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/operations/index.d.ts @@ -1030,8 +1030,8 @@ export interface Registries { * * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {array} [runRequest.argumentsProperty] The collection of override - * arguments to be used when executing the run. + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * * @param {string} runRequest.type Polymorphic Discriminator * @@ -1059,8 +1059,8 @@ export interface Registries { * * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {array} [runRequest.argumentsProperty] The collection of override - * arguments to be used when executing the run. + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * * @param {string} runRequest.type Polymorphic Discriminator * @@ -1668,8 +1668,8 @@ export interface Registries { * * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {array} [runRequest.argumentsProperty] The collection of override - * arguments to be used when executing the run. + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * * @param {string} runRequest.type Polymorphic Discriminator * @@ -1697,8 +1697,8 @@ export interface Registries { * * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {array} [runRequest.argumentsProperty] The collection of override - * arguments to be used when executing the run. + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * * @param {string} runRequest.type Polymorphic Discriminator * diff --git a/lib/services/containerRegistryManagement/lib/operations/registries.js b/lib/services/containerRegistryManagement/lib/operations/registries.js index 15512d156b..358eee5998 100644 --- a/lib/services/containerRegistryManagement/lib/operations/registries.js +++ b/lib/services/containerRegistryManagement/lib/operations/registries.js @@ -1736,8 +1736,8 @@ function _updatePolicies(resourceGroupName, registryName, registryPoliciesUpdate * * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {array} [runRequest.argumentsProperty] The collection of override - * arguments to be used when executing the run. + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * * @param {string} runRequest.type Polymorphic Discriminator * @@ -2935,8 +2935,8 @@ function _beginUpdatePolicies(resourceGroupName, registryName, registryPoliciesU * * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {array} [runRequest.argumentsProperty] The collection of override - * arguments to be used when executing the run. + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * * @param {string} runRequest.type Polymorphic Discriminator * @@ -4754,8 +4754,8 @@ class Registries { * * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {array} [runRequest.argumentsProperty] The collection of override - * arguments to be used when executing the run. + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * * @param {string} runRequest.type Polymorphic Discriminator * @@ -4795,8 +4795,8 @@ class Registries { * * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {array} [runRequest.argumentsProperty] The collection of override - * arguments to be used when executing the run. + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * * @param {string} runRequest.type Polymorphic Discriminator * @@ -5581,8 +5581,8 @@ class Registries { * * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {array} [runRequest.argumentsProperty] The collection of override - * arguments to be used when executing the run. + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * * @param {string} runRequest.type Polymorphic Discriminator * @@ -5622,8 +5622,8 @@ class Registries { * * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {array} [runRequest.argumentsProperty] The collection of override - * arguments to be used when executing the run. + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * * @param {string} runRequest.type Polymorphic Discriminator * From c0b3f322b7168450ce10d8174ba18bfd409735ed Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 23 Aug 2018 21:54:01 +0000 Subject: [PATCH 7/8] Generated from bd17de82306bd5b6dffa291b5559787c23ea6639 Removed the Required attribute for the source control auth properties to fix the model validation failures. --- .../containerRegistryManagement/lib/models/index.d.ts | 4 ++-- .../lib/models/sourceProperties.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/services/containerRegistryManagement/lib/models/index.d.ts b/lib/services/containerRegistryManagement/lib/models/index.d.ts index 6742b12c5b..03ac2f6701 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/models/index.d.ts @@ -1237,7 +1237,7 @@ export interface AuthInfo { * 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 + * @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 @@ -1255,7 +1255,7 @@ export interface SourceProperties { sourceControlType: string; repositoryUrl: string; branch?: string; - sourceControlAuthProperties: AuthInfo; + sourceControlAuthProperties?: AuthInfo; } /** diff --git a/lib/services/containerRegistryManagement/lib/models/sourceProperties.js b/lib/services/containerRegistryManagement/lib/models/sourceProperties.js index 4faf7beaac..fb0c311ee6 100644 --- a/lib/services/containerRegistryManagement/lib/models/sourceProperties.js +++ b/lib/services/containerRegistryManagement/lib/models/sourceProperties.js @@ -23,8 +23,8 @@ class SourceProperties { * 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 + * @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' @@ -76,7 +76,7 @@ class SourceProperties { } }, sourceControlAuthProperties: { - required: true, + required: false, serializedName: 'sourceControlAuthProperties', type: { name: 'Composite', From 2a3b9c3cfb4222793d8f7a14534dcd8134e44773 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 23 Aug 2018 23:45:35 +0000 Subject: [PATCH 8/8] Generated from fd9d36edfbdcdd3f434fd8fcac2868cd8c3007d6 Updated the operation ID as per the feedback --- .../lib/operations/index.d.ts | 36 ++++++++----------- .../lib/operations/registries.js | 14 ++++---- .../lib/operations/runs.js | 30 ++++------------ .../lib/operations/tasks.js | 14 ++++---- 4 files changed, 36 insertions(+), 58 deletions(-) diff --git a/lib/services/containerRegistryManagement/lib/operations/index.d.ts b/lib/services/containerRegistryManagement/lib/operations/index.d.ts index fc727288a0..06cdfc0956 100644 --- a/lib/services/containerRegistryManagement/lib/operations/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/operations/index.d.ts @@ -1115,7 +1115,7 @@ export interface Registries { * * @reject {Error|ServiceError} - The error object. */ - listBuildSourceUploadUrlWithHttpOperationResponse(resourceGroupName: string, registryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getBuildSourceUploadUrlWithHttpOperationResponse(resourceGroupName: string, registryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Get the upload location for the user to be able to upload the source. @@ -1153,9 +1153,9 @@ export interface Registries { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listBuildSourceUploadUrl(resourceGroupName: string, registryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBuildSourceUploadUrl(resourceGroupName: string, registryName: string, callback: ServiceCallback): void; - listBuildSourceUploadUrl(resourceGroupName: string, registryName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getBuildSourceUploadUrl(resourceGroupName: string, registryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getBuildSourceUploadUrl(resourceGroupName: string, registryName: string, callback: ServiceCallback): void; + getBuildSourceUploadUrl(resourceGroupName: string, registryName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -3659,9 +3659,6 @@ export interface Runs { * @param {number} [options.top] $top is supported for get list of runs, which * limits the maximum number of runs to return. * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * runs, which provides the next page in the list of runs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -3671,7 +3668,7 @@ export interface Runs { * * @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 runs for a registry. @@ -3690,9 +3687,6 @@ export interface Runs { * @param {number} [options.top] $top is supported for get list of runs, which * limits the maximum number of runs to return. * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * runs, which provides the next page in the list of runs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -3718,9 +3712,9 @@ export interface Runs { * * {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, 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, skipToken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, registryName: string, options: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -3884,7 +3878,7 @@ export interface Runs { * * @reject {Error|ServiceError} - The error object. */ - listLogSasUrlWithHttpOperationResponse(resourceGroupName: string, registryName: string, runId: 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 run logs. @@ -3923,9 +3917,9 @@ export interface Runs { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listLogSasUrl(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listLogSasUrl(resourceGroupName: string, registryName: string, runId: string, callback: ServiceCallback): void; - listLogSasUrl(resourceGroupName: string, registryName: string, runId: 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; /** @@ -4754,7 +4748,7 @@ export interface Tasks { * * @reject {Error|ServiceError} - The error object. */ - listDetailsWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getDetailsWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Returns a task with extended information that includes all secrets. @@ -4793,9 +4787,9 @@ export interface Tasks { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listDetails(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listDetails(resourceGroupName: string, registryName: string, taskName: string, callback: ServiceCallback): void; - listDetails(resourceGroupName: string, registryName: string, taskName: 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; /** diff --git a/lib/services/containerRegistryManagement/lib/operations/registries.js b/lib/services/containerRegistryManagement/lib/operations/registries.js index 358eee5998..68be1d6574 100644 --- a/lib/services/containerRegistryManagement/lib/operations/registries.js +++ b/lib/services/containerRegistryManagement/lib/operations/registries.js @@ -1838,7 +1838,7 @@ function _scheduleRun(resourceGroupName, registryName, runRequest, options, call * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listBuildSourceUploadUrl(resourceGroupName, registryName, options, callback) { +function _getBuildSourceUploadUrl(resourceGroupName, registryName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3383,7 +3383,7 @@ class Registries { this._listPolicies = _listPolicies; this._updatePolicies = _updatePolicies; this._scheduleRun = _scheduleRun; - this._listBuildSourceUploadUrl = _listBuildSourceUploadUrl; + this._getBuildSourceUploadUrl = _getBuildSourceUploadUrl; this._beginImportImage = _beginImportImage; this._beginCreate = _beginCreate; this._beginDeleteMethod = _beginDeleteMethod; @@ -4866,11 +4866,11 @@ class Registries { * * @reject {Error} - The error object. */ - listBuildSourceUploadUrlWithHttpOperationResponse(resourceGroupName, registryName, options) { + getBuildSourceUploadUrlWithHttpOperationResponse(resourceGroupName, registryName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listBuildSourceUploadUrl(resourceGroupName, registryName, options, (err, result, request, response) => { + self._getBuildSourceUploadUrl(resourceGroupName, registryName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4916,7 +4916,7 @@ class Registries { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listBuildSourceUploadUrl(resourceGroupName, registryName, options, optionalCallback) { + getBuildSourceUploadUrl(resourceGroupName, registryName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4925,14 +4925,14 @@ class Registries { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listBuildSourceUploadUrl(resourceGroupName, registryName, options, (err, result, request, response) => { + self._getBuildSourceUploadUrl(resourceGroupName, registryName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listBuildSourceUploadUrl(resourceGroupName, registryName, options, optionalCallback); + return self._getBuildSourceUploadUrl(resourceGroupName, registryName, options, optionalCallback); } } diff --git a/lib/services/containerRegistryManagement/lib/operations/runs.js b/lib/services/containerRegistryManagement/lib/operations/runs.js index 6fc319b901..0175450ea5 100644 --- a/lib/services/containerRegistryManagement/lib/operations/runs.js +++ b/lib/services/containerRegistryManagement/lib/operations/runs.js @@ -31,9 +31,6 @@ const WebResource = msRest.WebResource; * @param {number} [options.top] $top is supported for get list of runs, which * limits the maximum number of runs to return. * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * runs, which provides the next page in the list of runs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -62,7 +59,6 @@ function _list(resourceGroupName, registryName, options, callback) { } let filter = (options && options.filter !== undefined) ? options.filter : undefined; let top = (options && options.top !== undefined) ? options.top : undefined; - let skipToken = (options && options.skipToken !== undefined) ? options.skipToken : undefined; let apiVersion = '2018-09-01'; // Validate try { @@ -95,9 +91,6 @@ function _list(resourceGroupName, registryName, options, callback) { if (top !== null && top !== undefined && typeof top !== 'number') { throw new Error('top must be of type number.'); } - if (skipToken !== null && skipToken !== undefined && typeof skipToken.valueOf() !== 'string') { - throw new Error('skipToken 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.'); } @@ -119,9 +112,6 @@ function _list(resourceGroupName, registryName, options, callback) { if (top !== null && top !== undefined) { queryParameters.push('$top=' + encodeURIComponent(top.toString())); } - if (skipToken !== null && skipToken !== undefined) { - queryParameters.push('$skipToken=' + encodeURIComponent(skipToken)); - } if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -481,7 +471,7 @@ function _update(resourceGroupName, registryName, runId, runUpdateParameters, op * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listLogSasUrl(resourceGroupName, registryName, runId, options, callback) { +function _getLogSasUrl(resourceGroupName, registryName, runId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1170,7 +1160,7 @@ class Runs { this._list = _list; this._get = _get; this._update = _update; - this._listLogSasUrl = _listLogSasUrl; + this._getLogSasUrl = _getLogSasUrl; this._cancel = _cancel; this._beginUpdate = _beginUpdate; this._beginCancel = _beginCancel; @@ -1194,9 +1184,6 @@ class Runs { * @param {number} [options.top] $top is supported for get list of runs, which * limits the maximum number of runs to return. * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * runs, which provides the next page in the list of runs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1237,9 +1224,6 @@ class Runs { * @param {number} [options.top] $top is supported for get list of runs, which * limits the maximum number of runs to return. * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * runs, which provides the next page in the list of runs. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1500,11 +1484,11 @@ class Runs { * * @reject {Error} - The error object. */ - listLogSasUrlWithHttpOperationResponse(resourceGroupName, registryName, runId, options) { + getLogSasUrlWithHttpOperationResponse(resourceGroupName, registryName, runId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listLogSasUrl(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + self._getLogSasUrl(resourceGroupName, registryName, runId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1551,7 +1535,7 @@ class Runs { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listLogSasUrl(resourceGroupName, registryName, runId, options, optionalCallback) { + getLogSasUrl(resourceGroupName, registryName, runId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1560,14 +1544,14 @@ class Runs { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listLogSasUrl(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + self._getLogSasUrl(resourceGroupName, registryName, runId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listLogSasUrl(resourceGroupName, registryName, runId, options, optionalCallback); + return self._getLogSasUrl(resourceGroupName, registryName, runId, options, optionalCallback); } } diff --git a/lib/services/containerRegistryManagement/lib/operations/tasks.js b/lib/services/containerRegistryManagement/lib/operations/tasks.js index 0ed5a02911..d5aaac06fd 100644 --- a/lib/services/containerRegistryManagement/lib/operations/tasks.js +++ b/lib/services/containerRegistryManagement/lib/operations/tasks.js @@ -714,7 +714,7 @@ function _update(resourceGroupName, registryName, taskName, taskUpdateParameters * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listDetails(resourceGroupName, registryName, taskName, options, callback) { +function _getDetails(resourceGroupName, registryName, taskName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1696,7 +1696,7 @@ class Tasks { this._create = _create; this._deleteMethod = _deleteMethod; this._update = _update; - this._listDetails = _listDetails; + this._getDetails = _getDetails; this._beginCreate = _beginCreate; this._beginDeleteMethod = _beginDeleteMethod; this._beginUpdate = _beginUpdate; @@ -2395,11 +2395,11 @@ class Tasks { * * @reject {Error} - The error object. */ - listDetailsWithHttpOperationResponse(resourceGroupName, registryName, taskName, options) { + getDetailsWithHttpOperationResponse(resourceGroupName, registryName, taskName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listDetails(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + self._getDetails(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2446,7 +2446,7 @@ class Tasks { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listDetails(resourceGroupName, registryName, taskName, options, optionalCallback) { + getDetails(resourceGroupName, registryName, taskName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2455,14 +2455,14 @@ class Tasks { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listDetails(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + self._getDetails(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listDetails(resourceGroupName, registryName, taskName, options, optionalCallback); + return self._getDetails(resourceGroupName, registryName, taskName, options, optionalCallback); } }