From 3c76deadd012bc840e72a65f22c1108cd55b4d9a Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 14 Aug 2018 10:57:24 -0700 Subject: [PATCH 1/5] Generated from 86b5463c9e7a593a222031b8c652836efb5f159f (#3323) add option to import images from public registries Allows users to import images from public registries instead of only Azure Container Registries. Only one registry source can be specified. --- .../containerRegistryManagementClient.d.ts | 6 +- .../lib/containerRegistryManagementClient.js | 6 +- .../lib/models/importImageParameters.js | 3 +- .../lib/models/importSource.js | 12 +- .../lib/models/index.d.ts | 103 ++- .../lib/models/index.js | 5 + .../lib/models/operationDefinition.js | 21 + .../operationMetricSpecificationDefinition.js | 92 ++ ...operationServiceSpecificationDefinition.js | 63 ++ .../lib/models/quarantinePolicy.js | 53 ++ .../lib/models/registryPolicies.js | 73 ++ .../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 | 291 +++++- .../lib/operations/registries.js | 869 +++++++++++++++++- .../containerRegistryManagement/package.json | 6 +- 18 files changed, 1619 insertions(+), 52 deletions(-) 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/registryPolicies.js create mode 100644 lib/services/containerRegistryManagement/lib/models/trustPolicy.js diff --git a/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.d.ts b/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.d.ts index 0bc7fd95cf..6cb71b86c3 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); diff --git a/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.js b/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.js index e7a2b2b65a..da03d13afc 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) { diff --git a/lib/services/containerRegistryManagement/lib/models/importImageParameters.js b/lib/services/containerRegistryManagement/lib/models/importImageParameters.js index 191b46a8a9..5e93c9c8cc 100644 --- a/lib/services/containerRegistryManagement/lib/models/importImageParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/importImageParameters.js @@ -19,8 +19,9 @@ class ImportImageParameters { /** * Create a ImportImageParameters. * @member {object} source The source of the image. - * @member {string} [source.resourceId] The resource identifier of the target + * @member {string} [source.resourceId] The resource identifier of the source * Azure Container Registry. + * @member {string} [source.registryUri] The address of the source registry. * @member {string} [source.sourceImage] Repository name of the source image. * Specify an image by repository ('hello-world'). This will use the 'latest' * tag. diff --git a/lib/services/containerRegistryManagement/lib/models/importSource.js b/lib/services/containerRegistryManagement/lib/models/importSource.js index 43a81fbb5e..171a3d18d4 100644 --- a/lib/services/containerRegistryManagement/lib/models/importSource.js +++ b/lib/services/containerRegistryManagement/lib/models/importSource.js @@ -16,8 +16,9 @@ class ImportSource { /** * Create a ImportSource. - * @member {string} resourceId The resource identifier of the target Azure + * @member {string} [resourceId] The resource identifier of the source Azure * Container Registry. + * @member {string} [registryUri] The address of the source registry. * @member {string} sourceImage Repository name of the source image. * Specify an image by repository ('hello-world'). This will use the 'latest' * tag. @@ -43,12 +44,19 @@ class ImportSource { className: 'ImportSource', modelProperties: { resourceId: { - required: true, + required: false, serializedName: 'resourceId', type: { name: 'String' } }, + registryUri: { + required: false, + serializedName: 'registryUri', + type: { + name: 'String' + } + }, sourceImage: { required: true, serializedName: 'sourceImage', diff --git a/lib/services/containerRegistryManagement/lib/models/index.d.ts b/lib/services/containerRegistryManagement/lib/models/index.d.ts index fecb9c6c9f..e48b2a111d 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/models/index.d.ts @@ -20,8 +20,9 @@ export { CloudError } from 'ms-rest-azure'; * @class * Initializes a new instance of the ImportSource class. * @constructor - * @member {string} resourceId The resource identifier of the target Azure + * @member {string} [resourceId] The resource identifier of the source Azure * Container Registry. + * @member {string} [registryUri] The address of the source registry. * @member {string} sourceImage Repository name of the source image. * Specify an image by repository ('hello-world'). This will use the 'latest' * tag. @@ -30,7 +31,8 @@ export { CloudError } from 'ms-rest-azure'; * ('hello-world@sha256:abc123'). */ export interface ImportSource { - resourceId: string; + resourceId?: string; + registryUri?: string; sourceImage: string; } @@ -39,8 +41,9 @@ export interface ImportSource { * Initializes a new instance of the ImportImageParameters class. * @constructor * @member {object} source The source of the image. - * @member {string} [source.resourceId] The resource identifier of the target + * @member {string} [source.resourceId] The resource identifier of the source * Azure Container Registry. + * @member {string} [source.registryUri] The address of the source registry. * @member {string} [source.sourceImage] Repository name of the source image. * Specify an image by repository ('hello-world'). This will use the 'latest' * tag. @@ -115,12 +118,49 @@ export interface OperationDisplayDefinition { description?: string; } +/** + * @class + * Initializes a new instance of the OperationMetricSpecificationDefinition class. + * @constructor + * The definition of Azure Monitoring metric. + * + * @member {string} [name] Metric name. + * @member {string} [displayName] Metric display name. + * @member {string} [displayDescription] Metric description. + * @member {string} [unit] Metric unit. + * @member {string} [aggregationType] Metric aggregation type. + * @member {string} [internalMetricName] Internal metric name. + */ +export interface OperationMetricSpecificationDefinition { + name?: string; + displayName?: string; + displayDescription?: string; + unit?: string; + aggregationType?: string; + internalMetricName?: string; +} + +/** + * @class + * Initializes a new instance of the OperationServiceSpecificationDefinition class. + * @constructor + * The definition of Azure Monitoring metrics list. + * + * @member {array} [metricSpecifications] A list of Azure Monitoring metrics + * definition. + */ +export interface OperationServiceSpecificationDefinition { + metricSpecifications?: OperationMetricSpecificationDefinition[]; +} + /** * @class * Initializes a new instance of the OperationDefinition class. * @constructor * The definition of a container registry operation. * + * @member {string} [origin] The origin information of the container registry + * operation. * @member {string} [name] Operation name: {provider}/{resource}/{operation}. * @member {object} [display] The display information for the container * registry operation. @@ -130,10 +170,16 @@ export interface OperationDisplayDefinition { * performed. * @member {string} [display.operation] The operation that users can perform. * @member {string} [display.description] The description for the operation. + * @member {object} [serviceSpecification] The definition of Azure Monitoring + * service. + * @member {array} [serviceSpecification.metricSpecifications] A list of Azure + * Monitoring metrics definition. */ export interface OperationDefinition { + origin?: string; name?: string; display?: OperationDisplayDefinition; + serviceSpecification?: OperationServiceSpecificationDefinition; } /** @@ -349,6 +395,57 @@ export interface RegistryUsageListResult { value?: RegistryUsage[]; } +/** + * @class + * Initializes a new instance of the QuarantinePolicy class. + * @constructor + * An object that represents quarantine policy for a container registry. + * + * @member {string} [status] The value that indicates whether the policy is + * enabled or not. Possible values include: 'enabled', 'disabled' + */ +export interface QuarantinePolicy { + status?: string; +} + +/** + * @class + * Initializes a new instance of the TrustPolicy class. + * @constructor + * An object that represents content trust policy for a container registry. + * + * @member {string} [type] The type of trust policy. Possible values include: + * 'Notary' + * @member {string} [status] The value that indicates whether the policy is + * enabled or not. Possible values include: 'enabled', 'disabled' + */ +export interface TrustPolicy { + type?: string; + status?: string; +} + +/** + * @class + * Initializes a new instance of the RegistryPolicies class. + * @constructor + * An object that represents policies for a container registry. + * + * @member {object} [quarantinePolicy] An object that represents quarantine + * policy for a container registry. + * @member {string} [quarantinePolicy.status] The value that indicates whether + * the policy is enabled or not. Possible values include: 'enabled', 'disabled' + * @member {object} [trustPolicy] An object that represents content trust + * policy for a container registry. + * @member {string} [trustPolicy.type] The type of trust policy. Possible + * values include: 'Notary' + * @member {string} [trustPolicy.status] The value that indicates whether the + * policy is enabled or not. Possible values include: 'enabled', 'disabled' + */ +export interface RegistryPolicies { + quarantinePolicy?: QuarantinePolicy; + trustPolicy?: TrustPolicy; +} + /** * @class * Initializes a new instance of the Replication class. diff --git a/lib/services/containerRegistryManagement/lib/models/index.js b/lib/services/containerRegistryManagement/lib/models/index.js index cb2d81152f..3b9552475c 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'); 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/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/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/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..f437291059 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. @@ -851,6 +857,168 @@ export interface Registries { listUsages(resourceGroupName: string, registryName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * 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; + + /** * Creates a new build based on the request parameters and add it to the build * queue. @@ -998,8 +1166,11 @@ export interface Registries { * * @param {object} parameters.source The source of the image. * - * @param {string} parameters.source.resourceId The resource identifier of the - * target Azure Container Registry. + * @param {string} [parameters.source.resourceId] The resource identifier of + * the source Azure Container Registry. + * + * @param {string} [parameters.source.registryUri] The address of the source + * registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -1048,8 +1219,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. @@ -1376,6 +1550,107 @@ export interface Registries { beginUpdate(resourceGroupName: string, registryName: string, registryUpdateParameters: models.RegistryUpdateParameters, 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. + */ + 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; + + /** * Creates a new build based on the request parameters and add it to the build * queue. diff --git a/lib/services/containerRegistryManagement/lib/operations/registries.js b/lib/services/containerRegistryManagement/lib/operations/registries.js index 8ba49758c9..f3e75e8c34 100644 --- a/lib/services/containerRegistryManagement/lib/operations/registries.js +++ b/lib/services/containerRegistryManagement/lib/operations/registries.js @@ -29,8 +29,11 @@ const WebResource = msRest.WebResource; * * @param {object} parameters.source The source of the image. * - * @param {string} parameters.source.resourceId The resource identifier of the - * target Azure Container Registry. + * @param {string} [parameters.source.resourceId] The resource identifier of + * the source Azure Container Registry. + * + * @param {string} [parameters.source.registryUri] The address of the source + * registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -1464,6 +1467,263 @@ 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 @@ -1721,8 +1981,11 @@ function _getBuildSourceUploadUrl(resourceGroupName, registryName, options, call * * @param {object} parameters.source The source of the image. * - * @param {string} parameters.source.resourceId The resource identifier of the - * target Azure Container Registry. + * @param {string} [parameters.source.resourceId] The resource identifier of + * the source Azure Container Registry. + * + * @param {string} [parameters.source.registryUri] The address of the source + * registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -2464,17 +2727,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 {string} buildRequest.type Polymorphic Discriminator + * @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. * @@ -2488,13 +2766,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 +2782,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 +2808,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 +2820,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 +2854,194 @@ 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; + // 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['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 + * queue. + * + * @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 {string} buildRequest.type Polymorphic Discriminator + * + * @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 Build} 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) { + /* 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-02-01-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (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 (buildRequest === null || buildRequest === undefined) { + throw new Error('buildRequest 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}/queueBuild'; + 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 (buildRequest !== null && buildRequest !== undefined) { + let requestModelMapper = new client.models['QueueBuildRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, buildRequest, 'buildRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(buildRequest, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -2916,12 +3374,15 @@ class Registries { this._listCredentials = _listCredentials; this._regenerateCredential = _regenerateCredential; this._listUsages = _listUsages; + this._listPolicies = _listPolicies; + this._updatePolicies = _updatePolicies; this._queueBuild = _queueBuild; this._getBuildSourceUploadUrl = _getBuildSourceUploadUrl; this._beginImportImage = _beginImportImage; this._beginCreate = _beginCreate; this._beginDeleteMethod = _beginDeleteMethod; this._beginUpdate = _beginUpdate; + this._beginUpdatePolicies = _beginUpdatePolicies; this._beginQueueBuild = _beginQueueBuild; this._listByResourceGroupNext = _listByResourceGroupNext; this._listNext = _listNext; @@ -2941,8 +3402,11 @@ class Registries { * * @param {object} parameters.source The source of the image. * - * @param {string} parameters.source.resourceId The resource identifier of the - * target Azure Container Registry. + * @param {string} [parameters.source.resourceId] The resource identifier of + * the source Azure Container Registry. + * + * @param {string} [parameters.source.registryUri] The address of the source + * registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -3003,8 +3467,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. @@ -4054,6 +4521,222 @@ class Registries { } } + /** + * 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); + } + } + /** * Creates a new build based on the request parameters and add it to the build * queue. @@ -4255,8 +4938,11 @@ class Registries { * * @param {object} parameters.source The source of the image. * - * @param {string} parameters.source.resourceId The resource identifier of the - * target Azure Container Registry. + * @param {string} [parameters.source.resourceId] The resource identifier of + * the source Azure Container Registry. + * + * @param {string} [parameters.source.registryUri] The address of the source + * registry. * * @param {string} parameters.source.sourceImage Repository name of the source * image. @@ -4317,8 +5003,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. @@ -4741,6 +5430,134 @@ class Registries { } } + /** + * 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); + } + } + /** * Creates a new build based on the request parameters and add it to the build * queue. 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 d1524d07f838f08516df6497af40d88c42574c85 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 28 Aug 2018 12:45:01 -0700 Subject: [PATCH 2/5] Generated from 8211af77ca617639df4c4668ca621b6f65c05918 (#3442) Renamed BuildTask to FileTask and RunTask to EncodedTask --- .../containerRegistryManagementClient.d.ts | 5 +- .../lib/containerRegistryManagementClient.js | 5 +- .../lib/models/agentProperties.js | 53 + .../lib/models/argument.js | 71 + .../lib/models/authInfo.js | 87 + .../lib/models/authInfoUpdateParameters.js | 87 + .../lib/models/baseImageTrigger.js | 70 + .../baseImageTriggerUpdateParameters.js | 70 + .../lib/models/dockerBuildRequest.js | 185 + .../lib/models/dockerBuildStep.js | 84 +- .../models/dockerBuildStepUpdateParameters.js | 48 +- .../lib/models/encodedTaskRunRequest.js | 145 + .../lib/models/encodedTaskStep.js | 112 + .../models/encodedTaskStepUpdateParameters.js | 96 + .../lib/models/fileTaskRunRequest.js | 157 + .../lib/models/fileTaskStep.js | 123 + .../models/fileTaskStepUpdateParameters.js | 107 + .../lib/models/index.d.ts | 1007 ++++-- .../lib/models/index.js | 77 +- .../lib/models/platformProperties.js | 27 +- .../lib/models/platformUpdateParameters.js | 71 + .../lib/models/run.js | 239 ++ .../lib/models/runFilter.js | 116 + .../lib/models/runGetLogResult.js | 53 + .../lib/models/runListResult.js | 68 + .../lib/models/runRequest.js | 68 + .../lib/models/runUpdateParameters.js | 53 + .../lib/models/setValue.js | 70 + .../lib/models/sourceProperties.js | 92 + .../lib/models/sourceTrigger.js | 111 + .../lib/models/sourceTriggerDescriptor.js | 101 + .../models/sourceTriggerUpdateParameters.js | 111 + .../lib/models/sourceUpdateParameters.js | 93 + .../lib/models/task.js | 201 ++ .../lib/models/taskListResult.js | 68 + .../lib/models/taskRunRequest.js | 95 + .../lib/models/taskStepProperties.js | 78 + .../lib/models/taskStepUpdateParameters.js | 58 + .../lib/models/taskUpdateParameters.js | 140 + .../lib/models/triggerProperties.js | 79 + .../lib/models/triggerUpdateParameters.js | 79 + .../lib/operations/index.d.ts | 2053 ++++------- .../lib/operations/index.js | 5 +- .../lib/operations/registries.js | 124 +- .../lib/operations/runs.js | 1928 +++++++++++ .../lib/operations/tasks.js | 3046 +++++++++++++++++ 46 files changed, 9828 insertions(+), 1988 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/authInfo.js create mode 100644 lib/services/containerRegistryManagement/lib/models/authInfoUpdateParameters.js create mode 100644 lib/services/containerRegistryManagement/lib/models/baseImageTrigger.js create mode 100644 lib/services/containerRegistryManagement/lib/models/baseImageTriggerUpdateParameters.js create mode 100644 lib/services/containerRegistryManagement/lib/models/dockerBuildRequest.js create mode 100644 lib/services/containerRegistryManagement/lib/models/encodedTaskRunRequest.js create mode 100644 lib/services/containerRegistryManagement/lib/models/encodedTaskStep.js create mode 100644 lib/services/containerRegistryManagement/lib/models/encodedTaskStepUpdateParameters.js create mode 100644 lib/services/containerRegistryManagement/lib/models/fileTaskRunRequest.js create mode 100644 lib/services/containerRegistryManagement/lib/models/fileTaskStep.js create mode 100644 lib/services/containerRegistryManagement/lib/models/fileTaskStepUpdateParameters.js create mode 100644 lib/services/containerRegistryManagement/lib/models/platformUpdateParameters.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/runUpdateParameters.js create mode 100644 lib/services/containerRegistryManagement/lib/models/setValue.js create mode 100644 lib/services/containerRegistryManagement/lib/models/sourceProperties.js create mode 100644 lib/services/containerRegistryManagement/lib/models/sourceTrigger.js create mode 100644 lib/services/containerRegistryManagement/lib/models/sourceTriggerDescriptor.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/task.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/taskStepProperties.js create mode 100644 lib/services/containerRegistryManagement/lib/models/taskStepUpdateParameters.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/triggerUpdateParameters.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 6cb71b86c3..404e18ea5d 100644 --- a/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.d.ts +++ b/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.d.ts @@ -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 da03d13afc..c8cd8b8aeb 100644 --- a/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.js +++ b/lib/services/containerRegistryManagement/lib/containerRegistryManagementClient.js @@ -75,9 +75,8 @@ class ContainerRegistryManagementClient extends ServiceClient { this.operations = new operations.Operations(this); this.replications = new operations.Replications(this); this.webhooks = new operations.Webhooks(this); - this.builds = new operations.Builds(this); - this.buildSteps = new operations.BuildSteps(this); - this.buildTasks = new operations.BuildTasks(this); + this.runs = new operations.Runs(this); + this.tasks = new operations.Tasks(this); this.models = models; msRest.addSerializationMixin(this); } diff --git a/lib/services/containerRegistryManagement/lib/models/agentProperties.js b/lib/services/containerRegistryManagement/lib/models/agentProperties.js new file mode 100644 index 0000000000..54ca08b66b --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/agentProperties.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The properties that determine the run agent configuration. + * + */ +class AgentProperties { + /** + * Create a AgentProperties. + * @member {number} [cpu] The CPU configuration in terms of number of cores + * required for the run. + */ + constructor() { + } + + /** + * Defines the metadata of AgentProperties + * + * @returns {object} metadata of AgentProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'AgentProperties', + type: { + name: 'Composite', + className: 'AgentProperties', + modelProperties: { + cpu: { + required: false, + serializedName: 'cpu', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = AgentProperties; diff --git a/lib/services/containerRegistryManagement/lib/models/argument.js b/lib/services/containerRegistryManagement/lib/models/argument.js new file mode 100644 index 0000000000..292d0d83d9 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/argument.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The properties of a run argument. + * + */ +class Argument { + /** + * Create a Argument. + * @member {string} name The name of the argument. + * @member {string} value The value of the argument. + * @member {boolean} [isSecret] Flag to indicate whether the argument + * represents a secret and want to be removed from build logs. Default value: + * false . + */ + constructor() { + } + + /** + * Defines the metadata of Argument + * + * @returns {object} metadata of Argument + * + */ + mapper() { + return { + required: false, + serializedName: 'Argument', + type: { + name: 'Composite', + className: 'Argument', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: true, + serializedName: 'value', + type: { + name: 'String' + } + }, + isSecret: { + required: false, + serializedName: 'isSecret', + defaultValue: false, + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = Argument; diff --git a/lib/services/containerRegistryManagement/lib/models/authInfo.js b/lib/services/containerRegistryManagement/lib/models/authInfo.js new file mode 100644 index 0000000000..0303c4f789 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/authInfo.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The authorization properties for accessing the source code repository. + * + */ +class AuthInfo { + /** + * Create a AuthInfo. + * @member {string} tokenType The type of Auth token. Possible values + * include: 'PAT', 'OAuth' + * @member {string} token The access token used to access the source control + * provider. + * @member {string} [refreshToken] The refresh token used to refresh the + * access token. + * @member {string} [scope] The scope of the access token. + * @member {number} [expiresIn] Time in seconds that the token remains valid + */ + constructor() { + } + + /** + * Defines the metadata of AuthInfo + * + * @returns {object} metadata of AuthInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'AuthInfo', + type: { + name: 'Composite', + className: 'AuthInfo', + modelProperties: { + tokenType: { + required: true, + serializedName: 'tokenType', + type: { + name: 'String' + } + }, + token: { + required: true, + serializedName: 'token', + type: { + name: 'String' + } + }, + refreshToken: { + required: false, + serializedName: 'refreshToken', + type: { + name: 'String' + } + }, + scope: { + required: false, + serializedName: 'scope', + type: { + name: 'String' + } + }, + expiresIn: { + required: false, + serializedName: 'expiresIn', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = AuthInfo; diff --git a/lib/services/containerRegistryManagement/lib/models/authInfoUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/authInfoUpdateParameters.js new file mode 100644 index 0000000000..df1896032b --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/authInfoUpdateParameters.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The authorization properties for accessing the source code repository. + * + */ +class AuthInfoUpdateParameters { + /** + * Create a AuthInfoUpdateParameters. + * @member {string} [tokenType] The type of Auth token. Possible values + * include: 'PAT', 'OAuth' + * @member {string} [token] The access token used to access the source + * control provider. + * @member {string} [refreshToken] The refresh token used to refresh the + * access token. + * @member {string} [scope] The scope of the access token. + * @member {number} [expiresIn] Time in seconds that the token remains valid + */ + constructor() { + } + + /** + * Defines the metadata of AuthInfoUpdateParameters + * + * @returns {object} metadata of AuthInfoUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'AuthInfoUpdateParameters', + type: { + name: 'Composite', + className: 'AuthInfoUpdateParameters', + modelProperties: { + tokenType: { + required: false, + serializedName: 'tokenType', + type: { + name: 'String' + } + }, + token: { + required: false, + serializedName: 'token', + type: { + name: 'String' + } + }, + refreshToken: { + required: false, + serializedName: 'refreshToken', + type: { + name: 'String' + } + }, + scope: { + required: false, + serializedName: 'scope', + type: { + name: 'String' + } + }, + expiresIn: { + required: false, + serializedName: 'expiresIn', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = AuthInfoUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/baseImageTrigger.js b/lib/services/containerRegistryManagement/lib/models/baseImageTrigger.js new file mode 100644 index 0000000000..08c97f3e0e --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/baseImageTrigger.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The trigger based on base image dependency. + * + */ +class BaseImageTrigger { + /** + * Create a BaseImageTrigger. + * @member {string} baseImageTriggerType The type of the auto trigger for + * base image dependency updates. Possible values include: 'All', 'Runtime' + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ + constructor() { + } + + /** + * Defines the metadata of BaseImageTrigger + * + * @returns {object} metadata of BaseImageTrigger + * + */ + mapper() { + return { + required: false, + serializedName: 'BaseImageTrigger', + type: { + name: 'Composite', + className: 'BaseImageTrigger', + modelProperties: { + baseImageTriggerType: { + required: true, + serializedName: 'baseImageTriggerType', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BaseImageTrigger; diff --git a/lib/services/containerRegistryManagement/lib/models/baseImageTriggerUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/baseImageTriggerUpdateParameters.js new file mode 100644 index 0000000000..51f8a76de6 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/baseImageTriggerUpdateParameters.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The properties for updating base image dependency trigger. + * + */ +class BaseImageTriggerUpdateParameters { + /** + * Create a BaseImageTriggerUpdateParameters. + * @member {string} [baseImageTriggerType] The type of the auto trigger for + * base image dependency updates. Possible values include: 'All', 'Runtime' + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ + constructor() { + } + + /** + * Defines the metadata of BaseImageTriggerUpdateParameters + * + * @returns {object} metadata of BaseImageTriggerUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'BaseImageTriggerUpdateParameters', + type: { + name: 'Composite', + className: 'BaseImageTriggerUpdateParameters', + modelProperties: { + baseImageTriggerType: { + required: false, + serializedName: 'baseImageTriggerType', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BaseImageTriggerUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/dockerBuildRequest.js b/lib/services/containerRegistryManagement/lib/models/dockerBuildRequest.js new file mode 100644 index 0000000000..d719942893 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/dockerBuildRequest.js @@ -0,0 +1,185 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The parameters for a docker quick build. + * + * @extends models['RunRequest'] + */ +class DockerBuildRequest extends models['RunRequest'] { + /** + * Create a DockerBuildRequest. + * @member {array} [imageNames] The fully qualified image names including the + * repository and tag. + * @member {boolean} [isPushEnabled] The value of this property indicates + * whether the image built should be pushed to the registry or not. Default + * value: true . + * @member {boolean} [noCache] The value of this property indicates whether + * the image cache is enabled or not. Default value: false . + * @member {string} dockerFilePath The Docker file path relative to the + * source location. + * @member {array} [argumentsProperty] The collection of override arguments + * to be used when executing the run. + * @member {string} sourceLocation The URL(absolute or relative) of the + * source that needs to be built. For Docker build, it can be an URL to a tar + * or github repoistory as supported by Docker. + * If it is relative URL, the relative path should be obtained from calling + * getSourceUploadUrl API. + * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . + * @member {object} platform The platform properties against which the build + * will happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the + * build agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms + * of number of cores required for the run. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DockerBuildRequest + * + * @returns {object} metadata of DockerBuildRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'DockerBuildRequest', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'RunRequest', + className: 'DockerBuildRequest', + modelProperties: { + isArchiveEnabled: { + required: false, + serializedName: 'isArchiveEnabled', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + imageNames: { + required: false, + serializedName: 'imageNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + isPushEnabled: { + required: false, + serializedName: 'isPushEnabled', + defaultValue: true, + type: { + name: 'Boolean' + } + }, + noCache: { + required: false, + serializedName: 'noCache', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + dockerFilePath: { + required: true, + serializedName: 'dockerFilePath', + type: { + name: 'String' + } + }, + argumentsProperty: { + required: false, + serializedName: 'arguments', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ArgumentElementType', + type: { + name: 'Composite', + className: 'Argument' + } + } + } + }, + sourceLocation: { + required: true, + serializedName: 'sourceLocation', + type: { + name: 'String' + } + }, + timeout: { + required: false, + serializedName: 'timeout', + defaultValue: 3600, + constraints: { + InclusiveMaximum: 28800, + InclusiveMinimum: 300 + }, + type: { + name: 'Number' + } + }, + platform: { + required: true, + serializedName: 'platform', + type: { + name: 'Composite', + className: 'PlatformProperties' + } + }, + agentConfiguration: { + required: false, + serializedName: 'agentConfiguration', + type: { + name: 'Composite', + className: 'AgentProperties' + } + } + } + } + }; + } +} + +module.exports = DockerBuildRequest; diff --git a/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js b/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js index 84bef7d173..5cd17b7d78 100644 --- a/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js +++ b/lib/services/containerRegistryManagement/lib/models/dockerBuildStep.js @@ -15,12 +15,11 @@ const models = require('./index'); /** * The Docker build step. * - * @extends models['BuildStepProperties'] + * @extends models['TaskStepProperties'] */ -class DockerBuildStep extends models['BuildStepProperties'] { +class DockerBuildStep extends models['TaskStepProperties'] { /** * Create a DockerBuildStep. - * @member {string} [branch] The repository branch name. * @member {array} [imageNames] The fully qualified image names including the * repository and tag. * @member {boolean} [isPushEnabled] The value of this property indicates @@ -28,17 +27,14 @@ class DockerBuildStep extends models['BuildStepProperties'] { * value: true . * @member {boolean} [noCache] The value of this property indicates whether * the image cache is enabled or not. Default value: false . - * @member {string} [dockerFilePath] The Docker file path relative to the - * source control root. - * @member {string} [contextPath] The relative context path for a docker - * build in the source. - * @member {array} [buildArguments] The custom arguments for building this - * build step. - * @member {array} [baseImageDependencies] List of base image dependencies - * for a step. - * @member {string} [baseImageTrigger] The type of the auto trigger for base - * image dependency updates. Possible values include: 'All', 'Runtime', - * 'None' + * @member {string} dockerFilePath The Docker file path relative to the + * source context. + * @member {array} [argumentsProperty] The collection of override arguments + * to be used when executing this build step. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository + * URL of the build task. */ constructor() { super(); @@ -60,15 +56,23 @@ class DockerBuildStep extends models['BuildStepProperties'] { serializedName: 'type', clientName: 'type' }, - uberParent: 'BuildStepProperties', + uberParent: 'TaskStepProperties', className: 'DockerBuildStep', modelProperties: { - provisioningState: { + baseImageDependencies: { required: false, readOnly: true, - serializedName: 'provisioningState', + serializedName: 'baseImageDependencies', type: { - name: 'String' + name: 'Sequence', + element: { + required: false, + serializedName: 'BaseImageDependencyElementType', + type: { + name: 'Composite', + className: 'BaseImageDependency' + } + } } }, type: { @@ -79,13 +83,6 @@ class DockerBuildStep extends models['BuildStepProperties'] { name: 'String' } }, - branch: { - required: false, - serializedName: 'branch', - type: { - name: 'String' - } - }, imageNames: { required: false, serializedName: 'imageNames', @@ -117,53 +114,30 @@ class DockerBuildStep extends models['BuildStepProperties'] { } }, dockerFilePath: { - required: false, + required: true, serializedName: 'dockerFilePath', type: { name: 'String' } }, - contextPath: { - required: false, - serializedName: 'contextPath', - type: { - name: 'String' - } - }, - buildArguments: { - required: false, - serializedName: 'buildArguments', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'BuildArgumentElementType', - type: { - name: 'Composite', - className: 'BuildArgument' - } - } - } - }, - baseImageDependencies: { + argumentsProperty: { required: false, - readOnly: true, - serializedName: 'baseImageDependencies', + serializedName: 'arguments', type: { name: 'Sequence', element: { required: false, - serializedName: 'BaseImageDependencyElementType', + serializedName: 'ArgumentElementType', type: { name: 'Composite', - className: 'BaseImageDependency' + className: 'Argument' } } } }, - baseImageTrigger: { + contextPath: { required: false, - serializedName: 'baseImageTrigger', + serializedName: 'contextPath', type: { name: 'String' } diff --git a/lib/services/containerRegistryManagement/lib/models/dockerBuildStepUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/dockerBuildStepUpdateParameters.js index 20db8e9d98..700e9af7e3 100644 --- a/lib/services/containerRegistryManagement/lib/models/dockerBuildStepUpdateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/dockerBuildStepUpdateParameters.js @@ -15,12 +15,11 @@ const models = require('./index'); /** * The properties for updating a docker build step. * - * @extends models['BuildStepPropertiesUpdateParameters'] + * @extends models['TaskStepUpdateParameters'] */ -class DockerBuildStepUpdateParameters extends models['BuildStepPropertiesUpdateParameters'] { +class DockerBuildStepUpdateParameters extends models['TaskStepUpdateParameters'] { /** * Create a DockerBuildStepUpdateParameters. - * @member {string} [branch] The repository branch name. * @member {array} [imageNames] The fully qualified image names including the * repository and tag. * @member {boolean} [isPushEnabled] The value of this property indicates @@ -28,14 +27,13 @@ class DockerBuildStepUpdateParameters extends models['BuildStepPropertiesUpdateP * @member {boolean} [noCache] The value of this property indicates whether * the image cache is enabled or not. * @member {string} [dockerFilePath] The Docker file path relative to the - * source control root. - * @member {string} [contextPath] The relative context path for a docker - * build in the source. - * @member {array} [buildArguments] The custom arguments for building this - * build step. - * @member {string} [baseImageTrigger] The type of the auto trigger for base - * image dependency updates. Possible values include: 'All', 'Runtime', - * 'None' + * source context. + * @member {array} [argumentsProperty] The collection of override arguments + * to be used when executing this build step. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository + * URL of the build task. */ constructor() { super(); @@ -57,7 +55,7 @@ class DockerBuildStepUpdateParameters extends models['BuildStepPropertiesUpdateP serializedName: 'type', clientName: 'type' }, - uberParent: 'BuildStepPropertiesUpdateParameters', + uberParent: 'TaskStepUpdateParameters', className: 'DockerBuildStepUpdateParameters', modelProperties: { type: { @@ -68,13 +66,6 @@ class DockerBuildStepUpdateParameters extends models['BuildStepPropertiesUpdateP name: 'String' } }, - branch: { - required: false, - serializedName: 'branch', - type: { - name: 'String' - } - }, imageNames: { required: false, serializedName: 'imageNames', @@ -110,31 +101,24 @@ class DockerBuildStepUpdateParameters extends models['BuildStepPropertiesUpdateP name: 'String' } }, - contextPath: { - required: false, - serializedName: 'contextPath', - type: { - name: 'String' - } - }, - buildArguments: { + argumentsProperty: { required: false, - serializedName: 'buildArguments', + serializedName: 'arguments', type: { name: 'Sequence', element: { required: false, - serializedName: 'BuildArgumentElementType', + serializedName: 'ArgumentElementType', type: { name: 'Composite', - className: 'BuildArgument' + className: 'Argument' } } } }, - baseImageTrigger: { + contextPath: { required: false, - serializedName: 'baseImageTrigger', + serializedName: 'contextPath', type: { name: 'String' } diff --git a/lib/services/containerRegistryManagement/lib/models/encodedTaskRunRequest.js b/lib/services/containerRegistryManagement/lib/models/encodedTaskRunRequest.js new file mode 100644 index 0000000000..828f9b42e3 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/encodedTaskRunRequest.js @@ -0,0 +1,145 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The parameters for a quick task run request. + * + * @extends models['RunRequest'] + */ +class EncodedTaskRunRequest extends models['RunRequest'] { + /** + * Create a EncodedTaskRunRequest. + * @member {string} encodedTaskContent Base64 encoded value of the + * template/definition file content. + * @member {string} [encodedValuesContent] Base64 encoded value of the + * parameters/values file content. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . + * @member {object} platform The platform properties against which the build + * will happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the + * build agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms + * of number of cores required for the run. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of EncodedTaskRunRequest + * + * @returns {object} metadata of EncodedTaskRunRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'EncodedTaskRunRequest', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'RunRequest', + className: 'EncodedTaskRunRequest', + modelProperties: { + isArchiveEnabled: { + required: false, + serializedName: 'isArchiveEnabled', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + encodedTaskContent: { + required: true, + serializedName: 'encodedTaskContent', + type: { + name: 'String' + } + }, + encodedValuesContent: { + required: false, + serializedName: 'encodedValuesContent', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } + }, + timeout: { + required: false, + serializedName: 'timeout', + defaultValue: 3600, + constraints: { + InclusiveMaximum: 28800, + InclusiveMinimum: 300 + }, + type: { + name: 'Number' + } + }, + platform: { + required: true, + serializedName: 'platform', + type: { + name: 'Composite', + className: 'PlatformProperties' + } + }, + agentConfiguration: { + required: false, + serializedName: 'agentConfiguration', + type: { + name: 'Composite', + className: 'AgentProperties' + } + } + } + } + }; + } +} + +module.exports = EncodedTaskRunRequest; diff --git a/lib/services/containerRegistryManagement/lib/models/encodedTaskStep.js b/lib/services/containerRegistryManagement/lib/models/encodedTaskStep.js new file mode 100644 index 0000000000..293e3eaf40 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/encodedTaskStep.js @@ -0,0 +1,112 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties of a encoded task step. + * + * @extends models['TaskStepProperties'] + */ +class EncodedTaskStep extends models['TaskStepProperties'] { + /** + * Create a EncodedTaskStep. + * @member {string} encodedTaskContent Base64 encoded value of the + * template/definition file content. + * @member {string} [encodedValuesContent] Base64 encoded value of the + * parameters/values file content. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of EncodedTaskStep + * + * @returns {object} metadata of EncodedTaskStep + * + */ + mapper() { + return { + required: false, + serializedName: 'EncodedTask', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepProperties', + className: 'EncodedTaskStep', + modelProperties: { + baseImageDependencies: { + required: false, + readOnly: true, + serializedName: 'baseImageDependencies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BaseImageDependencyElementType', + type: { + name: 'Composite', + className: 'BaseImageDependency' + } + } + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + encodedTaskContent: { + required: true, + serializedName: 'encodedTaskContent', + type: { + name: 'String' + } + }, + encodedValuesContent: { + required: false, + serializedName: 'encodedValuesContent', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } + } + } + } + }; + } +} + +module.exports = EncodedTaskStep; diff --git a/lib/services/containerRegistryManagement/lib/models/encodedTaskStepUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/encodedTaskStepUpdateParameters.js new file mode 100644 index 0000000000..94e2556036 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/encodedTaskStepUpdateParameters.js @@ -0,0 +1,96 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties for updating encoded task step. + * + * @extends models['TaskStepUpdateParameters'] + */ +class EncodedTaskStepUpdateParameters extends models['TaskStepUpdateParameters'] { + /** + * Create a EncodedTaskStepUpdateParameters. + * @member {string} [encodedTaskContent] Base64 encoded value of the + * template/definition file content. + * @member {string} [encodedValuesContent] Base64 encoded value of the + * parameters/values file content. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of EncodedTaskStepUpdateParameters + * + * @returns {object} metadata of EncodedTaskStepUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'EncodedTask', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepUpdateParameters', + className: 'EncodedTaskStepUpdateParameters', + modelProperties: { + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + encodedTaskContent: { + required: false, + serializedName: 'encodedTaskContent', + type: { + name: 'String' + } + }, + encodedValuesContent: { + required: false, + serializedName: 'encodedValuesContent', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } + } + } + } + }; + } +} + +module.exports = EncodedTaskStepUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/fileTaskRunRequest.js b/lib/services/containerRegistryManagement/lib/models/fileTaskRunRequest.js new file mode 100644 index 0000000000..7738db1a26 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/fileTaskRunRequest.js @@ -0,0 +1,157 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The request parameters for a scheduling run against a task file. + * + * @extends models['RunRequest'] + */ +class FileTaskRunRequest extends models['RunRequest'] { + /** + * Create a FileTaskRunRequest. + * @member {string} taskFilePath The template/definition file path relative + * to the source. + * @member {string} [valuesFilePath] The values/parameters file path relative + * to the source. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {string} sourceLocation The URL(absolute or relative) of the + * source that needs to be built. For Docker build, it can be an URL to a tar + * or github repoistory as supported by Docker. + * If it is relative URL, the relative path should be obtained from calling + * getSourceUploadUrl API. + * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . + * @member {object} platform The platform properties against which the build + * will happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the + * build agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms + * of number of cores required for the run. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FileTaskRunRequest + * + * @returns {object} metadata of FileTaskRunRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'FileTaskRunRequest', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'RunRequest', + className: 'FileTaskRunRequest', + modelProperties: { + isArchiveEnabled: { + required: false, + serializedName: 'isArchiveEnabled', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + taskFilePath: { + required: true, + serializedName: 'taskFilePath', + type: { + name: 'String' + } + }, + valuesFilePath: { + required: false, + serializedName: 'valuesFilePath', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } + }, + sourceLocation: { + required: true, + serializedName: 'sourceLocation', + type: { + name: 'String' + } + }, + timeout: { + required: false, + serializedName: 'timeout', + defaultValue: 3600, + constraints: { + InclusiveMaximum: 28800, + InclusiveMinimum: 300 + }, + type: { + name: 'Number' + } + }, + platform: { + required: true, + serializedName: 'platform', + type: { + name: 'Composite', + className: 'PlatformProperties' + } + }, + agentConfiguration: { + required: false, + serializedName: 'agentConfiguration', + type: { + name: 'Composite', + className: 'AgentProperties' + } + } + } + } + }; + } +} + +module.exports = FileTaskRunRequest; diff --git a/lib/services/containerRegistryManagement/lib/models/fileTaskStep.js b/lib/services/containerRegistryManagement/lib/models/fileTaskStep.js new file mode 100644 index 0000000000..9b6d548acc --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/fileTaskStep.js @@ -0,0 +1,123 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties of a task step. + * + * @extends models['TaskStepProperties'] + */ +class FileTaskStep extends models['TaskStepProperties'] { + /** + * Create a FileTaskStep. + * @member {string} taskFilePath The task template/definition file path + * relative to the source context. + * @member {string} [valuesFilePath] The task values/parameters file path + * relative to the source context. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository + * URL of the build task. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FileTaskStep + * + * @returns {object} metadata of FileTaskStep + * + */ + mapper() { + return { + required: false, + serializedName: 'FileTask', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepProperties', + className: 'FileTaskStep', + modelProperties: { + baseImageDependencies: { + required: false, + readOnly: true, + serializedName: 'baseImageDependencies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BaseImageDependencyElementType', + type: { + name: 'Composite', + className: 'BaseImageDependency' + } + } + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + taskFilePath: { + required: true, + serializedName: 'taskFilePath', + type: { + name: 'String' + } + }, + valuesFilePath: { + required: false, + serializedName: 'valuesFilePath', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } + }, + contextPath: { + required: false, + serializedName: 'contextPath', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FileTaskStep; diff --git a/lib/services/containerRegistryManagement/lib/models/fileTaskStepUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/fileTaskStepUpdateParameters.js new file mode 100644 index 0000000000..5596a580ad --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/fileTaskStepUpdateParameters.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 task step. + * + * @extends models['TaskStepUpdateParameters'] + */ +class FileTaskStepUpdateParameters extends models['TaskStepUpdateParameters'] { + /** + * Create a FileTaskStepUpdateParameters. + * @member {string} [taskFilePath] The task template/definition file path + * relative to the source context. + * @member {string} [valuesFilePath] The values/parameters file path relative + * to the source context. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository + * URL of the build task. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FileTaskStepUpdateParameters + * + * @returns {object} metadata of FileTaskStepUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'FileTask', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepUpdateParameters', + className: 'FileTaskStepUpdateParameters', + modelProperties: { + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + taskFilePath: { + required: false, + serializedName: 'taskFilePath', + type: { + name: 'String' + } + }, + valuesFilePath: { + required: false, + serializedName: 'valuesFilePath', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } + }, + contextPath: { + required: false, + serializedName: 'contextPath', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FileTaskStepUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/index.d.ts b/lib/services/containerRegistryManagement/lib/models/index.d.ts index e48b2a111d..d1aef972dd 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/models/index.d.ts @@ -897,6 +897,21 @@ export interface Event extends EventInfo { eventResponseMessage?: EventResponseMessage; } +/** + * @class + * Initializes a new instance of the RunRequest class. + * @constructor + * The request parameters for scheduling a run. + * + * @member {boolean} [isArchiveEnabled] The value that indicates whether + * archiving is enabled for the run or not. Default value: false . + * @member {string} type Polymorphic Discriminator + */ +export interface RunRequest { + isArchiveEnabled?: boolean; + type: string; +} + /** * @class * Initializes a new instance of the ImageDescriptor class. @@ -933,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; @@ -955,15 +974,31 @@ export interface GitCommitTrigger { * @class * Initializes a new instance of the PlatformProperties class. * @constructor - * The platform properties against which the build has to happen. + * The platform properties against which the run has to happen. * - * @member {string} osType The operating system type required for the build. - * Possible values include: 'Windows', 'Linux' - * @member {number} [cpu] The CPU configuration in terms of number of cores - * required for the build. + * @member {string} os The operating system type required for the run. Possible + * values include: 'Windows', 'Linux' + * @member {string} [architecture] The OS architecture. Possible values + * include: 'amd64', 'x86', 'arm' + * @member {string} [variant] Variant of the CPU. Possible values include: + * 'v6', 'v7', 'v8' */ export interface PlatformProperties { - osType: string; + os: string; + architecture?: string; + variant?: string; +} + +/** + * @class + * Initializes a new instance of the AgentProperties class. + * @constructor + * The properties that determine the run agent configuration. + * + * @member {number} [cpu] The CPU configuration in terms of number of cores + * required for the run. + */ +export interface AgentProperties { cpu?: number; } @@ -986,213 +1021,197 @@ export interface ProxyResource extends BaseResource { /** * @class - * Initializes a new instance of the Build class. + * Initializes a new instance of the Run class. * @constructor - * Build resource properties + * Run resource properties * - * @member {string} [buildId] The unique identifier for the build. - * @member {string} [status] The current status of the build. Possible values + * @member {string} [runId] The unique identifier for the run. + * @member {string} [status] The current status of the run. Possible values * include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', * 'Error', 'Timeout' - * @member {date} [lastUpdatedTime] The last updated time for the build. - * @member {string} [buildType] The type of build. Possible values include: - * 'AutoBuild', 'QuickBuild' - * @member {date} [createTime] The time the build was created. - * @member {date} [startTime] The time the build started. - * @member {date} [finishTime] The time the build finished. + * @member {date} [lastUpdatedTime] The last updated time for the run. + * @member {string} [runType] The type of run. Possible values include: + * 'QuickBuild', 'AutoBuild' + * @member {date} [createTime] The time the run was scheduled. + * @member {date} [startTime] The time the run started. + * @member {date} [finishTime] The time the run finished. * @member {array} [outputImages] The list of all images that were generated - * from the build. - * @member {string} [buildTask] The build task with which the build was - * started. + * from the run. This is applicable if the run is of type Build. + * @member {string} [task] The task against which run was scheduled. * @member {object} [imageUpdateTrigger] The image update trigger that caused - * the build. + * the run. This is applicable if the task is of build type. * @member {string} [imageUpdateTrigger.id] The unique ID of the trigger. * @member {date} [imageUpdateTrigger.timestamp] The timestamp when the image * update happened. * @member {array} [imageUpdateTrigger.images] The list of image updates that * caused the build. - * @member {object} [gitCommitTrigger] The git commit trigger that caused the - * build. - * @member {string} [gitCommitTrigger.id] The unique ID of the trigger. - * @member {string} [gitCommitTrigger.commitId] The unique ID that identifies a + * @member {object} [sourceTrigger] The source trigger that caused the run. + * @member {string} [sourceTrigger.id] The unique ID of the trigger. + * @member {string} [sourceTrigger.eventType] The event type of the trigger. + * @member {string} [sourceTrigger.commitId] The unique ID that identifies a * commit. - * @member {string} [gitCommitTrigger.repositoryUrl] The repository URL. - * @member {string} [gitCommitTrigger.branchName] The branch name in the + * @member {string} [sourceTrigger.pullRequestId] The unique ID that identifies + * pull request. + * @member {string} [sourceTrigger.repositoryUrl] The repository URL. + * @member {string} [sourceTrigger.branchName] The branch name in the * repository. - * @member {string} [gitCommitTrigger.providerType] The source control provider + * @member {string} [sourceTrigger.providerType] The source control provider * type. * @member {boolean} [isArchiveEnabled] The value that indicates whether * archiving is enabled or not. Default value: false . - * @member {object} [platform] The platform properties against which the build + * @member {object} [platform] The platform properties against which the run * will happen. - * @member {string} [platform.osType] The operating system type required for - * the build. Possible values include: 'Windows', 'Linux' - * @member {number} [platform.cpu] The CPU configuration in terms of number of - * cores required for the build. - * @member {string} [provisioningState] The provisioning state of a build. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the run + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms of + * number of cores required for the run. + * @member {string} [provisioningState] The provisioning state of a run. * Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', * 'Failed', 'Canceled' */ -export interface Build extends ProxyResource { - buildId?: string; +export interface Run extends ProxyResource { + runId?: string; status?: string; lastUpdatedTime?: Date; - buildType?: string; + runType?: string; createTime?: Date; startTime?: Date; finishTime?: Date; outputImages?: ImageDescriptor[]; - buildTask?: string; + task?: string; imageUpdateTrigger?: ImageUpdateTrigger; - gitCommitTrigger?: GitCommitTrigger; + sourceTrigger?: SourceTriggerDescriptor; isArchiveEnabled?: boolean; platform?: PlatformProperties; + agentConfiguration?: AgentProperties; provisioningState?: string; } /** * @class - * Initializes a new instance of the BuildFilter class. + * Initializes a new instance of the SourceUploadDefinition class. + * @constructor + * The properties of a response to source upload request. + * + * @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. + * Properties that are enabled for Odata querying on runs. * - * @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} [runId] The unique identifier for the run. + * @member {string} [runType] The type of run. Possible values include: + * 'QuickBuild', 'AutoBuild' + * @member {string} [status] The current status of the run. Possible values * include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', * 'Error', 'Timeout' - * @member {date} [createTime] The create time for a build. - * @member {date} [finishTime] The time the build finished. + * @member {date} [createTime] The create time for a run. + * @member {date} [finishTime] The time the run finished. * @member {string} [outputImageManifests] The list of comma-separated image - * manifests that were generated from the build. + * manifests that were generated from the run. This is applicable if the run is + * of + * build type. * @member {boolean} [isArchiveEnabled] The value that indicates whether * archiving is enabled or not. - * @member {string} [buildTaskName] The name of the build task that the build - * corresponds to. + * @member {string} [taskName] The name of the task that the run corresponds + * to. */ -export interface BuildFilter { - buildId?: string; - buildType?: string; +export interface RunFilter { + runId?: string; + runType?: string; status?: string; createTime?: Date; finishTime?: Date; outputImageManifests?: string; isArchiveEnabled?: boolean; - buildTaskName?: string; + taskName?: string; } /** * @class - * Initializes a new instance of the BuildUpdateParameters class. + * Initializes a new instance of the RunUpdateParameters class. * @constructor - * The set of build properties that can be updated. + * The set of run properties that can be updated. * * @member {boolean} [isArchiveEnabled] The value that indicates whether * archiving is enabled or not. */ -export interface BuildUpdateParameters { +export interface RunUpdateParameters { isArchiveEnabled?: boolean; } /** * @class - * Initializes a new instance of the BuildGetLogResult class. + * Initializes a new instance of the RunGetLogResult class. * @constructor * The result of get log link operation. * - * @member {string} [logLink] The link to logs for a azure container registry - * build. + * @member {string} [logLink] The link to logs for a run on a azure container + * registry. */ -export interface BuildGetLogResult { +export interface RunGetLogResult { logLink?: string; } /** * @class - * Initializes a new instance of the BuildStepProperties class. - * @constructor - * Base properties for any build step. - * - * @member {string} [provisioningState] The provisioning state of the build - * step. Possible values include: 'Creating', 'Updating', 'Deleting', - * 'Succeeded', 'Failed', 'Canceled' - * @member {string} type Polymorphic Discriminator - */ -export interface BuildStepProperties { - readonly provisioningState?: string; - type: string; -} - -/** - * @class - * Initializes a new instance of the BuildStep class. + * Initializes a new instance of the BaseImageDependency class. * @constructor - * Build step resource properties + * Properties that describe a base image dependency. * - * @member {object} [properties] The properties of a build step. - * @member {string} [properties.provisioningState] The provisioning state of - * the build step. Possible values include: 'Creating', 'Updating', 'Deleting', - * 'Succeeded', 'Failed', 'Canceled' - * @member {string} [properties.type] Polymorphic Discriminator + * @member {string} [type] The type of the base image dependency. Possible + * values include: 'BuildTime', 'RunTime' + * @member {string} [registry] The registry login server. + * @member {string} [repository] The repository name. + * @member {string} [tag] The tag name. + * @member {string} [digest] The sha256-based digest of the image manifest. */ -export interface BuildStep extends ProxyResource { - properties?: BuildStepProperties; +export interface BaseImageDependency { + type?: string; + registry?: string; + repository?: string; + tag?: string; + digest?: string; } /** * @class - * Initializes a new instance of the BuildStepPropertiesUpdateParameters class. + * Initializes a new instance of the TaskStepProperties class. * @constructor - * The properties for updating a build step. + * Base properties for any task step. * + * @member {array} [baseImageDependencies] List of base image dependencies for + * a step. * @member {string} type Polymorphic Discriminator */ -export interface BuildStepPropertiesUpdateParameters { +export interface TaskStepProperties { + readonly baseImageDependencies?: BaseImageDependency[]; type: string; } /** * @class - * Initializes a new instance of the BuildStepUpdateParameters class. - * @constructor - * The parameters for updating a build step. - * - * @member {object} [properties] The properties for updating a build step. - * @member {string} [properties.type] Polymorphic Discriminator - * @member {object} [tags] The ARM resource tags. - */ -export interface BuildStepUpdateParameters { - properties?: BuildStepPropertiesUpdateParameters; - tags?: { [propertyName: string]: string }; -} - -/** - * @class - * Initializes a new instance of the BuildArgument class. - * @constructor - * Properties of a build argument. - * - * @member {string} name The name of the argument. - * @member {string} value The value of the argument. - * @member {boolean} [isSecret] Flag to indicate whether the argument - * represents a secret and want to be removed from build logs. Default value: - * false . - */ -export interface BuildArgument { - name: string; - value: string; - isSecret?: boolean; -} - -/** - * @class - * Initializes a new instance of the SourceControlAuthInfo class. + * Initializes a new instance of the AuthInfo class. * @constructor * The authorization properties for accessing the source code repository. * - * @member {string} [tokenType] The type of Auth token. Possible values - * include: 'PAT', 'OAuth' + * @member {string} tokenType The type of Auth token. Possible values include: + * 'PAT', 'OAuth' * @member {string} token The access token used to access the source control * provider. * @member {string} [refreshToken] The refresh token used to refresh the access @@ -1200,8 +1219,8 @@ export interface BuildArgument { * @member {string} [scope] The scope of the access token. * @member {number} [expiresIn] Time in seconds that the token remains valid */ -export interface SourceControlAuthInfo { - tokenType?: string; +export interface AuthInfo { + tokenType: string; token: string; refreshToken?: string; scope?: string; @@ -1210,18 +1229,17 @@ export interface SourceControlAuthInfo { /** * @class - * Initializes a new instance of the SourceRepositoryProperties class. + * Initializes a new instance of the SourceProperties class. * @constructor * The properties of the source code repository. * * @member {string} sourceControlType The type of source control service. * Possible values include: 'Github', 'VisualStudioTeamService' * @member {string} repositoryUrl The full URL to the source code respository - * @member {boolean} [isCommitTriggerEnabled] The value of this property - * indicates whether the source control commit trigger is enabled or not. - * Default value: false . + * @member {string} [branch] The branch name of the source code. * @member {object} [sourceControlAuthProperties] The authorization properties - * for accessing the source code repository. + * for accessing the source code repository and to set up + * webhooks for notifications. * @member {string} [sourceControlAuthProperties.tokenType] The type of Auth * token. Possible values include: 'PAT', 'OAuth' * @member {string} [sourceControlAuthProperties.token] The access token used @@ -1233,39 +1251,32 @@ export interface SourceControlAuthInfo { * @member {number} [sourceControlAuthProperties.expiresIn] Time in seconds * that the token remains valid */ -export interface SourceRepositoryProperties { +export interface SourceProperties { sourceControlType: string; repositoryUrl: string; - isCommitTriggerEnabled?: boolean; - sourceControlAuthProperties?: SourceControlAuthInfo; + branch?: string; + sourceControlAuthProperties?: AuthInfo; } /** * @class - * Initializes a new instance of the BuildTask class. + * Initializes a new instance of the SourceTrigger class. * @constructor - * The build task that has the resource properties and all build items. The - * build task will have all information to schedule a build against it. + * The properties of a source based trigger. * - * @member {string} [provisioningState] The provisioning state of the build - * task. Possible values include: 'Creating', 'Updating', 'Deleting', - * 'Succeeded', 'Failed', 'Canceled' - * @member {date} [creationDate] The creation date of build task. - * @member {string} alias The alternative updatable name for a build task. - * @member {string} [status] The current status of build task. Possible values - * include: 'Disabled', 'Enabled' * @member {object} sourceRepository The properties that describes the - * source(code) for the build task. + * source(code) for the task. * @member {string} [sourceRepository.sourceControlType] The type of source * control service. Possible values include: 'Github', * 'VisualStudioTeamService' * @member {string} [sourceRepository.repositoryUrl] The full URL to the source * code respository - * @member {boolean} [sourceRepository.isCommitTriggerEnabled] The value of - * this property indicates whether the source control commit trigger is enabled - * or not. + * @member {string} [sourceRepository.branch] The branch name of the source + * code. * @member {object} [sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. + * authorization properties for accessing the source code repository and to set + * up + * webhooks for notifications. * @member {string} [sourceRepository.sourceControlAuthProperties.tokenType] * The type of Auth token. Possible values include: 'PAT', 'OAuth' * @member {string} [sourceRepository.sourceControlAuthProperties.token] The @@ -1276,44 +1287,180 @@ export interface SourceRepositoryProperties { * scope of the access token. * @member {number} [sourceRepository.sourceControlAuthProperties.expiresIn] * Time in seconds that the token remains valid - * @member {object} platform The platform properties against which the build - * has to happen. - * @member {string} [platform.osType] The operating system type required for - * the build. Possible values include: 'Windows', 'Linux' - * @member {number} [platform.cpu] The CPU configuration in terms of number of - * cores required for the build. - * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . + * @member {array} sourceTriggerEvents The source event corresponding to the + * trigger. + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ +export interface SourceTrigger { + sourceRepository: SourceProperties; + sourceTriggerEvents: string[]; + status?: string; + name: string; +} + +/** + * @class + * Initializes a new instance of the BaseImageTrigger class. + * @constructor + * The trigger based on base image dependency. + * + * @member {string} baseImageTriggerType The type of the auto trigger for base + * image dependency updates. Possible values include: 'All', 'Runtime' + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ +export interface BaseImageTrigger { + baseImageTriggerType: string; + status?: string; + name: string; +} + +/** + * @class + * Initializes a new instance of the TriggerProperties class. + * @constructor + * The properties of a build trigger. + * + * @member {array} [sourceTriggers] The collection of triggers based on source + * code repository. + * @member {object} [baseImageTrigger] The trigger based on base image + * dependencies. + * @member {string} [baseImageTrigger.baseImageTriggerType] The type of the + * auto trigger for base image dependency updates. Possible values include: + * 'All', 'Runtime' + * @member {string} [baseImageTrigger.status] The current status of build + * trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [baseImageTrigger.name] The name of the trigger. */ -export interface BuildTask extends Resource { +export interface TriggerProperties { + sourceTriggers?: SourceTrigger[]; + baseImageTrigger?: BaseImageTrigger; +} + +/** + * @class + * Initializes a new instance of the Task class. + * @constructor + * The task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it. + * + * @member {string} [provisioningState] The provisioning state of the task. + * Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + * 'Failed', 'Canceled' + * @member {date} [creationDate] The creation date of task. + * @member {string} [status] The current status of task. Possible values + * include: 'Disabled', 'Enabled' + * @member {object} platform The platform properties against which the run has + * to happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the run + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms of + * number of cores required for the run. + * @member {number} [timeout] Run timeout in seconds. Default value: 3600 . + * @member {object} step The properties of a task step. + * @member {array} [step.baseImageDependencies] List of base image dependencies + * for a step. + * @member {string} [step.type] Polymorphic Discriminator + * @member {object} [trigger] The properties that describe all triggers for the + * task. + * @member {array} [trigger.sourceTriggers] The collection of triggers based on + * source code repository. + * @member {object} [trigger.baseImageTrigger] The trigger based on base image + * dependencies. + * @member {string} [trigger.baseImageTrigger.baseImageTriggerType] The type of + * the auto trigger for base image dependency updates. Possible values include: + * 'All', 'Runtime' + * @member {string} [trigger.baseImageTrigger.status] The current status of + * build trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [trigger.baseImageTrigger.name] The name of the trigger. + */ +export interface Task extends Resource { readonly provisioningState?: string; readonly creationDate?: Date; - alias: string; status?: string; - sourceRepository: SourceRepositoryProperties; platform: PlatformProperties; + agentConfiguration?: AgentProperties; timeout?: number; + step: TaskStepProperties; + trigger?: TriggerProperties; +} + +/** + * @class + * Initializes a new instance of the 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 BuildTaskFilter class. + * Initializes a new instance of the AuthInfoUpdateParameters class. * @constructor - * The filter that can be used for listing build tasks. + * The authorization properties for accessing the source code repository. * - * @member {string} [alias] The alternative name for build task. + * @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 BuildTaskFilter { - alias?: string; +export interface AuthInfoUpdateParameters { + tokenType?: string; + token?: string; + refreshToken?: string; + scope?: string; + expiresIn?: number; } /** * @class - * Initializes a new instance of the SourceRepositoryUpdateParameters class. + * Initializes a new instance of the SourceUpdateParameters class. * @constructor - * The properties for updating the source code repository configuration. + * The properties for updating the source code repository. * + * @member {string} [sourceControlType] The type of source control service. + * Possible values include: 'Github', 'VisualStudioTeamService' + * @member {string} [repositoryUrl] The full URL to the source code respository + * @member {string} [branch] The branch name of the source code. * @member {object} [sourceControlAuthProperties] The authorization properties - * for accessing the source code repository. + * for accessing the source code repository and to set up + * webhooks for notifications. * @member {string} [sourceControlAuthProperties.tokenType] The type of Auth * token. Possible values include: 'PAT', 'OAuth' * @member {string} [sourceControlAuthProperties.token] The access token used @@ -1324,34 +1471,33 @@ export interface BuildTaskFilter { * token. * @member {number} [sourceControlAuthProperties.expiresIn] Time in seconds * that the token remains valid - * @member {boolean} [isCommitTriggerEnabled] The value of this property - * indicates whether the source control commit trigger is enabled or not. */ -export interface SourceRepositoryUpdateParameters { - sourceControlAuthProperties?: SourceControlAuthInfo; - isCommitTriggerEnabled?: boolean; +export interface SourceUpdateParameters { + sourceControlType?: string; + repositoryUrl?: string; + branch?: string; + sourceControlAuthProperties?: AuthInfoUpdateParameters; } /** * @class - * Initializes a new instance of the BuildTaskUpdateParameters class. + * Initializes a new instance of the SourceTriggerUpdateParameters class. * @constructor - * The parameters for updating a build task. + * The properties for updating a source based trigger. * - * @member {string} [alias] The alternative updatable name for a build task. - * @member {string} [status] The current status of build task. Possible values - * include: 'Disabled', 'Enabled' - * @member {object} [platform] The platform properties against which the build - * has to happen. - * @member {string} [platform.osType] The operating system type required for - * the build. Possible values include: 'Windows', 'Linux' - * @member {number} [platform.cpu] The CPU configuration in terms of number of - * cores required for the build. - * @member {number} [timeout] Build timeout in seconds. * @member {object} [sourceRepository] The properties that describes the - * source(code) for the build task. + * source(code) for the task. + * @member {string} [sourceRepository.sourceControlType] The type of source + * control service. Possible values include: 'Github', + * 'VisualStudioTeamService' + * @member {string} [sourceRepository.repositoryUrl] The full URL to the source + * code respository + * @member {string} [sourceRepository.branch] The branch name of the source + * code. * @member {object} [sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. + * authorization properties for accessing the source code repository and to set + * up + * webhooks for notifications. * @member {string} [sourceRepository.sourceControlAuthProperties.tokenType] * The type of Auth token. Possible values include: 'PAT', 'OAuth' * @member {string} [sourceRepository.sourceControlAuthProperties.token] The @@ -1362,66 +1508,278 @@ export interface SourceRepositoryUpdateParameters { * scope of the access token. * @member {number} [sourceRepository.sourceControlAuthProperties.expiresIn] * Time in seconds that the token remains valid - * @member {boolean} [sourceRepository.isCommitTriggerEnabled] The value of - * this property indicates whether the source control commit trigger is enabled - * or not. + * @member {array} [sourceTriggerEvents] The source event corresponding to the + * trigger. + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ +export interface SourceTriggerUpdateParameters { + sourceRepository?: SourceUpdateParameters; + sourceTriggerEvents?: string[]; + status?: string; + name: string; +} + +/** + * @class + * Initializes a new instance of the BaseImageTriggerUpdateParameters class. + * @constructor + * The properties for updating base image dependency trigger. + * + * @member {string} [baseImageTriggerType] The type of the auto trigger for + * base image dependency updates. Possible values include: 'All', 'Runtime' + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ +export interface BaseImageTriggerUpdateParameters { + baseImageTriggerType?: string; + status?: string; + name: string; +} + +/** + * @class + * Initializes a new instance of the TriggerUpdateParameters class. + * @constructor + * The properties for updating build triggers. + * + * @member {array} [sourceTriggers] The collection of triggers based on source + * code repository. + * @member {object} [baseImageTrigger] The trigger based on base image + * dependencies. + * @member {string} [baseImageTrigger.baseImageTriggerType] The type of the + * auto trigger for base image dependency updates. Possible values include: + * 'All', 'Runtime' + * @member {string} [baseImageTrigger.status] The current status of build + * trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [baseImageTrigger.name] The name of the trigger. + */ +export interface TriggerUpdateParameters { + sourceTriggers?: SourceTriggerUpdateParameters[]; + baseImageTrigger?: BaseImageTriggerUpdateParameters; +} + +/** + * @class + * Initializes a new instance of the TaskUpdateParameters class. + * @constructor + * The parameters for updating a task. + * + * @member {string} [status] The current status of task. Possible values + * include: 'Disabled', 'Enabled' + * @member {object} [platform] The platform properties against which the run + * has to happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the run + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms of + * number of cores required for the run. + * @member {number} [timeout] Run timeout in seconds. + * @member {object} [step] The properties for updating a task step. + * @member {string} [step.type] Polymorphic Discriminator + * @member {object} [trigger] The properties for updating trigger properties. + * @member {array} [trigger.sourceTriggers] The collection of triggers based on + * source code repository. + * @member {object} [trigger.baseImageTrigger] The trigger based on base image + * dependencies. + * @member {string} [trigger.baseImageTrigger.baseImageTriggerType] The type of + * the auto trigger for base image dependency updates. Possible values include: + * 'All', 'Runtime' + * @member {string} [trigger.baseImageTrigger.status] The current status of + * build trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [trigger.baseImageTrigger.name] The name of the trigger. * @member {object} [tags] The ARM resource tags. */ -export interface BuildTaskUpdateParameters { - alias?: string; +export interface TaskUpdateParameters { status?: string; - platform?: PlatformProperties; + platform?: PlatformUpdateParameters; + agentConfiguration?: AgentProperties; timeout?: number; - sourceRepository?: SourceRepositoryUpdateParameters; + step?: TaskStepUpdateParameters; + trigger?: TriggerUpdateParameters; tags?: { [propertyName: string]: string }; } /** * @class - * Initializes a new instance of the QueueBuildRequest class. + * Initializes a new instance of the Argument class. * @constructor - * The queue build request parameters. + * The properties of a run argument. * - * @member {string} type Polymorphic Discriminator + * @member {string} name The name of the argument. + * @member {string} value The value of the argument. + * @member {boolean} [isSecret] Flag to indicate whether the argument + * represents a secret and want to be removed from build logs. Default value: + * false . */ -export interface QueueBuildRequest { - type: string; +export interface Argument { + name: string; + value: string; + isSecret?: boolean; } /** * @class - * Initializes a new instance of the SourceUploadDefinition class. + * Initializes a new instance of the DockerBuildRequest class. * @constructor - * The properties of a response to source upload request. + * The parameters for a docker quick build. * - * @member {string} [uploadUrl] The URL where the client can upload the source. - * @member {string} [relativePath] The relative path to the source. This is - * used to submit the subsequent queue build request. + * @member {array} [imageNames] The fully qualified image names including the + * repository and tag. + * @member {boolean} [isPushEnabled] The value of this property indicates + * whether the image built should be pushed to the registry or not. Default + * value: true . + * @member {boolean} [noCache] The value of this property indicates whether the + * image cache is enabled or not. Default value: false . + * @member {string} dockerFilePath The Docker file path relative to the source + * location. + * @member {array} [argumentsProperty] The collection of override arguments to + * be used when executing the run. + * @member {string} sourceLocation The URL(absolute or relative) of the source + * that needs to be built. For Docker build, it can be an URL to a tar or + * github repoistory as supported by Docker. + * If it is relative URL, the relative path should be obtained from calling + * getSourceUploadUrl API. + * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . + * @member {object} platform The platform properties against which the build + * will happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the build + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms of + * number of cores required for the run. + */ +export interface DockerBuildRequest extends RunRequest { + imageNames?: string[]; + isPushEnabled?: boolean; + noCache?: boolean; + dockerFilePath: string; + argumentsProperty?: Argument[]; + sourceLocation: string; + timeout?: number; + platform: PlatformProperties; + agentConfiguration?: AgentProperties; +} + +/** + * @class + * Initializes a new instance of the SetValue class. + * @constructor + * The properties of a overridable value that can be passed to a task template. + * + * @member {string} name The name of the overridable value. + * @member {string} value The overridable value. + * @member {boolean} [isSecret] Flag to indicate whether the value represents a + * secret or not. Default value: false . */ -export interface SourceUploadDefinition { - uploadUrl?: string; - relativePath?: string; +export interface SetValue { + name: string; + value: string; + isSecret?: boolean; } /** * @class - * Initializes a new instance of the BaseImageDependency class. + * Initializes a new instance of the FileTaskRunRequest class. * @constructor - * Properties that describe a base image dependency. + * The request parameters for a scheduling run against a task file. * - * @member {string} [type] The type of the base image dependency. Possible - * values include: 'BuildTime', 'RunTime' - * @member {string} [registry] The registry login server. - * @member {string} [repository] The repository name. - * @member {string} [tag] The tag name. - * @member {string} [digest] The sha256-based digest of the image manifest. + * @member {string} taskFilePath The template/definition file path relative to + * the source. + * @member {string} [valuesFilePath] The values/parameters file path relative + * to the source. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {string} sourceLocation The URL(absolute or relative) of the source + * that needs to be built. For Docker build, it can be an URL to a tar or + * github repoistory as supported by Docker. + * If it is relative URL, the relative path should be obtained from calling + * getSourceUploadUrl API. + * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . + * @member {object} platform The platform properties against which the build + * will happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the build + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms of + * number of cores required for the run. + */ +export interface FileTaskRunRequest extends RunRequest { + taskFilePath: string; + valuesFilePath?: string; + values?: SetValue[]; + sourceLocation: string; + timeout?: number; + platform: PlatformProperties; + agentConfiguration?: AgentProperties; +} + +/** + * @class + * Initializes a new instance of the TaskRunRequest class. + * @constructor + * The parameters for a task run request. + * + * @member {string} taskName The name of task against which run has to be + * queued. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. */ -export interface BaseImageDependency { - type?: string; - registry?: string; - repository?: string; - tag?: string; - digest?: string; +export interface TaskRunRequest extends RunRequest { + taskName: string; + values?: SetValue[]; +} + +/** + * @class + * Initializes a new instance of the EncodedTaskRunRequest class. + * @constructor + * The parameters for a quick task run request. + * + * @member {string} encodedTaskContent Base64 encoded value of the + * template/definition file content. + * @member {string} [encodedValuesContent] Base64 encoded value of the + * parameters/values file content. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . + * @member {object} platform The platform properties against which the build + * will happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the build + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms of + * number of cores required for the run. + */ +export interface EncodedTaskRunRequest extends RunRequest { + encodedTaskContent: string; + encodedValuesContent?: string; + values?: SetValue[]; + timeout?: number; + platform: PlatformProperties; + agentConfiguration?: AgentProperties; } /** @@ -1430,7 +1788,6 @@ export interface BaseImageDependency { * @constructor * The Docker build step. * - * @member {string} [branch] The repository branch name. * @member {array} [imageNames] The fully qualified image names including the * repository and tag. * @member {boolean} [isPushEnabled] The value of this property indicates @@ -1438,27 +1795,65 @@ export interface BaseImageDependency { * value: true . * @member {boolean} [noCache] The value of this property indicates whether the * image cache is enabled or not. Default value: false . - * @member {string} [dockerFilePath] The Docker file path relative to the - * source control root. - * @member {string} [contextPath] The relative context path for a docker build - * in the source. - * @member {array} [buildArguments] The custom arguments for building this - * build step. - * @member {array} [baseImageDependencies] List of base image dependencies for - * a step. - * @member {string} [baseImageTrigger] The type of the auto trigger for base - * image dependency updates. Possible values include: 'All', 'Runtime', 'None' - */ -export interface DockerBuildStep extends BuildStepProperties { - branch?: string; + * @member {string} dockerFilePath The Docker file path relative to the source + * context. + * @member {array} [argumentsProperty] The collection of override arguments to + * be used when executing this build step. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository URL + * of the build task. + */ +export interface DockerBuildStep extends TaskStepProperties { imageNames?: string[]; isPushEnabled?: boolean; noCache?: boolean; - dockerFilePath?: string; + dockerFilePath: string; + argumentsProperty?: Argument[]; + contextPath?: string; +} + +/** + * @class + * Initializes a new instance of the FileTaskStep class. + * @constructor + * The properties of a task step. + * + * @member {string} taskFilePath The task template/definition file path + * relative to the source context. + * @member {string} [valuesFilePath] The task values/parameters file path + * relative to the source context. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository URL + * of the build task. + */ +export interface FileTaskStep extends TaskStepProperties { + taskFilePath: string; + valuesFilePath?: string; + values?: SetValue[]; contextPath?: string; - buildArguments?: BuildArgument[]; - readonly baseImageDependencies?: BaseImageDependency[]; - baseImageTrigger?: string; +} + +/** + * @class + * Initializes a new instance of the EncodedTaskStep class. + * @constructor + * The properties of a encoded task step. + * + * @member {string} encodedTaskContent Base64 encoded value of the + * template/definition file content. + * @member {string} [encodedValuesContent] 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 EncodedTaskStep extends TaskStepProperties { + encodedTaskContent: string; + encodedValuesContent?: string; + values?: SetValue[]; } /** @@ -1467,7 +1862,6 @@ export interface DockerBuildStep extends BuildStepProperties { * @constructor * The properties for updating a docker build step. * - * @member {string} [branch] The repository branch name. * @member {array} [imageNames] The fully qualified image names including the * repository and tag. * @member {boolean} [isPushEnabled] The value of this property indicates @@ -1475,77 +1869,64 @@ export interface DockerBuildStep extends BuildStepProperties { * @member {boolean} [noCache] The value of this property indicates whether the * image cache is enabled or not. * @member {string} [dockerFilePath] The Docker file path relative to the - * source control root. - * @member {string} [contextPath] The relative context path for a docker build - * in the source. - * @member {array} [buildArguments] The custom arguments for building this - * build step. - * @member {string} [baseImageTrigger] The type of the auto trigger for base - * image dependency updates. Possible values include: 'All', 'Runtime', 'None' - */ -export interface DockerBuildStepUpdateParameters extends BuildStepPropertiesUpdateParameters { - branch?: string; + * source context. + * @member {array} [argumentsProperty] The collection of override arguments to + * be used when executing this build step. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository URL + * of the build task. + */ +export interface DockerBuildStepUpdateParameters extends TaskStepUpdateParameters { imageNames?: string[]; isPushEnabled?: boolean; noCache?: boolean; dockerFilePath?: string; + argumentsProperty?: Argument[]; contextPath?: string; - buildArguments?: BuildArgument[]; - baseImageTrigger?: string; } /** * @class - * Initializes a new instance of the BuildTaskBuildRequest class. + * Initializes a new instance of the FileTaskStepUpdateParameters class. * @constructor - * The queue build parameters based on a build task. + * The properties of updating a task step. * - * @member {string} buildTaskName The name of build task against which build - * has to be queued. + * @member {string} [taskFilePath] The task template/definition file path + * relative to the source context. + * @member {string} [valuesFilePath] The values/parameters file path relative + * to the source context. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + * @member {string} [contextPath] The URL(absolute or relative) of the source + * context for the build task. + * If it is relative, the context will be relative to the source repository URL + * of the build task. */ -export interface BuildTaskBuildRequest extends QueueBuildRequest { - buildTaskName: string; +export interface FileTaskStepUpdateParameters extends TaskStepUpdateParameters { + taskFilePath?: string; + valuesFilePath?: string; + values?: SetValue[]; + contextPath?: string; } /** * @class - * Initializes a new instance of the QuickBuildRequest class. + * Initializes a new instance of the EncodedTaskStepUpdateParameters class. * @constructor - * The queue build request parameters for a quick build. + * The properties for updating encoded task step. * - * @member {array} [imageNames] The fully qualified image names including the - * repository and tag. - * @member {string} sourceLocation The URL(absolute or relative) of the source - * that needs to be built. For Docker build, it can be an URL to a tar or - * github repoistory as supported by Docker. - * If it is relative URL, the relative path should be obtained from calling - * getSourceUploadUrl API. - * @member {array} [buildArguments] The collection of build arguments to be - * used. - * @member {boolean} [isPushEnabled] The value of this property indicates - * whether the image built should be pushed to the registry or not. Default - * value: true . - * @member {boolean} [noCache] The value of this property indicates whether the - * image cache is enabled or not. Default value: false . - * @member {number} [timeout] Build timeout in seconds. Default value: 3600 . - * @member {object} platform The platform properties against which the build - * will happen. - * @member {string} [platform.osType] The operating system type required for - * the build. Possible values include: 'Windows', 'Linux' - * @member {number} [platform.cpu] The CPU configuration in terms of number of - * cores required for the build. - * @member {string} dockerFilePath The Docker file path relative to the source - * location. + * @member {string} [encodedTaskContent] Base64 encoded value of the + * template/definition file content. + * @member {string} [encodedValuesContent] Base64 encoded value of the + * parameters/values file content. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. */ -export interface QuickBuildRequest extends QueueBuildRequest { - imageNames?: string[]; - sourceLocation: string; - buildArguments?: BuildArgument[]; - isPushEnabled?: boolean; - noCache?: boolean; - timeout?: number; - platform: PlatformProperties; - dockerFilePath: string; +export interface EncodedTaskStepUpdateParameters extends TaskStepUpdateParameters { + encodedTaskContent?: string; + encodedValuesContent?: string; + values?: SetValue[]; } @@ -1616,52 +1997,26 @@ export interface EventListResult extends Array { /** * @class - * Initializes a new instance of the BuildListResult class. - * @constructor - * Collection of builds. - * - * @member {string} [nextLink] The URI that can be used to request the next set - * of paged results. - */ -export interface BuildListResult extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the BuildStepList class. - * @constructor - * The collection of build items. - * - * @member {string} [nextLink] The URI that can be used to request the next set - * of paged results. - */ -export interface BuildStepList extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the BuildArgumentList class. + * Initializes a new instance of the RunListResult class. * @constructor - * The list of build arguments for a build step. + * Collection of runs. * * @member {string} [nextLink] The URI that can be used to request the next set * of paged results. */ -export interface BuildArgumentList extends Array { +export interface RunListResult extends Array { nextLink?: string; } /** * @class - * Initializes a new instance of the BuildTaskListResult class. + * Initializes a new instance of the TaskListResult class. * @constructor - * The collection of build tasks. + * The collection of tasks. * * @member {string} [nextLink] The URI that can be used to request the next set * of paged results. */ -export interface BuildTaskListResult extends Array { +export interface TaskListResult extends Array { nextLink?: string; } diff --git a/lib/services/containerRegistryManagement/lib/models/index.js b/lib/services/containerRegistryManagement/lib/models/index.js index 3b9552475c..251e5a95fe 100644 --- a/lib/services/containerRegistryManagement/lib/models/index.js +++ b/lib/services/containerRegistryManagement/lib/models/index.js @@ -55,48 +55,65 @@ exports.EventContent = require('./eventContent'); exports.EventRequestMessage = require('./eventRequestMessage'); exports.EventResponseMessage = require('./eventResponseMessage'); exports.Event = require('./event'); +exports.RunRequest = require('./runRequest'); exports.ImageDescriptor = require('./imageDescriptor'); exports.ImageUpdateTrigger = require('./imageUpdateTrigger'); -exports.GitCommitTrigger = require('./gitCommitTrigger'); +exports.SourceTriggerDescriptor = require('./sourceTriggerDescriptor'); exports.PlatformProperties = require('./platformProperties'); +exports.AgentProperties = require('./agentProperties'); exports.ProxyResource = require('./proxyResource'); -exports.Build = require('./build'); -exports.BuildFilter = require('./buildFilter'); -exports.BuildUpdateParameters = require('./buildUpdateParameters'); -exports.BuildGetLogResult = require('./buildGetLogResult'); -exports.BuildStepProperties = require('./buildStepProperties'); -exports.BuildStep = require('./buildStep'); -exports.BuildStepPropertiesUpdateParameters = require('./buildStepPropertiesUpdateParameters'); -exports.BuildStepUpdateParameters = require('./buildStepUpdateParameters'); -exports.BuildArgument = require('./buildArgument'); -exports.SourceControlAuthInfo = require('./sourceControlAuthInfo'); -exports.SourceRepositoryProperties = require('./sourceRepositoryProperties'); -exports.BuildTask = require('./buildTask'); -exports.BuildTaskFilter = require('./buildTaskFilter'); -exports.SourceRepositoryUpdateParameters = require('./sourceRepositoryUpdateParameters'); -exports.BuildTaskUpdateParameters = require('./buildTaskUpdateParameters'); -exports.QueueBuildRequest = require('./queueBuildRequest'); +exports.Run = require('./run'); exports.SourceUploadDefinition = require('./sourceUploadDefinition'); +exports.RunFilter = require('./runFilter'); +exports.RunUpdateParameters = require('./runUpdateParameters'); +exports.RunGetLogResult = require('./runGetLogResult'); exports.BaseImageDependency = require('./baseImageDependency'); +exports.TaskStepProperties = require('./taskStepProperties'); +exports.AuthInfo = require('./authInfo'); +exports.SourceProperties = require('./sourceProperties'); +exports.SourceTrigger = require('./sourceTrigger'); +exports.BaseImageTrigger = require('./baseImageTrigger'); +exports.TriggerProperties = require('./triggerProperties'); +exports.Task = require('./task'); +exports.PlatformUpdateParameters = require('./platformUpdateParameters'); +exports.TaskStepUpdateParameters = require('./taskStepUpdateParameters'); +exports.AuthInfoUpdateParameters = require('./authInfoUpdateParameters'); +exports.SourceUpdateParameters = require('./sourceUpdateParameters'); +exports.SourceTriggerUpdateParameters = require('./sourceTriggerUpdateParameters'); +exports.BaseImageTriggerUpdateParameters = require('./baseImageTriggerUpdateParameters'); +exports.TriggerUpdateParameters = require('./triggerUpdateParameters'); +exports.TaskUpdateParameters = require('./taskUpdateParameters'); +exports.Argument = require('./argument'); +exports.DockerBuildRequest = require('./dockerBuildRequest'); +exports.SetValue = require('./setValue'); +exports.FileTaskRunRequest = require('./fileTaskRunRequest'); +exports.TaskRunRequest = require('./taskRunRequest'); +exports.EncodedTaskRunRequest = require('./encodedTaskRunRequest'); exports.DockerBuildStep = require('./dockerBuildStep'); +exports.FileTaskStep = require('./fileTaskStep'); +exports.EncodedTaskStep = require('./encodedTaskStep'); exports.DockerBuildStepUpdateParameters = require('./dockerBuildStepUpdateParameters'); -exports.BuildTaskBuildRequest = require('./buildTaskBuildRequest'); -exports.QuickBuildRequest = require('./quickBuildRequest'); +exports.FileTaskStepUpdateParameters = require('./fileTaskStepUpdateParameters'); +exports.EncodedTaskStepUpdateParameters = require('./encodedTaskStepUpdateParameters'); exports.RegistryListResult = require('./registryListResult'); exports.OperationListResult = require('./operationListResult'); exports.ReplicationListResult = require('./replicationListResult'); exports.WebhookListResult = require('./webhookListResult'); exports.EventListResult = require('./eventListResult'); -exports.BuildListResult = require('./buildListResult'); -exports.BuildStepList = require('./buildStepList'); -exports.BuildArgumentList = require('./buildArgumentList'); -exports.BuildTaskListResult = require('./buildTaskListResult'); +exports.RunListResult = require('./runListResult'); +exports.TaskListResult = require('./taskListResult'); exports.discriminators = { - 'BuildStepProperties' : exports.BuildStepProperties, - 'BuildStepPropertiesUpdateParameters' : exports.BuildStepPropertiesUpdateParameters, - 'QueueBuildRequest' : exports.QueueBuildRequest, - 'BuildStepProperties.Docker' : exports.DockerBuildStep, - 'BuildStepPropertiesUpdateParameters.Docker' : exports.DockerBuildStepUpdateParameters, - 'QueueBuildRequest.BuildTask' : exports.BuildTaskBuildRequest, - 'QueueBuildRequest.QuickBuild' : exports.QuickBuildRequest + 'RunRequest' : exports.RunRequest, + 'TaskStepProperties' : exports.TaskStepProperties, + 'TaskStepUpdateParameters' : exports.TaskStepUpdateParameters, + 'RunRequest.DockerBuildRequest' : exports.DockerBuildRequest, + 'RunRequest.FileTaskRunRequest' : exports.FileTaskRunRequest, + 'RunRequest.TaskRunRequest' : exports.TaskRunRequest, + 'RunRequest.EncodedTaskRunRequest' : exports.EncodedTaskRunRequest, + 'TaskStepProperties.Docker' : exports.DockerBuildStep, + 'TaskStepProperties.FileTask' : exports.FileTaskStep, + 'TaskStepProperties.EncodedTask' : exports.EncodedTaskStep, + 'TaskStepUpdateParameters.Docker' : exports.DockerBuildStepUpdateParameters, + 'TaskStepUpdateParameters.FileTask' : exports.FileTaskStepUpdateParameters, + 'TaskStepUpdateParameters.EncodedTask' : exports.EncodedTaskStepUpdateParameters }; diff --git a/lib/services/containerRegistryManagement/lib/models/platformProperties.js b/lib/services/containerRegistryManagement/lib/models/platformProperties.js index 1199942297..a3c90aba84 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: false, - serializedName: 'cpu', + serializedName: 'architecture', type: { - name: 'Number' + name: 'String' + } + }, + variant: { + required: false, + serializedName: 'variant', + type: { + name: 'String' } } } diff --git a/lib/services/containerRegistryManagement/lib/models/platformUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/platformUpdateParameters.js new file mode 100644 index 0000000000..df811ebf64 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/platformUpdateParameters.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The properties for updating the platform configuration. + * + */ +class PlatformUpdateParameters { + /** + * Create a PlatformUpdateParameters. + * @member {string} [os] The operating system type required for the run. + * Possible values include: 'Windows', 'Linux' + * @member {string} [architecture] The OS architecture. Possible values + * include: 'amd64', 'x86', 'arm' + * @member {string} [variant] Variant of the CPU. Possible values include: + * 'v6', 'v7', 'v8' + */ + constructor() { + } + + /** + * Defines the metadata of PlatformUpdateParameters + * + * @returns {object} metadata of PlatformUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'PlatformUpdateParameters', + type: { + name: 'Composite', + className: 'PlatformUpdateParameters', + modelProperties: { + os: { + required: false, + serializedName: 'os', + type: { + name: 'String' + } + }, + architecture: { + required: false, + serializedName: 'architecture', + type: { + name: 'String' + } + }, + variant: { + required: false, + serializedName: 'variant', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PlatformUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/run.js b/lib/services/containerRegistryManagement/lib/models/run.js new file mode 100644 index 0000000000..d7de25ecfa --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/run.js @@ -0,0 +1,239 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Run resource properties + * + * @extends models['ProxyResource'] + */ +class Run extends models['ProxyResource'] { + /** + * Create a Run. + * @member {string} [runId] The unique identifier for the run. + * @member {string} [status] The current status of the run. Possible values + * include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', + * 'Canceled', 'Error', 'Timeout' + * @member {date} [lastUpdatedTime] The last updated time for the run. + * @member {string} [runType] The type of run. Possible values include: + * 'QuickBuild', 'AutoBuild' + * @member {date} [createTime] The time the run was scheduled. + * @member {date} [startTime] The time the run started. + * @member {date} [finishTime] The time the run finished. + * @member {array} [outputImages] The list of all images that were generated + * from the run. This is applicable if the run is of type Build. + * @member {string} [task] The task against which run was scheduled. + * @member {object} [imageUpdateTrigger] The image update trigger that caused + * the run. This is applicable if the task is of build type. + * @member {string} [imageUpdateTrigger.id] The unique ID of the trigger. + * @member {date} [imageUpdateTrigger.timestamp] The timestamp when the image + * update happened. + * @member {array} [imageUpdateTrigger.images] The list of image updates that + * caused the build. + * @member {object} [sourceTrigger] The source trigger that caused the run. + * @member {string} [sourceTrigger.id] The unique ID of the trigger. + * @member {string} [sourceTrigger.eventType] The event type of the trigger. + * @member {string} [sourceTrigger.commitId] The unique ID that identifies a + * commit. + * @member {string} [sourceTrigger.pullRequestId] The unique ID that + * identifies pull request. + * @member {string} [sourceTrigger.repositoryUrl] The repository URL. + * @member {string} [sourceTrigger.branchName] The branch name in the + * repository. + * @member {string} [sourceTrigger.providerType] The source control provider + * type. + * @member {boolean} [isArchiveEnabled] The value that indicates whether + * archiving is enabled or not. Default value: false . + * @member {object} [platform] The platform properties against which the run + * will happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the run + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms + * of number of cores required for the run. + * @member {string} [provisioningState] The provisioning state of a run. + * Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + * 'Failed', 'Canceled' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Run + * + * @returns {object} metadata of Run + * + */ + mapper() { + return { + required: false, + serializedName: 'Run', + type: { + name: 'Composite', + className: 'Run', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + runId: { + required: false, + serializedName: 'properties.runId', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + lastUpdatedTime: { + required: false, + serializedName: 'properties.lastUpdatedTime', + type: { + name: 'DateTime' + } + }, + runType: { + required: false, + serializedName: 'properties.runType', + type: { + name: 'String' + } + }, + createTime: { + required: false, + serializedName: 'properties.createTime', + type: { + name: 'DateTime' + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + finishTime: { + required: false, + serializedName: 'properties.finishTime', + type: { + name: 'DateTime' + } + }, + outputImages: { + required: false, + serializedName: 'properties.outputImages', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ImageDescriptorElementType', + type: { + name: 'Composite', + className: 'ImageDescriptor' + } + } + } + }, + task: { + required: false, + serializedName: 'properties.task', + type: { + name: 'String' + } + }, + imageUpdateTrigger: { + required: false, + serializedName: 'properties.imageUpdateTrigger', + type: { + name: 'Composite', + className: 'ImageUpdateTrigger' + } + }, + sourceTrigger: { + required: false, + serializedName: 'properties.sourceTrigger', + type: { + name: 'Composite', + className: 'SourceTriggerDescriptor' + } + }, + isArchiveEnabled: { + required: false, + serializedName: 'properties.isArchiveEnabled', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + platform: { + required: false, + serializedName: 'properties.platform', + type: { + name: 'Composite', + className: 'PlatformProperties' + } + }, + agentConfiguration: { + required: false, + serializedName: 'properties.agentConfiguration', + type: { + name: 'Composite', + className: 'AgentProperties' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Run; diff --git a/lib/services/containerRegistryManagement/lib/models/runFilter.js b/lib/services/containerRegistryManagement/lib/models/runFilter.js new file mode 100644 index 0000000000..3a4434f1ab --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/runFilter.js @@ -0,0 +1,116 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Properties that are enabled for Odata querying on runs. + * + */ +class RunFilter { + /** + * Create a RunFilter. + * @member {string} [runId] The unique identifier for the run. + * @member {string} [runType] The type of run. Possible values include: + * 'QuickBuild', 'AutoBuild' + * @member {string} [status] The current status of the run. Possible values + * include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', + * 'Canceled', 'Error', 'Timeout' + * @member {date} [createTime] The create time for a run. + * @member {date} [finishTime] The time the run finished. + * @member {string} [outputImageManifests] The list of comma-separated image + * manifests that were generated from the run. This is applicable if the run + * is of + * build type. + * @member {boolean} [isArchiveEnabled] The value that indicates whether + * archiving is enabled or not. + * @member {string} [taskName] The name of the task that the run corresponds + * to. + */ + constructor() { + } + + /** + * Defines the metadata of RunFilter + * + * @returns {object} metadata of RunFilter + * + */ + mapper() { + return { + required: false, + serializedName: 'RunFilter', + type: { + name: 'Composite', + className: 'RunFilter', + modelProperties: { + runId: { + required: false, + serializedName: 'runId', + type: { + name: 'String' + } + }, + runType: { + required: false, + serializedName: 'runType', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + createTime: { + required: false, + serializedName: 'createTime', + type: { + name: 'DateTime' + } + }, + finishTime: { + required: false, + serializedName: 'finishTime', + type: { + name: 'DateTime' + } + }, + outputImageManifests: { + required: false, + serializedName: 'outputImageManifests', + type: { + name: 'String' + } + }, + isArchiveEnabled: { + required: false, + serializedName: 'isArchiveEnabled', + type: { + name: 'Boolean' + } + }, + taskName: { + required: false, + serializedName: 'taskName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RunFilter; diff --git a/lib/services/containerRegistryManagement/lib/models/runGetLogResult.js b/lib/services/containerRegistryManagement/lib/models/runGetLogResult.js new file mode 100644 index 0000000000..afe8df834e --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/runGetLogResult.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The result of get log link operation. + * + */ +class RunGetLogResult { + /** + * Create a RunGetLogResult. + * @member {string} [logLink] The link to logs for a run on a azure container + * registry. + */ + constructor() { + } + + /** + * Defines the metadata of RunGetLogResult + * + * @returns {object} metadata of RunGetLogResult + * + */ + mapper() { + return { + required: false, + serializedName: 'RunGetLogResult', + type: { + name: 'Composite', + className: 'RunGetLogResult', + modelProperties: { + logLink: { + required: false, + serializedName: 'logLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RunGetLogResult; diff --git a/lib/services/containerRegistryManagement/lib/models/runListResult.js b/lib/services/containerRegistryManagement/lib/models/runListResult.js new file mode 100644 index 0000000000..6052c64db3 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/runListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Collection of runs. + */ +class RunListResult extends Array { + /** + * Create a RunListResult. + * @member {string} [nextLink] The URI that can be used to request the next + * set of paged results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RunListResult + * + * @returns {object} metadata of RunListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'RunListResult', + type: { + name: 'Composite', + className: 'RunListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'RunElementType', + type: { + name: 'Composite', + className: 'Run' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RunListResult; diff --git a/lib/services/containerRegistryManagement/lib/models/runRequest.js b/lib/services/containerRegistryManagement/lib/models/runRequest.js new file mode 100644 index 0000000000..c5cb76253c --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/runRequest.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The request parameters for scheduling a run. + * + */ +class RunRequest { + /** + * Create a RunRequest. + * @member {boolean} [isArchiveEnabled] The value that indicates whether + * archiving is enabled for the run or not. Default value: false . + * @member {string} type Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of RunRequest + * + * @returns {object} metadata of RunRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'RunRequest', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'RunRequest', + className: 'RunRequest', + modelProperties: { + isArchiveEnabled: { + required: false, + serializedName: 'isArchiveEnabled', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RunRequest; diff --git a/lib/services/containerRegistryManagement/lib/models/runUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/runUpdateParameters.js new file mode 100644 index 0000000000..1ebbe3fff1 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/runUpdateParameters.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The set of run properties that can be updated. + * + */ +class RunUpdateParameters { + /** + * Create a RunUpdateParameters. + * @member {boolean} [isArchiveEnabled] The value that indicates whether + * archiving is enabled or not. + */ + constructor() { + } + + /** + * Defines the metadata of RunUpdateParameters + * + * @returns {object} metadata of RunUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'RunUpdateParameters', + type: { + name: 'Composite', + className: 'RunUpdateParameters', + modelProperties: { + isArchiveEnabled: { + required: false, + serializedName: 'isArchiveEnabled', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = RunUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/setValue.js b/lib/services/containerRegistryManagement/lib/models/setValue.js new file mode 100644 index 0000000000..c0937b1aea --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/setValue.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The properties of a overridable value that can be passed to a task template. + * + */ +class SetValue { + /** + * Create a SetValue. + * @member {string} name The name of the overridable value. + * @member {string} value The overridable value. + * @member {boolean} [isSecret] Flag to indicate whether the value represents + * a secret or not. Default value: false . + */ + constructor() { + } + + /** + * Defines the metadata of SetValue + * + * @returns {object} metadata of SetValue + * + */ + mapper() { + return { + required: false, + serializedName: 'SetValue', + type: { + name: 'Composite', + className: 'SetValue', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: true, + serializedName: 'value', + type: { + name: 'String' + } + }, + isSecret: { + required: false, + serializedName: 'isSecret', + defaultValue: false, + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = SetValue; diff --git a/lib/services/containerRegistryManagement/lib/models/sourceProperties.js b/lib/services/containerRegistryManagement/lib/models/sourceProperties.js new file mode 100644 index 0000000000..fb0c311ee6 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/sourceProperties.js @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties of the source code repository. + * + */ +class SourceProperties { + /** + * Create a SourceProperties. + * @member {string} sourceControlType The type of source control service. + * Possible values include: 'Github', 'VisualStudioTeamService' + * @member {string} repositoryUrl The full URL to the source code respository + * @member {string} [branch] The branch name of the source code. + * @member {object} [sourceControlAuthProperties] The authorization + * properties for accessing the source code repository and to set up + * webhooks for notifications. + * @member {string} [sourceControlAuthProperties.tokenType] The type of Auth + * token. Possible values include: 'PAT', 'OAuth' + * @member {string} [sourceControlAuthProperties.token] The access token used + * to access the source control provider. + * @member {string} [sourceControlAuthProperties.refreshToken] The refresh + * token used to refresh the access token. + * @member {string} [sourceControlAuthProperties.scope] The scope of the + * access token. + * @member {number} [sourceControlAuthProperties.expiresIn] Time in seconds + * that the token remains valid + */ + constructor() { + } + + /** + * Defines the metadata of SourceProperties + * + * @returns {object} metadata of SourceProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceProperties', + type: { + name: 'Composite', + className: 'SourceProperties', + modelProperties: { + sourceControlType: { + required: true, + serializedName: 'sourceControlType', + type: { + name: 'String' + } + }, + repositoryUrl: { + required: true, + serializedName: 'repositoryUrl', + type: { + name: 'String' + } + }, + branch: { + required: false, + serializedName: 'branch', + type: { + name: 'String' + } + }, + sourceControlAuthProperties: { + required: false, + serializedName: 'sourceControlAuthProperties', + type: { + name: 'Composite', + className: 'AuthInfo' + } + } + } + } + }; + } +} + +module.exports = SourceProperties; diff --git a/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js b/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js new file mode 100644 index 0000000000..44436f1fb2 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js @@ -0,0 +1,111 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties of a source based trigger. + * + */ +class SourceTrigger { + /** + * Create a SourceTrigger. + * @member {object} sourceRepository The properties that describes the + * source(code) for the task. + * @member {string} [sourceRepository.sourceControlType] The type of source + * control service. Possible values include: 'Github', + * 'VisualStudioTeamService' + * @member {string} [sourceRepository.repositoryUrl] The full URL to the + * source code respository + * @member {string} [sourceRepository.branch] The branch name of the source + * code. + * @member {object} [sourceRepository.sourceControlAuthProperties] The + * authorization properties for accessing the source code repository and to + * set up + * webhooks for notifications. + * @member {string} [sourceRepository.sourceControlAuthProperties.tokenType] + * The type of Auth token. Possible values include: 'PAT', 'OAuth' + * @member {string} [sourceRepository.sourceControlAuthProperties.token] The + * access token used to access the source control provider. + * @member {string} + * [sourceRepository.sourceControlAuthProperties.refreshToken] The refresh + * token used to refresh the access token. + * @member {string} [sourceRepository.sourceControlAuthProperties.scope] The + * scope of the access token. + * @member {number} [sourceRepository.sourceControlAuthProperties.expiresIn] + * Time in seconds that the token remains valid + * @member {array} sourceTriggerEvents The source event corresponding to the + * trigger. + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ + constructor() { + } + + /** + * Defines the metadata of SourceTrigger + * + * @returns {object} metadata of SourceTrigger + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceTrigger', + type: { + name: 'Composite', + className: 'SourceTrigger', + modelProperties: { + sourceRepository: { + required: true, + serializedName: 'sourceRepository', + type: { + name: 'Composite', + className: 'SourceProperties' + } + }, + sourceTriggerEvents: { + required: true, + serializedName: 'sourceTriggerEvents', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SourceTriggerEventElementType', + type: { + name: 'String' + } + } + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceTrigger; diff --git a/lib/services/containerRegistryManagement/lib/models/sourceTriggerDescriptor.js b/lib/services/containerRegistryManagement/lib/models/sourceTriggerDescriptor.js new file mode 100644 index 0000000000..6bf83c3d08 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/sourceTriggerDescriptor.js @@ -0,0 +1,101 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The source trigger that caused a run. + * + */ +class SourceTriggerDescriptor { + /** + * Create a SourceTriggerDescriptor. + * @member {string} [id] The unique ID of the trigger. + * @member {string} [eventType] The event type of the trigger. + * @member {string} [commitId] The unique ID that identifies a commit. + * @member {string} [pullRequestId] The unique ID that identifies pull + * request. + * @member {string} [repositoryUrl] The repository URL. + * @member {string} [branchName] The branch name in the repository. + * @member {string} [providerType] The source control provider type. + */ + constructor() { + } + + /** + * Defines the metadata of SourceTriggerDescriptor + * + * @returns {object} metadata of SourceTriggerDescriptor + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceTriggerDescriptor', + type: { + name: 'Composite', + className: 'SourceTriggerDescriptor', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + }, + eventType: { + required: false, + serializedName: 'eventType', + type: { + name: 'String' + } + }, + commitId: { + required: false, + serializedName: 'commitId', + type: { + name: 'String' + } + }, + pullRequestId: { + required: false, + serializedName: 'pullRequestId', + type: { + name: 'String' + } + }, + repositoryUrl: { + required: false, + serializedName: 'repositoryUrl', + type: { + name: 'String' + } + }, + branchName: { + required: false, + serializedName: 'branchName', + type: { + name: 'String' + } + }, + providerType: { + required: false, + serializedName: 'providerType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceTriggerDescriptor; diff --git a/lib/services/containerRegistryManagement/lib/models/sourceTriggerUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/sourceTriggerUpdateParameters.js new file mode 100644 index 0000000000..ce53fb72cc --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/sourceTriggerUpdateParameters.js @@ -0,0 +1,111 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties for updating a source based trigger. + * + */ +class SourceTriggerUpdateParameters { + /** + * Create a SourceTriggerUpdateParameters. + * @member {object} [sourceRepository] The properties that describes the + * source(code) for the task. + * @member {string} [sourceRepository.sourceControlType] The type of source + * control service. Possible values include: 'Github', + * 'VisualStudioTeamService' + * @member {string} [sourceRepository.repositoryUrl] The full URL to the + * source code respository + * @member {string} [sourceRepository.branch] The branch name of the source + * code. + * @member {object} [sourceRepository.sourceControlAuthProperties] The + * authorization properties for accessing the source code repository and to + * set up + * webhooks for notifications. + * @member {string} [sourceRepository.sourceControlAuthProperties.tokenType] + * The type of Auth token. Possible values include: 'PAT', 'OAuth' + * @member {string} [sourceRepository.sourceControlAuthProperties.token] The + * access token used to access the source control provider. + * @member {string} + * [sourceRepository.sourceControlAuthProperties.refreshToken] The refresh + * token used to refresh the access token. + * @member {string} [sourceRepository.sourceControlAuthProperties.scope] The + * scope of the access token. + * @member {number} [sourceRepository.sourceControlAuthProperties.expiresIn] + * Time in seconds that the token remains valid + * @member {array} [sourceTriggerEvents] The source event corresponding to + * the trigger. + * @member {string} [status] The current status of build trigger. Possible + * values include: 'Disabled', 'Enabled' + * @member {string} name The name of the trigger. + */ + constructor() { + } + + /** + * Defines the metadata of SourceTriggerUpdateParameters + * + * @returns {object} metadata of SourceTriggerUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceTriggerUpdateParameters', + type: { + name: 'Composite', + className: 'SourceTriggerUpdateParameters', + modelProperties: { + sourceRepository: { + required: false, + serializedName: 'sourceRepository', + type: { + name: 'Composite', + className: 'SourceUpdateParameters' + } + }, + sourceTriggerEvents: { + required: false, + serializedName: 'sourceTriggerEvents', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SourceTriggerEventElementType', + type: { + name: 'String' + } + } + } + }, + status: { + required: false, + serializedName: 'status', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SourceTriggerUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/sourceUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/sourceUpdateParameters.js new file mode 100644 index 0000000000..cdd92ccf5c --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/sourceUpdateParameters.js @@ -0,0 +1,93 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties for updating the source code repository. + * + */ +class SourceUpdateParameters { + /** + * Create a SourceUpdateParameters. + * @member {string} [sourceControlType] The type of source control service. + * Possible values include: 'Github', 'VisualStudioTeamService' + * @member {string} [repositoryUrl] The full URL to the source code + * respository + * @member {string} [branch] The branch name of the source code. + * @member {object} [sourceControlAuthProperties] The authorization + * properties for accessing the source code repository and to set up + * webhooks for notifications. + * @member {string} [sourceControlAuthProperties.tokenType] The type of Auth + * token. Possible values include: 'PAT', 'OAuth' + * @member {string} [sourceControlAuthProperties.token] The access token used + * to access the source control provider. + * @member {string} [sourceControlAuthProperties.refreshToken] The refresh + * token used to refresh the access token. + * @member {string} [sourceControlAuthProperties.scope] The scope of the + * access token. + * @member {number} [sourceControlAuthProperties.expiresIn] Time in seconds + * that the token remains valid + */ + constructor() { + } + + /** + * Defines the metadata of SourceUpdateParameters + * + * @returns {object} metadata of SourceUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceUpdateParameters', + type: { + name: 'Composite', + className: 'SourceUpdateParameters', + modelProperties: { + sourceControlType: { + required: false, + serializedName: 'sourceControlType', + type: { + name: 'String' + } + }, + repositoryUrl: { + required: false, + serializedName: 'repositoryUrl', + type: { + name: 'String' + } + }, + branch: { + required: false, + serializedName: 'branch', + type: { + name: 'String' + } + }, + sourceControlAuthProperties: { + required: false, + serializedName: 'sourceControlAuthProperties', + type: { + name: 'Composite', + className: 'AuthInfoUpdateParameters' + } + } + } + } + }; + } +} + +module.exports = SourceUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/task.js b/lib/services/containerRegistryManagement/lib/models/task.js new file mode 100644 index 0000000000..b75b307fcc --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/task.js @@ -0,0 +1,201 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it. + * + * @extends models['Resource'] + */ +class Task extends models['Resource'] { + /** + * Create a Task. + * @member {string} [provisioningState] The provisioning state of the task. + * Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + * 'Failed', 'Canceled' + * @member {date} [creationDate] The creation date of task. + * @member {string} [status] The current status of task. Possible values + * include: 'Disabled', 'Enabled' + * @member {object} platform The platform properties against which the run + * has to happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the run + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms + * of number of cores required for the run. + * @member {number} [timeout] Run timeout in seconds. Default value: 3600 . + * @member {object} step The properties of a task step. + * @member {array} [step.baseImageDependencies] List of base image + * dependencies for a step. + * @member {string} [step.type] Polymorphic Discriminator + * @member {object} [trigger] The properties that describe all triggers for + * the task. + * @member {array} [trigger.sourceTriggers] The collection of triggers based + * on source code repository. + * @member {object} [trigger.baseImageTrigger] The trigger based on base + * image dependencies. + * @member {string} [trigger.baseImageTrigger.baseImageTriggerType] The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * @member {string} [trigger.baseImageTrigger.status] The current status of + * build trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [trigger.baseImageTrigger.name] The name of the trigger. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Task + * + * @returns {object} metadata of Task + * + */ + mapper() { + return { + required: false, + serializedName: 'Task', + type: { + name: 'Composite', + className: 'Task', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + creationDate: { + required: false, + readOnly: true, + serializedName: 'properties.creationDate', + type: { + name: 'DateTime' + } + }, + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + platform: { + required: true, + serializedName: 'properties.platform', + type: { + name: 'Composite', + className: 'PlatformProperties' + } + }, + agentConfiguration: { + required: false, + serializedName: 'properties.agentConfiguration', + type: { + name: 'Composite', + className: 'AgentProperties' + } + }, + timeout: { + required: false, + serializedName: 'properties.timeout', + defaultValue: 3600, + constraints: { + InclusiveMaximum: 28800, + InclusiveMinimum: 300 + }, + type: { + name: 'Number' + } + }, + step: { + required: true, + serializedName: 'properties.step', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepProperties', + className: 'TaskStepProperties' + } + }, + trigger: { + required: false, + serializedName: 'properties.trigger', + type: { + name: 'Composite', + className: 'TriggerProperties' + } + } + } + } + }; + } +} + +module.exports = Task; diff --git a/lib/services/containerRegistryManagement/lib/models/taskListResult.js b/lib/services/containerRegistryManagement/lib/models/taskListResult.js new file mode 100644 index 0000000000..3b5f4ac383 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/taskListResult.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The collection of tasks. + */ +class TaskListResult extends Array { + /** + * Create a TaskListResult. + * @member {string} [nextLink] The URI that can be used to request the next + * set of paged results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TaskListResult + * + * @returns {object} metadata of TaskListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'TaskListResult', + type: { + name: 'Composite', + className: 'TaskListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TaskElementType', + type: { + name: 'Composite', + className: 'Task' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TaskListResult; diff --git a/lib/services/containerRegistryManagement/lib/models/taskRunRequest.js b/lib/services/containerRegistryManagement/lib/models/taskRunRequest.js new file mode 100644 index 0000000000..0d65fa1d5f --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/taskRunRequest.js @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The parameters for a task run request. + * + * @extends models['RunRequest'] + */ +class TaskRunRequest extends models['RunRequest'] { + /** + * Create a TaskRunRequest. + * @member {string} taskName The name of task against which run has to be + * queued. + * @member {array} [values] The collection of overridable values that can be + * passed when running a task. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TaskRunRequest + * + * @returns {object} metadata of TaskRunRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'TaskRunRequest', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'RunRequest', + className: 'TaskRunRequest', + modelProperties: { + isArchiveEnabled: { + required: false, + serializedName: 'isArchiveEnabled', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + taskName: { + required: true, + serializedName: 'taskName', + type: { + name: 'String' + } + }, + values: { + required: false, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SetValueElementType', + type: { + name: 'Composite', + className: 'SetValue' + } + } + } + } + } + } + }; + } +} + +module.exports = TaskRunRequest; diff --git a/lib/services/containerRegistryManagement/lib/models/taskStepProperties.js b/lib/services/containerRegistryManagement/lib/models/taskStepProperties.js new file mode 100644 index 0000000000..275e033e12 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/taskStepProperties.js @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Base properties for any task step. + * + */ +class TaskStepProperties { + /** + * Create a TaskStepProperties. + * @member {array} [baseImageDependencies] List of base image dependencies + * for a step. + * @member {string} type Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of TaskStepProperties + * + * @returns {object} metadata of TaskStepProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'TaskStepProperties', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepProperties', + className: 'TaskStepProperties', + modelProperties: { + baseImageDependencies: { + required: false, + readOnly: true, + serializedName: 'baseImageDependencies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BaseImageDependencyElementType', + type: { + name: 'Composite', + className: 'BaseImageDependency' + } + } + } + }, + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TaskStepProperties; diff --git a/lib/services/containerRegistryManagement/lib/models/taskStepUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/taskStepUpdateParameters.js new file mode 100644 index 0000000000..5801fd946d --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/taskStepUpdateParameters.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Base properties for updating any task step. + * + */ +class TaskStepUpdateParameters { + /** + * Create a TaskStepUpdateParameters. + * @member {string} type Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of TaskStepUpdateParameters + * + * @returns {object} metadata of TaskStepUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'TaskStepUpdateParameters', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepUpdateParameters', + className: 'TaskStepUpdateParameters', + modelProperties: { + type: { + required: true, + serializedName: 'type', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TaskStepUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js new file mode 100644 index 0000000000..5b82cf8a85 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js @@ -0,0 +1,140 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The parameters for updating a task. + * + */ +class TaskUpdateParameters { + /** + * Create a TaskUpdateParameters. + * @member {string} [status] The current status of task. Possible values + * include: 'Disabled', 'Enabled' + * @member {object} [platform] The platform properties against which the run + * has to happen. + * @member {string} [platform.os] The operating system type required for the + * run. Possible values include: 'Windows', 'Linux' + * @member {string} [platform.architecture] The OS architecture. Possible + * values include: 'amd64', 'x86', 'arm' + * @member {string} [platform.variant] Variant of the CPU. Possible values + * include: 'v6', 'v7', 'v8' + * @member {object} [agentConfiguration] The machine configuration of the run + * agent. + * @member {number} [agentConfiguration.cpu] The CPU configuration in terms + * of number of cores required for the run. + * @member {number} [timeout] Run timeout in seconds. + * @member {object} [step] The properties for updating a task step. + * @member {string} [step.type] Polymorphic Discriminator + * @member {object} [trigger] The properties for updating trigger properties. + * @member {array} [trigger.sourceTriggers] The collection of triggers based + * on source code repository. + * @member {object} [trigger.baseImageTrigger] The trigger based on base + * image dependencies. + * @member {string} [trigger.baseImageTrigger.baseImageTriggerType] The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * @member {string} [trigger.baseImageTrigger.status] The current status of + * build trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [trigger.baseImageTrigger.name] The name of the trigger. + * @member {object} [tags] The ARM resource tags. + */ + constructor() { + } + + /** + * Defines the metadata of TaskUpdateParameters + * + * @returns {object} metadata of TaskUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'TaskUpdateParameters', + type: { + name: 'Composite', + className: 'TaskUpdateParameters', + modelProperties: { + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + platform: { + required: false, + serializedName: 'properties.platform', + type: { + name: 'Composite', + className: 'PlatformUpdateParameters' + } + }, + agentConfiguration: { + required: false, + serializedName: 'properties.agentConfiguration', + type: { + name: 'Composite', + className: 'AgentProperties' + } + }, + timeout: { + required: false, + serializedName: 'properties.timeout', + type: { + name: 'Number' + } + }, + step: { + required: false, + serializedName: 'properties.step', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'type', + clientName: 'type' + }, + uberParent: 'TaskStepUpdateParameters', + className: 'TaskStepUpdateParameters' + } + }, + trigger: { + required: false, + serializedName: 'properties.trigger', + type: { + name: 'Composite', + className: 'TriggerUpdateParameters' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = TaskUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/models/triggerProperties.js b/lib/services/containerRegistryManagement/lib/models/triggerProperties.js new file mode 100644 index 0000000000..7b366694ae --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/triggerProperties.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties of a build trigger. + * + */ +class TriggerProperties { + /** + * Create a TriggerProperties. + * @member {array} [sourceTriggers] The collection of triggers based on + * source code repository. + * @member {object} [baseImageTrigger] The trigger based on base image + * dependencies. + * @member {string} [baseImageTrigger.baseImageTriggerType] The type of the + * auto trigger for base image dependency updates. Possible values include: + * 'All', 'Runtime' + * @member {string} [baseImageTrigger.status] The current status of build + * trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [baseImageTrigger.name] The name of the trigger. + */ + constructor() { + } + + /** + * Defines the metadata of TriggerProperties + * + * @returns {object} metadata of TriggerProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'TriggerProperties', + type: { + name: 'Composite', + className: 'TriggerProperties', + modelProperties: { + sourceTriggers: { + required: false, + serializedName: 'sourceTriggers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SourceTriggerElementType', + type: { + name: 'Composite', + className: 'SourceTrigger' + } + } + } + }, + baseImageTrigger: { + required: false, + serializedName: 'baseImageTrigger', + type: { + name: 'Composite', + className: 'BaseImageTrigger' + } + } + } + } + }; + } +} + +module.exports = TriggerProperties; diff --git a/lib/services/containerRegistryManagement/lib/models/triggerUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/triggerUpdateParameters.js new file mode 100644 index 0000000000..42414d8727 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/models/triggerUpdateParameters.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties for updating build triggers. + * + */ +class TriggerUpdateParameters { + /** + * Create a TriggerUpdateParameters. + * @member {array} [sourceTriggers] The collection of triggers based on + * source code repository. + * @member {object} [baseImageTrigger] The trigger based on base image + * dependencies. + * @member {string} [baseImageTrigger.baseImageTriggerType] The type of the + * auto trigger for base image dependency updates. Possible values include: + * 'All', 'Runtime' + * @member {string} [baseImageTrigger.status] The current status of build + * trigger. Possible values include: 'Disabled', 'Enabled' + * @member {string} [baseImageTrigger.name] The name of the trigger. + */ + constructor() { + } + + /** + * Defines the metadata of TriggerUpdateParameters + * + * @returns {object} metadata of TriggerUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'TriggerUpdateParameters', + type: { + name: 'Composite', + className: 'TriggerUpdateParameters', + modelProperties: { + sourceTriggers: { + required: false, + serializedName: 'sourceTriggers', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SourceTriggerUpdateParametersElementType', + type: { + name: 'Composite', + className: 'SourceTriggerUpdateParameters' + } + } + } + }, + baseImageTrigger: { + required: false, + serializedName: 'baseImageTrigger', + type: { + name: 'Composite', + className: 'BaseImageTriggerUpdateParameters' + } + } + } + } + }; + } +} + +module.exports = TriggerUpdateParameters; diff --git a/lib/services/containerRegistryManagement/lib/operations/index.d.ts b/lib/services/containerRegistryManagement/lib/operations/index.d.ts index f437291059..3528092c4e 100644 --- a/lib/services/containerRegistryManagement/lib/operations/index.d.ts +++ b/lib/services/containerRegistryManagement/lib/operations/index.d.ts @@ -1020,7 +1020,7 @@ export interface 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 @@ -1028,9 +1028,12 @@ export interface Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. + * + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -1039,14 +1042,14 @@ export interface Registries { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - queueBuildWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + scheduleRunWithHttpOperationResponse(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new build based on the request parameters and add it to the build + * Schedules a new run based on the request parameters and add it to the run * queue. * * @param {string} resourceGroupName The name of the resource group to which @@ -1054,9 +1057,12 @@ export interface Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. + * + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -1070,7 +1076,7 @@ export interface Registries { * * {Promise} A promise is returned. * - * @resolve {Build} - The deserialized result object. + * @resolve {Run} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1078,16 +1084,16 @@ export interface Registries { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Build} [result] - The deserialized result object if an error did not occur. - * See {@link Build} for more information. + * {Run} [result] - The deserialized result object if an error did not occur. + * See {@link Run} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - queueBuild(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - queueBuild(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, callback: ServiceCallback): void; - queueBuild(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + scheduleRun(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + scheduleRun(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, callback: ServiceCallback): void; + scheduleRun(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -1652,7 +1658,7 @@ export interface 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 @@ -1660,9 +1666,12 @@ export interface Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. + * + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -1671,14 +1680,14 @@ export interface Registries { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginQueueBuildWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginScheduleRunWithHttpOperationResponse(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new build based on the request parameters and add it to the build + * Schedules a new run based on the request parameters and add it to the run * queue. * * @param {string} resourceGroupName The name of the resource group to which @@ -1686,9 +1695,12 @@ export interface Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. + * + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -1702,7 +1714,7 @@ export interface Registries { * * {Promise} A promise is returned. * - * @resolve {Build} - The deserialized result object. + * @resolve {Run} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1710,16 +1722,16 @@ export interface Registries { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Build} [result] - The deserialized result object if an error did not occur. - * See {@link Build} for more information. + * {Run} [result] - The deserialized result object if an error did not occur. + * See {@link Run} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginQueueBuild(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginQueueBuild(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, callback: ServiceCallback): void; - beginQueueBuild(resourceGroupName: string, registryName: string, buildRequest: models.QueueBuildRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginScheduleRun(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginScheduleRun(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, callback: ServiceCallback): void; + beginScheduleRun(resourceGroupName: string, registryName: string, runRequest: models.RunRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -3623,15 +3635,15 @@ export interface Webhooks { /** * @class - * Builds + * Runs * __NOTE__: An instance of this class is automatically created for an * instance of the ContainerRegistryManagementClient. */ -export interface Builds { +export interface Runs { /** - * Gets all the builds for a registry. + * Gets all the runs for a registry. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. @@ -3640,28 +3652,26 @@ export interface Builds { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The builds filter to apply on the - * operation. + * @param {string} [options.filter] The runs filter to apply on the operation. + * Arithmetic operators are not supported. The allowed string function is + * 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. * - * @param {number} [options.top] $top is supported for get list of builds, - * which limits the maximum number of builds to return. - * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * builds, which provides the next page in the list of builds. + * @param {number} [options.top] $top is supported for get list of runs, which + * limits the maximum number of runs to return. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, registryName: string, options?: { filter? : string, top? : number, skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, registryName: string, options?: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the builds for a registry. + * Gets all the runs for a registry. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. @@ -3670,14 +3680,12 @@ export interface Builds { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] The builds filter to apply on the - * operation. - * - * @param {number} [options.top] $top is supported for get list of builds, - * which limits the maximum number of builds to return. + * @param {string} [options.filter] The runs filter to apply on the operation. + * Arithmetic operators are not supported. The allowed string function is + * 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. * - * @param {string} [options.skipToken] $skipToken is supported on get list of - * builds, which provides the next page in the list of builds. + * @param {number} [options.top] $top is supported for get list of runs, which + * limits the maximum number of runs to return. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3689,7 +3697,7 @@ export interface Builds { * * {Promise} A promise is returned. * - * @resolve {BuildListResult} - The deserialized result object. + * @resolve {RunListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3697,27 +3705,27 @@ export interface Builds { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BuildListResult} for more information. + * {RunListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, registryName: string, options?: { filter? : string, top? : number, skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, registryName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, registryName: string, options: { filter? : string, top? : number, skipToken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, registryName: string, options?: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, registryName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, registryName: string, options: { filter? : string, top? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the detailed information for a given build. + * Gets the detailed information for a given run. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -3726,21 +3734,21 @@ export interface Builds { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the detailed information for a given build. + * Gets the detailed information for a given run. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -3754,7 +3762,7 @@ export interface Builds { * * {Promise} A promise is returned. * - * @resolve {Build} - The deserialized result object. + * @resolve {Run} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3762,31 +3770,31 @@ export interface Builds { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Build} [result] - The deserialized result object if an error did not occur. - * See {@link Build} for more information. + * {Run} [result] - The deserialized result object if an error did not occur. + * See {@link Run} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, registryName: string, buildId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, registryName: string, buildId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, registryName: string, runId: string, callback: ServiceCallback): void; + get(resourceGroupName: string, registryName: string, runId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Patch the build properties. + * Patch the run properties. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * - * @param {object} buildUpdateParameters The build update properties. + * @param {object} runUpdateParameters The run update properties. * - * @param {boolean} [buildUpdateParameters.isArchiveEnabled] The value that + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that * indicates whether archiving is enabled or not. * * @param {object} [options] Optional Parameters. @@ -3796,25 +3804,25 @@ export interface Builds { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Patch the build properties. + * Patch the run properties. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * - * @param {object} buildUpdateParameters The build update properties. + * @param {object} runUpdateParameters The run update properties. * - * @param {boolean} [buildUpdateParameters.isArchiveEnabled] The value that + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that * indicates whether archiving is enabled or not. * * @param {object} [options] Optional Parameters. @@ -3829,7 +3837,7 @@ export interface Builds { * * {Promise} A promise is returned. * - * @resolve {Build} - The deserialized result object. + * @resolve {Run} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3837,27 +3845,27 @@ export interface Builds { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Build} [result] - The deserialized result object if an error did not occur. - * See {@link Build} for more information. + * {Run} [result] - The deserialized result object if an error did not occur. + * See {@link Run} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, callback: ServiceCallback): void; + update(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a link to download the build logs. + * Gets a link to download the run logs. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -3866,21 +3874,21 @@ export interface Builds { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getLogLinkWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getLogSasUrlWithHttpOperationResponse(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a link to download the build logs. + * Gets a link to download the run logs. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -3894,7 +3902,7 @@ export interface Builds { * * {Promise} A promise is returned. * - * @resolve {BuildGetLogResult} - The deserialized result object. + * @resolve {RunGetLogResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3902,27 +3910,27 @@ export interface Builds { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildGetLogResult} [result] - The deserialized result object if an error did not occur. - * See {@link BuildGetLogResult} for more information. + * {RunGetLogResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunGetLogResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getLogLink(resourceGroupName: string, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getLogLink(resourceGroupName: string, registryName: string, buildId: string, callback: ServiceCallback): void; - getLogLink(resourceGroupName: string, registryName: string, buildId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getLogSasUrl(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getLogSasUrl(resourceGroupName: string, registryName: string, runId: string, callback: ServiceCallback): void; + getLogSasUrl(resourceGroupName: string, registryName: string, runId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Cancel an existing build. + * Cancel an existing run. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -3935,17 +3943,17 @@ export interface Builds { * * @reject {Error|ServiceError} - The error object. */ - cancelWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelWithHttpOperationResponse(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancel an existing build. + * Cancel an existing run. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -3973,24 +3981,24 @@ export interface Builds { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - cancel(resourceGroupName: string, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - cancel(resourceGroupName: string, registryName: string, buildId: string, callback: ServiceCallback): void; - cancel(resourceGroupName: string, registryName: string, buildId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + cancel(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancel(resourceGroupName: string, registryName: string, runId: string, callback: ServiceCallback): void; + cancel(resourceGroupName: string, registryName: string, runId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Patch the build properties. + * Patch the run properties. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * - * @param {object} buildUpdateParameters The build update properties. + * @param {object} runUpdateParameters The run update properties. * - * @param {boolean} [buildUpdateParameters.isArchiveEnabled] The value that + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that * indicates whether archiving is enabled or not. * * @param {object} [options] Optional Parameters. @@ -4000,25 +4008,25 @@ export interface Builds { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Patch the build properties. + * Patch the run properties. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * - * @param {object} buildUpdateParameters The build update properties. + * @param {object} runUpdateParameters The run update properties. * - * @param {boolean} [buildUpdateParameters.isArchiveEnabled] The value that + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that * indicates whether archiving is enabled or not. * * @param {object} [options] Optional Parameters. @@ -4033,7 +4041,7 @@ export interface Builds { * * {Promise} A promise is returned. * - * @resolve {Build} - The deserialized result object. + * @resolve {Run} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4041,27 +4049,27 @@ export interface Builds { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Build} [result] - The deserialized result object if an error did not occur. - * See {@link Build} for more information. + * {Run} [result] - The deserialized result object if an error did not occur. + * See {@link Run} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, registryName: string, buildId: string, buildUpdateParameters: models.BuildUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, registryName: string, runId: string, runUpdateParameters: models.RunUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Cancel an existing build. + * Cancel an existing run. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -4074,17 +4082,17 @@ export interface Builds { * * @reject {Error|ServiceError} - The error object. */ - beginCancelWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCancelWithHttpOperationResponse(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancel an existing build. + * Cancel an existing run. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildId The build ID. + * @param {string} runId The run ID. * * @param {object} [options] Optional Parameters. * @@ -4112,13 +4120,13 @@ export interface Builds { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCancel(resourceGroupName: string, registryName: string, buildId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCancel(resourceGroupName: string, registryName: string, buildId: string, callback: ServiceCallback): void; - beginCancel(resourceGroupName: string, registryName: string, buildId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCancel(resourceGroupName: string, registryName: string, runId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCancel(resourceGroupName: string, registryName: string, runId: string, callback: ServiceCallback): void; + beginCancel(resourceGroupName: string, registryName: string, runId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all the builds for a registry. + * Gets all the runs for a registry. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -4130,14 +4138,14 @@ export interface Builds { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all the builds for a registry. + * Gets all the runs for a registry. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -4154,7 +4162,7 @@ export interface Builds { * * {Promise} A promise is returned. * - * @resolve {BuildListResult} - The deserialized result object. + * @resolve {RunListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4162,37 +4170,35 @@ export interface Builds { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BuildListResult} for more information. + * {RunListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RunListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * BuildSteps + * Tasks * __NOTE__: An instance of this class is automatically created for an * instance of the ContainerRegistryManagementClient. */ -export interface BuildSteps { +export interface Tasks { /** - * List all the build steps for a given build task. + * Lists all the tasks for a specified container registry. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4200,22 +4206,20 @@ export interface BuildSteps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, registryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * List all the build steps for a given build task. + * Lists all the tasks for a specified container registry. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4228,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. * @@ -4236,30 +4240,27 @@ export interface BuildSteps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildStepList} [result] - The deserialized result object if an error did not occur. - * See {@link BuildStepList} for more information. + * {TaskListResult} [result] - The deserialized result object if an error did not occur. + * See {@link TaskListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName: string, registryName: string, buildTaskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, registryName: string, buildTaskName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, registryName: string, buildTaskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, registryName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, registryName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, registryName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the build step for a build task. + * Get the properties of a specified task. * * @param {string} resourceGroupName The name of the resource group to which * the container registry belongs. * * @param {string} registryName The name of the container registry. * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {string} stepName The name of a build step for a container registry - * build task. + * @param {string} taskName The name of the container registry task. * * @param {object} [options] Optional Parameters. * @@ -4268,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. * @@ -4299,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. * @@ -4307,145 +4305,160 @@ 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 {string} stepName The name of a build step for a container registry - * build task. + * @param {object} taskCreateParameters The parameters for creating 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 {object} [options] Optional Parameters. + * @param {string} [taskCreateParameters.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} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' * - * @returns {Promise} A promise is returned + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. * - * @reject {Error|ServiceError} - The error object. - */ - createWithHttpOperationResponse(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 {number} [taskCreateParameters.timeout] Run timeout in seconds. * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. + * @param {object} taskCreateParameters.step The properties of a task step. * - * @param {string} registryName The name of the container registry. + * @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} buildTaskName The name of the 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} stepName The name of a build step for a container registry - * build task. + * @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 {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. * - * @param {string} buildStepCreateParameters.properties.type Polymorphic - * Discriminator + * @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 {ServiceCallback} [optionalCallback] - The optional callback. + * @returns {Promise} A promise is returned * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {Promise} A promise is returned. + * @reject {Error|ServiceError} - The error object. + */ + createWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskCreateParameters: models.Task, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a task for a container registry with the specified parameters. * - * @resolve {BuildStep} - The deserialized result object. + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. * - * @reject {Error|ServiceError} - The error object. + * @param {string} registryName The name of the container registry. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} taskName The name of the container registry task. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} taskCreateParameters The parameters for creating a task. * - * {BuildStep} [result] - The deserialized result object if an error did not occur. - * See {@link BuildStep} for more information. + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. * - * {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; - - - /** - * Deletes a build step from the build task. + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. + * @param {string} [taskCreateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' * - * @param {string} registryName The name of the container registry. + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' * - * @param {string} buildTaskName The name of the container registry build task. + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * @param {string} stepName The name of a build step for a container registry - * build task. + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. * - * @param {object} [options] Optional Parameters. + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} taskCreateParameters.step The properties of a task step. * - * @returns {Promise} A promise is returned + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. * - * @reject {Error|ServiceError} - The error object. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a build step from the build task. + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. * - * @param {string} registryName The name of the container registry. + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. * - * @param {string} stepName The name of a build step for a container registry - * build task. + * @param {object} [taskCreateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -4459,7 +4472,7 @@ export interface BuildSteps { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {Task} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4467,40 +4480,27 @@ export interface BuildSteps { * * {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, 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; + 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; /** - * Updates a build step in a 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 {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 {string} taskName The name of the container registry task. * * @param {object} [options] Optional Parameters. * @@ -4509,35 +4509,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. */ - updateWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, buildStepUpdateParameters: models.BuildStepUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a build step in a 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 {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 {string} taskName The name of the container registry task. * * @param {object} [options] Optional Parameters. * @@ -4551,7 +4537,7 @@ export interface BuildSteps { * * {Promise} A promise is returned. * - * @resolve {BuildStep} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4559,145 +4545,155 @@ 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, 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; + 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; /** - * List the build arguments for a step including the secret arguments. + * 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} [options] Optional Parameters. + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. * - * @returns {Promise} A promise is returned + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' * - * @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} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * @param {string} registryName The name of the container registry. + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {string} stepName The name of a build step for a container registry - * build task. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * - * @param {object} [options] Optional Parameters. + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. * - * {Promise} A promise is returned. + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' * - * @resolve {BuildArgumentList} - The deserialized result object. + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * @reject {Error|ServiceError} - The error object. + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * {BuildArgumentList} [result] - The deserialized result object if an error did not occur. - * See {@link BuildArgumentList} for more information. + * @returns {Promise} A promise is returned * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @reject {Error|ServiceError} - The error object. */ - 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; - + updateWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a build step for 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} buildStepCreateParameters The parameters for creating a - * build step. + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * @param {object} [buildStepCreateParameters.properties] The properties of a - * build step. + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. * - * @param {string} buildStepCreateParameters.properties.type Polymorphic - * Discriminator + * @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' * - * @returns {Promise} A promise is returned + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. * - * @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 {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * - * @param {string} registryName The name of the container registry. + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. * - * @param {string} stepName The name of a build step for a container registry - * build task. + * @param {object} [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 {object} buildStepCreateParameters The parameters for creating a - * build step. + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * @param {object} [buildStepCreateParameters.properties] The properties of a - * build step. + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * @param {string} buildStepCreateParameters.properties.type Polymorphic - * Discriminator + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -4711,7 +4707,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. * @@ -4719,30 +4715,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. */ - 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; + 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 build step from the 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} 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. * @@ -4751,24 +4744,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. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, stepName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getDetailsWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a build step from the 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} 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. * @@ -4782,7 +4772,7 @@ export interface BuildSteps { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {Task} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4790,115 +4780,82 @@ export interface BuildSteps { * * {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. */ - 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; + getDetails(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDetails(resourceGroupName: string, registryName: string, taskName: string, callback: ServiceCallback): void; + getDetails(resourceGroupName: string, registryName: string, taskName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a build step in 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} 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} taskName The name of the container registry task. * - * @param {string} buildTaskName The name of the container registry build 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.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * @param {object} buildStepUpdateParameters The parameters for updating a - * build step. + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. * - * @param {object} [buildStepUpdateParameters.properties] The properties for - * updating a build step. + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' * - * @param {string} buildStepUpdateParameters.properties.type Polymorphic - * Discriminator + * @param {string} [taskCreateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' * - * @param {object} [buildStepUpdateParameters.tags] The ARM resource tags. + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' * - * @param {object} [options] Optional Parameters. + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} taskCreateParameters.step The properties of a task step. * - * {Promise} A promise is returned. + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator * - * @resolve {BuildStep} - The deserialized result object. + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. * - * @reject {Error|ServiceError} - The error object. + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' * - * {BuildStep} [result] - The deserialized result object if an error did not occur. - * See {@link BuildStep} for more information. + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * {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} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {object} [taskCreateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -4907,74 +4864,76 @@ export interface BuildSteps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskCreateParameters: models.Task, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * List all the build steps for a given build task. + * Creates a task for a container registry with the specified parameters. * - * @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 {object} [options] Optional Parameters. + * @param {string} registryName The name of the container registry. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} taskName The name of the container registry task. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} taskCreateParameters The parameters for creating a task. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * {Promise} A promise is returned. + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. * - * @resolve {BuildStepList} - The deserialized result object. + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' * - * @reject {Error|ServiceError} - The error object. + * @param {string} [taskCreateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * {BuildStepList} [result] - The deserialized result object if an error did not occur. - * See {@link BuildStepList} for more information. + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. * - * {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 {object} taskCreateParameters.step The properties of a task step. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator * - * @param {object} [options] Optional Parameters. + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. * - * @returns {Promise} A promise is returned + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' * - * @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} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskCreateParameters.tags] The tags of the resource. * * @param {object} [options] Optional Parameters. * @@ -4988,7 +4947,7 @@ export interface BuildSteps { * * {Promise} A promise is returned. * - * @resolve {BuildArgumentList} - The deserialized result object. + * @resolve {Task} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4996,69 +4955,52 @@ export interface BuildSteps { * * {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. + * {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. */ - 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 { + 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; /** - * Lists all the build tasks for a specified container registry. + * 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 {object} [options] Optional Parameters. - * - * @param {string} [options.filter] The build task filter to apply on the - * operation. + * @param {string} taskName The name of the container registry task. * - * @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] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, registryName: string, options?: { filter? : string, skipToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all the build tasks for a specified container registry. + * 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 {object} [options] Optional Parameters. - * - * @param {string} [options.filter] The build task filter to apply on the - * operation. + * @param {string} taskName The name of the container registry task. * - * @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] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5070,7 +5012,7 @@ export interface BuildTasks { * * {Promise} A promise is returned. * - * @resolve {BuildTaskListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5078,992 +5020,155 @@ 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. + * {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. */ - 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; + 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; /** - * Get the properties of a specified 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} [options] Optional Parameters. + * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * @returns {Promise} A promise is returned + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' * - * @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} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' * - * @param {string} registryName The name of the container registry. + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. * - * @param {object} [options] Optional Parameters. + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * - * {Promise} A promise is returned. + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. * - * @resolve {BuildTask} - The deserialized result object. + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. * - * @reject {Error|ServiceError} - The error object. + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * {BuildTask} [result] - The deserialized result object if an error did not occur. - * See {@link BuildTask} for more information. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} [options] Optional Parameters. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @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. */ - 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; - + beginUpdateWithHttpOperationResponse(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a build task for a container registry 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} buildTaskCreateParameters The parameters for creating a - * build task. + * @param {object} taskUpdateParameters The parameters for updating a task. * - * @param {string} buildTaskCreateParameters.alias The alternative updatable - * name for a build task. + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' * - * @param {string} [buildTaskCreateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. * - * @param {object} buildTaskCreateParameters.sourceRepository The properties - * that describes the source(code) for the build task. + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' * - * @param {string} buildTaskCreateParameters.sourceRepository.sourceControlType - * The type of source control service. Possible values include: 'Github', - * 'VisualStudioTeamService' + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' * - * @param {string} buildTaskCreateParameters.sourceRepository.repositoryUrl The - * full URL to the source code respository + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' * - * @param {boolean} - * [buildTaskCreateParameters.sourceRepository.isCommitTriggerEnabled] The - * value of this property indicates whether the source control commit trigger - * is enabled or not. + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. * - * @param {object} - * [buildTaskCreateParameters.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} - * [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 {number} [taskUpdateParameters.timeout] Run timeout in seconds. * - * @param {string} buildTaskName The name of the container registry build task. + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. * - * @param {object} buildTaskCreateParameters The parameters for creating a - * build task. + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator * - * @param {string} buildTaskCreateParameters.alias The alternative updatable - * name for a build task. + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. * - * @param {string} [buildTaskCreateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. * - * @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 - * - * @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. - */ - 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; - - - /** - * Deletes 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. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes 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 {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName: string, 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; - - - /** - * Updates a build task with the specified parameters. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {object} buildTaskUpdateParameters The parameters for updating a - * build task. - * - * @param {string} [buildTaskUpdateParameters.alias] The alternative updatable - * name for a build task. - * - * @param {string} [buildTaskUpdateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' - * - * @param {object} [buildTaskUpdateParameters.platform] The platform properties - * against which the build has to happen. - * - * @param {string} buildTaskUpdateParameters.platform.osType The operating - * system type required for the build. Possible values include: 'Windows', - * 'Linux' - * - * @param {number} [buildTaskUpdateParameters.platform.cpu] The CPU - * configuration in terms of number of cores required for the build. - * - * @param {number} [buildTaskUpdateParameters.timeout] Build timeout in - * seconds. - * - * @param {object} [buildTaskUpdateParameters.sourceRepository] The properties - * that describes the source(code) for the build task. - * - * @param {object} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. - * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.tokenType] - * The type of Auth token. Possible values include: 'PAT', 'OAuth' - * - * @param {string} - * buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.token - * The access token used to access the source control provider. - * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.refreshToken] - * The refresh token used to refresh the access token. - * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.scope] - * The scope of the access token. - * - * @param {number} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.expiresIn] - * Time in seconds that the token remains valid - * - * @param {boolean} - * [buildTaskUpdateParameters.sourceRepository.isCommitTriggerEnabled] The - * value of this property indicates whether the source control commit trigger - * is enabled or not. - * - * @param {object} [buildTaskUpdateParameters.tags] The ARM resource tags. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - updateWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskUpdateParameters: models.BuildTaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a build task with the specified parameters. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {object} buildTaskUpdateParameters The parameters for updating a - * build task. - * - * @param {string} [buildTaskUpdateParameters.alias] The alternative updatable - * name for a build task. - * - * @param {string} [buildTaskUpdateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' - * - * @param {object} [buildTaskUpdateParameters.platform] The platform properties - * against which the build has to happen. - * - * @param {string} buildTaskUpdateParameters.platform.osType The operating - * system type required for the build. Possible values include: 'Windows', - * 'Linux' - * - * @param {number} [buildTaskUpdateParameters.platform.cpu] The CPU - * configuration in terms of number of cores required for the build. - * - * @param {number} [buildTaskUpdateParameters.timeout] Build timeout in - * seconds. - * - * @param {object} [buildTaskUpdateParameters.sourceRepository] The properties - * that describes the source(code) for the build task. - * - * @param {object} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. - * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.tokenType] - * The type of Auth token. Possible values include: 'PAT', 'OAuth' - * - * @param {string} - * buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.token - * The access token used to access the source control provider. - * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.refreshToken] - * The refresh token used to refresh the access token. - * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.scope] - * The scope of the access token. - * - * @param {number} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.expiresIn] - * Time in seconds that the token remains valid - * - * @param {boolean} - * [buildTaskUpdateParameters.sourceRepository.isCommitTriggerEnabled] The - * value of this property indicates whether the source control commit trigger - * is enabled or not. - * - * @param {object} [buildTaskUpdateParameters.tags] The ARM resource tags. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @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. - */ - 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} 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. - */ - 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; - - - /** - * 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. - */ - 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 {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 - * - * @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. - */ - 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; - - - /** - * Deletes 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. - */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes 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 {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, 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; - - - /** - * Updates a build task with the specified parameters. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {object} buildTaskUpdateParameters The parameters for updating a - * build task. - * - * @param {string} [buildTaskUpdateParameters.alias] The alternative updatable - * name for a build task. - * - * @param {string} [buildTaskUpdateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' - * - * @param {object} [buildTaskUpdateParameters.platform] The platform properties - * against which the build has to happen. - * - * @param {string} buildTaskUpdateParameters.platform.osType The operating - * system type required for the build. Possible values include: 'Windows', - * 'Linux' - * - * @param {number} [buildTaskUpdateParameters.platform.cpu] The CPU - * configuration in terms of number of cores required for the build. - * - * @param {number} [buildTaskUpdateParameters.timeout] Build timeout in - * seconds. - * - * @param {object} [buildTaskUpdateParameters.sourceRepository] The properties - * that describes the source(code) for the build task. - * - * @param {object} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. - * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.tokenType] - * The type of Auth token. Possible values include: 'PAT', 'OAuth' - * - * @param {string} - * buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.token - * The access token used to access the source control provider. - * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.refreshToken] - * The refresh token used to refresh the access token. - * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.scope] - * The scope of the access token. - * - * @param {number} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.expiresIn] - * Time in seconds that the token remains valid - * - * @param {boolean} - * [buildTaskUpdateParameters.sourceRepository.isCommitTriggerEnabled] The - * value of this property indicates whether the source control commit trigger - * is enabled or not. - * - * @param {object} [buildTaskUpdateParameters.tags] The ARM resource tags. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskUpdateParameters: models.BuildTaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates a build task with the specified parameters. - * - * @param {string} resourceGroupName The name of the resource group to which - * the container registry belongs. - * - * @param {string} registryName The name of the container registry. - * - * @param {string} buildTaskName The name of the container registry build task. - * - * @param {object} buildTaskUpdateParameters The parameters for updating a - * build task. - * - * @param {string} [buildTaskUpdateParameters.alias] The alternative updatable - * name for a build task. - * - * @param {string} [buildTaskUpdateParameters.status] The current status of - * build task. Possible values include: 'Disabled', 'Enabled' - * - * @param {object} [buildTaskUpdateParameters.platform] The platform properties - * against which the build has to happen. - * - * @param {string} buildTaskUpdateParameters.platform.osType The operating - * system type required for the build. Possible values include: 'Windows', - * 'Linux' - * - * @param {number} [buildTaskUpdateParameters.platform.cpu] The CPU - * configuration in terms of number of cores required for the build. - * - * @param {number} [buildTaskUpdateParameters.timeout] Build timeout in - * seconds. - * - * @param {object} [buildTaskUpdateParameters.sourceRepository] The properties - * that describes the source(code) for the build task. - * - * @param {object} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties] The - * authorization properties for accessing the source code repository. - * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.tokenType] - * The type of Auth token. Possible values include: 'PAT', 'OAuth' - * - * @param {string} - * buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.token - * The access token used to access the source control provider. - * - * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.refreshToken] - * The refresh token used to refresh the access token. + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. * * @param {string} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.scope] - * The scope of the access token. + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' * - * @param {number} - * [buildTaskUpdateParameters.sourceRepository.sourceControlAuthProperties.expiresIn] - * Time in seconds that the token remains valid + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' * - * @param {boolean} - * [buildTaskUpdateParameters.sourceRepository.isCommitTriggerEnabled] The - * value of this property indicates whether the source control commit trigger - * is enabled or not. + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. * - * @param {object} [buildTaskUpdateParameters.tags] The ARM resource tags. + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. * * @param {object} [options] Optional Parameters. * @@ -6077,7 +5182,7 @@ export interface BuildTasks { * * {Promise} A promise is returned. * - * @resolve {BuildTask} - The deserialized result object. + * @resolve {Task} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6085,20 +5190,20 @@ export interface BuildTasks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildTask} [result] - The deserialized result object if an error did not occur. - * See {@link BuildTask} for more information. + * {Task} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskUpdateParameters: models.BuildTaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskUpdateParameters: models.BuildTaskUpdateParameters, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, registryName: string, buildTaskName: string, buildTaskUpdateParameters: models.BuildTaskUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, registryName: string, taskName: string, taskUpdateParameters: models.TaskUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all the build tasks for a specified container registry. + * Lists all the tasks for a specified container registry. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -6110,14 +5215,14 @@ export interface BuildTasks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all the build tasks for a specified container registry. + * Lists all the tasks for a specified container registry. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -6134,7 +5239,7 @@ export interface BuildTasks { * * {Promise} A promise is returned. * - * @resolve {BuildTaskListResult} - The deserialized result object. + * @resolve {TaskListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6142,14 +5247,14 @@ export interface BuildTasks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BuildTaskListResult} [result] - The deserialized result object if an error did not occur. - * See {@link BuildTaskListResult} for more information. + * {TaskListResult} [result] - The deserialized result object if an error did not occur. + * See {@link TaskListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } diff --git a/lib/services/containerRegistryManagement/lib/operations/index.js b/lib/services/containerRegistryManagement/lib/operations/index.js index 05a68dfdad..e026094c34 100644 --- a/lib/services/containerRegistryManagement/lib/operations/index.js +++ b/lib/services/containerRegistryManagement/lib/operations/index.js @@ -18,6 +18,5 @@ exports.Registries = require('./registries'); exports.Operations = require('./operations'); exports.Replications = require('./replications'); exports.Webhooks = require('./webhooks'); -exports.Builds = require('./builds'); -exports.BuildSteps = require('./buildSteps'); -exports.BuildTasks = require('./buildTasks'); +exports.Runs = require('./runs'); +exports.Tasks = require('./tasks'); diff --git a/lib/services/containerRegistryManagement/lib/operations/registries.js b/lib/services/containerRegistryManagement/lib/operations/registries.js index f3e75e8c34..68be1d6574 100644 --- a/lib/services/containerRegistryManagement/lib/operations/registries.js +++ b/lib/services/containerRegistryManagement/lib/operations/registries.js @@ -1726,7 +1726,7 @@ function _updatePolicies(resourceGroupName, registryName, registryPoliciesUpdate /** - * 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 @@ -1734,9 +1734,12 @@ function _updatePolicies(resourceGroupName, registryName, registryPoliciesUpdate * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. + * + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -1750,13 +1753,13 @@ function _updatePolicies(resourceGroupName, registryName, registryPoliciesUpdate * {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') { @@ -1769,7 +1772,7 @@ function _queueBuild(resourceGroupName, registryName, buildRequest, options, cal } // Send request - this.beginQueueBuild(resourceGroupName, registryName, buildRequest, options, (err, parsedResult, httpRequest, response) => { + this.beginScheduleRun(resourceGroupName, registryName, runRequest, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -1793,7 +1796,7 @@ function _queueBuild(resourceGroupName, registryName, buildRequest, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Build']().mapper(); + let resultMapper = new client.models['Run']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1845,7 +1848,7 @@ function _getBuildSourceUploadUrl(resourceGroupName, registryName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-02-01-preview'; + let apiVersion = '2018-09-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1880,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)); @@ -2922,7 +2925,7 @@ function _beginUpdatePolicies(resourceGroupName, registryName, registryPoliciesU } /** - * 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 @@ -2930,9 +2933,12 @@ function _beginUpdatePolicies(resourceGroupName, registryName, registryPoliciesU * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. + * + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -2946,13 +2952,13 @@ function _beginUpdatePolicies(resourceGroupName, registryName, registryPoliciesU * {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 _beginQueueBuild(resourceGroupName, registryName, buildRequest, options, callback) { +function _beginScheduleRun(resourceGroupName, registryName, runRequest, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2962,7 +2968,7 @@ function _beginQueueBuild(resourceGroupName, registryName, buildRequest, options 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') { @@ -2988,8 +2994,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 (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.'); @@ -3000,7 +3006,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}/scheduleRun'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); @@ -3034,14 +3040,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 (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(buildRequest, null, 2)}.`); + `payload - ${JSON.stringify(runRequest, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -3086,7 +3092,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['Run']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3376,14 +3382,14 @@ class Registries { this._listUsages = _listUsages; this._listPolicies = _listPolicies; this._updatePolicies = _updatePolicies; - this._queueBuild = _queueBuild; + this._scheduleRun = _scheduleRun; this._getBuildSourceUploadUrl = _getBuildSourceUploadUrl; this._beginImportImage = _beginImportImage; this._beginCreate = _beginCreate; this._beginDeleteMethod = _beginDeleteMethod; this._beginUpdate = _beginUpdate; this._beginUpdatePolicies = _beginUpdatePolicies; - this._beginQueueBuild = _beginQueueBuild; + this._beginScheduleRun = _beginScheduleRun; this._listByResourceGroupNext = _listByResourceGroupNext; this._listNext = _listNext; } @@ -4738,7 +4744,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 @@ -4746,9 +4752,12 @@ class Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. + * + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -4757,15 +4766,15 @@ class Registries { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - queueBuildWithHttpOperationResponse(resourceGroupName, registryName, buildRequest, options) { + scheduleRunWithHttpOperationResponse(resourceGroupName, registryName, runRequest, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._queueBuild(resourceGroupName, registryName, buildRequest, options, (err, result, request, response) => { + self._scheduleRun(resourceGroupName, registryName, runRequest, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4776,7 +4785,7 @@ class Registries { } /** - * Creates a new build based on the request parameters and add it to the build + * Schedules a new run based on the request parameters and add it to the run * queue. * * @param {string} resourceGroupName The name of the resource group to which @@ -4784,9 +4793,12 @@ class Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. + * + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -4800,7 +4812,7 @@ class Registries { * * {Promise} A promise is returned * - * @resolve {Build} - The deserialized result object. + * @resolve {Run} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4809,13 +4821,13 @@ class Registries { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Build} for more information. + * See {@link Run} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - queueBuild(resourceGroupName, registryName, buildRequest, options, optionalCallback) { + scheduleRun(resourceGroupName, registryName, runRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4824,14 +4836,14 @@ class Registries { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._queueBuild(resourceGroupName, registryName, buildRequest, options, (err, result, request, response) => { + self._scheduleRun(resourceGroupName, registryName, runRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._queueBuild(resourceGroupName, registryName, buildRequest, options, optionalCallback); + return self._scheduleRun(resourceGroupName, registryName, runRequest, options, optionalCallback); } } @@ -5559,7 +5571,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 @@ -5567,9 +5579,12 @@ class Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. + * + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -5578,15 +5593,15 @@ class Registries { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginQueueBuildWithHttpOperationResponse(resourceGroupName, registryName, buildRequest, options) { + beginScheduleRunWithHttpOperationResponse(resourceGroupName, registryName, runRequest, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginQueueBuild(resourceGroupName, registryName, buildRequest, options, (err, result, request, response) => { + self._beginScheduleRun(resourceGroupName, registryName, runRequest, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5597,7 +5612,7 @@ class Registries { } /** - * Creates a new build based on the request parameters and add it to the build + * Schedules a new run based on the request parameters and add it to the run * queue. * * @param {string} resourceGroupName The name of the resource group to which @@ -5605,9 +5620,12 @@ class Registries { * * @param {string} registryName The name of the container registry. * - * @param {object} buildRequest The parameters of a build that needs to queued. + * @param {object} runRequest The parameters of a run that needs to scheduled. + * + * @param {boolean} [runRequest.isArchiveEnabled] The value that indicates + * whether archiving is enabled for the run or not. * - * @param {string} buildRequest.type Polymorphic Discriminator + * @param {string} runRequest.type Polymorphic Discriminator * * @param {object} [options] Optional Parameters. * @@ -5621,7 +5639,7 @@ class Registries { * * {Promise} A promise is returned * - * @resolve {Build} - The deserialized result object. + * @resolve {Run} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5630,13 +5648,13 @@ class Registries { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Build} for more information. + * See {@link Run} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginQueueBuild(resourceGroupName, registryName, buildRequest, options, optionalCallback) { + beginScheduleRun(resourceGroupName, registryName, runRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5645,14 +5663,14 @@ class Registries { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginQueueBuild(resourceGroupName, registryName, buildRequest, options, (err, result, request, response) => { + self._beginScheduleRun(resourceGroupName, registryName, runRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginQueueBuild(resourceGroupName, registryName, buildRequest, options, optionalCallback); + return self._beginScheduleRun(resourceGroupName, registryName, runRequest, options, optionalCallback); } } diff --git a/lib/services/containerRegistryManagement/lib/operations/runs.js b/lib/services/containerRegistryManagement/lib/operations/runs.js new file mode 100644 index 0000000000..0175450ea5 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/operations/runs.js @@ -0,0 +1,1928 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets all the runs for a registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The runs filter to apply on the operation. + * Arithmetic operators are not supported. The allowed string function is + * 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * + * @param {number} [options.top] $top is supported for get list of runs, which + * limits the maximum number of runs to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RunListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, registryName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let top = (options && options.top !== undefined) ? options.top : undefined; + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (top !== null && top !== undefined && typeof top !== 'number') { + throw new Error('top must be of type number.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + encodeURIComponent(filter)); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RunListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets the detailed information for a given run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Run} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, registryName, runId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (runId === null || runId === undefined || typeof runId.valueOf() !== 'string') { + throw new Error('runId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{runId}', encodeURIComponent(runId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Run']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Patch the run properties. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} runUpdateParameters The run update properties. + * + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that + * indicates whether archiving is enabled or not. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Run} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, registryName, runId, runUpdateParameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, registryName, runId, runUpdateParameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Run']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets a link to download the run logs. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RunGetLogResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getLogSasUrl(resourceGroupName, registryName, runId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (runId === null || runId === undefined || typeof runId.valueOf() !== 'string') { + throw new Error('runId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/listLogSasUrl'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{runId}', encodeURIComponent(runId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RunGetLogResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Cancel an existing run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _cancel(resourceGroupName, registryName, runId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCancel(resourceGroupName, registryName, runId, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Patch the run properties. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} runUpdateParameters The run update properties. + * + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that + * indicates whether archiving is enabled or not. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Run} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, registryName, runId, runUpdateParameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (runId === null || runId === undefined || typeof runId.valueOf() !== 'string') { + throw new Error('runId cannot be null or undefined and it must be of type string.'); + } + if (runUpdateParameters === null || runUpdateParameters === undefined) { + throw new Error('runUpdateParameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{runId}', encodeURIComponent(runId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (runUpdateParameters !== null && runUpdateParameters !== undefined) { + let requestModelMapper = new client.models['RunUpdateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, runUpdateParameters, 'runUpdateParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(runUpdateParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Run']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Run']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Cancel an existing run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCancel(resourceGroupName, registryName, runId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (runId === null || runId === undefined || typeof runId.valueOf() !== 'string') { + throw new Error('runId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/cancel'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{runId}', encodeURIComponent(runId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all the runs for a registry. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RunListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RunListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Runs. */ +class Runs { + /** + * Create a Runs. + * @param {ContainerRegistryManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._update = _update; + this._getLogSasUrl = _getLogSasUrl; + this._cancel = _cancel; + this._beginUpdate = _beginUpdate; + this._beginCancel = _beginCancel; + this._listNext = _listNext; + } + + /** + * Gets all the runs for a registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The runs filter to apply on the operation. + * Arithmetic operators are not supported. The allowed string function is + * 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * + * @param {number} [options.top] $top is supported for get list of runs, which + * limits the maximum number of runs to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, registryName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, registryName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the runs for a registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] The runs filter to apply on the operation. + * Arithmetic operators are not supported. The allowed string function is + * 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. + * + * @param {number} [options.top] $top is supported for get list of runs, which + * limits the maximum number of runs to return. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RunListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RunListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName, registryName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceGroupName, registryName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, registryName, options, optionalCallback); + } + } + + /** + * Gets the detailed information for a given run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, registryName, runId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the detailed information for a given run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Run} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Run} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, registryName, runId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, registryName, runId, options, optionalCallback); + } + } + + /** + * Patch the run properties. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} runUpdateParameters The run update properties. + * + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that + * indicates whether archiving is enabled or not. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, registryName, runId, runUpdateParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, registryName, runId, runUpdateParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Patch the run properties. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} runUpdateParameters The run update properties. + * + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that + * indicates whether archiving is enabled or not. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Run} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Run} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, registryName, runId, runUpdateParameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, registryName, runId, runUpdateParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, registryName, runId, runUpdateParameters, options, optionalCallback); + } + } + + /** + * Gets a link to download the run logs. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getLogSasUrlWithHttpOperationResponse(resourceGroupName, registryName, runId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getLogSasUrl(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a link to download the run logs. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RunGetLogResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RunGetLogResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getLogSasUrl(resourceGroupName, registryName, runId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getLogSasUrl(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getLogSasUrl(resourceGroupName, registryName, runId, options, optionalCallback); + } + } + + /** + * Cancel an existing run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + cancelWithHttpOperationResponse(resourceGroupName, registryName, runId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._cancel(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Cancel an existing run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + cancel(resourceGroupName, registryName, runId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._cancel(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._cancel(resourceGroupName, registryName, runId, options, optionalCallback); + } + } + + /** + * Patch the run properties. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} runUpdateParameters The run update properties. + * + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that + * indicates whether archiving is enabled or not. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, registryName, runId, runUpdateParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, registryName, runId, runUpdateParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Patch the run properties. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} runUpdateParameters The run update properties. + * + * @param {boolean} [runUpdateParameters.isArchiveEnabled] The value that + * indicates whether archiving is enabled or not. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Run} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Run} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, registryName, runId, runUpdateParameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, registryName, runId, runUpdateParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, registryName, runId, runUpdateParameters, options, optionalCallback); + } + } + + /** + * Cancel an existing run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCancelWithHttpOperationResponse(resourceGroupName, registryName, runId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCancel(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Cancel an existing run. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} runId The run ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCancel(resourceGroupName, registryName, runId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCancel(resourceGroupName, registryName, runId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCancel(resourceGroupName, registryName, runId, options, optionalCallback); + } + } + + /** + * Gets all the runs for a registry. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all the runs for a registry. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RunListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RunListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Runs; diff --git a/lib/services/containerRegistryManagement/lib/operations/tasks.js b/lib/services/containerRegistryManagement/lib/operations/tasks.js new file mode 100644 index 0000000000..26fd1f0692 --- /dev/null +++ b/lib/services/containerRegistryManagement/lib/operations/tasks.js @@ -0,0 +1,3046 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Lists all the tasks for a specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TaskListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, registryName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['TaskListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Get the properties of a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, registryName, taskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (taskName !== null && taskName !== undefined) { + if (taskName.length > 50) + { + throw new Error('"taskName" should satisfy the constraint - "MaxLength": 50'); + } + if (taskName.length < 5) + { + throw new Error('"taskName" should satisfy the constraint - "MinLength": 5'); + } + if (taskName.match(/^[a-zA-Z0-9-_]*$/) === null) + { + throw new Error('"taskName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9-_]*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates a task for a container registry with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskCreateParameters The parameters for creating a task. + * + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. + * + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskCreateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. + * + * @param {object} taskCreateParameters.step The properties of a task step. + * + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskCreateParameters.tags] The tags of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _create(resourceGroupName, registryName, taskName, taskCreateParameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreate(resourceGroupName, registryName, taskName, taskCreateParameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, registryName, taskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, registryName, taskName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates a task with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskUpdateParameters The parameters for updating a task. + * + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. + * + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. + * + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. + * + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. + * + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, registryName, taskName, taskUpdateParameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, registryName, taskName, taskUpdateParameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Returns a task with extended information that includes all secrets. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getDetails(resourceGroupName, registryName, taskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (taskName !== null && taskName !== undefined) { + if (taskName.length > 50) + { + throw new Error('"taskName" should satisfy the constraint - "MaxLength": 50'); + } + if (taskName.length < 5) + { + throw new Error('"taskName" should satisfy the constraint - "MinLength": 5'); + } + if (taskName.match(/^[a-zA-Z0-9-_]*$/) === null) + { + throw new Error('"taskName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9-_]*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}/listDetails'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates a task for a container registry with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskCreateParameters The parameters for creating a task. + * + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. + * + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskCreateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. + * + * @param {object} taskCreateParameters.step The properties of a task step. + * + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskCreateParameters.tags] The tags of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreate(resourceGroupName, registryName, taskName, taskCreateParameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (taskName !== null && taskName !== undefined) { + if (taskName.length > 50) + { + throw new Error('"taskName" should satisfy the constraint - "MaxLength": 50'); + } + if (taskName.length < 5) + { + throw new Error('"taskName" should satisfy the constraint - "MinLength": 5'); + } + if (taskName.match(/^[a-zA-Z0-9-_]*$/) === null) + { + throw new Error('"taskName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9-_]*$/'); + } + } + if (taskCreateParameters === null || taskCreateParameters === undefined) { + throw new Error('taskCreateParameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (taskCreateParameters !== null && taskCreateParameters !== undefined) { + let requestModelMapper = new client.models['Task']().mapper(); + requestModel = client.serialize(requestModelMapper, taskCreateParameters, 'taskCreateParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(taskCreateParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(resourceGroupName, registryName, taskName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (taskName !== null && taskName !== undefined) { + if (taskName.length > 50) + { + throw new Error('"taskName" should satisfy the constraint - "MaxLength": 50'); + } + if (taskName.length < 5) + { + throw new Error('"taskName" should satisfy the constraint - "MinLength": 5'); + } + if (taskName.match(/^[a-zA-Z0-9-_]*$/) === null) + { + throw new Error('"taskName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9-_]*$/'); + } + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates a task with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskUpdateParameters The parameters for updating a task. + * + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. + * + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. + * + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. + * + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. + * + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, registryName, taskName, taskUpdateParameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-01'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (registryName === null || registryName === undefined || typeof registryName.valueOf() !== 'string') { + throw new Error('registryName cannot be null or undefined and it must be of type string.'); + } + if (registryName !== null && registryName !== undefined) { + if (registryName.length > 50) + { + throw new Error('"registryName" should satisfy the constraint - "MaxLength": 50'); + } + if (registryName.length < 5) + { + throw new Error('"registryName" should satisfy the constraint - "MinLength": 5'); + } + if (registryName.match(/^[a-zA-Z0-9]*$/) === null) + { + throw new Error('"registryName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9]*$/'); + } + } + if (taskName === null || taskName === undefined || typeof taskName.valueOf() !== 'string') { + throw new Error('taskName cannot be null or undefined and it must be of type string.'); + } + if (taskName !== null && taskName !== undefined) { + if (taskName.length > 50) + { + throw new Error('"taskName" should satisfy the constraint - "MaxLength": 50'); + } + if (taskName.length < 5) + { + throw new Error('"taskName" should satisfy the constraint - "MinLength": 5'); + } + if (taskName.match(/^[a-zA-Z0-9-_]*$/) === null) + { + throw new Error('"taskName" should satisfy the constraint - "Pattern": /^[a-zA-Z0-9-_]*$/'); + } + } + if (taskUpdateParameters === null || taskUpdateParameters === undefined) { + throw new Error('taskUpdateParameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{registryName}', encodeURIComponent(registryName)); + requestUrl = requestUrl.replace('{taskName}', encodeURIComponent(taskName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (taskUpdateParameters !== null && taskUpdateParameters !== undefined) { + let requestModelMapper = new client.models['TaskUpdateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, taskUpdateParameters, 'taskUpdateParameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(taskUpdateParameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Task']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all the tasks for a specified container registry. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TaskListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['TaskListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Tasks. */ +class Tasks { + /** + * Create a Tasks. + * @param {ContainerRegistryManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._create = _create; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._getDetails = _getDetails; + this._beginCreate = _beginCreate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginUpdate = _beginUpdate; + this._listNext = _listNext; + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, registryName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, registryName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {TaskListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TaskListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName, registryName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceGroupName, registryName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, registryName, options, optionalCallback); + } + } + + /** + * Get the properties of a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, registryName, taskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Get the properties of a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Task} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, registryName, taskName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, registryName, taskName, options, optionalCallback); + } + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskCreateParameters The parameters for creating a task. + * + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. + * + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskCreateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. + * + * @param {object} taskCreateParameters.step The properties of a task step. + * + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskCreateParameters.tags] The tags of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createWithHttpOperationResponse(resourceGroupName, registryName, taskName, taskCreateParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(resourceGroupName, registryName, taskName, taskCreateParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskCreateParameters The parameters for creating a task. + * + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. + * + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskCreateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. + * + * @param {object} taskCreateParameters.step The properties of a task step. + * + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskCreateParameters.tags] The tags of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Task} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + create(resourceGroupName, registryName, taskName, taskCreateParameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._create(resourceGroupName, registryName, taskName, taskCreateParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(resourceGroupName, registryName, taskName, taskCreateParameters, options, optionalCallback); + } + } + + /** + * Deletes a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, registryName, taskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, registryName, taskName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, registryName, taskName, options, optionalCallback); + } + } + + /** + * Updates a task with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskUpdateParameters The parameters for updating a task. + * + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. + * + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. + * + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. + * + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. + * + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, registryName, taskName, taskUpdateParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, registryName, taskName, taskUpdateParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a task with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskUpdateParameters The parameters for updating a task. + * + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. + * + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. + * + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. + * + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. + * + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Task} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, registryName, taskName, taskUpdateParameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, registryName, taskName, taskUpdateParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, registryName, taskName, taskUpdateParameters, options, optionalCallback); + } + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getDetailsWithHttpOperationResponse(resourceGroupName, registryName, taskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getDetails(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Task} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getDetails(resourceGroupName, registryName, taskName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getDetails(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDetails(resourceGroupName, registryName, taskName, options, optionalCallback); + } + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskCreateParameters The parameters for creating a task. + * + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. + * + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskCreateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. + * + * @param {object} taskCreateParameters.step The properties of a task step. + * + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskCreateParameters.tags] The tags of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateWithHttpOperationResponse(resourceGroupName, registryName, taskName, taskCreateParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, registryName, taskName, taskCreateParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskCreateParameters The parameters for creating a task. + * + * @param {string} [taskCreateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} taskCreateParameters.platform The platform properties + * against which the run has to happen. + * + * @param {string} taskCreateParameters.platform.os The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskCreateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskCreateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskCreateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskCreateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskCreateParameters.timeout] Run timeout in seconds. + * + * @param {object} taskCreateParameters.step The properties of a task step. + * + * @param {string} taskCreateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskCreateParameters.trigger] The properties that describe + * all triggers for the task. + * + * @param {array} [taskCreateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskCreateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * taskCreateParameters.trigger.baseImageTrigger.baseImageTriggerType The type + * of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskCreateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskCreateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {string} taskCreateParameters.location The location of the resource. + * This cannot be changed after the resource is created. + * + * @param {object} [taskCreateParameters.tags] The tags of the resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Task} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreate(resourceGroupName, registryName, taskName, taskCreateParameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, registryName, taskName, taskCreateParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreate(resourceGroupName, registryName, taskName, taskCreateParameters, options, optionalCallback); + } + } + + /** + * Deletes a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, registryName, taskName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a specified task. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName, registryName, taskName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, registryName, taskName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, registryName, taskName, options, optionalCallback); + } + } + + /** + * Updates a task with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskUpdateParameters The parameters for updating a task. + * + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. + * + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. + * + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. + * + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. + * + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, registryName, taskName, taskUpdateParameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, registryName, taskName, taskUpdateParameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a task with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the container registry belongs. + * + * @param {string} registryName The name of the container registry. + * + * @param {string} taskName The name of the container registry task. + * + * @param {object} taskUpdateParameters The parameters for updating a task. + * + * @param {string} [taskUpdateParameters.status] The current status of task. + * Possible values include: 'Disabled', 'Enabled' + * + * @param {object} [taskUpdateParameters.platform] The platform properties + * against which the run has to happen. + * + * @param {string} [taskUpdateParameters.platform.os] The operating system type + * required for the run. Possible values include: 'Windows', 'Linux' + * + * @param {string} [taskUpdateParameters.platform.architecture] The OS + * architecture. Possible values include: 'amd64', 'x86', 'arm' + * + * @param {string} [taskUpdateParameters.platform.variant] Variant of the CPU. + * Possible values include: 'v6', 'v7', 'v8' + * + * @param {object} [taskUpdateParameters.agentConfiguration] The machine + * configuration of the run agent. + * + * @param {number} [taskUpdateParameters.agentConfiguration.cpu] The CPU + * configuration in terms of number of cores required for the run. + * + * @param {number} [taskUpdateParameters.timeout] Run timeout in seconds. + * + * @param {object} [taskUpdateParameters.step] The properties for updating a + * task step. + * + * @param {string} taskUpdateParameters.step.type Polymorphic Discriminator + * + * @param {object} [taskUpdateParameters.trigger] The properties for updating + * trigger properties. + * + * @param {array} [taskUpdateParameters.trigger.sourceTriggers] The collection + * of triggers based on source code repository. + * + * @param {object} [taskUpdateParameters.trigger.baseImageTrigger] The trigger + * based on base image dependencies. + * + * @param {string} + * [taskUpdateParameters.trigger.baseImageTrigger.baseImageTriggerType] The + * type of the auto trigger for base image dependency updates. Possible values + * include: 'All', 'Runtime' + * + * @param {string} [taskUpdateParameters.trigger.baseImageTrigger.status] The + * current status of build trigger. Possible values include: 'Disabled', + * 'Enabled' + * + * @param {string} taskUpdateParameters.trigger.baseImageTrigger.name The name + * of the trigger. + * + * @param {object} [taskUpdateParameters.tags] The ARM resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Task} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Task} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, registryName, taskName, taskUpdateParameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, registryName, taskName, taskUpdateParameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, registryName, taskName, taskUpdateParameters, options, optionalCallback); + } + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {TaskListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TaskListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Tasks; From 858e4db5b97ebe6c5f2ad161adc02953285b2231 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Thu, 30 Aug 2018 10:17:23 -0700 Subject: [PATCH 3/5] Regenerate azure-arm-containerregistry --- .../lib/models/eventContent.js | 2 - .../lib/models/eventRequestMessage.js | 2 - .../lib/models/imageUpdateTrigger.js | 2 - .../lib/models/importImageParameters.js | 2 - .../lib/models/operationDefinition.js | 2 - ...operationServiceSpecificationDefinition.js | 2 - .../models/registryListCredentialsResult.js | 2 - .../lib/models/registryPolicies.js | 2 - .../lib/models/registryUpdateParameters.js | 2 - .../lib/models/registryUsageListResult.js | 2 - .../lib/models/sourceProperties.js | 2 - .../lib/models/sourceTrigger.js | 2 - .../models/sourceTriggerUpdateParameters.js | 2 - .../lib/models/sourceUpdateParameters.js | 2 - .../lib/models/taskStepProperties.js | 2 - .../lib/models/taskUpdateParameters.js | 2 - .../lib/models/triggerProperties.js | 2 - .../lib/models/triggerUpdateParameters.js | 2 - lib/services/websiteManagement2/LICENSE.txt | 21 - lib/services/websiteManagement2/README.md | 40 - .../lib/models/ipSecurityRestriction.js | 108 -- .../lib/operations/provider.js | 1391 ----------------- lib/services/websiteManagement2/package.json | 25 - 23 files changed, 1621 deletions(-) delete mode 100644 lib/services/websiteManagement2/LICENSE.txt delete mode 100644 lib/services/websiteManagement2/README.md delete mode 100644 lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js delete mode 100644 lib/services/websiteManagement2/lib/operations/provider.js delete mode 100644 lib/services/websiteManagement2/package.json diff --git a/lib/services/containerRegistryManagement/lib/models/eventContent.js b/lib/services/containerRegistryManagement/lib/models/eventContent.js index 73cf278bc1..6c21c04677 100644 --- a/lib/services/containerRegistryManagement/lib/models/eventContent.js +++ b/lib/services/containerRegistryManagement/lib/models/eventContent.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The content of the event request message. * diff --git a/lib/services/containerRegistryManagement/lib/models/eventRequestMessage.js b/lib/services/containerRegistryManagement/lib/models/eventRequestMessage.js index 448a66a9eb..2cb95eb72c 100644 --- a/lib/services/containerRegistryManagement/lib/models/eventRequestMessage.js +++ b/lib/services/containerRegistryManagement/lib/models/eventRequestMessage.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The event request message sent to the service URI. * diff --git a/lib/services/containerRegistryManagement/lib/models/imageUpdateTrigger.js b/lib/services/containerRegistryManagement/lib/models/imageUpdateTrigger.js index e66b3b727b..9301807a67 100644 --- a/lib/services/containerRegistryManagement/lib/models/imageUpdateTrigger.js +++ b/lib/services/containerRegistryManagement/lib/models/imageUpdateTrigger.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The image update trigger that caused a build. * diff --git a/lib/services/containerRegistryManagement/lib/models/importImageParameters.js b/lib/services/containerRegistryManagement/lib/models/importImageParameters.js index 5e93c9c8cc..27027a3978 100644 --- a/lib/services/containerRegistryManagement/lib/models/importImageParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/importImageParameters.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class representing a ImportImageParameters. */ diff --git a/lib/services/containerRegistryManagement/lib/models/operationDefinition.js b/lib/services/containerRegistryManagement/lib/models/operationDefinition.js index a26c639849..e41849d0d2 100644 --- a/lib/services/containerRegistryManagement/lib/models/operationDefinition.js +++ b/lib/services/containerRegistryManagement/lib/models/operationDefinition.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The definition of a container registry operation. * diff --git a/lib/services/containerRegistryManagement/lib/models/operationServiceSpecificationDefinition.js b/lib/services/containerRegistryManagement/lib/models/operationServiceSpecificationDefinition.js index d8698d8644..0474a63311 100644 --- a/lib/services/containerRegistryManagement/lib/models/operationServiceSpecificationDefinition.js +++ b/lib/services/containerRegistryManagement/lib/models/operationServiceSpecificationDefinition.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The definition of Azure Monitoring metrics list. * diff --git a/lib/services/containerRegistryManagement/lib/models/registryListCredentialsResult.js b/lib/services/containerRegistryManagement/lib/models/registryListCredentialsResult.js index 0a5f25943f..efc57692b8 100644 --- a/lib/services/containerRegistryManagement/lib/models/registryListCredentialsResult.js +++ b/lib/services/containerRegistryManagement/lib/models/registryListCredentialsResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The response from the ListCredentials operation. * diff --git a/lib/services/containerRegistryManagement/lib/models/registryPolicies.js b/lib/services/containerRegistryManagement/lib/models/registryPolicies.js index 0289e07d8e..5ad2aaa411 100644 --- a/lib/services/containerRegistryManagement/lib/models/registryPolicies.js +++ b/lib/services/containerRegistryManagement/lib/models/registryPolicies.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * An object that represents policies for a container registry. * diff --git a/lib/services/containerRegistryManagement/lib/models/registryUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/registryUpdateParameters.js index 1dc1c65006..1b5b26a0e9 100644 --- a/lib/services/containerRegistryManagement/lib/models/registryUpdateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/registryUpdateParameters.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The parameters for updating a container registry. * diff --git a/lib/services/containerRegistryManagement/lib/models/registryUsageListResult.js b/lib/services/containerRegistryManagement/lib/models/registryUsageListResult.js index 47f1bd5f54..7f8c8f829f 100644 --- a/lib/services/containerRegistryManagement/lib/models/registryUsageListResult.js +++ b/lib/services/containerRegistryManagement/lib/models/registryUsageListResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The result of a request to get container registry quota usages. * diff --git a/lib/services/containerRegistryManagement/lib/models/sourceProperties.js b/lib/services/containerRegistryManagement/lib/models/sourceProperties.js index fb0c311ee6..c78fcf34aa 100644 --- a/lib/services/containerRegistryManagement/lib/models/sourceProperties.js +++ b/lib/services/containerRegistryManagement/lib/models/sourceProperties.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The properties of the source code repository. * diff --git a/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js b/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js index 44436f1fb2..26fba399f5 100644 --- a/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js +++ b/lib/services/containerRegistryManagement/lib/models/sourceTrigger.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The properties of a source based trigger. * diff --git a/lib/services/containerRegistryManagement/lib/models/sourceTriggerUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/sourceTriggerUpdateParameters.js index ce53fb72cc..95db951254 100644 --- a/lib/services/containerRegistryManagement/lib/models/sourceTriggerUpdateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/sourceTriggerUpdateParameters.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The properties for updating a source based trigger. * diff --git a/lib/services/containerRegistryManagement/lib/models/sourceUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/sourceUpdateParameters.js index cdd92ccf5c..3c748030e1 100644 --- a/lib/services/containerRegistryManagement/lib/models/sourceUpdateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/sourceUpdateParameters.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The properties for updating the source code repository. * diff --git a/lib/services/containerRegistryManagement/lib/models/taskStepProperties.js b/lib/services/containerRegistryManagement/lib/models/taskStepProperties.js index 275e033e12..0c3e766e90 100644 --- a/lib/services/containerRegistryManagement/lib/models/taskStepProperties.js +++ b/lib/services/containerRegistryManagement/lib/models/taskStepProperties.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Base properties for any task step. * diff --git a/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js index 5b82cf8a85..dcf90a65a9 100644 --- a/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/taskUpdateParameters.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The parameters for updating a task. * diff --git a/lib/services/containerRegistryManagement/lib/models/triggerProperties.js b/lib/services/containerRegistryManagement/lib/models/triggerProperties.js index 7b366694ae..34e6e346dc 100644 --- a/lib/services/containerRegistryManagement/lib/models/triggerProperties.js +++ b/lib/services/containerRegistryManagement/lib/models/triggerProperties.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The properties of a build trigger. * diff --git a/lib/services/containerRegistryManagement/lib/models/triggerUpdateParameters.js b/lib/services/containerRegistryManagement/lib/models/triggerUpdateParameters.js index 42414d8727..6992ff2d03 100644 --- a/lib/services/containerRegistryManagement/lib/models/triggerUpdateParameters.js +++ b/lib/services/containerRegistryManagement/lib/models/triggerUpdateParameters.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The properties for updating build triggers. * diff --git a/lib/services/websiteManagement2/LICENSE.txt b/lib/services/websiteManagement2/LICENSE.txt deleted file mode 100644 index a70e8cf660..0000000000 --- a/lib/services/websiteManagement2/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/lib/services/websiteManagement2/README.md b/lib/services/websiteManagement2/README.md deleted file mode 100644 index dd95909622..0000000000 --- a/lib/services/websiteManagement2/README.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -uid: azure-arm-website -summary: *content - ---- -# Microsoft Azure SDK for Node.js - WebSiteManagementClient -This project provides a Node.js package for accessing Azure. Right now it supports: -- **Node.js version 6.x.x or higher** - -## Features - - -## How to Install - -```bash -npm install azure-arm-website -``` - -## How to use - -### Authentication, client creation and list appServiceCertificateOrders as an example. - -```javascript -const msRestAzure = require("ms-rest-azure"); -const WebSiteManagementClient = require("azure-arm-website"); -msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - const client = new WebSiteManagementClient(creds, subscriptionId); - return client.appServiceCertificateOrders.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.log('An error occurred:'); - console.dir(err, {depth: null, colors: true}); -}); - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js b/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js deleted file mode 100644 index 7442dc0ebd..0000000000 --- a/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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'; - -/** - * IP security restriction on an app. - * - */ -class IpSecurityRestriction { - /** - * Create a IpSecurityRestriction. - * @member {string} ipAddress IP address the security restriction is valid - * for. - * It can be in form of pure ipv4 address (required SubnetMask property) or - * CIDR notation such as ipv4/mask (leading bit match). For CIDR, - * SubnetMask property must not be specified. - * @member {string} [subnetMask] Subnet mask for the range of IP addresses - * the restriction is valid for. - * @member {string} [action] Allow or Deny access for this IP range. - * @member {string} [tag] Defines what this IP filter will be used for. This - * is to support IP filtering on proxies. Possible values include: 'Default', - * 'XffProxy' - * @member {number} [priority] Priority of IP restriction rule. - * @member {string} [name] IP restriction rule name. - * @member {string} [description] IP restriction rule description. - */ - constructor() { - } - - /** - * Defines the metadata of IpSecurityRestriction - * - * @returns {object} metadata of IpSecurityRestriction - * - */ - mapper() { - return { - required: false, - serializedName: 'IpSecurityRestriction', - type: { - name: 'Composite', - className: 'IpSecurityRestriction', - modelProperties: { - ipAddress: { - required: true, - serializedName: 'ipAddress', - type: { - name: 'String' - } - }, - subnetMask: { - required: false, - serializedName: 'subnetMask', - type: { - name: 'String' - } - }, - action: { - required: false, - serializedName: 'action', - type: { - name: 'String' - } - }, - tag: { - required: false, - serializedName: 'tag', - type: { - name: 'Enum', - allowedValues: [ 'Default', 'XffProxy' ] - } - }, - priority: { - required: false, - serializedName: 'priority', - type: { - name: 'Number' - } - }, - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - description: { - required: false, - serializedName: 'description', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = IpSecurityRestriction; diff --git a/lib/services/websiteManagement2/lib/operations/provider.js b/lib/services/websiteManagement2/lib/operations/provider.js deleted file mode 100644 index 064fc16469..0000000000 --- a/lib/services/websiteManagement2/lib/operations/provider.js +++ /dev/null @@ -1,1391 +0,0 @@ -/* - * 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; - -/** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @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 ApplicationStackCollection} 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 _getAvailableStacks(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 osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; - // Validate - try { - if (osTypeSelected !== null && osTypeSelected !== undefined && typeof osTypeSelected.valueOf() !== 'string') { - throw new Error('osTypeSelected must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/availableStacks'; - let queryParameters = []; - if (osTypeSelected !== null && osTypeSelected !== undefined) { - queryParameters.push('osTypeSelected=' + encodeURIComponent(osTypeSelected)); - } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().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['ApplicationStackCollection']().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); - }); -} - -/** - * @summary Gets all available operations for the Microsoft.Web resource - * provider. Also exposes resource metric definitions - * - * Gets all available operations for the Microsoft.Web resource provider. Also - * exposes resource metric definitions - * - * @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 CsmOperationCollection} 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 _listOperations(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/operations'; - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().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['CsmOperationCollection']().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); - }); -} - -/** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @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 ApplicationStackCollection} 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 _getAvailableStacksOnPrem(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 osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; - // Validate - try { - if (osTypeSelected !== null && osTypeSelected !== undefined && typeof osTypeSelected.valueOf() !== 'string') { - throw new Error('osTypeSelected must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - if (osTypeSelected !== null && osTypeSelected !== undefined) { - queryParameters.push('osTypeSelected=' + encodeURIComponent(osTypeSelected)); - } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().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['ApplicationStackCollection']().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); - }); -} - -/** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @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 ApplicationStackCollection} 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 _getAvailableStacksNext(nextPageLink, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().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['ApplicationStackCollection']().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); - }); -} - -/** - * @summary Gets all available operations for the Microsoft.Web resource - * provider. Also exposes resource metric definitions - * - * Gets all available operations for the Microsoft.Web resource provider. Also - * exposes resource metric definitions - * - * @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 CsmOperationCollection} 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 _listOperationsNext(nextPageLink, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().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['CsmOperationCollection']().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); - }); -} - -/** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @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 ApplicationStackCollection} 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 _getAvailableStacksOnPremNext(nextPageLink, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().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['ApplicationStackCollection']().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 Provider. */ -class Provider { - /** - * Create a Provider. - * @param {WebSiteManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._getAvailableStacks = _getAvailableStacks; - this._listOperations = _listOperations; - this._getAvailableStacksOnPrem = _getAvailableStacksOnPrem; - this._getAvailableStacksNext = _getAvailableStacksNext; - this._listOperationsNext = _listOperationsNext; - this._getAvailableStacksOnPremNext = _getAvailableStacksOnPremNext; - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @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. - */ - getAvailableStacksWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getAvailableStacks(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @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 {ApplicationStackCollection} - 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 ApplicationStackCollection} 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. - */ - getAvailableStacks(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._getAvailableStacks(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getAvailableStacks(options, optionalCallback); - } - } - - /** - * @summary Gets all available operations for the Microsoft.Web resource - * provider. Also exposes resource metric definitions - * - * Gets all available operations for the Microsoft.Web resource provider. Also - * exposes resource metric definitions - * - * @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. - */ - listOperationsWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listOperations(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets all available operations for the Microsoft.Web resource - * provider. Also exposes resource metric definitions - * - * Gets all available operations for the Microsoft.Web resource provider. Also - * exposes resource metric definitions - * - * @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 {CsmOperationCollection} - 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 CsmOperationCollection} 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. - */ - listOperations(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._listOperations(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listOperations(options, optionalCallback); - } - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @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. - */ - getAvailableStacksOnPremWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getAvailableStacksOnPrem(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @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 {ApplicationStackCollection} - 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 ApplicationStackCollection} 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. - */ - getAvailableStacksOnPrem(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._getAvailableStacksOnPrem(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getAvailableStacksOnPrem(options, optionalCallback); - } - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @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. - */ - getAvailableStacksNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getAvailableStacksNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @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 {ApplicationStackCollection} - 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 ApplicationStackCollection} 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. - */ - getAvailableStacksNext(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._getAvailableStacksNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getAvailableStacksNext(nextPageLink, options, optionalCallback); - } - } - - /** - * @summary Gets all available operations for the Microsoft.Web resource - * provider. Also exposes resource metric definitions - * - * Gets all available operations for the Microsoft.Web resource provider. Also - * exposes resource metric definitions - * - * @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. - */ - listOperationsNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listOperationsNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets all available operations for the Microsoft.Web resource - * provider. Also exposes resource metric definitions - * - * Gets all available operations for the Microsoft.Web resource provider. Also - * exposes resource metric definitions - * - * @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 {CsmOperationCollection} - 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 CsmOperationCollection} 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. - */ - listOperationsNext(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._listOperationsNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listOperationsNext(nextPageLink, options, optionalCallback); - } - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @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. - */ - getAvailableStacksOnPremNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getAvailableStacksOnPremNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @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 {ApplicationStackCollection} - 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 ApplicationStackCollection} 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. - */ - getAvailableStacksOnPremNext(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._getAvailableStacksOnPremNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getAvailableStacksOnPremNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = Provider; diff --git a/lib/services/websiteManagement2/package.json b/lib/services/websiteManagement2/package.json deleted file mode 100644 index 1776350f46..0000000000 --- a/lib/services/websiteManagement2/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "azure-arm-website", - "author": "Microsoft Corporation", - "description": "WebSiteManagementClient Library with typescript type definitions for node", - "version": "5.0.0", - "dependencies": { - "ms-rest": "^2.3.3", - "ms-rest-azure": "^2.5.5" - }, - "keywords": [ - "node", - "azure" - ], - "license": "MIT", - "main": "./lib/webSiteManagementClient.js", - "types": "./lib/webSiteManagementClient.d.ts", - "homepage": "https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/websiteManagement2", - "repository": { - "type": "git", - "url": "https://github.com/azure/azure-sdk-for-node.git" - }, - "bugs": { - "url": "https://github.com/azure/azure-sdk-for-node/issues" - } -} From f776abfefb2e6d2d484ff0330e84c98ddd571f1b Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Thu, 30 Aug 2018 10:19:33 -0700 Subject: [PATCH 4/5] Revert websiteManagement2 files --- lib/services/websiteManagement2/LICENSE.txt | 21 + lib/services/websiteManagement2/README.md | 40 + .../lib/models/ipSecurityRestriction.js | 108 ++ .../lib/operations/provider.js | 1391 +++++++++++++++++ lib/services/websiteManagement2/package.json | 25 + 5 files changed, 1585 insertions(+) create mode 100644 lib/services/websiteManagement2/LICENSE.txt create mode 100644 lib/services/websiteManagement2/README.md create mode 100644 lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js create mode 100644 lib/services/websiteManagement2/lib/operations/provider.js create mode 100644 lib/services/websiteManagement2/package.json diff --git a/lib/services/websiteManagement2/LICENSE.txt b/lib/services/websiteManagement2/LICENSE.txt new file mode 100644 index 0000000000..a70e8cf660 --- /dev/null +++ b/lib/services/websiteManagement2/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/websiteManagement2/README.md b/lib/services/websiteManagement2/README.md new file mode 100644 index 0000000000..dd95909622 --- /dev/null +++ b/lib/services/websiteManagement2/README.md @@ -0,0 +1,40 @@ +--- +uid: azure-arm-website +summary: *content + +--- +# Microsoft Azure SDK for Node.js - WebSiteManagementClient +This project provides a Node.js package for accessing Azure. Right now it supports: +- **Node.js version 6.x.x or higher** + +## Features + + +## How to Install + +```bash +npm install azure-arm-website +``` + +## How to use + +### Authentication, client creation and list appServiceCertificateOrders as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const WebSiteManagementClient = require("azure-arm-website"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new WebSiteManagementClient(creds, subscriptionId); + return client.appServiceCertificateOrders.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.log('An error occurred:'); + console.dir(err, {depth: null, colors: true}); +}); + +## Related projects + +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js b/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js new file mode 100644 index 0000000000..7442dc0ebd --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js @@ -0,0 +1,108 @@ +/* + * 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'; + +/** + * IP security restriction on an app. + * + */ +class IpSecurityRestriction { + /** + * Create a IpSecurityRestriction. + * @member {string} ipAddress IP address the security restriction is valid + * for. + * It can be in form of pure ipv4 address (required SubnetMask property) or + * CIDR notation such as ipv4/mask (leading bit match). For CIDR, + * SubnetMask property must not be specified. + * @member {string} [subnetMask] Subnet mask for the range of IP addresses + * the restriction is valid for. + * @member {string} [action] Allow or Deny access for this IP range. + * @member {string} [tag] Defines what this IP filter will be used for. This + * is to support IP filtering on proxies. Possible values include: 'Default', + * 'XffProxy' + * @member {number} [priority] Priority of IP restriction rule. + * @member {string} [name] IP restriction rule name. + * @member {string} [description] IP restriction rule description. + */ + constructor() { + } + + /** + * Defines the metadata of IpSecurityRestriction + * + * @returns {object} metadata of IpSecurityRestriction + * + */ + mapper() { + return { + required: false, + serializedName: 'IpSecurityRestriction', + type: { + name: 'Composite', + className: 'IpSecurityRestriction', + modelProperties: { + ipAddress: { + required: true, + serializedName: 'ipAddress', + type: { + name: 'String' + } + }, + subnetMask: { + required: false, + serializedName: 'subnetMask', + type: { + name: 'String' + } + }, + action: { + required: false, + serializedName: 'action', + type: { + name: 'String' + } + }, + tag: { + required: false, + serializedName: 'tag', + type: { + name: 'Enum', + allowedValues: [ 'Default', 'XffProxy' ] + } + }, + priority: { + required: false, + serializedName: 'priority', + type: { + name: 'Number' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = IpSecurityRestriction; diff --git a/lib/services/websiteManagement2/lib/operations/provider.js b/lib/services/websiteManagement2/lib/operations/provider.js new file mode 100644 index 0000000000..064fc16469 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/provider.js @@ -0,0 +1,1391 @@ +/* + * 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; + +/** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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 ApplicationStackCollection} 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 _getAvailableStacks(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 osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; + // Validate + try { + if (osTypeSelected !== null && osTypeSelected !== undefined && typeof osTypeSelected.valueOf() !== 'string') { + throw new Error('osTypeSelected must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/availableStacks'; + let queryParameters = []; + if (osTypeSelected !== null && osTypeSelected !== undefined) { + queryParameters.push('osTypeSelected=' + encodeURIComponent(osTypeSelected)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ApplicationStackCollection']().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); + }); +} + +/** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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 CsmOperationCollection} 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 _listOperations(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/operations'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmOperationCollection']().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); + }); +} + +/** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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 ApplicationStackCollection} 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 _getAvailableStacksOnPrem(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 osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; + // Validate + try { + if (osTypeSelected !== null && osTypeSelected !== undefined && typeof osTypeSelected.valueOf() !== 'string') { + throw new Error('osTypeSelected must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (osTypeSelected !== null && osTypeSelected !== undefined) { + queryParameters.push('osTypeSelected=' + encodeURIComponent(osTypeSelected)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ApplicationStackCollection']().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); + }); +} + +/** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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 ApplicationStackCollection} 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 _getAvailableStacksNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ApplicationStackCollection']().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); + }); +} + +/** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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 CsmOperationCollection} 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 _listOperationsNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmOperationCollection']().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); + }); +} + +/** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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 ApplicationStackCollection} 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 _getAvailableStacksOnPremNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ApplicationStackCollection']().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 Provider. */ +class Provider { + /** + * Create a Provider. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._getAvailableStacks = _getAvailableStacks; + this._listOperations = _listOperations; + this._getAvailableStacksOnPrem = _getAvailableStacksOnPrem; + this._getAvailableStacksNext = _getAvailableStacksNext; + this._listOperationsNext = _listOperationsNext; + this._getAvailableStacksOnPremNext = _getAvailableStacksOnPremNext; + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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. + */ + getAvailableStacksWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacks(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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 {ApplicationStackCollection} - 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 ApplicationStackCollection} 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. + */ + getAvailableStacks(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._getAvailableStacks(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacks(options, optionalCallback); + } + } + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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. + */ + listOperationsWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOperations(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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 {CsmOperationCollection} - 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 CsmOperationCollection} 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. + */ + listOperations(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._listOperations(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOperations(options, optionalCallback); + } + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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. + */ + getAvailableStacksOnPremWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacksOnPrem(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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 {ApplicationStackCollection} - 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 ApplicationStackCollection} 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. + */ + getAvailableStacksOnPrem(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._getAvailableStacksOnPrem(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacksOnPrem(options, optionalCallback); + } + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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. + */ + getAvailableStacksNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacksNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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 {ApplicationStackCollection} - 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 ApplicationStackCollection} 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. + */ + getAvailableStacksNext(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._getAvailableStacksNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacksNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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. + */ + listOperationsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOperationsNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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 {CsmOperationCollection} - 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 CsmOperationCollection} 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. + */ + listOperationsNext(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._listOperationsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOperationsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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. + */ + getAvailableStacksOnPremNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacksOnPremNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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 {ApplicationStackCollection} - 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 ApplicationStackCollection} 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. + */ + getAvailableStacksOnPremNext(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._getAvailableStacksOnPremNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacksOnPremNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Provider; diff --git a/lib/services/websiteManagement2/package.json b/lib/services/websiteManagement2/package.json new file mode 100644 index 0000000000..1776350f46 --- /dev/null +++ b/lib/services/websiteManagement2/package.json @@ -0,0 +1,25 @@ +{ + "name": "azure-arm-website", + "author": "Microsoft Corporation", + "description": "WebSiteManagementClient Library with typescript type definitions for node", + "version": "5.0.0", + "dependencies": { + "ms-rest": "^2.3.3", + "ms-rest-azure": "^2.5.5" + }, + "keywords": [ + "node", + "azure" + ], + "license": "MIT", + "main": "./lib/webSiteManagementClient.js", + "types": "./lib/webSiteManagementClient.d.ts", + "homepage": "https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/websiteManagement2", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-node.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-node/issues" + } +} From 48fcc9c1d2a0ca7ff2240779a518c82ea701c7d1 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Thu, 30 Aug 2018 10:20:54 -0700 Subject: [PATCH 5/5] Update azure-arm-containerregistry to 3.0.0 --- lib/services/containerRegistryManagement/package-lock.json | 2 +- lib/services/containerRegistryManagement/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/services/containerRegistryManagement/package-lock.json b/lib/services/containerRegistryManagement/package-lock.json index bfab80c28e..81f46c9dc8 100644 --- a/lib/services/containerRegistryManagement/package-lock.json +++ b/lib/services/containerRegistryManagement/package-lock.json @@ -1,6 +1,6 @@ { "name": "azure-arm-containerregistry", - "version": "2.4.1", + "version": "3.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/lib/services/containerRegistryManagement/package.json b/lib/services/containerRegistryManagement/package.json index ae844c6153..e45dd33725 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.4.1", + "version": "3.0.0", "dependencies": { "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5"