diff --git a/lib/services/machinelearning/lib/commitmentPlan/azureMLCommitmentPlansManagementClient.d.ts b/lib/services/machinelearning/lib/commitmentPlan/azureMLCommitmentPlansManagementClient.d.ts index 281bab750c..36239aae2b 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/azureMLCommitmentPlansManagementClient.d.ts +++ b/lib/services/machinelearning/lib/commitmentPlan/azureMLCommitmentPlansManagementClient.d.ts @@ -10,9 +10,10 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; -declare class AzureMLCommitmentPlansManagementClient extends AzureServiceClient { +export default class AzureMLCommitmentPlansManagementClient extends AzureServiceClient { /** * Initializes a new instance of the AzureMLCommitmentPlansManagementClient class. * @constructor @@ -33,11 +34,11 @@ declare class AzureMLCommitmentPlansManagementClient extends AzureServiceClient * * @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); @@ -55,9 +56,10 @@ declare class AzureMLCommitmentPlansManagementClient extends AzureServiceClient generateClientRequestId: boolean; // Operation groups + skus: operations.Skus; commitmentAssociations: operations.CommitmentAssociations; commitmentPlans: operations.CommitmentPlans; usageHistory: operations.UsageHistory; } -export = AzureMLCommitmentPlansManagementClient; +export { AzureMLCommitmentPlansManagementClient, models as AzureMLCommitmentPlansManagementModels }; diff --git a/lib/services/machinelearning/lib/commitmentPlan/azureMLCommitmentPlansManagementClient.js b/lib/services/machinelearning/lib/commitmentPlan/azureMLCommitmentPlansManagementClient.js index 4282bf27f8..bc0520e17c 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/azureMLCommitmentPlansManagementClient.js +++ b/lib/services/machinelearning/lib/commitmentPlan/azureMLCommitmentPlansManagementClient.js @@ -34,9 +34,9 @@ class AzureMLCommitmentPlansManagementClient 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) { @@ -72,6 +72,7 @@ class AzureMLCommitmentPlansManagementClient extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } + this.skus = new operations.Skus(this); this.commitmentAssociations = new operations.CommitmentAssociations(this); this.commitmentPlans = new operations.CommitmentPlans(this); this.usageHistory = new operations.UsageHistory(this); @@ -82,3 +83,6 @@ class AzureMLCommitmentPlansManagementClient extends ServiceClient { } module.exports = AzureMLCommitmentPlansManagementClient; +module.exports['default'] = AzureMLCommitmentPlansManagementClient; +module.exports.AzureMLCommitmentPlansManagementClient = AzureMLCommitmentPlansManagementClient; +module.exports.AzureMLCommitmentPlansManagementModels = models; diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/catalogSku.js b/lib/services/machinelearning/lib/commitmentPlan/models/catalogSku.js new file mode 100644 index 0000000000..503e0b17dd --- /dev/null +++ b/lib/services/machinelearning/lib/commitmentPlan/models/catalogSku.js @@ -0,0 +1,156 @@ +/* + * 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'; + +/** + * Details of a commitment plan SKU. + * + */ +class CatalogSku { + /** + * Create a CatalogSku. + * @property {string} [resourceType] Resource type name + * @property {string} [name] SKU name + * @property {string} [tier] SKU tier + * @property {array} [locations] Regions where the SKU is available. + * @property {object} [capacity] SKU scaling information + * @property {number} [capacity.minimum] The minimum capacity. + * @property {number} [capacity.maximum] The maximum capacity that can be + * set. + * @property {number} [capacity.default] The default capacity. + * @property {string} [capacity.scaleType] The scale type applicable to the + * sku. Possible values include: 'Automatic', 'Manual', 'None' + * @property {array} [capabilities] The capability information for the + * specified SKU. + * @property {array} [costs] The cost information for the specified SKU. + * @property {array} [restrictions] Restrictions which would prevent a SKU + * from being used. This is empty if there are no restrictions. + */ + constructor() { + } + + /** + * Defines the metadata of CatalogSku + * + * @returns {object} metadata of CatalogSku + * + */ + mapper() { + return { + required: false, + serializedName: 'CatalogSku', + type: { + name: 'Composite', + className: 'CatalogSku', + modelProperties: { + resourceType: { + required: false, + readOnly: true, + serializedName: 'resourceType', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + tier: { + required: false, + readOnly: true, + serializedName: 'tier', + type: { + name: 'String' + } + }, + locations: { + required: false, + readOnly: true, + serializedName: 'locations', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + capacity: { + required: false, + readOnly: true, + serializedName: 'capacity', + type: { + name: 'Composite', + className: 'SkuCapacity' + } + }, + capabilities: { + required: false, + readOnly: true, + serializedName: 'capabilities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SkuCapabilityElementType', + type: { + name: 'Composite', + className: 'SkuCapability' + } + } + } + }, + costs: { + required: false, + readOnly: true, + serializedName: 'costs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SkuCostElementType', + type: { + name: 'Composite', + className: 'SkuCost' + } + } + } + }, + restrictions: { + required: false, + readOnly: true, + serializedName: 'restrictions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SkuRestrictionsElementType', + type: { + name: 'Composite', + className: 'SkuRestrictions' + } + } + } + } + } + } + }; + } +} + +module.exports = CatalogSku; diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/commitmentAssociation.js b/lib/services/machinelearning/lib/commitmentPlan/models/commitmentAssociation.js index a360af1dfa..1b9b47f2fc 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/models/commitmentAssociation.js +++ b/lib/services/machinelearning/lib/commitmentPlan/models/commitmentAssociation.js @@ -21,16 +21,17 @@ const models = require('./index'); class CommitmentAssociation extends models['Resource'] { /** * Create a CommitmentAssociation. - * @member {string} [etag] An entity tag used to enforce optimistic + * @property {string} [etag] An entity tag used to enforce optimistic * concurrency. - * @member {object} [properties] The properties of the commitment association - * resource. - * @member {string} [properties.associatedResourceId] The ID of the resource - * this association points to, such as the ARM ID of an Azure ML web service. - * @member {string} [properties.commitmentPlanId] The ARM ID of the parent + * @property {object} [properties] The properties of the commitment + * association resource. + * @property {string} [properties.associatedResourceId] The ID of the + * resource this association points to, such as the ARM ID of an Azure ML web + * service. + * @property {string} [properties.commitmentPlanId] The ARM ID of the parent * Azure ML commitment plan. - * @member {date} [properties.creationDate] The date at which this commitment - * association was created, in ISO 8601 format. + * @property {date} [properties.creationDate] The date at which this + * commitment association was created, in ISO 8601 format. */ constructor() { super(); diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/commitmentAssociationListResult.js b/lib/services/machinelearning/lib/commitmentPlan/models/commitmentAssociationListResult.js index dbed9c36bf..59cd8bf92c 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/models/commitmentAssociationListResult.js +++ b/lib/services/machinelearning/lib/commitmentPlan/models/commitmentAssociationListResult.js @@ -16,7 +16,7 @@ class CommitmentAssociationListResult extends Array { /** * Create a CommitmentAssociationListResult. - * @member {string} [nextLink] A URI to retrieve the next page of results. + * @property {string} [nextLink] A URI to retrieve the next page of results. */ constructor() { super(); diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/commitmentAssociationProperties.js b/lib/services/machinelearning/lib/commitmentPlan/models/commitmentAssociationProperties.js index 2c2f2efbec..1931a418ed 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/models/commitmentAssociationProperties.js +++ b/lib/services/machinelearning/lib/commitmentPlan/models/commitmentAssociationProperties.js @@ -17,11 +17,11 @@ class CommitmentAssociationProperties { /** * Create a CommitmentAssociationProperties. - * @member {string} [associatedResourceId] The ID of the resource this + * @property {string} [associatedResourceId] The ID of the resource this * association points to, such as the ARM ID of an Azure ML web service. - * @member {string} [commitmentPlanId] The ARM ID of the parent Azure ML + * @property {string} [commitmentPlanId] The ARM ID of the parent Azure ML * commitment plan. - * @member {date} [creationDate] The date at which this commitment + * @property {date} [creationDate] The date at which this commitment * association was created, in ISO 8601 format. */ constructor() { diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlan.js b/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlan.js index 3f6d4b7917..23688755c8 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlan.js +++ b/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlan.js @@ -20,37 +20,37 @@ const models = require('./index'); class CommitmentPlan extends models['Resource'] { /** * Create a CommitmentPlan. - * @member {string} [etag] An entity tag used to enforce optimistic + * @property {string} [etag] An entity tag used to enforce optimistic * concurrency. - * @member {object} [properties] The commitment plan properties. - * @member {boolean} [properties.chargeForOverage] Indicates whether usage + * @property {object} [properties] The commitment plan properties. + * @property {boolean} [properties.chargeForOverage] Indicates whether usage * beyond the commitment plan's included quantities will be charged. - * @member {boolean} [properties.chargeForPlan] Indicates whether the + * @property {boolean} [properties.chargeForPlan] Indicates whether the * commitment plan will incur a charge. - * @member {date} [properties.creationDate] The date at which this commitment - * plan was created, in ISO 8601 format. - * @member {object} [properties.includedQuantities] The included resource + * @property {date} [properties.creationDate] The date at which this + * commitment plan was created, in ISO 8601 format. + * @property {object} [properties.includedQuantities] The included resource * quantities this plan gives you. - * @member {number} [properties.maxAssociationLimit] The maximum number of + * @property {number} [properties.maxAssociationLimit] The maximum number of * commitment associations that can be children of this commitment plan. - * @member {number} [properties.maxCapacityLimit] The maximum scale-out + * @property {number} [properties.maxCapacityLimit] The maximum scale-out * capacity for this commitment plan. - * @member {number} [properties.minCapacityLimit] The minimum scale-out + * @property {number} [properties.minCapacityLimit] The minimum scale-out * capacity for this commitment plan. - * @member {string} [properties.planMeter] The Azure meter which will be used - * to charge for this commitment plan. - * @member {number} [properties.refillFrequencyInDays] The frequency at which - * this commitment plan's included quantities are refilled. - * @member {boolean} [properties.suspendPlanOnOverage] Indicates whether this - * commitment plan will be moved into a suspended state if usage goes beyond - * the commitment plan's included quantities. - * @member {object} [sku] The commitment plan SKU. - * @member {number} [sku.capacity] The scale-out capacity of the resource. 1 - * is 1x, 2 is 2x, etc. This impacts the quantities and cost of any + * @property {string} [properties.planMeter] The Azure meter which will be + * used to charge for this commitment plan. + * @property {number} [properties.refillFrequencyInDays] The frequency at + * which this commitment plan's included quantities are refilled. + * @property {boolean} [properties.suspendPlanOnOverage] Indicates whether + * this commitment plan will be moved into a suspended state if usage goes + * beyond the commitment plan's included quantities. + * @property {object} [sku] The commitment plan SKU. + * @property {number} [sku.capacity] The scale-out capacity of the resource. + * 1 is 1x, 2 is 2x, etc. This impacts the quantities and cost of any * commitment plan resource. - * @member {string} [sku.name] The SKU name. Along with tier, uniquely + * @property {string} [sku.name] The SKU name. Along with tier, uniquely * identifies the SKU. - * @member {string} [sku.tier] The SKU tier. Along with name, uniquely + * @property {string} [sku.tier] The SKU tier. Along with name, uniquely * identifies the SKU. */ constructor() { diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlanListResult.js b/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlanListResult.js index 39c3a4bcf5..fe446e6733 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlanListResult.js +++ b/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlanListResult.js @@ -16,7 +16,7 @@ class CommitmentPlanListResult extends Array { /** * Create a CommitmentPlanListResult. - * @member {string} [nextLink] A URI to retrieve the next page of results. + * @property {string} [nextLink] A URI to retrieve the next page of results. */ constructor() { super(); diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlanPatchPayload.js b/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlanPatchPayload.js index deeabbd0f2..e75d65567b 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlanPatchPayload.js +++ b/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlanPatchPayload.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The properties of a commitment plan which may be updated via PATCH. * @@ -19,14 +17,14 @@ const models = require('./index'); class CommitmentPlanPatchPayload { /** * Create a CommitmentPlanPatchPayload. - * @member {object} [tags] User-defined tags for the commitment plan. - * @member {object} [sku] The commitment plan SKU. - * @member {number} [sku.capacity] The scale-out capacity of the resource. 1 - * is 1x, 2 is 2x, etc. This impacts the quantities and cost of any + * @property {object} [tags] User-defined tags for the commitment plan. + * @property {object} [sku] The commitment plan SKU. + * @property {number} [sku.capacity] The scale-out capacity of the resource. + * 1 is 1x, 2 is 2x, etc. This impacts the quantities and cost of any * commitment plan resource. - * @member {string} [sku.name] The SKU name. Along with tier, uniquely + * @property {string} [sku.name] The SKU name. Along with tier, uniquely * identifies the SKU. - * @member {string} [sku.tier] The SKU tier. Along with name, uniquely + * @property {string} [sku.tier] The SKU tier. Along with name, uniquely * identifies the SKU. */ constructor() { diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlanProperties.js b/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlanProperties.js index 4bf54fb989..c8f41bd85c 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlanProperties.js +++ b/lib/services/machinelearning/lib/commitmentPlan/models/commitmentPlanProperties.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Properties of an Azure ML commitment plan. * @@ -19,27 +17,27 @@ const models = require('./index'); class CommitmentPlanProperties { /** * Create a CommitmentPlanProperties. - * @member {boolean} [chargeForOverage] Indicates whether usage beyond the + * @property {boolean} [chargeForOverage] Indicates whether usage beyond the * commitment plan's included quantities will be charged. - * @member {boolean} [chargeForPlan] Indicates whether the commitment plan + * @property {boolean} [chargeForPlan] Indicates whether the commitment plan * will incur a charge. - * @member {date} [creationDate] The date at which this commitment plan was + * @property {date} [creationDate] The date at which this commitment plan was * created, in ISO 8601 format. - * @member {object} [includedQuantities] The included resource quantities + * @property {object} [includedQuantities] The included resource quantities * this plan gives you. - * @member {number} [maxAssociationLimit] The maximum number of commitment + * @property {number} [maxAssociationLimit] The maximum number of commitment * associations that can be children of this commitment plan. - * @member {number} [maxCapacityLimit] The maximum scale-out capacity for + * @property {number} [maxCapacityLimit] The maximum scale-out capacity for * this commitment plan. - * @member {number} [minCapacityLimit] The minimum scale-out capacity for + * @property {number} [minCapacityLimit] The minimum scale-out capacity for * this commitment plan. - * @member {string} [planMeter] The Azure meter which will be used to charge - * for this commitment plan. - * @member {number} [refillFrequencyInDays] The frequency at which this + * @property {string} [planMeter] The Azure meter which will be used to + * charge for this commitment plan. + * @property {number} [refillFrequencyInDays] The frequency at which this * commitment plan's included quantities are refilled. - * @member {boolean} [suspendPlanOnOverage] Indicates whether this commitment - * plan will be moved into a suspended state if usage goes beyond the - * commitment plan's included quantities. + * @property {boolean} [suspendPlanOnOverage] Indicates whether this + * commitment plan will be moved into a suspended state if usage goes beyond + * the commitment plan's included quantities. */ constructor() { } diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/index.d.ts b/lib/services/machinelearning/lib/commitmentPlan/models/index.d.ts index 62a8ac92c2..483764348f 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/models/index.d.ts +++ b/lib/services/machinelearning/lib/commitmentPlan/models/index.d.ts @@ -1,312 +1,392 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource } from 'ms-rest-azure'; -import { CloudError } from 'ms-rest-azure'; -import * as moment from 'moment'; +import { BaseResource, CloudError } from "ms-rest-azure"; +import * as moment from "moment"; -export { BaseResource } from 'ms-rest-azure'; -export { CloudError } from 'ms-rest-azure'; +export { + BaseResource, + CloudError +}; + +/** + * Describes scaling information of a SKU. + */ +export interface SkuCapacity { + /** + * The minimum capacity. + */ + readonly minimum?: number; + /** + * The maximum capacity that can be set. + */ + readonly maximum?: number; + /** + * The default capacity. + */ + readonly default?: number; + /** + * The scale type applicable to the sku. Possible values include: 'Automatic', 'Manual', 'None' + */ + readonly scaleType?: string; +} + +/** + * Describes The SKU capabilites object. + */ +export interface SkuCapability { + /** + * The capability name. + */ + readonly name?: string; + /** + * The capability value. + */ + readonly value?: string; +} + +/** + * Describes metadata for SKU cost info. + */ +export interface SkuCost { + /** + * The meter used for this part of a SKU's cost. + */ + readonly meterID?: string; + /** + * The multiplier for the meter ID. + */ + readonly quantity?: number; + /** + * The overall duration represented by the quantity. + */ + readonly extendedUnit?: string; +} + +/** + * Describes restrictions which would prevent a SKU from being used. + */ +export interface SkuRestrictions { + /** + * The type of restrictions. Possible values include: 'location', 'zone' + */ + readonly type?: string; + /** + * The value of restrictions. If the restriction type is set to location. This would be different + * locations where the SKU is restricted. + */ + readonly values?: string[]; + /** + * The reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription' + */ + readonly reasonCode?: string; +} + +/** + * Details of a commitment plan SKU. + */ +export interface CatalogSku { + /** + * Resource type name + */ + readonly resourceType?: string; + /** + * SKU name + */ + readonly name?: string; + /** + * SKU tier + */ + readonly tier?: string; + /** + * Regions where the SKU is available. + */ + readonly locations?: string[]; + /** + * SKU scaling information + */ + readonly capacity?: SkuCapacity; + /** + * The capability information for the specified SKU. + */ + readonly capabilities?: SkuCapability[]; + /** + * The cost information for the specified SKU. + */ + readonly costs?: SkuCost[]; + /** + * Restrictions which would prevent a SKU from being used. This is empty if there are no + * restrictions. + */ + readonly restrictions?: SkuRestrictions[]; +} /** - * @class - * Initializes a new instance of the Resource class. - * @constructor * Common properties of an ARM resource. - * - * @member {string} [id] Resource Id. - * @member {string} [name] Resource name. - * @member {string} location Resource location. - * @member {string} [type] Resource type. - * @member {object} [tags] User-defined tags for the resource. */ export interface Resource extends BaseResource { + /** + * Resource Id. + */ readonly id?: string; + /** + * Resource name. + */ readonly name?: string; + /** + * Resource location. + */ location: string; + /** + * Resource type. + */ readonly type?: string; + /** + * User-defined tags for the resource. + */ tags?: { [propertyName: string]: string }; } /** - * @class - * Initializes a new instance of the CommitmentAssociationProperties class. - * @constructor * Properties of an Azure ML commitment association. - * - * @member {string} [associatedResourceId] The ID of the resource this - * association points to, such as the ARM ID of an Azure ML web service. - * @member {string} [commitmentPlanId] The ARM ID of the parent Azure ML - * commitment plan. - * @member {date} [creationDate] The date at which this commitment association - * was created, in ISO 8601 format. */ export interface CommitmentAssociationProperties { + /** + * The ID of the resource this association points to, such as the ARM ID of an Azure ML web + * service. + */ readonly associatedResourceId?: string; + /** + * The ARM ID of the parent Azure ML commitment plan. + */ readonly commitmentPlanId?: string; + /** + * The date at which this commitment association was created, in ISO 8601 format. + */ readonly creationDate?: Date; } /** - * @class - * Initializes a new instance of the CommitmentAssociation class. - * @constructor - * Represents the association between a commitment plan and some other - * resource, such as a Machine Learning web service. - * - * @member {string} [etag] An entity tag used to enforce optimistic - * concurrency. - * @member {object} [properties] The properties of the commitment association - * resource. - * @member {string} [properties.associatedResourceId] The ID of the resource - * this association points to, such as the ARM ID of an Azure ML web service. - * @member {string} [properties.commitmentPlanId] The ARM ID of the parent - * Azure ML commitment plan. - * @member {date} [properties.creationDate] The date at which this commitment - * association was created, in ISO 8601 format. + * Represents the association between a commitment plan and some other resource, such as a Machine + * Learning web service. */ export interface CommitmentAssociation extends Resource { + /** + * An entity tag used to enforce optimistic concurrency. + */ etag?: string; + /** + * The properties of the commitment association resource. + */ properties?: CommitmentAssociationProperties; } /** - * @class - * Initializes a new instance of the ResourceSku class. - * @constructor * The SKU of a resource. - * - * @member {number} [capacity] The scale-out capacity of the resource. 1 is 1x, - * 2 is 2x, etc. This impacts the quantities and cost of any commitment plan - * resource. - * @member {string} [name] The SKU name. Along with tier, uniquely identifies - * the SKU. - * @member {string} [tier] The SKU tier. Along with name, uniquely identifies - * the SKU. */ export interface ResourceSku { + /** + * The scale-out capacity of the resource. 1 is 1x, 2 is 2x, etc. This impacts the quantities and + * cost of any commitment plan resource. + */ capacity?: number; + /** + * The SKU name. Along with tier, uniquely identifies the SKU. + */ name?: string; + /** + * The SKU tier. Along with name, uniquely identifies the SKU. + */ tier?: string; } /** - * @class - * Initializes a new instance of the MoveCommitmentAssociationRequest class. - * @constructor * Specifies the destination Azure ML commitment plan for a move operation. - * - * @member {string} [destinationPlanId] The ARM ID of the commitment plan to - * re-parent the commitment association to. */ export interface MoveCommitmentAssociationRequest { + /** + * The ARM ID of the commitment plan to re-parent the commitment association to. + */ destinationPlanId?: string; } /** - * @class - * Initializes a new instance of the CommitmentPlanPatchPayload class. - * @constructor * The properties of a commitment plan which may be updated via PATCH. - * - * @member {object} [tags] User-defined tags for the commitment plan. - * @member {object} [sku] The commitment plan SKU. - * @member {number} [sku.capacity] The scale-out capacity of the resource. 1 is - * 1x, 2 is 2x, etc. This impacts the quantities and cost of any commitment - * plan resource. - * @member {string} [sku.name] The SKU name. Along with tier, uniquely - * identifies the SKU. - * @member {string} [sku.tier] The SKU tier. Along with name, uniquely - * identifies the SKU. */ export interface CommitmentPlanPatchPayload { + /** + * User-defined tags for the commitment plan. + */ tags?: { [propertyName: string]: string }; + /** + * The commitment plan SKU. + */ sku?: ResourceSku; } /** - * @class - * Initializes a new instance of the PlanQuantity class. - * @constructor * Represents the quantity a commitment plan provides of a metered resource. - * - * @member {number} [allowance] The quantity added to the commitment plan at an - * interval specified by its allowance frequency. - * @member {number} [amount] The quantity available to the plan the last time - * usage was calculated. - * @member {string} [includedQuantityMeter] The Azure meter for usage against - * included quantities. - * @member {string} [overageMeter] The Azure meter for usage which exceeds - * included quantities. */ export interface PlanQuantity { + /** + * The quantity added to the commitment plan at an interval specified by its allowance frequency. + */ readonly allowance?: number; + /** + * The quantity available to the plan the last time usage was calculated. + */ readonly amount?: number; + /** + * The Azure meter for usage against included quantities. + */ readonly includedQuantityMeter?: string; + /** + * The Azure meter for usage which exceeds included quantities. + */ readonly overageMeter?: string; } /** - * @class - * Initializes a new instance of the CommitmentPlanProperties class. - * @constructor * Properties of an Azure ML commitment plan. - * - * @member {boolean} [chargeForOverage] Indicates whether usage beyond the - * commitment plan's included quantities will be charged. - * @member {boolean} [chargeForPlan] Indicates whether the commitment plan will - * incur a charge. - * @member {date} [creationDate] The date at which this commitment plan was - * created, in ISO 8601 format. - * @member {object} [includedQuantities] The included resource quantities this - * plan gives you. - * @member {number} [maxAssociationLimit] The maximum number of commitment - * associations that can be children of this commitment plan. - * @member {number} [maxCapacityLimit] The maximum scale-out capacity for this - * commitment plan. - * @member {number} [minCapacityLimit] The minimum scale-out capacity for this - * commitment plan. - * @member {string} [planMeter] The Azure meter which will be used to charge - * for this commitment plan. - * @member {number} [refillFrequencyInDays] The frequency at which this - * commitment plan's included quantities are refilled. - * @member {boolean} [suspendPlanOnOverage] Indicates whether this commitment - * plan will be moved into a suspended state if usage goes beyond the - * commitment plan's included quantities. */ export interface CommitmentPlanProperties { + /** + * Indicates whether usage beyond the commitment plan's included quantities will be charged. + */ readonly chargeForOverage?: boolean; + /** + * Indicates whether the commitment plan will incur a charge. + */ readonly chargeForPlan?: boolean; + /** + * The date at which this commitment plan was created, in ISO 8601 format. + */ readonly creationDate?: Date; + /** + * The included resource quantities this plan gives you. + */ readonly includedQuantities?: { [propertyName: string]: PlanQuantity }; + /** + * The maximum number of commitment associations that can be children of this commitment plan. + */ readonly maxAssociationLimit?: number; + /** + * The maximum scale-out capacity for this commitment plan. + */ readonly maxCapacityLimit?: number; + /** + * The minimum scale-out capacity for this commitment plan. + */ readonly minCapacityLimit?: number; + /** + * The Azure meter which will be used to charge for this commitment plan. + */ readonly planMeter?: string; + /** + * The frequency at which this commitment plan's included quantities are refilled. + */ readonly refillFrequencyInDays?: number; + /** + * Indicates whether this commitment plan will be moved into a suspended state if usage goes + * beyond the commitment plan's included quantities. + */ readonly suspendPlanOnOverage?: boolean; } /** - * @class - * Initializes a new instance of the CommitmentPlan class. - * @constructor * An Azure ML commitment plan resource. - * - * @member {string} [etag] An entity tag used to enforce optimistic - * concurrency. - * @member {object} [properties] The commitment plan properties. - * @member {boolean} [properties.chargeForOverage] Indicates whether usage - * beyond the commitment plan's included quantities will be charged. - * @member {boolean} [properties.chargeForPlan] Indicates whether the - * commitment plan will incur a charge. - * @member {date} [properties.creationDate] The date at which this commitment - * plan was created, in ISO 8601 format. - * @member {object} [properties.includedQuantities] The included resource - * quantities this plan gives you. - * @member {number} [properties.maxAssociationLimit] The maximum number of - * commitment associations that can be children of this commitment plan. - * @member {number} [properties.maxCapacityLimit] The maximum scale-out - * capacity for this commitment plan. - * @member {number} [properties.minCapacityLimit] The minimum scale-out - * capacity for this commitment plan. - * @member {string} [properties.planMeter] The Azure meter which will be used - * to charge for this commitment plan. - * @member {number} [properties.refillFrequencyInDays] The frequency at which - * this commitment plan's included quantities are refilled. - * @member {boolean} [properties.suspendPlanOnOverage] Indicates whether this - * commitment plan will be moved into a suspended state if usage goes beyond - * the commitment plan's included quantities. - * @member {object} [sku] The commitment plan SKU. - * @member {number} [sku.capacity] The scale-out capacity of the resource. 1 is - * 1x, 2 is 2x, etc. This impacts the quantities and cost of any commitment - * plan resource. - * @member {string} [sku.name] The SKU name. Along with tier, uniquely - * identifies the SKU. - * @member {string} [sku.tier] The SKU tier. Along with name, uniquely - * identifies the SKU. */ export interface CommitmentPlan extends Resource { + /** + * An entity tag used to enforce optimistic concurrency. + */ etag?: string; + /** + * The commitment plan properties. + */ readonly properties?: CommitmentPlanProperties; + /** + * The commitment plan SKU. + */ sku?: ResourceSku; } /** - * @class - * Initializes a new instance of the PlanUsageHistory class. - * @constructor - * Represents historical information about usage of the Azure resources - * associated with a commitment plan. - * - * @member {object} [planDeletionOverage] Overage incurred as a result of - * deleting a commitment plan. - * @member {object} [planMigrationOverage] Overage incurred as a result of - * migrating a commitment plan from one SKU to another. - * @member {object} [planQuantitiesAfterUsage] Included quantities remaining - * after usage against the commitment plan's associated resources was - * calculated. - * @member {object} [planQuantitiesBeforeUsage] Included quantities remaining - * before usage against the commitment plan's associated resources was - * calculated. - * @member {object} [planUsageOverage] Usage against the commitment plan's - * associated resources which was not covered by included quantities and is - * therefore overage. - * @member {object} [usage] Usage against the commitment plan's associated - * resources. - * @member {date} [usageDate] The date of usage, in ISO 8601 format. + * Represents historical information about usage of the Azure resources associated with a + * commitment plan. */ export interface PlanUsageHistory { + /** + * Overage incurred as a result of deleting a commitment plan. + */ planDeletionOverage?: { [propertyName: string]: number }; + /** + * Overage incurred as a result of migrating a commitment plan from one SKU to another. + */ planMigrationOverage?: { [propertyName: string]: number }; + /** + * Included quantities remaining after usage against the commitment plan's associated resources + * was calculated. + */ planQuantitiesAfterUsage?: { [propertyName: string]: number }; + /** + * Included quantities remaining before usage against the commitment plan's associated resources + * was calculated. + */ planQuantitiesBeforeUsage?: { [propertyName: string]: number }; + /** + * Usage against the commitment plan's associated resources which was not covered by included + * quantities and is therefore overage. + */ planUsageOverage?: { [propertyName: string]: number }; + /** + * Usage against the commitment plan's associated resources. + */ usage?: { [propertyName: string]: number }; + /** + * The date of usage, in ISO 8601 format. + */ usageDate?: Date; } +/** + * The list of commitment plan SKUs. + */ +export interface SkuListResult extends Array { +} /** - * @class - * Initializes a new instance of the CommitmentAssociationListResult class. - * @constructor * A page of commitment association resources. - * - * @member {string} [nextLink] A URI to retrieve the next page of results. */ export interface CommitmentAssociationListResult extends Array { + /** + * A URI to retrieve the next page of results. + */ nextLink?: string; } /** - * @class - * Initializes a new instance of the CommitmentPlanListResult class. - * @constructor * A page of commitment plan resources. - * - * @member {string} [nextLink] A URI to retrieve the next page of results. */ export interface CommitmentPlanListResult extends Array { + /** + * A URI to retrieve the next page of results. + */ nextLink?: string; } /** - * @class - * Initializes a new instance of the PlanUsageHistoryListResult class. - * @constructor * A page of usage history. - * - * @member {string} [nextLink] A URI to retrieve the next page of results. */ export interface PlanUsageHistoryListResult extends Array { + /** + * A URI to retrieve the next page of results. + */ nextLink?: string; } diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/index.js b/lib/services/machinelearning/lib/commitmentPlan/models/index.js index 46171a5471..d4c1c19763 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/models/index.js +++ b/lib/services/machinelearning/lib/commitmentPlan/models/index.js @@ -18,6 +18,11 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; +exports.SkuCapacity = require('./skuCapacity'); +exports.SkuCapability = require('./skuCapability'); +exports.SkuCost = require('./skuCost'); +exports.SkuRestrictions = require('./skuRestrictions'); +exports.CatalogSku = require('./catalogSku'); exports.Resource = require('./resource'); exports.CommitmentAssociationProperties = require('./commitmentAssociationProperties'); exports.CommitmentAssociation = require('./commitmentAssociation'); @@ -28,6 +33,7 @@ exports.PlanQuantity = require('./planQuantity'); exports.CommitmentPlanProperties = require('./commitmentPlanProperties'); exports.CommitmentPlan = require('./commitmentPlan'); exports.PlanUsageHistory = require('./planUsageHistory'); +exports.SkuListResult = require('./skuListResult'); exports.CommitmentAssociationListResult = require('./commitmentAssociationListResult'); exports.CommitmentPlanListResult = require('./commitmentPlanListResult'); exports.PlanUsageHistoryListResult = require('./planUsageHistoryListResult'); diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/moveCommitmentAssociationRequest.js b/lib/services/machinelearning/lib/commitmentPlan/models/moveCommitmentAssociationRequest.js index f8b01fbced..2be106084a 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/models/moveCommitmentAssociationRequest.js +++ b/lib/services/machinelearning/lib/commitmentPlan/models/moveCommitmentAssociationRequest.js @@ -17,8 +17,8 @@ class MoveCommitmentAssociationRequest { /** * Create a MoveCommitmentAssociationRequest. - * @member {string} [destinationPlanId] The ARM ID of the commitment plan to - * re-parent the commitment association to. + * @property {string} [destinationPlanId] The ARM ID of the commitment plan + * to re-parent the commitment association to. */ constructor() { } diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/planQuantity.js b/lib/services/machinelearning/lib/commitmentPlan/models/planQuantity.js index 6059858666..f884b5da98 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/models/planQuantity.js +++ b/lib/services/machinelearning/lib/commitmentPlan/models/planQuantity.js @@ -17,13 +17,13 @@ class PlanQuantity { /** * Create a PlanQuantity. - * @member {number} [allowance] The quantity added to the commitment plan at - * an interval specified by its allowance frequency. - * @member {number} [amount] The quantity available to the plan the last time - * usage was calculated. - * @member {string} [includedQuantityMeter] The Azure meter for usage against - * included quantities. - * @member {string} [overageMeter] The Azure meter for usage which exceeds + * @property {number} [allowance] The quantity added to the commitment plan + * at an interval specified by its allowance frequency. + * @property {number} [amount] The quantity available to the plan the last + * time usage was calculated. + * @property {string} [includedQuantityMeter] The Azure meter for usage + * against included quantities. + * @property {string} [overageMeter] The Azure meter for usage which exceeds * included quantities. */ constructor() { diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/planUsageHistory.js b/lib/services/machinelearning/lib/commitmentPlan/models/planUsageHistory.js index 4d3badd065..2228414ade 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/models/planUsageHistory.js +++ b/lib/services/machinelearning/lib/commitmentPlan/models/planUsageHistory.js @@ -18,22 +18,22 @@ class PlanUsageHistory { /** * Create a PlanUsageHistory. - * @member {object} [planDeletionOverage] Overage incurred as a result of + * @property {object} [planDeletionOverage] Overage incurred as a result of * deleting a commitment plan. - * @member {object} [planMigrationOverage] Overage incurred as a result of + * @property {object} [planMigrationOverage] Overage incurred as a result of * migrating a commitment plan from one SKU to another. - * @member {object} [planQuantitiesAfterUsage] Included quantities remaining - * after usage against the commitment plan's associated resources was - * calculated. - * @member {object} [planQuantitiesBeforeUsage] Included quantities remaining - * before usage against the commitment plan's associated resources was - * calculated. - * @member {object} [planUsageOverage] Usage against the commitment plan's + * @property {object} [planQuantitiesAfterUsage] Included quantities + * remaining after usage against the commitment plan's associated resources + * was calculated. + * @property {object} [planQuantitiesBeforeUsage] Included quantities + * remaining before usage against the commitment plan's associated resources + * was calculated. + * @property {object} [planUsageOverage] Usage against the commitment plan's * associated resources which was not covered by included quantities and is * therefore overage. - * @member {object} [usage] Usage against the commitment plan's associated + * @property {object} [usage] Usage against the commitment plan's associated * resources. - * @member {date} [usageDate] The date of usage, in ISO 8601 format. + * @property {date} [usageDate] The date of usage, in ISO 8601 format. */ constructor() { } diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/planUsageHistoryListResult.js b/lib/services/machinelearning/lib/commitmentPlan/models/planUsageHistoryListResult.js index 0615e0fbff..7a14d6f041 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/models/planUsageHistoryListResult.js +++ b/lib/services/machinelearning/lib/commitmentPlan/models/planUsageHistoryListResult.js @@ -16,7 +16,7 @@ class PlanUsageHistoryListResult extends Array { /** * Create a PlanUsageHistoryListResult. - * @member {string} [nextLink] A URI to retrieve the next page of results. + * @property {string} [nextLink] A URI to retrieve the next page of results. */ constructor() { super(); diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/resource.js b/lib/services/machinelearning/lib/commitmentPlan/models/resource.js index 3f15f48923..2664553650 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/models/resource.js +++ b/lib/services/machinelearning/lib/commitmentPlan/models/resource.js @@ -20,11 +20,11 @@ const models = require('./index'); class Resource extends models['BaseResource'] { /** * Create a Resource. - * @member {string} [id] Resource Id. - * @member {string} [name] Resource name. - * @member {string} location Resource location. - * @member {string} [type] Resource type. - * @member {object} [tags] User-defined tags for the resource. + * @property {string} [id] Resource Id. + * @property {string} [name] Resource name. + * @property {string} location Resource location. + * @property {string} [type] Resource type. + * @property {object} [tags] User-defined tags for the resource. */ constructor() { super(); diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/resourceSku.js b/lib/services/machinelearning/lib/commitmentPlan/models/resourceSku.js index e15eae450b..d62326e1b1 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/models/resourceSku.js +++ b/lib/services/machinelearning/lib/commitmentPlan/models/resourceSku.js @@ -17,13 +17,13 @@ class ResourceSku { /** * Create a ResourceSku. - * @member {number} [capacity] The scale-out capacity of the resource. 1 is + * @property {number} [capacity] The scale-out capacity of the resource. 1 is * 1x, 2 is 2x, etc. This impacts the quantities and cost of any commitment * plan resource. - * @member {string} [name] The SKU name. Along with tier, uniquely identifies - * the SKU. - * @member {string} [tier] The SKU tier. Along with name, uniquely identifies - * the SKU. + * @property {string} [name] The SKU name. Along with tier, uniquely + * identifies the SKU. + * @property {string} [tier] The SKU tier. Along with name, uniquely + * identifies the SKU. */ constructor() { } diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/skuCapability.js b/lib/services/machinelearning/lib/commitmentPlan/models/skuCapability.js new file mode 100644 index 0000000000..dd336fc6d7 --- /dev/null +++ b/lib/services/machinelearning/lib/commitmentPlan/models/skuCapability.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'; + +/** + * Describes The SKU capabilites object. + * + */ +class SkuCapability { + /** + * Create a SkuCapability. + * @property {string} [name] The capability name. + * @property {string} [value] The capability value. + */ + constructor() { + } + + /** + * Defines the metadata of SkuCapability + * + * @returns {object} metadata of SkuCapability + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuCapability', + type: { + name: 'Composite', + className: 'SkuCapability', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SkuCapability; diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/skuCapacity.js b/lib/services/machinelearning/lib/commitmentPlan/models/skuCapacity.js new file mode 100644 index 0000000000..ad5b1a9085 --- /dev/null +++ b/lib/services/machinelearning/lib/commitmentPlan/models/skuCapacity.js @@ -0,0 +1,81 @@ +/* + * 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'; + +/** + * Describes scaling information of a SKU. + * + */ +class SkuCapacity { + /** + * Create a SkuCapacity. + * @property {number} [minimum] The minimum capacity. + * @property {number} [maximum] The maximum capacity that can be set. + * @property {number} [default] The default capacity. + * @property {string} [scaleType] The scale type applicable to the sku. + * Possible values include: 'Automatic', 'Manual', 'None' + */ + constructor() { + } + + /** + * Defines the metadata of SkuCapacity + * + * @returns {object} metadata of SkuCapacity + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuCapacity', + type: { + name: 'Composite', + className: 'SkuCapacity', + modelProperties: { + minimum: { + required: false, + readOnly: true, + serializedName: 'minimum', + type: { + name: 'Number' + } + }, + maximum: { + required: false, + readOnly: true, + serializedName: 'maximum', + type: { + name: 'Number' + } + }, + default: { + required: false, + readOnly: true, + serializedName: 'default', + type: { + name: 'Number' + } + }, + scaleType: { + required: false, + readOnly: true, + serializedName: 'scaleType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SkuCapacity; diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/skuCost.js b/lib/services/machinelearning/lib/commitmentPlan/models/skuCost.js new file mode 100644 index 0000000000..338be2820e --- /dev/null +++ b/lib/services/machinelearning/lib/commitmentPlan/models/skuCost.js @@ -0,0 +1,72 @@ +/* + * 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'; + +/** + * Describes metadata for SKU cost info. + * + */ +class SkuCost { + /** + * Create a SkuCost. + * @property {string} [meterID] The meter used for this part of a SKU's cost. + * @property {number} [quantity] The multiplier for the meter ID. + * @property {string} [extendedUnit] The overall duration represented by the + * quantity. + */ + constructor() { + } + + /** + * Defines the metadata of SkuCost + * + * @returns {object} metadata of SkuCost + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuCost', + type: { + name: 'Composite', + className: 'SkuCost', + modelProperties: { + meterID: { + required: false, + readOnly: true, + serializedName: 'meterID', + type: { + name: 'String' + } + }, + quantity: { + required: false, + readOnly: true, + serializedName: 'quantity', + type: { + name: 'Number' + } + }, + extendedUnit: { + required: false, + readOnly: true, + serializedName: 'extendedUnit', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SkuCost; diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/skuListResult.js b/lib/services/machinelearning/lib/commitmentPlan/models/skuListResult.js new file mode 100644 index 0000000000..fbbc932589 --- /dev/null +++ b/lib/services/machinelearning/lib/commitmentPlan/models/skuListResult.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The list of commitment plan SKUs. + */ +class SkuListResult extends Array { + /** + * Create a SkuListResult. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SkuListResult + * + * @returns {object} metadata of SkuListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuListResult', + type: { + name: 'Composite', + className: 'SkuListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CatalogSkuElementType', + type: { + name: 'Composite', + className: 'CatalogSku' + } + } + } + } + } + } + }; + } +} + +module.exports = SkuListResult; diff --git a/lib/services/machinelearning/lib/commitmentPlan/models/skuRestrictions.js b/lib/services/machinelearning/lib/commitmentPlan/models/skuRestrictions.js new file mode 100644 index 0000000000..6c08046304 --- /dev/null +++ b/lib/services/machinelearning/lib/commitmentPlan/models/skuRestrictions.js @@ -0,0 +1,82 @@ +/* + * 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'; + +/** + * Describes restrictions which would prevent a SKU from being used. + * + */ +class SkuRestrictions { + /** + * Create a SkuRestrictions. + * @property {string} [type] The type of restrictions. Possible values + * include: 'location', 'zone' + * @property {array} [values] The value of restrictions. If the restriction + * type is set to location. This would be different locations where the SKU + * is restricted. + * @property {string} [reasonCode] The reason for restriction. Possible + * values include: 'QuotaId', 'NotAvailableForSubscription' + */ + constructor() { + } + + /** + * Defines the metadata of SkuRestrictions + * + * @returns {object} metadata of SkuRestrictions + * + */ + mapper() { + return { + required: false, + serializedName: 'SkuRestrictions', + type: { + name: 'Composite', + className: 'SkuRestrictions', + modelProperties: { + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + values: { + required: false, + readOnly: true, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + reasonCode: { + required: false, + readOnly: true, + serializedName: 'reasonCode', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SkuRestrictions; diff --git a/lib/services/machinelearning/lib/commitmentPlan/operations/index.d.ts b/lib/services/machinelearning/lib/commitmentPlan/operations/index.d.ts index 26a700ae6d..144ed3d1ab 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/operations/index.d.ts +++ b/lib/services/machinelearning/lib/commitmentPlan/operations/index.d.ts @@ -12,6 +12,66 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationRes import * as models from '../models'; +/** + * @class + * Skus + * __NOTE__: An instance of this class is automatically created for an + * instance of the AzureMLCommitmentPlansManagementClient. + */ +export interface Skus { + + + /** + * Lists the available commitment plan SKUs. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the available commitment plan SKUs. + * + * @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 {SkuListResult} - 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. + * + * {SkuListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SkuListResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * CommitmentAssociations diff --git a/lib/services/machinelearning/lib/commitmentPlan/operations/index.js b/lib/services/machinelearning/lib/commitmentPlan/operations/index.js index a1d7abc178..26da863e22 100644 --- a/lib/services/machinelearning/lib/commitmentPlan/operations/index.js +++ b/lib/services/machinelearning/lib/commitmentPlan/operations/index.js @@ -14,6 +14,7 @@ 'use strict'; +exports.Skus = require('./skus'); exports.CommitmentAssociations = require('./commitmentAssociations'); exports.CommitmentPlans = require('./commitmentPlans'); exports.UsageHistory = require('./usageHistory'); diff --git a/lib/services/machinelearning/lib/commitmentPlan/operations/skus.js b/lib/services/machinelearning/lib/commitmentPlan/operations/skus.js new file mode 100644 index 0000000000..ea3f0a0313 --- /dev/null +++ b/lib/services/machinelearning/lib/commitmentPlan/operations/skus.js @@ -0,0 +1,241 @@ +/* + * 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 the available commitment plan SKUs. + * + * @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 SkuListResult} 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(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.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.MachineLearning/skus'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + 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) { + 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['SkuListResult']().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 Skus. */ +class Skus { + /** + * Create a Skus. + * @param {AzureMLCommitmentPlansManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + } + + /** + * Lists the available commitment plan SKUs. + * + * @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(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(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 available commitment plan SKUs. + * + * @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 {SkuListResult} - 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 SkuListResult} 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(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(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + +} + +module.exports = Skus; diff --git a/lib/services/machinelearning/lib/webservices/azureMLWebServicesManagementClient.d.ts b/lib/services/machinelearning/lib/webservices/azureMLWebServicesManagementClient.d.ts index 7dcb5bff61..e4e3773cb2 100644 --- a/lib/services/machinelearning/lib/webservices/azureMLWebServicesManagementClient.d.ts +++ b/lib/services/machinelearning/lib/webservices/azureMLWebServicesManagementClient.d.ts @@ -10,9 +10,10 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; -declare class AzureMLWebServicesManagementClient extends AzureServiceClient { +export default class AzureMLWebServicesManagementClient extends AzureServiceClient { /** * Initializes a new instance of the AzureMLWebServicesManagementClient class. * @constructor @@ -33,11 +34,11 @@ declare class AzureMLWebServicesManagementClient extends AzureServiceClient { * * @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); @@ -55,7 +56,8 @@ declare class AzureMLWebServicesManagementClient extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups + operations: operations.Operations; webServices: operations.WebServices; } -export = AzureMLWebServicesManagementClient; +export { AzureMLWebServicesManagementClient, models as AzureMLWebServicesManagementModels }; diff --git a/lib/services/machinelearning/lib/webservices/azureMLWebServicesManagementClient.js b/lib/services/machinelearning/lib/webservices/azureMLWebServicesManagementClient.js index 2c347ff8d0..a45d323980 100644 --- a/lib/services/machinelearning/lib/webservices/azureMLWebServicesManagementClient.js +++ b/lib/services/machinelearning/lib/webservices/azureMLWebServicesManagementClient.js @@ -34,9 +34,9 @@ class AzureMLWebServicesManagementClient 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) { @@ -72,6 +72,7 @@ class AzureMLWebServicesManagementClient extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } + this.operations = new operations.Operations(this); this.webServices = new operations.WebServices(this); this.models = models; msRest.addSerializationMixin(this); @@ -80,3 +81,6 @@ class AzureMLWebServicesManagementClient extends ServiceClient { } module.exports = AzureMLWebServicesManagementClient; +module.exports['default'] = AzureMLWebServicesManagementClient; +module.exports.AzureMLWebServicesManagementClient = AzureMLWebServicesManagementClient; +module.exports.AzureMLWebServicesManagementModels = models; diff --git a/lib/services/machinelearning/lib/webservices/models/assetItem.js b/lib/services/machinelearning/lib/webservices/models/assetItem.js index a1dd63c5e7..4414e96db4 100644 --- a/lib/services/machinelearning/lib/webservices/models/assetItem.js +++ b/lib/services/machinelearning/lib/webservices/models/assetItem.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about an asset associated with the web service. * @@ -19,22 +17,23 @@ const models = require('./index'); class AssetItem { /** * Create a AssetItem. - * @member {string} name Asset's friendly name. - * @member {string} [id] Asset's Id. - * @member {string} type Asset's type. Possible values include: 'Module', + * @property {string} name Asset's friendly name. + * @property {string} [id] Asset's Id. + * @property {string} type Asset's type. Possible values include: 'Module', * 'Resource' - * @member {object} locationInfo Access information for the asset. - * @member {string} [locationInfo.uri] The URI from which the blob is + * @property {object} locationInfo Access information for the asset. + * @property {string} [locationInfo.uri] The URI from which the blob is * accessible from. For example, aml://abc for system assets or https://xyz * for user assets or payload. - * @member {string} [locationInfo.credentials] Access credentials for the + * @property {string} [locationInfo.credentials] Access credentials for the * blob, if applicable (e.g. blob specified by storage account connection * string + blob URI) - * @member {object} [inputPorts] Information about the asset's input ports. - * @member {object} [outputPorts] Information about the asset's output ports. - * @member {object} [metadata] If the asset is a custom module, this holds + * @property {object} [inputPorts] Information about the asset's input ports. + * @property {object} [outputPorts] Information about the asset's output + * ports. + * @property {object} [metadata] If the asset is a custom module, this holds * the module's metadata. - * @member {array} [parameters] If the asset is a custom module, this holds + * @property {array} [parameters] If the asset is a custom module, this holds * the module's parameters. */ constructor() { diff --git a/lib/services/machinelearning/lib/webservices/models/asyncOperationErrorInfo.js b/lib/services/machinelearning/lib/webservices/models/asyncOperationErrorInfo.js index eb1967c634..73a0be34d7 100644 --- a/lib/services/machinelearning/lib/webservices/models/asyncOperationErrorInfo.js +++ b/lib/services/machinelearning/lib/webservices/models/asyncOperationErrorInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The error detail information for async operation * @@ -19,10 +17,10 @@ const models = require('./index'); class AsyncOperationErrorInfo { /** * Create a AsyncOperationErrorInfo. - * @member {string} [code] The error code. - * @member {string} [target] The error target. - * @member {string} [message] The error message. - * @member {array} [details] An array containing error information. + * @property {string} [code] The error code. + * @property {string} [target] The error target. + * @property {string} [message] The error message. + * @property {array} [details] An array containing error information. */ constructor() { } @@ -43,6 +41,7 @@ class AsyncOperationErrorInfo { modelProperties: { code: { required: false, + readOnly: true, serializedName: 'code', type: { name: 'String' @@ -50,6 +49,7 @@ class AsyncOperationErrorInfo { }, target: { required: false, + readOnly: true, serializedName: 'target', type: { name: 'String' @@ -57,6 +57,7 @@ class AsyncOperationErrorInfo { }, message: { required: false, + readOnly: true, serializedName: 'message', type: { name: 'String' @@ -64,6 +65,7 @@ class AsyncOperationErrorInfo { }, details: { required: false, + readOnly: true, serializedName: 'details', type: { name: 'Sequence', diff --git a/lib/services/machinelearning/lib/webservices/models/asyncOperationStatus.js b/lib/services/machinelearning/lib/webservices/models/asyncOperationStatus.js index 8693e017fd..171f8396fe 100644 --- a/lib/services/machinelearning/lib/webservices/models/asyncOperationStatus.js +++ b/lib/services/machinelearning/lib/webservices/models/asyncOperationStatus.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Azure async operation status. * @@ -19,21 +17,24 @@ const models = require('./index'); class AsyncOperationStatus { /** * Create a AsyncOperationStatus. - * @member {string} [id] Async operation id. - * @member {string} [name] Async operation name. - * @member {string} [provisioningState] Read Only: The provisioning state of - * the web service. Valid values are Unknown, Provisioning, Succeeded, and + * @property {string} [id] Async operation id. + * @property {string} [name] Async operation name. + * @property {string} [provisioningState] Read Only: The provisioning state + * of the web service. Valid values are Unknown, Provisioning, Succeeded, and * Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', * 'Failed' - * @member {date} [startTime] The date time that the async operation started. - * @member {date} [endTime] The date time that the async operation finished. - * @member {number} [percentComplete] Async operation progress. - * @member {object} [errorInfo] If the async operation fails, this structure - * contains the error details. - * @member {string} [errorInfo.code] The error code. - * @member {string} [errorInfo.target] The error target. - * @member {string} [errorInfo.message] The error message. - * @member {array} [errorInfo.details] An array containing error information. + * @property {date} [startTime] The date time that the async operation + * started. + * @property {date} [endTime] The date time that the async operation + * finished. + * @property {number} [percentComplete] Async operation progress. + * @property {object} [errorInfo] If the async operation fails, this + * structure contains the error details. + * @property {string} [errorInfo.code] The error code. + * @property {string} [errorInfo.target] The error target. + * @property {string} [errorInfo.message] The error message. + * @property {array} [errorInfo.details] An array containing error + * information. */ constructor() { } @@ -54,6 +55,7 @@ class AsyncOperationStatus { modelProperties: { id: { required: false, + readOnly: true, serializedName: 'id', type: { name: 'String' @@ -61,6 +63,7 @@ class AsyncOperationStatus { }, name: { required: false, + readOnly: true, serializedName: 'name', type: { name: 'String' @@ -92,6 +95,7 @@ class AsyncOperationStatus { }, percentComplete: { required: false, + readOnly: true, serializedName: 'percentComplete', type: { name: 'Number' @@ -99,6 +103,7 @@ class AsyncOperationStatus { }, errorInfo: { required: false, + readOnly: true, serializedName: 'errorInfo', type: { name: 'Composite', diff --git a/lib/services/machinelearning/lib/webservices/models/blobLocation.js b/lib/services/machinelearning/lib/webservices/models/blobLocation.js index 9c46fd3e3e..1d532cf6c7 100644 --- a/lib/services/machinelearning/lib/webservices/models/blobLocation.js +++ b/lib/services/machinelearning/lib/webservices/models/blobLocation.js @@ -17,10 +17,10 @@ class BlobLocation { /** * Create a BlobLocation. - * @member {string} uri The URI from which the blob is accessible from. For + * @property {string} uri The URI from which the blob is accessible from. For * example, aml://abc for system assets or https://xyz for user assets or * payload. - * @member {string} [credentials] Access credentials for the blob, if + * @property {string} [credentials] Access credentials for the blob, if * applicable (e.g. blob specified by storage account connection string + * blob URI) */ diff --git a/lib/services/machinelearning/lib/webservices/models/columnSpecification.js b/lib/services/machinelearning/lib/webservices/models/columnSpecification.js index 3634611061..c661df1ff1 100644 --- a/lib/services/machinelearning/lib/webservices/models/columnSpecification.js +++ b/lib/services/machinelearning/lib/webservices/models/columnSpecification.js @@ -19,17 +19,17 @@ class ColumnSpecification { /** * Create a ColumnSpecification. - * @member {string} type Data type of the column. Possible values include: + * @property {string} type Data type of the column. Possible values include: * 'Boolean', 'Integer', 'Number', 'String' - * @member {string} [format] Additional format information for the data type. - * Possible values include: 'Byte', 'Char', 'Complex64', 'Complex128', + * @property {string} [format] Additional format information for the data + * type. Possible values include: 'Byte', 'Char', 'Complex64', 'Complex128', * 'Date-time', 'Date-timeOffset', 'Double', 'Duration', 'Float', 'Int8', * 'Int16', 'Int32', 'Int64', 'Uint8', 'Uint16', 'Uint32', 'Uint64' - * @member {array} [enum] If the data type is categorical, this provides the - * list of accepted categories. - * @member {boolean} [xMsIsnullable] Flag indicating if the type supports + * @property {array} [enum] If the data type is categorical, this provides + * the list of accepted categories. + * @property {boolean} [xMsIsnullable] Flag indicating if the type supports * null values or not. - * @member {boolean} [xMsIsordered] Flag indicating whether the categories + * @property {boolean} [xMsIsordered] Flag indicating whether the categories * are treated as an ordered set or not, if this is a categorical column. */ constructor() { diff --git a/lib/services/machinelearning/lib/webservices/models/commitmentPlan.js b/lib/services/machinelearning/lib/webservices/models/commitmentPlan.js index b8a4a1f3ce..8f6399401c 100644 --- a/lib/services/machinelearning/lib/webservices/models/commitmentPlan.js +++ b/lib/services/machinelearning/lib/webservices/models/commitmentPlan.js @@ -18,7 +18,7 @@ class CommitmentPlan { /** * Create a CommitmentPlan. - * @member {string} id Specifies the Azure Resource Manager ID of the + * @property {string} id Specifies the Azure Resource Manager ID of the * commitment plan associated with the web service. */ constructor() { diff --git a/lib/services/machinelearning/lib/webservices/models/diagnosticsConfiguration.js b/lib/services/machinelearning/lib/webservices/models/diagnosticsConfiguration.js index 70e41cc26f..4192133d60 100644 --- a/lib/services/machinelearning/lib/webservices/models/diagnosticsConfiguration.js +++ b/lib/services/machinelearning/lib/webservices/models/diagnosticsConfiguration.js @@ -17,12 +17,12 @@ class DiagnosticsConfiguration { /** * Create a DiagnosticsConfiguration. - * @member {string} level Specifies the verbosity of the diagnostic output. + * @property {string} level Specifies the verbosity of the diagnostic output. * Valid values are: None - disables tracing; Error - collects only error * (stderr) traces; All - collects all traces (stdout and stderr). Possible * values include: 'None', 'Error', 'All' - * @member {date} [expiry] Specifies the date and time when the logging will - * cease. If null, diagnostic collection is not time limited. + * @property {date} [expiry] Specifies the date and time when the logging + * will cease. If null, diagnostic collection is not time limited. */ constructor() { } diff --git a/lib/services/machinelearning/lib/webservices/models/exampleRequest.js b/lib/services/machinelearning/lib/webservices/models/exampleRequest.js index 587b336d7b..d461d9e25c 100644 --- a/lib/services/machinelearning/lib/webservices/models/exampleRequest.js +++ b/lib/services/machinelearning/lib/webservices/models/exampleRequest.js @@ -17,9 +17,9 @@ class ExampleRequest { /** * Create a ExampleRequest. - * @member {object} [inputs] Sample input data for the web service's input(s) - * given as an input name to sample input values matrix map. - * @member {object} [globalParameters] Sample input data for the web + * @property {object} [inputs] Sample input data for the web service's + * input(s) given as an input name to sample input values matrix map. + * @property {object} [globalParameters] Sample input data for the web * service's global parameters */ constructor() { diff --git a/lib/services/machinelearning/lib/webservices/models/graphEdge.js b/lib/services/machinelearning/lib/webservices/models/graphEdge.js index e9303dd20b..c4c38201eb 100644 --- a/lib/services/machinelearning/lib/webservices/models/graphEdge.js +++ b/lib/services/machinelearning/lib/webservices/models/graphEdge.js @@ -17,11 +17,11 @@ class GraphEdge { /** * Create a GraphEdge. - * @member {string} [sourceNodeId] The source graph node's identifier. - * @member {string} [sourcePortId] The identifier of the source node's port + * @property {string} [sourceNodeId] The source graph node's identifier. + * @property {string} [sourcePortId] The identifier of the source node's port * that the edge connects from. - * @member {string} [targetNodeId] The destination graph node's identifier. - * @member {string} [targetPortId] The identifier of the destination node's + * @property {string} [targetNodeId] The destination graph node's identifier. + * @property {string} [targetPortId] The identifier of the destination node's * port that the edge connects into. */ constructor() { diff --git a/lib/services/machinelearning/lib/webservices/models/graphNode.js b/lib/services/machinelearning/lib/webservices/models/graphNode.js index e65c09f8c5..fa335309bd 100644 --- a/lib/services/machinelearning/lib/webservices/models/graphNode.js +++ b/lib/services/machinelearning/lib/webservices/models/graphNode.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Specifies a node in the web service graph. The node can either be an input, * output or asset node, so only one of the corresponding id properties is @@ -21,12 +19,12 @@ const models = require('./index'); class GraphNode { /** * Create a GraphNode. - * @member {string} [assetId] The id of the asset represented by this node. - * @member {string} [inputId] The id of the input element represented by this - * node. - * @member {string} [outputId] The id of the output element represented by + * @property {string} [assetId] The id of the asset represented by this node. + * @property {string} [inputId] The id of the input element represented by + * this node. + * @property {string} [outputId] The id of the output element represented by * this node. - * @member {object} [parameters] If applicable, parameters of the node. + * @property {object} [parameters] If applicable, parameters of the node. * Global graph parameters map into these, with values set at runtime. */ constructor() { diff --git a/lib/services/machinelearning/lib/webservices/models/graphPackage.js b/lib/services/machinelearning/lib/webservices/models/graphPackage.js index 57993b4aab..995fc77a93 100644 --- a/lib/services/machinelearning/lib/webservices/models/graphPackage.js +++ b/lib/services/machinelearning/lib/webservices/models/graphPackage.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Defines the graph of modules making up the machine learning solution. * @@ -19,12 +17,12 @@ const models = require('./index'); class GraphPackage { /** * Create a GraphPackage. - * @member {object} [nodes] The set of nodes making up the graph, provided as - * a nodeId to GraphNode map - * @member {array} [edges] The list of edges making up the graph. - * @member {object} [graphParameters] The collection of global parameters for - * the graph, given as a global parameter name to GraphParameter map. Each - * parameter here has a 1:1 match with the global parameters values map + * @property {object} [nodes] The set of nodes making up the graph, provided + * as a nodeId to GraphNode map + * @property {array} [edges] The list of edges making up the graph. + * @property {object} [graphParameters] The collection of global parameters + * for the graph, given as a global parameter name to GraphParameter map. + * Each parameter here has a 1:1 match with the global parameters values map * declared at the WebServiceProperties level. */ constructor() { diff --git a/lib/services/machinelearning/lib/webservices/models/graphParameter.js b/lib/services/machinelearning/lib/webservices/models/graphParameter.js index 099968d349..b6ec9d3d85 100644 --- a/lib/services/machinelearning/lib/webservices/models/graphParameter.js +++ b/lib/services/machinelearning/lib/webservices/models/graphParameter.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Defines a global parameter in the graph. * @@ -19,12 +17,12 @@ const models = require('./index'); class GraphParameter { /** * Create a GraphParameter. - * @member {string} [description] Description of this graph parameter. - * @member {string} type Graph parameter's type. Possible values include: + * @property {string} [description] Description of this graph parameter. + * @property {string} type Graph parameter's type. Possible values include: * 'String', 'Int', 'Float', 'Enumerated', 'Script', 'Mode', 'Credential', * 'Boolean', 'Double', 'ColumnPicker', 'ParameterRange', 'DataGatewayName' - * @member {array} links Association links for this parameter to nodes in the - * graph. + * @property {array} links Association links for this parameter to nodes in + * the graph. */ constructor() { } diff --git a/lib/services/machinelearning/lib/webservices/models/graphParameterLink.js b/lib/services/machinelearning/lib/webservices/models/graphParameterLink.js index 6f8ea22670..7960667503 100644 --- a/lib/services/machinelearning/lib/webservices/models/graphParameterLink.js +++ b/lib/services/machinelearning/lib/webservices/models/graphParameterLink.js @@ -17,8 +17,8 @@ class GraphParameterLink { /** * Create a GraphParameterLink. - * @member {string} nodeId The graph node's identifier - * @member {string} parameterKey The identifier of the node parameter that + * @property {string} nodeId The graph node's identifier + * @property {string} parameterKey The identifier of the node parameter that * the global parameter maps to. */ constructor() { diff --git a/lib/services/machinelearning/lib/webservices/models/index.d.ts b/lib/services/machinelearning/lib/webservices/models/index.d.ts index 75ad514ca4..a58e3ccb96 100644 --- a/lib/services/machinelearning/lib/webservices/models/index.d.ts +++ b/lib/services/machinelearning/lib/webservices/models/index.d.ts @@ -1,786 +1,683 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource } from 'ms-rest-azure'; -import { CloudError } from 'ms-rest-azure'; -import * as moment from 'moment'; +import { BaseResource, CloudError } from "ms-rest-azure"; +import * as moment from "moment"; -export { BaseResource } from 'ms-rest-azure'; -export { CloudError } from 'ms-rest-azure'; +export { + BaseResource, + CloudError +}; /** - * @class - * Initializes a new instance of the Resource class. - * @constructor * Azure resource. - * - * @member {string} [id] Specifies the resource ID. - * @member {string} [name] Specifies the name of the resource. - * @member {string} location Specifies the location of the resource. - * @member {string} [type] Specifies the type of the resource. - * @member {object} [tags] Contains resource tags defined as key/value pairs. */ export interface Resource extends BaseResource { + /** + * Specifies the resource ID. + */ readonly id?: string; + /** + * Specifies the name of the resource. + */ readonly name?: string; + /** + * Specifies the location of the resource. + */ location: string; + /** + * Specifies the type of the resource. + */ readonly type?: string; + /** + * Contains resource tags defined as key/value pairs. + */ tags?: { [propertyName: string]: string }; } /** - * @class - * Initializes a new instance of the WebServiceKeys class. - * @constructor * Access keys for the web service calls. - * - * @member {string} [primary] The primary access key. - * @member {string} [secondary] The secondary access key. */ export interface WebServiceKeys { + /** + * The primary access key. + */ primary?: string; + /** + * The secondary access key. + */ secondary?: string; } /** - * @class - * Initializes a new instance of the RealtimeConfiguration class. - * @constructor - * Holds the available configuration options for an Azure ML web service - * endpoint. - * - * @member {number} [maxConcurrentCalls] Specifies the maximum concurrent calls - * that can be made to the web service. Minimum value: 4, Maximum value: 200. + * Holds the available configuration options for an Azure ML web service endpoint. */ export interface RealtimeConfiguration { + /** + * Specifies the maximum concurrent calls that can be made to the web service. Minimum value: 4, + * Maximum value: 200. + */ maxConcurrentCalls?: number; } /** - * @class - * Initializes a new instance of the DiagnosticsConfiguration class. - * @constructor * Diagnostics settings for an Azure ML web service. - * - * @member {string} level Specifies the verbosity of the diagnostic output. - * Valid values are: None - disables tracing; Error - collects only error - * (stderr) traces; All - collects all traces (stdout and stderr). Possible - * values include: 'None', 'Error', 'All' - * @member {date} [expiry] Specifies the date and time when the logging will - * cease. If null, diagnostic collection is not time limited. */ export interface DiagnosticsConfiguration { + /** + * Specifies the verbosity of the diagnostic output. Valid values are: None - disables tracing; + * Error - collects only error (stderr) traces; All - collects all traces (stdout and stderr). + * Possible values include: 'None', 'Error', 'All' + */ level: string; + /** + * Specifies the date and time when the logging will cease. If null, diagnostic collection is not + * time limited. + */ expiry?: Date; } /** - * @class - * Initializes a new instance of the StorageAccount class. - * @constructor * Access information for a storage account. - * - * @member {string} [name] Specifies the name of the storage account. - * @member {string} [key] Specifies the key used to access the storage account. */ export interface StorageAccount { + /** + * Specifies the name of the storage account. + */ name?: string; + /** + * Specifies the key used to access the storage account. + */ key?: string; } /** - * @class - * Initializes a new instance of the MachineLearningWorkspace class. - * @constructor - * Information about the machine learning workspace containing the experiment - * that is source for the web service. - * - * @member {string} id Specifies the workspace ID of the machine learning - * workspace associated with the web service + * Information about the machine learning workspace containing the experiment that is source for + * the web service. */ export interface MachineLearningWorkspace { + /** + * Specifies the workspace ID of the machine learning workspace associated with the web service + */ id: string; } /** - * @class - * Initializes a new instance of the CommitmentPlan class. - * @constructor - * Information about the machine learning commitment plan associated with the - * web service. - * - * @member {string} id Specifies the Azure Resource Manager ID of the - * commitment plan associated with the web service. + * Information about the machine learning commitment plan associated with the web service. */ export interface CommitmentPlan { + /** + * Specifies the Azure Resource Manager ID of the commitment plan associated with the web + * service. + */ id: string; } /** - * @class - * Initializes a new instance of the ColumnSpecification class. - * @constructor - * Swagger 2.0 schema for a column within the data table representing a web - * service input or output. See Swagger specification: - * http://swagger.io/specification/ - * - * @member {string} type Data type of the column. Possible values include: - * 'Boolean', 'Integer', 'Number', 'String' - * @member {string} [format] Additional format information for the data type. - * Possible values include: 'Byte', 'Char', 'Complex64', 'Complex128', - * 'Date-time', 'Date-timeOffset', 'Double', 'Duration', 'Float', 'Int8', - * 'Int16', 'Int32', 'Int64', 'Uint8', 'Uint16', 'Uint32', 'Uint64' - * @member {array} [enum] If the data type is categorical, this provides the - * list of accepted categories. - * @member {boolean} [xMsIsnullable] Flag indicating if the type supports null - * values or not. - * @member {boolean} [xMsIsordered] Flag indicating whether the categories are - * treated as an ordered set or not, if this is a categorical column. + * Swagger 2.0 schema for a column within the data table representing a web service input or + * output. See Swagger specification: http://swagger.io/specification/ */ export interface ColumnSpecification { + /** + * Data type of the column. Possible values include: 'Boolean', 'Integer', 'Number', 'String' + */ type: string; + /** + * Additional format information for the data type. Possible values include: 'Byte', 'Char', + * 'Complex64', 'Complex128', 'Date-time', 'Date-timeOffset', 'Double', 'Duration', 'Float', + * 'Int8', 'Int16', 'Int32', 'Int64', 'Uint8', 'Uint16', 'Uint32', 'Uint64' + */ format?: string; + /** + * If the data type is categorical, this provides the list of accepted categories. + */ enum?: any[]; + /** + * Flag indicating if the type supports null values or not. + */ xMsIsnullable?: boolean; + /** + * Flag indicating whether the categories are treated as an ordered set or not, if this is a + * categorical column. + */ xMsIsordered?: boolean; } /** - * @class - * Initializes a new instance of the TableSpecification class. - * @constructor - * The swagger 2.0 schema describing a single service input or output. See - * Swagger specification: http://swagger.io/specification/ - * - * @member {string} [title] Swagger schema title. - * @member {string} [description] Swagger schema description. - * @member {string} type The type of the entity described in swagger. Default - * value: 'object' . - * @member {string} [format] The format, if 'type' is not 'object' - * @member {object} [properties] The set of columns within the data table. + * The swagger 2.0 schema describing a single service input or output. See Swagger specification: + * http://swagger.io/specification/ */ export interface TableSpecification { + /** + * Swagger schema title. + */ title?: string; + /** + * Swagger schema description. + */ description?: string; + /** + * The type of the entity described in swagger. + */ type: string; + /** + * The format, if 'type' is not 'object' + */ format?: string; + /** + * The set of columns within the data table. + */ properties?: { [propertyName: string]: ColumnSpecification }; } /** - * @class - * Initializes a new instance of the ServiceInputOutputSpecification class. - * @constructor - * The swagger 2.0 schema describing the service's inputs or outputs. See - * Swagger specification: http://swagger.io/specification/ - * - * @member {string} [title] The title of your Swagger schema. - * @member {string} [description] The description of the Swagger schema. - * @member {string} type The type of the entity described in swagger. Always - * 'object'. Default value: 'object' . - * @member {object} properties Specifies a collection that contains the column - * schema for each input or output of the web service. For more information, - * see the Swagger specification. + * The swagger 2.0 schema describing the service's inputs or outputs. See Swagger specification: + * http://swagger.io/specification/ */ export interface ServiceInputOutputSpecification { + /** + * The title of your Swagger schema. + */ title?: string; + /** + * The description of the Swagger schema. + */ description?: string; + /** + * The type of the entity described in swagger. Always 'object'. + */ type: string; + /** + * Specifies a collection that contains the column schema for each input or output of the web + * service. For more information, see the Swagger specification. + */ properties: { [propertyName: string]: TableSpecification }; } /** - * @class - * Initializes a new instance of the ExampleRequest class. - * @constructor * Sample input data for the service's input(s). - * - * @member {object} [inputs] Sample input data for the web service's input(s) - * given as an input name to sample input values matrix map. - * @member {object} [globalParameters] Sample input data for the web service's - * global parameters */ export interface ExampleRequest { + /** + * Sample input data for the web service's input(s) given as an input name to sample input values + * matrix map. + */ inputs?: { [propertyName: string]: any[][] }; + /** + * Sample input data for the web service's global parameters + */ globalParameters?: { [propertyName: string]: any }; } /** - * @class - * Initializes a new instance of the BlobLocation class. - * @constructor * Describes the access location for a blob. - * - * @member {string} uri The URI from which the blob is accessible from. For - * example, aml://abc for system assets or https://xyz for user assets or - * payload. - * @member {string} [credentials] Access credentials for the blob, if - * applicable (e.g. blob specified by storage account connection string + blob - * URI) */ export interface BlobLocation { + /** + * The URI from which the blob is accessible from. For example, aml://abc for system assets or + * https://xyz for user assets or payload. + */ uri: string; + /** + * Access credentials for the blob, if applicable (e.g. blob specified by storage account + * connection string + blob URI) + */ credentials?: string; } /** - * @class - * Initializes a new instance of the InputPort class. - * @constructor * Asset input port - * - * @member {string} [type] Port data type. Possible values include: 'Dataset'. - * Default value: 'Dataset' . */ export interface InputPort { + /** + * Port data type. Possible values include: 'Dataset' + */ type?: string; } /** - * @class - * Initializes a new instance of the OutputPort class. - * @constructor * Asset output port - * - * @member {string} [type] Port data type. Possible values include: 'Dataset'. - * Default value: 'Dataset' . */ export interface OutputPort { + /** + * Port data type. Possible values include: 'Dataset' + */ type?: string; } /** - * @class - * Initializes a new instance of the ModeValueInfo class. - * @constructor * Nested parameter definition. - * - * @member {string} [interfaceString] The interface string name for the nested - * parameter. - * @member {array} [parameters] The definition of the parameter. */ export interface ModeValueInfo { + /** + * The interface string name for the nested parameter. + */ interfaceString?: string; + /** + * The definition of the parameter. + */ parameters?: ModuleAssetParameter[]; } /** - * @class - * Initializes a new instance of the ModuleAssetParameter class. - * @constructor * Parameter definition for a module asset. - * - * @member {string} [name] Parameter name. - * @member {string} [parameterType] Parameter type. - * @member {object} [modeValuesInfo] Definitions for nested interface - * parameters if this is a complex module parameter. */ export interface ModuleAssetParameter { + /** + * Parameter name. + */ name?: string; + /** + * Parameter type. + */ parameterType?: string; + /** + * Definitions for nested interface parameters if this is a complex module parameter. + */ modeValuesInfo?: { [propertyName: string]: ModeValueInfo }; } /** - * @class - * Initializes a new instance of the AssetItem class. - * @constructor * Information about an asset associated with the web service. - * - * @member {string} name Asset's friendly name. - * @member {string} [id] Asset's Id. - * @member {string} type Asset's type. Possible values include: 'Module', - * 'Resource' - * @member {object} locationInfo Access information for the asset. - * @member {string} [locationInfo.uri] The URI from which the blob is - * accessible from. For example, aml://abc for system assets or https://xyz for - * user assets or payload. - * @member {string} [locationInfo.credentials] Access credentials for the blob, - * if applicable (e.g. blob specified by storage account connection string + - * blob URI) - * @member {object} [inputPorts] Information about the asset's input ports. - * @member {object} [outputPorts] Information about the asset's output ports. - * @member {object} [metadata] If the asset is a custom module, this holds the - * module's metadata. - * @member {array} [parameters] If the asset is a custom module, this holds the - * module's parameters. */ export interface AssetItem { + /** + * Asset's friendly name. + */ name: string; + /** + * Asset's Id. + */ id?: string; + /** + * Asset's type. Possible values include: 'Module', 'Resource' + */ type: string; + /** + * Access information for the asset. + */ locationInfo: BlobLocation; + /** + * Information about the asset's input ports. + */ inputPorts?: { [propertyName: string]: InputPort }; + /** + * Information about the asset's output ports. + */ outputPorts?: { [propertyName: string]: OutputPort }; + /** + * If the asset is a custom module, this holds the module's metadata. + */ metadata?: { [propertyName: string]: string }; + /** + * If the asset is a custom module, this holds the module's parameters. + */ parameters?: ModuleAssetParameter[]; } /** - * @class - * Initializes a new instance of the WebServiceParameter class. - * @constructor * Web Service Parameter object for node and global parameter - * - * @member {object} [value] The parameter value - * @member {string} [certificateThumbprint] If the parameter value in 'value' - * field is encrypted, the thumbprint of the certificate should be put here. */ export interface WebServiceParameter { + /** + * The parameter value + */ value?: any; + /** + * If the parameter value in 'value' field is encrypted, the thumbprint of the certificate should + * be put here. + */ certificateThumbprint?: string; } /** - * @class - * Initializes a new instance of the WebServiceProperties class. - * @constructor * The set of properties specific to the Azure ML web service resource. - * - * @member {string} [title] The title of the web service. - * @member {string} [description] The description of the web service. - * @member {date} [createdOn] Read Only: The date and time when the web service - * was created. - * @member {date} [modifiedOn] Read Only: The date and time when the web - * service was last modified. - * @member {string} [provisioningState] Read Only: The provision state of the - * web service. Valid values are Unknown, Provisioning, Succeeded, and Failed. - * Possible values include: 'Unknown', 'Provisioning', 'Succeeded', 'Failed' - * @member {object} [keys] Contains the web service provisioning keys. If you - * do not specify provisioning keys, the Azure Machine Learning system - * generates them for you. Note: The keys are not returned from calls to GET - * operations. - * @member {string} [keys.primary] The primary access key. - * @member {string} [keys.secondary] The secondary access key. - * @member {boolean} [readOnly] When set to true, indicates that the web - * service is read-only and can no longer be updated or patched, only removed. - * Default, is false. Note: Once set to true, you cannot change its value. - * @member {string} [swaggerLocation] Read Only: Contains the URI of the - * swagger spec associated with this web service. - * @member {boolean} [exposeSampleData] When set to true, sample data is - * included in the web service's swagger definition. The default value is true. - * @member {object} [realtimeConfiguration] Contains the configuration settings - * for the web service endpoint. - * @member {number} [realtimeConfiguration.maxConcurrentCalls] Specifies the - * maximum concurrent calls that can be made to the web service. Minimum value: - * 4, Maximum value: 200. - * @member {object} [diagnostics] Settings controlling the diagnostics traces - * collection for the web service. - * @member {string} [diagnostics.level] Specifies the verbosity of the - * diagnostic output. Valid values are: None - disables tracing; Error - - * collects only error (stderr) traces; All - collects all traces (stdout and - * stderr). Possible values include: 'None', 'Error', 'All' - * @member {date} [diagnostics.expiry] Specifies the date and time when the - * logging will cease. If null, diagnostic collection is not time limited. - * @member {object} [storageAccount] Specifies the storage account that Azure - * Machine Learning uses to store information about the web service. Only the - * name of the storage account is returned from calls to GET operations. When - * updating the storage account information, you must ensure that all necessary - * assets are available in the new storage account or calls to your web service - * will fail. - * @member {string} [storageAccount.name] Specifies the name of the storage - * account. - * @member {string} [storageAccount.key] Specifies the key used to access the - * storage account. - * @member {object} [machineLearningWorkspace] Specifies the Machine Learning - * workspace containing the experiment that is source for the web service. - * @member {string} [machineLearningWorkspace.id] Specifies the workspace ID of - * the machine learning workspace associated with the web service - * @member {object} [commitmentPlan] Contains the commitment plan associated - * with this web service. Set at creation time. Once set, this value cannot be - * changed. Note: The commitment plan is not returned from calls to GET - * operations. - * @member {string} [commitmentPlan.id] Specifies the Azure Resource Manager ID - * of the commitment plan associated with the web service. - * @member {object} [input] Contains the Swagger 2.0 schema describing one or - * more of the web service's inputs. For more information, see the Swagger - * specification. - * @member {string} [input.title] The title of your Swagger schema. - * @member {string} [input.description] The description of the Swagger schema. - * @member {string} [input.type] The type of the entity described in swagger. - * Always 'object'. - * @member {object} [input.properties] Specifies a collection that contains the - * column schema for each input or output of the web service. For more - * information, see the Swagger specification. - * @member {object} [output] Contains the Swagger 2.0 schema describing one or - * more of the web service's outputs. For more information, see the Swagger - * specification. - * @member {string} [output.title] The title of your Swagger schema. - * @member {string} [output.description] The description of the Swagger schema. - * @member {string} [output.type] The type of the entity described in swagger. - * Always 'object'. - * @member {object} [output.properties] Specifies a collection that contains - * the column schema for each input or output of the web service. For more - * information, see the Swagger specification. - * @member {object} [exampleRequest] Defines sample input data for one or more - * of the service's inputs. - * @member {object} [exampleRequest.inputs] Sample input data for the web - * service's input(s) given as an input name to sample input values matrix map. - * @member {object} [exampleRequest.globalParameters] Sample input data for the - * web service's global parameters - * @member {object} [assets] Contains user defined properties describing web - * service assets. Properties are expressed as Key/Value pairs. - * @member {object} [parameters] The set of global parameters values defined - * for the web service, given as a global parameter name to default value map. - * If no default value is specified, the parameter is considered to be - * required. - * @member {boolean} [payloadsInBlobStorage] When set to true, indicates that - * the payload size is larger than 3 MB. Otherwise false. If the payload size - * exceed 3 MB, the payload is stored in a blob and the PayloadsLocation - * parameter contains the URI of the blob. Otherwise, this will be set to false - * and Assets, Input, Output, Package, Parameters, ExampleRequest are inline. - * The Payload sizes is determined by adding the size of the Assets, Input, - * Output, Package, Parameters, and the ExampleRequest. - * @member {object} [payloadsLocation] The URI of the payload blob. This - * paramater contains a value only if the payloadsInBlobStorage parameter is - * set to true. Otherwise is set to null. - * @member {string} [payloadsLocation.uri] The URI from which the blob is - * accessible from. For example, aml://abc for system assets or https://xyz for - * user assets or payload. - * @member {string} [payloadsLocation.credentials] Access credentials for the - * blob, if applicable (e.g. blob specified by storage account connection - * string + blob URI) - * @member {string} packageType Polymorphic Discriminator */ export interface WebServiceProperties { + /** + * The title of the web service. + */ title?: string; + /** + * The description of the web service. + */ description?: string; + /** + * Read Only: The date and time when the web service was created. + */ readonly createdOn?: Date; + /** + * Read Only: The date and time when the web service was last modified. + */ readonly modifiedOn?: Date; + /** + * Read Only: The provision state of the web service. Valid values are Unknown, Provisioning, + * Succeeded, and Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', + * 'Failed' + */ readonly provisioningState?: string; + /** + * Contains the web service provisioning keys. If you do not specify provisioning keys, the Azure + * Machine Learning system generates them for you. Note: The keys are not returned from calls to + * GET operations. + */ keys?: WebServiceKeys; + /** + * When set to true, indicates that the web service is read-only and can no longer be updated or + * patched, only removed. Default, is false. Note: Once set to true, you cannot change its value. + */ readOnly?: boolean; + /** + * Read Only: Contains the URI of the swagger spec associated with this web service. + */ readonly swaggerLocation?: string; + /** + * When set to true, sample data is included in the web service's swagger definition. The default + * value is true. + */ exposeSampleData?: boolean; + /** + * Contains the configuration settings for the web service endpoint. + */ realtimeConfiguration?: RealtimeConfiguration; + /** + * Settings controlling the diagnostics traces collection for the web service. + */ diagnostics?: DiagnosticsConfiguration; + /** + * Specifies the storage account that Azure Machine Learning uses to store information about the + * web service. Only the name of the storage account is returned from calls to GET operations. + * When updating the storage account information, you must ensure that all necessary assets are + * available in the new storage account or calls to your web service will fail. + */ storageAccount?: StorageAccount; + /** + * Specifies the Machine Learning workspace containing the experiment that is source for the web + * service. + */ machineLearningWorkspace?: MachineLearningWorkspace; + /** + * Contains the commitment plan associated with this web service. Set at creation time. Once set, + * this value cannot be changed. Note: The commitment plan is not returned from calls to GET + * operations. + */ commitmentPlan?: CommitmentPlan; + /** + * Contains the Swagger 2.0 schema describing one or more of the web service's inputs. For more + * information, see the Swagger specification. + */ input?: ServiceInputOutputSpecification; + /** + * Contains the Swagger 2.0 schema describing one or more of the web service's outputs. For more + * information, see the Swagger specification. + */ output?: ServiceInputOutputSpecification; + /** + * Defines sample input data for one or more of the service's inputs. + */ exampleRequest?: ExampleRequest; + /** + * Contains user defined properties describing web service assets. Properties are expressed as + * Key/Value pairs. + */ assets?: { [propertyName: string]: AssetItem }; + /** + * The set of global parameters values defined for the web service, given as a global parameter + * name to default value map. If no default value is specified, the parameter is considered to be + * required. + */ parameters?: { [propertyName: string]: WebServiceParameter }; + /** + * When set to true, indicates that the payload size is larger than 3 MB. Otherwise false. If the + * payload size exceed 3 MB, the payload is stored in a blob and the PayloadsLocation parameter + * contains the URI of the blob. Otherwise, this will be set to false and Assets, Input, Output, + * Package, Parameters, ExampleRequest are inline. The Payload sizes is determined by adding the + * size of the Assets, Input, Output, Package, Parameters, and the ExampleRequest. + */ payloadsInBlobStorage?: boolean; + /** + * The URI of the payload blob. This paramater contains a value only if the payloadsInBlobStorage + * parameter is set to true. Otherwise is set to null. + */ payloadsLocation?: BlobLocation; + /** + * Polymorphic Discriminator + */ packageType: string; } /** - * @class - * Initializes a new instance of the WebService class. - * @constructor * Instance of an Azure ML web service resource. - * - * @member {object} properties Contains the property payload that describes the - * web service. - * @member {string} [properties.title] The title of the web service. - * @member {string} [properties.description] The description of the web - * service. - * @member {date} [properties.createdOn] Read Only: The date and time when the - * web service was created. - * @member {date} [properties.modifiedOn] Read Only: The date and time when the - * web service was last modified. - * @member {string} [properties.provisioningState] Read Only: The provision - * state of the web service. Valid values are Unknown, Provisioning, Succeeded, - * and Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', - * 'Failed' - * @member {object} [properties.keys] Contains the web service provisioning - * keys. If you do not specify provisioning keys, the Azure Machine Learning - * system generates them for you. Note: The keys are not returned from calls to - * GET operations. - * @member {string} [properties.keys.primary] The primary access key. - * @member {string} [properties.keys.secondary] The secondary access key. - * @member {boolean} [properties.readOnly] When set to true, indicates that the - * web service is read-only and can no longer be updated or patched, only - * removed. Default, is false. Note: Once set to true, you cannot change its - * value. - * @member {string} [properties.swaggerLocation] Read Only: Contains the URI of - * the swagger spec associated with this web service. - * @member {boolean} [properties.exposeSampleData] When set to true, sample - * data is included in the web service's swagger definition. The default value - * is true. - * @member {object} [properties.realtimeConfiguration] Contains the - * configuration settings for the web service endpoint. - * @member {number} [properties.realtimeConfiguration.maxConcurrentCalls] - * Specifies the maximum concurrent calls that can be made to the web service. - * Minimum value: 4, Maximum value: 200. - * @member {object} [properties.diagnostics] Settings controlling the - * diagnostics traces collection for the web service. - * @member {string} [properties.diagnostics.level] Specifies the verbosity of - * the diagnostic output. Valid values are: None - disables tracing; Error - - * collects only error (stderr) traces; All - collects all traces (stdout and - * stderr). Possible values include: 'None', 'Error', 'All' - * @member {date} [properties.diagnostics.expiry] Specifies the date and time - * when the logging will cease. If null, diagnostic collection is not time - * limited. - * @member {object} [properties.storageAccount] Specifies the storage account - * that Azure Machine Learning uses to store information about the web service. - * Only the name of the storage account is returned from calls to GET - * operations. When updating the storage account information, you must ensure - * that all necessary assets are available in the new storage account or calls - * to your web service will fail. - * @member {string} [properties.storageAccount.name] Specifies the name of the - * storage account. - * @member {string} [properties.storageAccount.key] Specifies the key used to - * access the storage account. - * @member {object} [properties.machineLearningWorkspace] Specifies the Machine - * Learning workspace containing the experiment that is source for the web - * service. - * @member {string} [properties.machineLearningWorkspace.id] Specifies the - * workspace ID of the machine learning workspace associated with the web - * service - * @member {object} [properties.commitmentPlan] Contains the commitment plan - * associated with this web service. Set at creation time. Once set, this value - * cannot be changed. Note: The commitment plan is not returned from calls to - * GET operations. - * @member {string} [properties.commitmentPlan.id] Specifies the Azure Resource - * Manager ID of the commitment plan associated with the web service. - * @member {object} [properties.input] Contains the Swagger 2.0 schema - * describing one or more of the web service's inputs. For more information, - * see the Swagger specification. - * @member {string} [properties.input.title] The title of your Swagger schema. - * @member {string} [properties.input.description] The description of the - * Swagger schema. - * @member {string} [properties.input.type] The type of the entity described in - * swagger. Always 'object'. - * @member {object} [properties.input.properties] Specifies a collection that - * contains the column schema for each input or output of the web service. For - * more information, see the Swagger specification. - * @member {object} [properties.output] Contains the Swagger 2.0 schema - * describing one or more of the web service's outputs. For more information, - * see the Swagger specification. - * @member {string} [properties.output.title] The title of your Swagger schema. - * @member {string} [properties.output.description] The description of the - * Swagger schema. - * @member {string} [properties.output.type] The type of the entity described - * in swagger. Always 'object'. - * @member {object} [properties.output.properties] Specifies a collection that - * contains the column schema for each input or output of the web service. For - * more information, see the Swagger specification. - * @member {object} [properties.exampleRequest] Defines sample input data for - * one or more of the service's inputs. - * @member {object} [properties.exampleRequest.inputs] Sample input data for - * the web service's input(s) given as an input name to sample input values - * matrix map. - * @member {object} [properties.exampleRequest.globalParameters] Sample input - * data for the web service's global parameters - * @member {object} [properties.assets] Contains user defined properties - * describing web service assets. Properties are expressed as Key/Value pairs. - * @member {object} [properties.parameters] The set of global parameters values - * defined for the web service, given as a global parameter name to default - * value map. If no default value is specified, the parameter is considered to - * be required. - * @member {boolean} [properties.payloadsInBlobStorage] When set to true, - * indicates that the payload size is larger than 3 MB. Otherwise false. If the - * payload size exceed 3 MB, the payload is stored in a blob and the - * PayloadsLocation parameter contains the URI of the blob. Otherwise, this - * will be set to false and Assets, Input, Output, Package, Parameters, - * ExampleRequest are inline. The Payload sizes is determined by adding the - * size of the Assets, Input, Output, Package, Parameters, and the - * ExampleRequest. - * @member {object} [properties.payloadsLocation] The URI of the payload blob. - * This paramater contains a value only if the payloadsInBlobStorage parameter - * is set to true. Otherwise is set to null. - * @member {string} [properties.payloadsLocation.uri] The URI from which the - * blob is accessible from. For example, aml://abc for system assets or - * https://xyz for user assets or payload. - * @member {string} [properties.payloadsLocation.credentials] Access - * credentials for the blob, if applicable (e.g. blob specified by storage - * account connection string + blob URI) - * @member {string} [properties.packageType] Polymorphic Discriminator */ export interface WebService extends Resource { + /** + * Contains the property payload that describes the web service. + */ properties: WebServiceProperties; } /** - * @class - * Initializes a new instance of the GraphNode class. - * @constructor - * Specifies a node in the web service graph. The node can either be an input, - * output or asset node, so only one of the corresponding id properties is - * populated at any given time. - * - * @member {string} [assetId] The id of the asset represented by this node. - * @member {string} [inputId] The id of the input element represented by this - * node. - * @member {string} [outputId] The id of the output element represented by this - * node. - * @member {object} [parameters] If applicable, parameters of the node. Global - * graph parameters map into these, with values set at runtime. + * Specifies a node in the web service graph. The node can either be an input, output or asset + * node, so only one of the corresponding id properties is populated at any given time. */ export interface GraphNode { + /** + * The id of the asset represented by this node. + */ assetId?: string; + /** + * The id of the input element represented by this node. + */ inputId?: string; + /** + * The id of the output element represented by this node. + */ outputId?: string; + /** + * If applicable, parameters of the node. Global graph parameters map into these, with values set + * at runtime. + */ parameters?: { [propertyName: string]: WebServiceParameter }; } /** - * @class - * Initializes a new instance of the GraphEdge class. - * @constructor * Defines an edge within the web service's graph. - * - * @member {string} [sourceNodeId] The source graph node's identifier. - * @member {string} [sourcePortId] The identifier of the source node's port - * that the edge connects from. - * @member {string} [targetNodeId] The destination graph node's identifier. - * @member {string} [targetPortId] The identifier of the destination node's - * port that the edge connects into. */ export interface GraphEdge { + /** + * The source graph node's identifier. + */ sourceNodeId?: string; + /** + * The identifier of the source node's port that the edge connects from. + */ sourcePortId?: string; + /** + * The destination graph node's identifier. + */ targetNodeId?: string; + /** + * The identifier of the destination node's port that the edge connects into. + */ targetPortId?: string; } /** - * @class - * Initializes a new instance of the GraphParameterLink class. - * @constructor * Association link for a graph global parameter to a node in the graph. - * - * @member {string} nodeId The graph node's identifier - * @member {string} parameterKey The identifier of the node parameter that the - * global parameter maps to. */ export interface GraphParameterLink { + /** + * The graph node's identifier + */ nodeId: string; + /** + * The identifier of the node parameter that the global parameter maps to. + */ parameterKey: string; } /** - * @class - * Initializes a new instance of the GraphParameter class. - * @constructor * Defines a global parameter in the graph. - * - * @member {string} [description] Description of this graph parameter. - * @member {string} type Graph parameter's type. Possible values include: - * 'String', 'Int', 'Float', 'Enumerated', 'Script', 'Mode', 'Credential', - * 'Boolean', 'Double', 'ColumnPicker', 'ParameterRange', 'DataGatewayName' - * @member {array} links Association links for this parameter to nodes in the - * graph. */ export interface GraphParameter { + /** + * Description of this graph parameter. + */ description?: string; + /** + * Graph parameter's type. Possible values include: 'String', 'Int', 'Float', 'Enumerated', + * 'Script', 'Mode', 'Credential', 'Boolean', 'Double', 'ColumnPicker', 'ParameterRange', + * 'DataGatewayName' + */ type: string; + /** + * Association links for this parameter to nodes in the graph. + */ links: GraphParameterLink[]; } /** - * @class - * Initializes a new instance of the GraphPackage class. - * @constructor * Defines the graph of modules making up the machine learning solution. - * - * @member {object} [nodes] The set of nodes making up the graph, provided as a - * nodeId to GraphNode map - * @member {array} [edges] The list of edges making up the graph. - * @member {object} [graphParameters] The collection of global parameters for - * the graph, given as a global parameter name to GraphParameter map. Each - * parameter here has a 1:1 match with the global parameters values map - * declared at the WebServiceProperties level. */ export interface GraphPackage { + /** + * The set of nodes making up the graph, provided as a nodeId to GraphNode map + */ nodes?: { [propertyName: string]: GraphNode }; + /** + * The list of edges making up the graph. + */ edges?: GraphEdge[]; + /** + * The collection of global parameters for the graph, given as a global parameter name to + * GraphParameter map. Each parameter here has a 1:1 match with the global parameters values map + * declared at the WebServiceProperties level. + */ graphParameters?: { [propertyName: string]: GraphParameter }; } /** - * @class - * Initializes a new instance of the WebServicePropertiesForGraph class. - * @constructor * Properties specific to a Graph based web service. - * - * @member {object} [packageProperty] The definition of the graph package - * making up this web service. - * @member {object} [packageProperty.nodes] The set of nodes making up the - * graph, provided as a nodeId to GraphNode map - * @member {array} [packageProperty.edges] The list of edges making up the - * graph. - * @member {object} [packageProperty.graphParameters] The collection of global - * parameters for the graph, given as a global parameter name to GraphParameter - * map. Each parameter here has a 1:1 match with the global parameters values - * map declared at the WebServiceProperties level. */ export interface WebServicePropertiesForGraph extends WebServiceProperties { + /** + * The definition of the graph package making up this web service. + */ packageProperty?: GraphPackage; } /** - * @class - * Initializes a new instance of the AsyncOperationErrorInfo class. - * @constructor * The error detail information for async operation - * - * @member {string} [code] The error code. - * @member {string} [target] The error target. - * @member {string} [message] The error message. - * @member {array} [details] An array containing error information. */ export interface AsyncOperationErrorInfo { - code?: string; - target?: string; - message?: string; - details?: AsyncOperationErrorInfo[]; + /** + * The error code. + */ + readonly code?: string; + /** + * The error target. + */ + readonly target?: string; + /** + * The error message. + */ + readonly message?: string; + /** + * An array containing error information. + */ + readonly details?: AsyncOperationErrorInfo[]; } /** - * @class - * Initializes a new instance of the AsyncOperationStatus class. - * @constructor * Azure async operation status. - * - * @member {string} [id] Async operation id. - * @member {string} [name] Async operation name. - * @member {string} [provisioningState] Read Only: The provisioning state of - * the web service. Valid values are Unknown, Provisioning, Succeeded, and - * Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', - * 'Failed' - * @member {date} [startTime] The date time that the async operation started. - * @member {date} [endTime] The date time that the async operation finished. - * @member {number} [percentComplete] Async operation progress. - * @member {object} [errorInfo] If the async operation fails, this structure - * contains the error details. - * @member {string} [errorInfo.code] The error code. - * @member {string} [errorInfo.target] The error target. - * @member {string} [errorInfo.message] The error message. - * @member {array} [errorInfo.details] An array containing error information. */ export interface AsyncOperationStatus { - id?: string; - name?: string; + /** + * Async operation id. + */ + readonly id?: string; + /** + * Async operation name. + */ + readonly name?: string; + /** + * Read Only: The provisioning state of the web service. Valid values are Unknown, Provisioning, + * Succeeded, and Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', + * 'Failed' + */ readonly provisioningState?: string; + /** + * The date time that the async operation started. + */ readonly startTime?: Date; + /** + * The date time that the async operation finished. + */ readonly endTime?: Date; - percentComplete?: number; - errorInfo?: AsyncOperationErrorInfo; + /** + * Async operation progress. + */ + readonly percentComplete?: number; + /** + * If the async operation fails, this structure contains the error details. + */ + readonly errorInfo?: AsyncOperationErrorInfo; +} + +/** + * The API operation info. + */ +export interface OperationDisplayInfo { + /** + * The description of the operation. + */ + readonly description?: string; + /** + * The action that users can perform, based on their permission level. + */ + readonly operation?: string; + /** + * The service provider. + */ + readonly provider?: string; + /** + * The resource on which the operation is performed. + */ + readonly resource?: string; +} + +/** + * An API operation. + */ +export interface OperationEntity { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + readonly name?: string; + /** + * The API operation info. + */ + display?: OperationDisplayInfo; } +/** + * The list of REST API operations. + */ +export interface OperationEntityListResult extends Array { +} /** - * @class - * Initializes a new instance of the PaginatedWebServicesList class. - * @constructor * Paginated list of web services. - * - * @member {string} [nextLink] A continuation link (absolute URI) to the next - * page of results in the list. */ export interface PaginatedWebServicesList extends Array { + /** + * A continuation link (absolute URI) to the next page of results in the list. + */ nextLink?: string; } diff --git a/lib/services/machinelearning/lib/webservices/models/index.js b/lib/services/machinelearning/lib/webservices/models/index.js index 6ecc41d019..f19097cebd 100644 --- a/lib/services/machinelearning/lib/webservices/models/index.js +++ b/lib/services/machinelearning/lib/webservices/models/index.js @@ -46,6 +46,9 @@ exports.GraphPackage = require('./graphPackage'); exports.WebServicePropertiesForGraph = require('./webServicePropertiesForGraph'); exports.AsyncOperationErrorInfo = require('./asyncOperationErrorInfo'); exports.AsyncOperationStatus = require('./asyncOperationStatus'); +exports.OperationDisplayInfo = require('./operationDisplayInfo'); +exports.OperationEntity = require('./operationEntity'); +exports.OperationEntityListResult = require('./operationEntityListResult'); exports.PaginatedWebServicesList = require('./paginatedWebServicesList'); exports.discriminators = { 'WebServiceProperties' : exports.WebServiceProperties, diff --git a/lib/services/machinelearning/lib/webservices/models/inputPort.js b/lib/services/machinelearning/lib/webservices/models/inputPort.js index 8e8d2c97b8..cfb9ea81b3 100644 --- a/lib/services/machinelearning/lib/webservices/models/inputPort.js +++ b/lib/services/machinelearning/lib/webservices/models/inputPort.js @@ -17,7 +17,7 @@ class InputPort { /** * Create a InputPort. - * @member {string} [type] Port data type. Possible values include: + * @property {string} [type] Port data type. Possible values include: * 'Dataset'. Default value: 'Dataset' . */ constructor() { diff --git a/lib/services/machinelearning/lib/webservices/models/machineLearningWorkspace.js b/lib/services/machinelearning/lib/webservices/models/machineLearningWorkspace.js index 6a7d5ebb89..e5d0a56477 100644 --- a/lib/services/machinelearning/lib/webservices/models/machineLearningWorkspace.js +++ b/lib/services/machinelearning/lib/webservices/models/machineLearningWorkspace.js @@ -18,7 +18,7 @@ class MachineLearningWorkspace { /** * Create a MachineLearningWorkspace. - * @member {string} id Specifies the workspace ID of the machine learning + * @property {string} id Specifies the workspace ID of the machine learning * workspace associated with the web service */ constructor() { diff --git a/lib/services/machinelearning/lib/webservices/models/modeValueInfo.js b/lib/services/machinelearning/lib/webservices/models/modeValueInfo.js index 5020abc303..e42f524d3a 100644 --- a/lib/services/machinelearning/lib/webservices/models/modeValueInfo.js +++ b/lib/services/machinelearning/lib/webservices/models/modeValueInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Nested parameter definition. * @@ -19,9 +17,9 @@ const models = require('./index'); class ModeValueInfo { /** * Create a ModeValueInfo. - * @member {string} [interfaceString] The interface string name for the + * @property {string} [interfaceString] The interface string name for the * nested parameter. - * @member {array} [parameters] The definition of the parameter. + * @property {array} [parameters] The definition of the parameter. */ constructor() { } diff --git a/lib/services/machinelearning/lib/webservices/models/moduleAssetParameter.js b/lib/services/machinelearning/lib/webservices/models/moduleAssetParameter.js index ee4dd5978f..fd9f720eaf 100644 --- a/lib/services/machinelearning/lib/webservices/models/moduleAssetParameter.js +++ b/lib/services/machinelearning/lib/webservices/models/moduleAssetParameter.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Parameter definition for a module asset. * @@ -19,9 +17,9 @@ const models = require('./index'); class ModuleAssetParameter { /** * Create a ModuleAssetParameter. - * @member {string} [name] Parameter name. - * @member {string} [parameterType] Parameter type. - * @member {object} [modeValuesInfo] Definitions for nested interface + * @property {string} [name] Parameter name. + * @property {string} [parameterType] Parameter type. + * @property {object} [modeValuesInfo] Definitions for nested interface * parameters if this is a complex module parameter. */ constructor() { diff --git a/lib/services/machinelearning/lib/webservices/models/operationDisplayInfo.js b/lib/services/machinelearning/lib/webservices/models/operationDisplayInfo.js new file mode 100644 index 0000000000..1e0c55d4ab --- /dev/null +++ b/lib/services/machinelearning/lib/webservices/models/operationDisplayInfo.js @@ -0,0 +1,82 @@ +/* + * 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 API operation info. + * + */ +class OperationDisplayInfo { + /** + * Create a OperationDisplayInfo. + * @property {string} [description] The description of the operation. + * @property {string} [operation] The action that users can perform, based on + * their permission level. + * @property {string} [provider] The service provider. + * @property {string} [resource] The resource on which the operation is + * performed. + */ + constructor() { + } + + /** + * Defines the metadata of OperationDisplayInfo + * + * @returns {object} metadata of OperationDisplayInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationDisplayInfo', + type: { + name: 'Composite', + className: 'OperationDisplayInfo', + modelProperties: { + description: { + required: false, + readOnly: true, + serializedName: 'description', + type: { + name: 'String' + } + }, + operation: { + required: false, + readOnly: true, + serializedName: 'operation', + type: { + name: 'String' + } + }, + provider: { + required: false, + readOnly: true, + serializedName: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + readOnly: true, + serializedName: 'resource', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationDisplayInfo; diff --git a/lib/services/machinelearning/lib/webservices/models/operationEntity.js b/lib/services/machinelearning/lib/webservices/models/operationEntity.js new file mode 100644 index 0000000000..f1f135f742 --- /dev/null +++ b/lib/services/machinelearning/lib/webservices/models/operationEntity.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * An API operation. + * + */ +class OperationEntity { + /** + * Create a OperationEntity. + * @property {string} [name] Operation name: + * {provider}/{resource}/{operation}. + * @property {object} [display] The API operation info. + * @property {string} [display.description] The description of the operation. + * @property {string} [display.operation] The action that users can perform, + * based on their permission level. + * @property {string} [display.provider] The service provider. + * @property {string} [display.resource] The resource on which the operation + * is performed. + */ + constructor() { + } + + /** + * Defines the metadata of OperationEntity + * + * @returns {object} metadata of OperationEntity + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationEntity', + type: { + name: 'Composite', + className: 'OperationEntity', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serializedName: 'display', + type: { + name: 'Composite', + className: 'OperationDisplayInfo' + } + } + } + } + }; + } +} + +module.exports = OperationEntity; diff --git a/lib/services/machinelearning/lib/webservices/models/operationEntityListResult.js b/lib/services/machinelearning/lib/webservices/models/operationEntityListResult.js new file mode 100644 index 0000000000..bc2f6127e5 --- /dev/null +++ b/lib/services/machinelearning/lib/webservices/models/operationEntityListResult.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The list of REST API operations. + */ +class OperationEntityListResult extends Array { + /** + * Create a OperationEntityListResult. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OperationEntityListResult + * + * @returns {object} metadata of OperationEntityListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationEntityListResult', + type: { + name: 'Composite', + className: 'OperationEntityListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationEntityElementType', + type: { + name: 'Composite', + className: 'OperationEntity' + } + } + } + } + } + } + }; + } +} + +module.exports = OperationEntityListResult; diff --git a/lib/services/machinelearning/lib/webservices/models/outputPort.js b/lib/services/machinelearning/lib/webservices/models/outputPort.js index b6c71476bd..48c0fca207 100644 --- a/lib/services/machinelearning/lib/webservices/models/outputPort.js +++ b/lib/services/machinelearning/lib/webservices/models/outputPort.js @@ -17,7 +17,7 @@ class OutputPort { /** * Create a OutputPort. - * @member {string} [type] Port data type. Possible values include: + * @property {string} [type] Port data type. Possible values include: * 'Dataset'. Default value: 'Dataset' . */ constructor() { diff --git a/lib/services/machinelearning/lib/webservices/models/paginatedWebServicesList.js b/lib/services/machinelearning/lib/webservices/models/paginatedWebServicesList.js index 26a07179fb..c6e8dbc4d8 100644 --- a/lib/services/machinelearning/lib/webservices/models/paginatedWebServicesList.js +++ b/lib/services/machinelearning/lib/webservices/models/paginatedWebServicesList.js @@ -16,8 +16,8 @@ class PaginatedWebServicesList extends Array { /** * Create a PaginatedWebServicesList. - * @member {string} [nextLink] A continuation link (absolute URI) to the next - * page of results in the list. + * @property {string} [nextLink] A continuation link (absolute URI) to the + * next page of results in the list. */ constructor() { super(); diff --git a/lib/services/machinelearning/lib/webservices/models/realtimeConfiguration.js b/lib/services/machinelearning/lib/webservices/models/realtimeConfiguration.js index 47a301f202..0eb7c59d5c 100644 --- a/lib/services/machinelearning/lib/webservices/models/realtimeConfiguration.js +++ b/lib/services/machinelearning/lib/webservices/models/realtimeConfiguration.js @@ -18,7 +18,7 @@ class RealtimeConfiguration { /** * Create a RealtimeConfiguration. - * @member {number} [maxConcurrentCalls] Specifies the maximum concurrent + * @property {number} [maxConcurrentCalls] Specifies the maximum concurrent * calls that can be made to the web service. Minimum value: 4, Maximum * value: 200. */ diff --git a/lib/services/machinelearning/lib/webservices/models/resource.js b/lib/services/machinelearning/lib/webservices/models/resource.js index 41e3ea1a20..03ea5b5525 100644 --- a/lib/services/machinelearning/lib/webservices/models/resource.js +++ b/lib/services/machinelearning/lib/webservices/models/resource.js @@ -20,11 +20,12 @@ const models = require('./index'); class Resource extends models['BaseResource'] { /** * Create a Resource. - * @member {string} [id] Specifies the resource ID. - * @member {string} [name] Specifies the name of the resource. - * @member {string} location Specifies the location of the resource. - * @member {string} [type] Specifies the type of the resource. - * @member {object} [tags] Contains resource tags defined as key/value pairs. + * @property {string} [id] Specifies the resource ID. + * @property {string} [name] Specifies the name of the resource. + * @property {string} location Specifies the location of the resource. + * @property {string} [type] Specifies the type of the resource. + * @property {object} [tags] Contains resource tags defined as key/value + * pairs. */ constructor() { super(); diff --git a/lib/services/machinelearning/lib/webservices/models/serviceInputOutputSpecification.js b/lib/services/machinelearning/lib/webservices/models/serviceInputOutputSpecification.js index f048307be9..5f6d531d80 100644 --- a/lib/services/machinelearning/lib/webservices/models/serviceInputOutputSpecification.js +++ b/lib/services/machinelearning/lib/webservices/models/serviceInputOutputSpecification.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The swagger 2.0 schema describing the service's inputs or outputs. See * Swagger specification: http://swagger.io/specification/ @@ -20,11 +18,11 @@ const models = require('./index'); class ServiceInputOutputSpecification { /** * Create a ServiceInputOutputSpecification. - * @member {string} [title] The title of your Swagger schema. - * @member {string} [description] The description of the Swagger schema. - * @member {string} type The type of the entity described in swagger. Always - * 'object'. Default value: 'object' . - * @member {object} properties Specifies a collection that contains the + * @property {string} [title] The title of your Swagger schema. + * @property {string} [description] The description of the Swagger schema. + * @property {string} type The type of the entity described in swagger. + * Always 'object'. Default value: 'object' . + * @property {object} properties Specifies a collection that contains the * column schema for each input or output of the web service. For more * information, see the Swagger specification. */ diff --git a/lib/services/machinelearning/lib/webservices/models/storageAccount.js b/lib/services/machinelearning/lib/webservices/models/storageAccount.js index 5d072b7b6d..ed2d371dee 100644 --- a/lib/services/machinelearning/lib/webservices/models/storageAccount.js +++ b/lib/services/machinelearning/lib/webservices/models/storageAccount.js @@ -17,8 +17,8 @@ class StorageAccount { /** * Create a StorageAccount. - * @member {string} [name] Specifies the name of the storage account. - * @member {string} [key] Specifies the key used to access the storage + * @property {string} [name] Specifies the name of the storage account. + * @property {string} [key] Specifies the key used to access the storage * account. */ constructor() { diff --git a/lib/services/machinelearning/lib/webservices/models/tableSpecification.js b/lib/services/machinelearning/lib/webservices/models/tableSpecification.js index 92a86b694e..b0d6706652 100644 --- a/lib/services/machinelearning/lib/webservices/models/tableSpecification.js +++ b/lib/services/machinelearning/lib/webservices/models/tableSpecification.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The swagger 2.0 schema describing a single service input or output. See * Swagger specification: http://swagger.io/specification/ @@ -20,12 +18,12 @@ const models = require('./index'); class TableSpecification { /** * Create a TableSpecification. - * @member {string} [title] Swagger schema title. - * @member {string} [description] Swagger schema description. - * @member {string} type The type of the entity described in swagger. Default - * value: 'object' . - * @member {string} [format] The format, if 'type' is not 'object' - * @member {object} [properties] The set of columns within the data table. + * @property {string} [title] Swagger schema title. + * @property {string} [description] Swagger schema description. + * @property {string} type The type of the entity described in swagger. + * Default value: 'object' . + * @property {string} [format] The format, if 'type' is not 'object' + * @property {object} [properties] The set of columns within the data table. */ constructor() { } diff --git a/lib/services/machinelearning/lib/webservices/models/webService.js b/lib/services/machinelearning/lib/webservices/models/webService.js index 0aa3382535..0fb159abc1 100644 --- a/lib/services/machinelearning/lib/webservices/models/webService.js +++ b/lib/services/machinelearning/lib/webservices/models/webService.js @@ -20,110 +20,110 @@ const models = require('./index'); class WebService extends models['Resource'] { /** * Create a WebService. - * @member {object} properties Contains the property payload that describes + * @property {object} properties Contains the property payload that describes * the web service. - * @member {string} [properties.title] The title of the web service. - * @member {string} [properties.description] The description of the web + * @property {string} [properties.title] The title of the web service. + * @property {string} [properties.description] The description of the web * service. - * @member {date} [properties.createdOn] Read Only: The date and time when + * @property {date} [properties.createdOn] Read Only: The date and time when * the web service was created. - * @member {date} [properties.modifiedOn] Read Only: The date and time when + * @property {date} [properties.modifiedOn] Read Only: The date and time when * the web service was last modified. - * @member {string} [properties.provisioningState] Read Only: The provision + * @property {string} [properties.provisioningState] Read Only: The provision * state of the web service. Valid values are Unknown, Provisioning, * Succeeded, and Failed. Possible values include: 'Unknown', 'Provisioning', * 'Succeeded', 'Failed' - * @member {object} [properties.keys] Contains the web service provisioning + * @property {object} [properties.keys] Contains the web service provisioning * keys. If you do not specify provisioning keys, the Azure Machine Learning * system generates them for you. Note: The keys are not returned from calls * to GET operations. - * @member {string} [properties.keys.primary] The primary access key. - * @member {string} [properties.keys.secondary] The secondary access key. - * @member {boolean} [properties.readOnly] When set to true, indicates that + * @property {string} [properties.keys.primary] The primary access key. + * @property {string} [properties.keys.secondary] The secondary access key. + * @property {boolean} [properties.readOnly] When set to true, indicates that * the web service is read-only and can no longer be updated or patched, only * removed. Default, is false. Note: Once set to true, you cannot change its * value. - * @member {string} [properties.swaggerLocation] Read Only: Contains the URI - * of the swagger spec associated with this web service. - * @member {boolean} [properties.exposeSampleData] When set to true, sample + * @property {string} [properties.swaggerLocation] Read Only: Contains the + * URI of the swagger spec associated with this web service. + * @property {boolean} [properties.exposeSampleData] When set to true, sample * data is included in the web service's swagger definition. The default * value is true. - * @member {object} [properties.realtimeConfiguration] Contains the + * @property {object} [properties.realtimeConfiguration] Contains the * configuration settings for the web service endpoint. - * @member {number} [properties.realtimeConfiguration.maxConcurrentCalls] + * @property {number} [properties.realtimeConfiguration.maxConcurrentCalls] * Specifies the maximum concurrent calls that can be made to the web * service. Minimum value: 4, Maximum value: 200. - * @member {object} [properties.diagnostics] Settings controlling the + * @property {object} [properties.diagnostics] Settings controlling the * diagnostics traces collection for the web service. - * @member {string} [properties.diagnostics.level] Specifies the verbosity of - * the diagnostic output. Valid values are: None - disables tracing; Error - - * collects only error (stderr) traces; All - collects all traces (stdout and - * stderr). Possible values include: 'None', 'Error', 'All' - * @member {date} [properties.diagnostics.expiry] Specifies the date and time - * when the logging will cease. If null, diagnostic collection is not time - * limited. - * @member {object} [properties.storageAccount] Specifies the storage account - * that Azure Machine Learning uses to store information about the web - * service. Only the name of the storage account is returned from calls to - * GET operations. When updating the storage account information, you must + * @property {string} [properties.diagnostics.level] Specifies the verbosity + * of the diagnostic output. Valid values are: None - disables tracing; Error + * - collects only error (stderr) traces; All - collects all traces (stdout + * and stderr). Possible values include: 'None', 'Error', 'All' + * @property {date} [properties.diagnostics.expiry] Specifies the date and + * time when the logging will cease. If null, diagnostic collection is not + * time limited. + * @property {object} [properties.storageAccount] Specifies the storage + * account that Azure Machine Learning uses to store information about the + * web service. Only the name of the storage account is returned from calls + * to GET operations. When updating the storage account information, you must * ensure that all necessary assets are available in the new storage account * or calls to your web service will fail. - * @member {string} [properties.storageAccount.name] Specifies the name of + * @property {string} [properties.storageAccount.name] Specifies the name of * the storage account. - * @member {string} [properties.storageAccount.key] Specifies the key used to - * access the storage account. - * @member {object} [properties.machineLearningWorkspace] Specifies the + * @property {string} [properties.storageAccount.key] Specifies the key used + * to access the storage account. + * @property {object} [properties.machineLearningWorkspace] Specifies the * Machine Learning workspace containing the experiment that is source for * the web service. - * @member {string} [properties.machineLearningWorkspace.id] Specifies the + * @property {string} [properties.machineLearningWorkspace.id] Specifies the * workspace ID of the machine learning workspace associated with the web * service - * @member {object} [properties.commitmentPlan] Contains the commitment plan - * associated with this web service. Set at creation time. Once set, this - * value cannot be changed. Note: The commitment plan is not returned from - * calls to GET operations. - * @member {string} [properties.commitmentPlan.id] Specifies the Azure + * @property {object} [properties.commitmentPlan] Contains the commitment + * plan associated with this web service. Set at creation time. Once set, + * this value cannot be changed. Note: The commitment plan is not returned + * from calls to GET operations. + * @property {string} [properties.commitmentPlan.id] Specifies the Azure * Resource Manager ID of the commitment plan associated with the web * service. - * @member {object} [properties.input] Contains the Swagger 2.0 schema + * @property {object} [properties.input] Contains the Swagger 2.0 schema * describing one or more of the web service's inputs. For more information, * see the Swagger specification. - * @member {string} [properties.input.title] The title of your Swagger + * @property {string} [properties.input.title] The title of your Swagger * schema. - * @member {string} [properties.input.description] The description of the + * @property {string} [properties.input.description] The description of the * Swagger schema. - * @member {string} [properties.input.type] The type of the entity described - * in swagger. Always 'object'. - * @member {object} [properties.input.properties] Specifies a collection that - * contains the column schema for each input or output of the web service. - * For more information, see the Swagger specification. - * @member {object} [properties.output] Contains the Swagger 2.0 schema + * @property {string} [properties.input.type] The type of the entity + * described in swagger. Always 'object'. + * @property {object} [properties.input.properties] Specifies a collection + * that contains the column schema for each input or output of the web + * service. For more information, see the Swagger specification. + * @property {object} [properties.output] Contains the Swagger 2.0 schema * describing one or more of the web service's outputs. For more information, * see the Swagger specification. - * @member {string} [properties.output.title] The title of your Swagger + * @property {string} [properties.output.title] The title of your Swagger * schema. - * @member {string} [properties.output.description] The description of the + * @property {string} [properties.output.description] The description of the * Swagger schema. - * @member {string} [properties.output.type] The type of the entity described - * in swagger. Always 'object'. - * @member {object} [properties.output.properties] Specifies a collection + * @property {string} [properties.output.type] The type of the entity + * described in swagger. Always 'object'. + * @property {object} [properties.output.properties] Specifies a collection * that contains the column schema for each input or output of the web * service. For more information, see the Swagger specification. - * @member {object} [properties.exampleRequest] Defines sample input data for - * one or more of the service's inputs. - * @member {object} [properties.exampleRequest.inputs] Sample input data for - * the web service's input(s) given as an input name to sample input values - * matrix map. - * @member {object} [properties.exampleRequest.globalParameters] Sample input - * data for the web service's global parameters - * @member {object} [properties.assets] Contains user defined properties + * @property {object} [properties.exampleRequest] Defines sample input data + * for one or more of the service's inputs. + * @property {object} [properties.exampleRequest.inputs] Sample input data + * for the web service's input(s) given as an input name to sample input + * values matrix map. + * @property {object} [properties.exampleRequest.globalParameters] Sample + * input data for the web service's global parameters + * @property {object} [properties.assets] Contains user defined properties * describing web service assets. Properties are expressed as Key/Value * pairs. - * @member {object} [properties.parameters] The set of global parameters + * @property {object} [properties.parameters] The set of global parameters * values defined for the web service, given as a global parameter name to * default value map. If no default value is specified, the parameter is * considered to be required. - * @member {boolean} [properties.payloadsInBlobStorage] When set to true, + * @property {boolean} [properties.payloadsInBlobStorage] When set to true, * indicates that the payload size is larger than 3 MB. Otherwise false. If * the payload size exceed 3 MB, the payload is stored in a blob and the * PayloadsLocation parameter contains the URI of the blob. Otherwise, this @@ -131,16 +131,16 @@ class WebService extends models['Resource'] { * ExampleRequest are inline. The Payload sizes is determined by adding the * size of the Assets, Input, Output, Package, Parameters, and the * ExampleRequest. - * @member {object} [properties.payloadsLocation] The URI of the payload + * @property {object} [properties.payloadsLocation] The URI of the payload * blob. This paramater contains a value only if the payloadsInBlobStorage * parameter is set to true. Otherwise is set to null. - * @member {string} [properties.payloadsLocation.uri] The URI from which the - * blob is accessible from. For example, aml://abc for system assets or + * @property {string} [properties.payloadsLocation.uri] The URI from which + * the blob is accessible from. For example, aml://abc for system assets or * https://xyz for user assets or payload. - * @member {string} [properties.payloadsLocation.credentials] Access + * @property {string} [properties.payloadsLocation.credentials] Access * credentials for the blob, if applicable (e.g. blob specified by storage * account connection string + blob URI) - * @member {string} [properties.packageType] Polymorphic Discriminator + * @property {string} [properties.packageType] Polymorphic Discriminator */ constructor() { super(); diff --git a/lib/services/machinelearning/lib/webservices/models/webServiceKeys.js b/lib/services/machinelearning/lib/webservices/models/webServiceKeys.js index 6d0ad4d062..9467e19879 100644 --- a/lib/services/machinelearning/lib/webservices/models/webServiceKeys.js +++ b/lib/services/machinelearning/lib/webservices/models/webServiceKeys.js @@ -17,8 +17,8 @@ class WebServiceKeys { /** * Create a WebServiceKeys. - * @member {string} [primary] The primary access key. - * @member {string} [secondary] The secondary access key. + * @property {string} [primary] The primary access key. + * @property {string} [secondary] The secondary access key. */ constructor() { } diff --git a/lib/services/machinelearning/lib/webservices/models/webServiceParameter.js b/lib/services/machinelearning/lib/webservices/models/webServiceParameter.js index 4a81c11483..50a46f072a 100644 --- a/lib/services/machinelearning/lib/webservices/models/webServiceParameter.js +++ b/lib/services/machinelearning/lib/webservices/models/webServiceParameter.js @@ -17,9 +17,10 @@ class WebServiceParameter { /** * Create a WebServiceParameter. - * @member {object} [value] The parameter value - * @member {string} [certificateThumbprint] If the parameter value in 'value' - * field is encrypted, the thumbprint of the certificate should be put here. + * @property {object} [value] The parameter value + * @property {string} [certificateThumbprint] If the parameter value in + * 'value' field is encrypted, the thumbprint of the certificate should be + * put here. */ constructor() { } diff --git a/lib/services/machinelearning/lib/webservices/models/webServiceProperties.js b/lib/services/machinelearning/lib/webservices/models/webServiceProperties.js index 039446d4f4..8eba365e29 100644 --- a/lib/services/machinelearning/lib/webservices/models/webServiceProperties.js +++ b/lib/services/machinelearning/lib/webservices/models/webServiceProperties.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The set of properties specific to the Azure ML web service resource. * @@ -19,116 +17,117 @@ const models = require('./index'); class WebServiceProperties { /** * Create a WebServiceProperties. - * @member {string} [title] The title of the web service. - * @member {string} [description] The description of the web service. - * @member {date} [createdOn] Read Only: The date and time when the web + * @property {string} [title] The title of the web service. + * @property {string} [description] The description of the web service. + * @property {date} [createdOn] Read Only: The date and time when the web * service was created. - * @member {date} [modifiedOn] Read Only: The date and time when the web + * @property {date} [modifiedOn] Read Only: The date and time when the web * service was last modified. - * @member {string} [provisioningState] Read Only: The provision state of the - * web service. Valid values are Unknown, Provisioning, Succeeded, and + * @property {string} [provisioningState] Read Only: The provision state of + * the web service. Valid values are Unknown, Provisioning, Succeeded, and * Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', * 'Failed' - * @member {object} [keys] Contains the web service provisioning keys. If you - * do not specify provisioning keys, the Azure Machine Learning system + * @property {object} [keys] Contains the web service provisioning keys. If + * you do not specify provisioning keys, the Azure Machine Learning system * generates them for you. Note: The keys are not returned from calls to GET * operations. - * @member {string} [keys.primary] The primary access key. - * @member {string} [keys.secondary] The secondary access key. - * @member {boolean} [readOnly] When set to true, indicates that the web + * @property {string} [keys.primary] The primary access key. + * @property {string} [keys.secondary] The secondary access key. + * @property {boolean} [readOnly] When set to true, indicates that the web * service is read-only and can no longer be updated or patched, only * removed. Default, is false. Note: Once set to true, you cannot change its * value. - * @member {string} [swaggerLocation] Read Only: Contains the URI of the + * @property {string} [swaggerLocation] Read Only: Contains the URI of the * swagger spec associated with this web service. - * @member {boolean} [exposeSampleData] When set to true, sample data is + * @property {boolean} [exposeSampleData] When set to true, sample data is * included in the web service's swagger definition. The default value is * true. - * @member {object} [realtimeConfiguration] Contains the configuration + * @property {object} [realtimeConfiguration] Contains the configuration * settings for the web service endpoint. - * @member {number} [realtimeConfiguration.maxConcurrentCalls] Specifies the - * maximum concurrent calls that can be made to the web service. Minimum + * @property {number} [realtimeConfiguration.maxConcurrentCalls] Specifies + * the maximum concurrent calls that can be made to the web service. Minimum * value: 4, Maximum value: 200. - * @member {object} [diagnostics] Settings controlling the diagnostics traces - * collection for the web service. - * @member {string} [diagnostics.level] Specifies the verbosity of the + * @property {object} [diagnostics] Settings controlling the diagnostics + * traces collection for the web service. + * @property {string} [diagnostics.level] Specifies the verbosity of the * diagnostic output. Valid values are: None - disables tracing; Error - * collects only error (stderr) traces; All - collects all traces (stdout and * stderr). Possible values include: 'None', 'Error', 'All' - * @member {date} [diagnostics.expiry] Specifies the date and time when the + * @property {date} [diagnostics.expiry] Specifies the date and time when the * logging will cease. If null, diagnostic collection is not time limited. - * @member {object} [storageAccount] Specifies the storage account that Azure - * Machine Learning uses to store information about the web service. Only the - * name of the storage account is returned from calls to GET operations. When - * updating the storage account information, you must ensure that all - * necessary assets are available in the new storage account or calls to your - * web service will fail. - * @member {string} [storageAccount.name] Specifies the name of the storage + * @property {object} [storageAccount] Specifies the storage account that + * Azure Machine Learning uses to store information about the web service. + * Only the name of the storage account is returned from calls to GET + * operations. When updating the storage account information, you must ensure + * that all necessary assets are available in the new storage account or + * calls to your web service will fail. + * @property {string} [storageAccount.name] Specifies the name of the storage * account. - * @member {string} [storageAccount.key] Specifies the key used to access the - * storage account. - * @member {object} [machineLearningWorkspace] Specifies the Machine Learning - * workspace containing the experiment that is source for the web service. - * @member {string} [machineLearningWorkspace.id] Specifies the workspace ID - * of the machine learning workspace associated with the web service - * @member {object} [commitmentPlan] Contains the commitment plan associated - * with this web service. Set at creation time. Once set, this value cannot - * be changed. Note: The commitment plan is not returned from calls to GET - * operations. - * @member {string} [commitmentPlan.id] Specifies the Azure Resource Manager - * ID of the commitment plan associated with the web service. - * @member {object} [input] Contains the Swagger 2.0 schema describing one or - * more of the web service's inputs. For more information, see the Swagger + * @property {string} [storageAccount.key] Specifies the key used to access + * the storage account. + * @property {object} [machineLearningWorkspace] Specifies the Machine + * Learning workspace containing the experiment that is source for the web + * service. + * @property {string} [machineLearningWorkspace.id] Specifies the workspace + * ID of the machine learning workspace associated with the web service + * @property {object} [commitmentPlan] Contains the commitment plan + * associated with this web service. Set at creation time. Once set, this + * value cannot be changed. Note: The commitment plan is not returned from + * calls to GET operations. + * @property {string} [commitmentPlan.id] Specifies the Azure Resource + * Manager ID of the commitment plan associated with the web service. + * @property {object} [input] Contains the Swagger 2.0 schema describing one + * or more of the web service's inputs. For more information, see the Swagger * specification. - * @member {string} [input.title] The title of your Swagger schema. - * @member {string} [input.description] The description of the Swagger + * @property {string} [input.title] The title of your Swagger schema. + * @property {string} [input.description] The description of the Swagger * schema. - * @member {string} [input.type] The type of the entity described in swagger. - * Always 'object'. - * @member {object} [input.properties] Specifies a collection that contains + * @property {string} [input.type] The type of the entity described in + * swagger. Always 'object'. + * @property {object} [input.properties] Specifies a collection that contains * the column schema for each input or output of the web service. For more * information, see the Swagger specification. - * @member {object} [output] Contains the Swagger 2.0 schema describing one + * @property {object} [output] Contains the Swagger 2.0 schema describing one * or more of the web service's outputs. For more information, see the * Swagger specification. - * @member {string} [output.title] The title of your Swagger schema. - * @member {string} [output.description] The description of the Swagger + * @property {string} [output.title] The title of your Swagger schema. + * @property {string} [output.description] The description of the Swagger * schema. - * @member {string} [output.type] The type of the entity described in + * @property {string} [output.type] The type of the entity described in * swagger. Always 'object'. - * @member {object} [output.properties] Specifies a collection that contains - * the column schema for each input or output of the web service. For more - * information, see the Swagger specification. - * @member {object} [exampleRequest] Defines sample input data for one or + * @property {object} [output.properties] Specifies a collection that + * contains the column schema for each input or output of the web service. + * For more information, see the Swagger specification. + * @property {object} [exampleRequest] Defines sample input data for one or * more of the service's inputs. - * @member {object} [exampleRequest.inputs] Sample input data for the web + * @property {object} [exampleRequest.inputs] Sample input data for the web * service's input(s) given as an input name to sample input values matrix * map. - * @member {object} [exampleRequest.globalParameters] Sample input data for + * @property {object} [exampleRequest.globalParameters] Sample input data for * the web service's global parameters - * @member {object} [assets] Contains user defined properties describing web - * service assets. Properties are expressed as Key/Value pairs. - * @member {object} [parameters] The set of global parameters values defined - * for the web service, given as a global parameter name to default value - * map. If no default value is specified, the parameter is considered to be - * required. - * @member {boolean} [payloadsInBlobStorage] When set to true, indicates that - * the payload size is larger than 3 MB. Otherwise false. If the payload size - * exceed 3 MB, the payload is stored in a blob and the PayloadsLocation + * @property {object} [assets] Contains user defined properties describing + * web service assets. Properties are expressed as Key/Value pairs. + * @property {object} [parameters] The set of global parameters values + * defined for the web service, given as a global parameter name to default + * value map. If no default value is specified, the parameter is considered + * to be required. + * @property {boolean} [payloadsInBlobStorage] When set to true, indicates + * that the payload size is larger than 3 MB. Otherwise false. If the payload + * size exceed 3 MB, the payload is stored in a blob and the PayloadsLocation * parameter contains the URI of the blob. Otherwise, this will be set to * false and Assets, Input, Output, Package, Parameters, ExampleRequest are * inline. The Payload sizes is determined by adding the size of the Assets, * Input, Output, Package, Parameters, and the ExampleRequest. - * @member {object} [payloadsLocation] The URI of the payload blob. This + * @property {object} [payloadsLocation] The URI of the payload blob. This * paramater contains a value only if the payloadsInBlobStorage parameter is * set to true. Otherwise is set to null. - * @member {string} [payloadsLocation.uri] The URI from which the blob is + * @property {string} [payloadsLocation.uri] The URI from which the blob is * accessible from. For example, aml://abc for system assets or https://xyz * for user assets or payload. - * @member {string} [payloadsLocation.credentials] Access credentials for the - * blob, if applicable (e.g. blob specified by storage account connection + * @property {string} [payloadsLocation.credentials] Access credentials for + * the blob, if applicable (e.g. blob specified by storage account connection * string + blob URI) - * @member {string} packageType Polymorphic Discriminator + * @property {string} packageType Polymorphic Discriminator */ constructor() { } @@ -332,6 +331,7 @@ class WebServiceProperties { packageType: { required: true, serializedName: 'packageType', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/machinelearning/lib/webservices/models/webServicePropertiesForGraph.js b/lib/services/machinelearning/lib/webservices/models/webServicePropertiesForGraph.js index 23cdf3415f..8ae1a58c8e 100644 --- a/lib/services/machinelearning/lib/webservices/models/webServicePropertiesForGraph.js +++ b/lib/services/machinelearning/lib/webservices/models/webServicePropertiesForGraph.js @@ -20,13 +20,13 @@ const models = require('./index'); class WebServicePropertiesForGraph extends models['WebServiceProperties'] { /** * Create a WebServicePropertiesForGraph. - * @member {object} [packageProperty] The definition of the graph package + * @property {object} [packageProperty] The definition of the graph package * making up this web service. - * @member {object} [packageProperty.nodes] The set of nodes making up the + * @property {object} [packageProperty.nodes] The set of nodes making up the * graph, provided as a nodeId to GraphNode map - * @member {array} [packageProperty.edges] The list of edges making up the + * @property {array} [packageProperty.edges] The list of edges making up the * graph. - * @member {object} [packageProperty.graphParameters] The collection of + * @property {object} [packageProperty.graphParameters] The collection of * global parameters for the graph, given as a global parameter name to * GraphParameter map. Each parameter here has a 1:1 match with the global * parameters values map declared at the WebServiceProperties level. @@ -47,6 +47,11 @@ class WebServicePropertiesForGraph extends models['WebServiceProperties'] { serializedName: 'Graph', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'packageType', + clientName: 'packageType' + }, + uberParent: 'WebServiceProperties', className: 'WebServicePropertiesForGraph', modelProperties: { title: { @@ -229,6 +234,7 @@ class WebServicePropertiesForGraph extends models['WebServiceProperties'] { packageType: { required: true, serializedName: 'packageType', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/machinelearning/lib/webservices/operations/index.d.ts b/lib/services/machinelearning/lib/webservices/operations/index.d.ts index 164f8e4b96..75594b7ba1 100644 --- a/lib/services/machinelearning/lib/webservices/operations/index.d.ts +++ b/lib/services/machinelearning/lib/webservices/operations/index.d.ts @@ -12,6 +12,67 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationRes import * as models from '../models'; +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the AzureMLWebServicesManagementClient. + */ +export interface Operations { + + + /** + * Lists all the available REST API operations. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the available REST API operations. + * + * @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 {OperationEntityListResult} - 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. + * + * {OperationEntityListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationEntityListResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * WebServices diff --git a/lib/services/machinelearning/lib/webservices/operations/index.js b/lib/services/machinelearning/lib/webservices/operations/index.js index cd543ca45f..492c461663 100644 --- a/lib/services/machinelearning/lib/webservices/operations/index.js +++ b/lib/services/machinelearning/lib/webservices/operations/index.js @@ -14,4 +14,5 @@ 'use strict'; +exports.Operations = require('./operations'); exports.WebServices = require('./webServices'); diff --git a/lib/services/machinelearning/lib/webservices/operations/operations.js b/lib/services/machinelearning/lib/webservices/operations/operations.js new file mode 100644 index 0000000000..10663488bb --- /dev/null +++ b/lib/services/machinelearning/lib/webservices/operations/operations.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 msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Lists all the available REST API operations. + * + * @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 OperationEntityListResult} 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(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.MachineLearning/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) { + 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['OperationEntityListResult']().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 Operations. */ +class Operations { + /** + * Create a Operations. + * @param {AzureMLWebServicesManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + } + + /** + * Lists all the available REST API operations. + * + * @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(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(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 available REST API operations. + * + * @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 {OperationEntityListResult} - 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 OperationEntityListResult} 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(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(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + +} + +module.exports = Operations; diff --git a/lib/services/machinelearning/lib/webservices/operations/webServices.js b/lib/services/machinelearning/lib/webservices/operations/webServices.js index 3f5e30bfc0..8ba9a561b6 100644 --- a/lib/services/machinelearning/lib/webservices/operations/webServices.js +++ b/lib/services/machinelearning/lib/webservices/operations/webServices.js @@ -2120,7 +2120,7 @@ function _beginCreateRegionalProperties(resourceGroupName, webServiceName, regio return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/machinelearning/lib/workspaces/machineLearningWorkspacesManagementClient.d.ts b/lib/services/machinelearning/lib/workspaces/machineLearningWorkspacesManagementClient.d.ts new file mode 100644 index 0000000000..f1079ad3c1 --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/machineLearningWorkspacesManagementClient.d.ts @@ -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. + */ + +import { ServiceClientCredentials } from 'ms-rest'; +import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; +import * as operations from "./operations"; + +export default class MachineLearningWorkspacesManagementClient extends AzureServiceClient { + /** + * Initializes a new instance of the MachineLearningWorkspacesManagementClient class. + * @constructor + * + * @class + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @param {string} subscriptionId - The Microsoft Azure subscription ID. + * + * @param {string} [baseUri] - The base URI of the service. + * + * @param {object} [options] - The parameter options + * + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * + * @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] - 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: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); + + credentials: ServiceClientCredentials; + + subscriptionId: string; + + apiVersion: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + generateClientRequestId: boolean; + + // Operation groups + operations: operations.Operations; + workspaces: operations.Workspaces; +} + +export { MachineLearningWorkspacesManagementClient, models as MachineLearningWorkspacesManagementModels }; diff --git a/lib/services/machinelearning/lib/workspaces/machineLearningWorkspacesManagementClient.js b/lib/services/machinelearning/lib/workspaces/machineLearningWorkspacesManagementClient.js new file mode 100644 index 0000000000..bd9c6cb533 --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/machineLearningWorkspacesManagementClient.js @@ -0,0 +1,86 @@ +/* + * 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. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const ServiceClient = msRestAzure.AzureServiceClient; + +const models = require('./models'); +const operations = require('./operations'); + + +/** Class representing a MachineLearningWorkspacesManagementClient. */ +class MachineLearningWorkspacesManagementClient extends ServiceClient { + /** + * Create a MachineLearningWorkspacesManagementClient. + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * @param {string} subscriptionId - The Microsoft Azure subscription ID. + * @param {string} [baseUri] - The base URI of the service. + * @param {object} [options] - The parameter options + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * @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] - 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) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId === null || subscriptionId === undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) options = {}; + + super(credentials, options); + + this.apiVersion = '2016-04-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.baseUri = baseUri; + if (!this.baseUri) { + this.baseUri = 'https://management.azure.com'; + } + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + let packageInfo = this.getPackageJsonInfo(__dirname); + this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { + this.generateClientRequestId = options.generateClientRequestId; + } + this.operations = new operations.Operations(this); + this.workspaces = new operations.Workspaces(this); + this.models = models; + msRest.addSerializationMixin(this); + } + +} + +module.exports = MachineLearningWorkspacesManagementClient; +module.exports['default'] = MachineLearningWorkspacesManagementClient; +module.exports.MachineLearningWorkspacesManagementClient = MachineLearningWorkspacesManagementClient; +module.exports.MachineLearningWorkspacesManagementModels = models; diff --git a/lib/services/machinelearning/lib/workspaces/models/errorResponse.js b/lib/services/machinelearning/lib/workspaces/models/errorResponse.js new file mode 100644 index 0000000000..d6f5a446b9 --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/models/errorResponse.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The error response send when an operation fails. + * + */ +class ErrorResponse { + /** + * Create a ErrorResponse. + * @property {string} code error code + * @property {string} message error message + */ + constructor() { + } + + /** + * Defines the metadata of ErrorResponse + * + * @returns {object} metadata of ErrorResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorResponse', + type: { + name: 'Composite', + className: 'ErrorResponse', + modelProperties: { + code: { + required: true, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: true, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ErrorResponse; diff --git a/lib/services/machinelearning/lib/workspaces/models/index.d.ts b/lib/services/machinelearning/lib/workspaces/models/index.d.ts new file mode 100644 index 0000000000..581fd09514 --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/models/index.d.ts @@ -0,0 +1,181 @@ +/* + * 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. + */ + +import { BaseResource, CloudError } from "ms-rest-azure"; +import * as moment from "moment"; + +export { + + BaseResource, + CloudError +}; + +/** + * The error response send when an operation fails. + */ +export interface ErrorResponse { + /** + * error code + */ + code: string; + /** + * error message + */ + message: string; +} + +/** + * An Azure resource. + */ +export interface Resource extends BaseResource { + /** + * The resource ID. + */ + readonly id?: string; + /** + * The name of the resource. + */ + readonly name?: string; + /** + * The type of the resource. + */ + readonly type?: string; + /** + * The location of the resource. This cannot be changed after the resource is created. + */ + location: string; + /** + * The tags of the resource. + */ + tags?: { [propertyName: string]: string }; +} + +/** + * An object that represents a machine learning workspace. + */ +export interface Workspace extends Resource { + /** + * The fully qualified arm id of the storage account associated with this workspace. + */ + userStorageAccountId: string; + /** + * The email id of the owner for this workspace. + */ + ownerEmail?: string; + /** + * The type of this workspace. Possible values include: 'Production', 'Free', 'Anonymous', + * 'PaidStandard', 'PaidPremium' + */ + readonly workspaceType?: string; + /** + * The current state of workspace resource. Possible values include: 'Deleted', 'Enabled', + * 'Disabled', 'Migrated', 'Updated', 'Registered', 'Unregistered' + */ + readonly workspaceState?: string; + /** + * The immutable id associated with this workspace. + */ + readonly workspaceId?: string; + /** + * The creation time for this workspace resource. + */ + readonly creationTime?: string; + /** + * The regional endpoint for the machine learning studio service which hosts this workspace. + */ + readonly studioEndpoint?: string; + /** + * The key vault identifier used for encrypted workspaces. + */ + keyVaultIdentifierId?: string; +} + +/** + * The parameters for updating a machine learning workspace. + */ +export interface WorkspaceUpdateParameters { + /** + * The resource tags for the machine learning workspace. + */ + tags?: { [propertyName: string]: string }; + /** + * The current state of workspace resource. Possible values include: 'Deleted', 'Enabled', + * 'Disabled', 'Migrated', 'Updated', 'Registered', 'Unregistered' + */ + workspaceState?: string; + /** + * The key vault identifier used for encrypted workspaces. + */ + keyVaultIdentifierId?: string; +} + +/** + * Workspace authorization keys for a workspace. + */ +export interface WorkspaceKeysResponse { + /** + * Primary authorization key for this workspace. + */ + primaryToken?: string; + /** + * Secondary authorization key for this workspace. + */ + secondaryToken?: string; +} + +/** + * Display name of operation + */ +export interface OperationDisplay { + /** + * The resource provider name: Microsoft.MachineLearning + */ + provider?: string; + /** + * The resource on which the operation is performed. + */ + resource?: string; + /** + * The operation that users can perform. + */ + operation?: string; + /** + * The description for the operation. + */ + description?: string; +} + +/** + * Azure Machine Learning Studio REST API operation + */ +export interface Operation { + /** + * Operation name: {provider}/{resource}/{operation} + */ + name?: string; + /** + * Display name of operation + */ + display?: OperationDisplay; +} + +/** + * An array of operations supported by the resource provider. + */ +export interface OperationListResult extends Array { +} + +/** + * The result of a request to list machine learning workspace keys. + */ +export interface WorkspaceListResult extends Array { + /** + * The URI that can be used to request the next list of machine learning workspaces. + */ + nextLink?: string; +} diff --git a/lib/services/machinelearning/lib/workspaces/models/index.js b/lib/services/machinelearning/lib/workspaces/models/index.js new file mode 100644 index 0000000000..ba5d9bfebc --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/models/index.js @@ -0,0 +1,29 @@ +/* + * 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. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +var msRestAzure = require('ms-rest-azure'); + +exports.BaseResource = msRestAzure.BaseResource; +exports.CloudError = msRestAzure.CloudError; +exports.ErrorResponse = require('./errorResponse'); +exports.Resource = require('./resource'); +exports.Workspace = require('./workspace'); +exports.WorkspaceUpdateParameters = require('./workspaceUpdateParameters'); +exports.WorkspaceKeysResponse = require('./workspaceKeysResponse'); +exports.OperationDisplay = require('./operationDisplay'); +exports.Operation = require('./operation'); +exports.OperationListResult = require('./operationListResult'); +exports.WorkspaceListResult = require('./workspaceListResult'); diff --git a/lib/services/machinelearning/lib/workspaces/models/operation.js b/lib/services/machinelearning/lib/workspaces/models/operation.js new file mode 100644 index 0000000000..6a8d5dfb42 --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/models/operation.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'; + +/** + * Azure Machine Learning Studio REST API operation + * + */ +class Operation { + /** + * Create a Operation. + * @property {string} [name] Operation name: + * {provider}/{resource}/{operation} + * @property {object} [display] Display name of operation + * @property {string} [display.provider] The resource provider name: + * Microsoft.MachineLearning + * @property {string} [display.resource] The resource on which the operation + * is performed. + * @property {string} [display.operation] The operation that users can + * perform. + * @property {string} [display.description] The description for the + * operation. + */ + constructor() { + } + + /** + * Defines the metadata of Operation + * + * @returns {object} metadata of Operation + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation', + type: { + name: 'Composite', + className: 'Operation', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serializedName: 'display', + type: { + name: 'Composite', + className: 'OperationDisplay' + } + } + } + } + }; + } +} + +module.exports = Operation; diff --git a/lib/services/machinelearning/lib/workspaces/models/operationDisplay.js b/lib/services/machinelearning/lib/workspaces/models/operationDisplay.js new file mode 100644 index 0000000000..0d31e994a8 --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/models/operationDisplay.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'; + +/** + * Display name of operation + * + */ +class OperationDisplay { + /** + * Create a OperationDisplay. + * @property {string} [provider] The resource provider name: + * Microsoft.MachineLearning + * @property {string} [resource] The resource on which the operation is + * performed. + * @property {string} [operation] The operation that users can perform. + * @property {string} [description] The description for the operation. + */ + constructor() { + } + + /** + * Defines the metadata of OperationDisplay + * + * @returns {object} metadata of OperationDisplay + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation_display', + type: { + name: 'Composite', + className: 'OperationDisplay', + modelProperties: { + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + serializedName: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + serializedName: 'operation', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationDisplay; diff --git a/lib/services/machinelearning/lib/workspaces/models/operationListResult.js b/lib/services/machinelearning/lib/workspaces/models/operationListResult.js new file mode 100644 index 0000000000..91e43a3a22 --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/models/operationListResult.js @@ -0,0 +1,59 @@ +/* + * 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 array of operations supported by the resource provider. + */ +class OperationListResult extends Array { + /** + * Create a OperationListResult. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OperationListResult + * + * @returns {object} metadata of OperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationListResult', + type: { + name: 'Composite', + className: 'OperationListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationElementType', + type: { + name: 'Composite', + className: 'Operation' + } + } + } + } + } + } + }; + } +} + +module.exports = OperationListResult; diff --git a/lib/services/machinelearning/lib/workspaces/models/resource.js b/lib/services/machinelearning/lib/workspaces/models/resource.js new file mode 100644 index 0000000000..d76fa1783d --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/models/resource.js @@ -0,0 +1,99 @@ +/* + * 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 Azure resource. + * + * @extends models['BaseResource'] + */ +class Resource extends models['BaseResource'] { + /** + * Create a Resource. + * @property {string} [id] The resource ID. + * @property {string} [name] The name of the resource. + * @property {string} [type] The type of the resource. + * @property {string} location The location of the resource. This cannot be + * changed after the resource is created. + * @property {object} [tags] The tags of the resource. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Resource + * + * @returns {object} metadata of Resource + * + */ + mapper() { + return { + required: false, + serializedName: 'Resource', + type: { + name: 'Composite', + className: 'Resource', + 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' + } + } + } + } + } + } + }; + } +} + +module.exports = Resource; diff --git a/lib/services/machinelearning/lib/workspaces/models/workspace.js b/lib/services/machinelearning/lib/workspaces/models/workspace.js new file mode 100644 index 0000000000..e8aa7a662e --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/models/workspace.js @@ -0,0 +1,174 @@ +/* + * 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 a machine learning workspace. + * + * @extends models['Resource'] + */ +class Workspace extends models['Resource'] { + /** + * Create a Workspace. + * @property {string} userStorageAccountId The fully qualified arm id of the + * storage account associated with this workspace. + * @property {string} [ownerEmail] The email id of the owner for this + * workspace. + * @property {string} [workspaceType] The type of this workspace. Possible + * values include: 'Production', 'Free', 'Anonymous', 'PaidStandard', + * 'PaidPremium' + * @property {string} [workspaceState] The current state of workspace + * resource. Possible values include: 'Deleted', 'Enabled', 'Disabled', + * 'Migrated', 'Updated', 'Registered', 'Unregistered' + * @property {string} [workspaceId] The immutable id associated with this + * workspace. + * @property {string} [creationTime] The creation time for this workspace + * resource. + * @property {string} [studioEndpoint] The regional endpoint for the machine + * learning studio service which hosts this workspace. + * @property {string} [keyVaultIdentifierId] The key vault identifier used + * for encrypted workspaces. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Workspace + * + * @returns {object} metadata of Workspace + * + */ + mapper() { + return { + required: false, + serializedName: 'Workspace', + type: { + name: 'Composite', + className: 'Workspace', + 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' + } + } + } + }, + userStorageAccountId: { + required: true, + serializedName: 'properties.userStorageAccountId', + type: { + name: 'String' + } + }, + ownerEmail: { + required: false, + serializedName: 'properties.ownerEmail', + type: { + name: 'String' + } + }, + workspaceType: { + required: false, + readOnly: true, + serializedName: 'properties.workspaceType', + type: { + name: 'Enum', + allowedValues: [ 'Production', 'Free', 'Anonymous', 'PaidStandard', 'PaidPremium' ] + } + }, + workspaceState: { + required: false, + readOnly: true, + serializedName: 'properties.workspaceState', + type: { + name: 'Enum', + allowedValues: [ 'Deleted', 'Enabled', 'Disabled', 'Migrated', 'Updated', 'Registered', 'Unregistered' ] + } + }, + workspaceId: { + required: false, + readOnly: true, + serializedName: 'properties.workspaceId', + type: { + name: 'String' + } + }, + creationTime: { + required: false, + readOnly: true, + serializedName: 'properties.creationTime', + type: { + name: 'String' + } + }, + studioEndpoint: { + required: false, + readOnly: true, + serializedName: 'properties.studioEndpoint', + type: { + name: 'String' + } + }, + keyVaultIdentifierId: { + required: false, + serializedName: 'properties.keyVaultIdentifierId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Workspace; diff --git a/lib/services/machinelearning/lib/workspaces/models/workspaceKeysResponse.js b/lib/services/machinelearning/lib/workspaces/models/workspaceKeysResponse.js new file mode 100644 index 0000000000..2aa7e62d5a --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/models/workspaceKeysResponse.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'; + +/** + * Workspace authorization keys for a workspace. + * + */ +class WorkspaceKeysResponse { + /** + * Create a WorkspaceKeysResponse. + * @property {string} [primaryToken] Primary authorization key for this + * workspace. + * @property {string} [secondaryToken] Secondary authorization key for this + * workspace. + */ + constructor() { + } + + /** + * Defines the metadata of WorkspaceKeysResponse + * + * @returns {object} metadata of WorkspaceKeysResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'WorkspaceKeysResponse', + type: { + name: 'Composite', + className: 'WorkspaceKeysResponse', + modelProperties: { + primaryToken: { + required: false, + serializedName: 'primaryToken', + type: { + name: 'String' + } + }, + secondaryToken: { + required: false, + serializedName: 'secondaryToken', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = WorkspaceKeysResponse; diff --git a/lib/services/machinelearning/lib/workspaces/models/workspaceListResult.js b/lib/services/machinelearning/lib/workspaces/models/workspaceListResult.js new file mode 100644 index 0000000000..030c6218a0 --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/models/workspaceListResult.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 result of a request to list machine learning workspace keys. + */ +class WorkspaceListResult extends Array { + /** + * Create a WorkspaceListResult. + * @property {string} [nextLink] The URI that can be used to request the next + * list of machine learning workspaces. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of WorkspaceListResult + * + * @returns {object} metadata of WorkspaceListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'WorkspaceListResult', + type: { + name: 'Composite', + className: 'WorkspaceListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'WorkspaceElementType', + type: { + name: 'Composite', + className: 'Workspace' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = WorkspaceListResult; diff --git a/lib/services/machinelearning/lib/workspaces/models/workspaceUpdateParameters.js b/lib/services/machinelearning/lib/workspaces/models/workspaceUpdateParameters.js new file mode 100644 index 0000000000..5349bcb226 --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/models/workspaceUpdateParameters.js @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The parameters for updating a machine learning workspace. + * + */ +class WorkspaceUpdateParameters { + /** + * Create a WorkspaceUpdateParameters. + * @property {object} [tags] The resource tags for the machine learning + * workspace. + * @property {string} [workspaceState] The current state of workspace + * resource. Possible values include: 'Deleted', 'Enabled', 'Disabled', + * 'Migrated', 'Updated', 'Registered', 'Unregistered' + * @property {string} [keyVaultIdentifierId] The key vault identifier used + * for encrypted workspaces. + */ + constructor() { + } + + /** + * Defines the metadata of WorkspaceUpdateParameters + * + * @returns {object} metadata of WorkspaceUpdateParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'WorkspaceUpdateParameters', + type: { + name: 'Composite', + className: 'WorkspaceUpdateParameters', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + workspaceState: { + required: false, + serializedName: 'properties.workspaceState', + type: { + name: 'Enum', + allowedValues: [ 'Deleted', 'Enabled', 'Disabled', 'Migrated', 'Updated', 'Registered', 'Unregistered' ] + } + }, + keyVaultIdentifierId: { + required: false, + serializedName: 'properties.keyVaultIdentifierId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = WorkspaceUpdateParameters; diff --git a/lib/services/machinelearning/lib/workspaces/operations/index.d.ts b/lib/services/machinelearning/lib/workspaces/operations/index.d.ts new file mode 100644 index 0000000000..b2507311d1 --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/operations/index.d.ts @@ -0,0 +1,738 @@ +/* + * 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. +*/ + +import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; +import * as models from '../models'; + + +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the MachineLearningWorkspacesManagementClient. + */ +export interface Operations { + + + /** + * Lists all of the available Azure Machine Learning Studio REST API + * operations. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the available Azure Machine Learning Studio REST API + * operations. + * + * @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 {OperationListResult} - 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. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Workspaces + * __NOTE__: An instance of this class is automatically created for an + * instance of the MachineLearningWorkspacesManagementClient. + */ +export interface Workspaces { + + + /** + * Gets the properties of the specified machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, workspaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the properties of the specified machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @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 {Workspace} - 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. + * + * {Workspace} [result] - The deserialized result object if an error did not occur. + * See {@link Workspace} 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, workspaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, workspaceName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, workspaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a workspace with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {object} parameters The parameters for creating or updating a machine + * learning workspace. + * + * @param {string} parameters.userStorageAccountId The fully qualified arm id + * of the storage account associated with this workspace. + * + * @param {string} [parameters.ownerEmail] The email id of the owner for this + * workspace. + * + * @param {string} [parameters.keyVaultIdentifierId] The key vault identifier + * used for encrypted workspaces. + * + * @param {string} parameters.location The location of the resource. This + * cannot be changed after the resource is created. + * + * @param {object} [parameters.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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, workspaceName: string, parameters: models.Workspace, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a workspace with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {object} parameters The parameters for creating or updating a machine + * learning workspace. + * + * @param {string} parameters.userStorageAccountId The fully qualified arm id + * of the storage account associated with this workspace. + * + * @param {string} [parameters.ownerEmail] The email id of the owner for this + * workspace. + * + * @param {string} [parameters.keyVaultIdentifierId] The key vault identifier + * used for encrypted workspaces. + * + * @param {string} parameters.location The location of the resource. This + * cannot be changed after the resource is created. + * + * @param {object} [parameters.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 {Workspace} - 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. + * + * {Workspace} [result] - The deserialized result object if an error did not occur. + * See {@link Workspace} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, workspaceName: string, parameters: models.Workspace, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, workspaceName: string, parameters: models.Workspace, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, workspaceName: string, parameters: models.Workspace, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @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, workspaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @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, workspaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, workspaceName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, workspaceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a machine learning workspace with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {object} parameters The parameters for updating a machine learning + * workspace. + * + * @param {object} [parameters.tags] The resource tags for the machine learning + * workspace. + * + * @param {string} [parameters.workspaceState] The current state of workspace + * resource. Possible values include: 'Deleted', 'Enabled', 'Disabled', + * 'Migrated', 'Updated', 'Registered', 'Unregistered' + * + * @param {string} [parameters.keyVaultIdentifierId] The key vault identifier + * used for encrypted workspaces. + * + * @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, workspaceName: string, parameters: models.WorkspaceUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a machine learning workspace with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {object} parameters The parameters for updating a machine learning + * workspace. + * + * @param {object} [parameters.tags] The resource tags for the machine learning + * workspace. + * + * @param {string} [parameters.workspaceState] The current state of workspace + * resource. Possible values include: 'Deleted', 'Enabled', 'Disabled', + * 'Migrated', 'Updated', 'Registered', 'Unregistered' + * + * @param {string} [parameters.keyVaultIdentifierId] The key vault identifier + * used for encrypted workspaces. + * + * @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 {Workspace} - 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. + * + * {Workspace} [result] - The deserialized result object if an error did not occur. + * See {@link Workspace} 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, workspaceName: string, parameters: models.WorkspaceUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, workspaceName: string, parameters: models.WorkspaceUpdateParameters, callback: ServiceCallback): void; + update(resourceGroupName: string, workspaceName: string, parameters: models.WorkspaceUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Resync storage keys associated with this workspace. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @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. + */ + resyncStorageKeysWithHttpOperationResponse(workspaceName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Resync storage keys associated with this workspace. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @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. + */ + resyncStorageKeys(workspaceName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resyncStorageKeys(workspaceName: string, resourceGroupName: string, callback: ServiceCallback): void; + resyncStorageKeys(workspaceName: string, resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * List the authorization keys associated with this workspace. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @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. + */ + listWorkspaceKeysWithHttpOperationResponse(workspaceName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * List the authorization keys associated with this workspace. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @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 {WorkspaceKeysResponse} - 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. + * + * {WorkspaceKeysResponse} [result] - The deserialized result object if an error did not occur. + * See {@link WorkspaceKeysResponse} 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. + */ + listWorkspaceKeys(workspaceName: string, resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWorkspaceKeys(workspaceName: string, resourceGroupName: string, callback: ServiceCallback): void; + listWorkspaceKeys(workspaceName: string, resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all the available machine learning workspaces under the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the available machine learning workspaces under the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @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 {WorkspaceListResult} - 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. + * + * {WorkspaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link WorkspaceListResult} 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. + */ + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all the available machine learning workspaces under the specified + * subscription. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the available machine learning workspaces under the specified + * subscription. + * + * @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 {WorkspaceListResult} - 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. + * + * {WorkspaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link WorkspaceListResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all the available machine learning workspaces under the specified + * resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the available machine learning workspaces under the specified + * resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {WorkspaceListResult} - 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. + * + * {WorkspaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link WorkspaceListResult} 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. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all the available machine learning workspaces under the specified + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all the available machine learning workspaces under the specified + * subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {WorkspaceListResult} - 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. + * + * {WorkspaceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link WorkspaceListResult} 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; +} diff --git a/lib/services/machinelearning/lib/workspaces/operations/index.js b/lib/services/machinelearning/lib/workspaces/operations/index.js new file mode 100644 index 0000000000..c9ad5a809b --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/operations/index.js @@ -0,0 +1,18 @@ +/* + * 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. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +exports.Operations = require('./operations'); +exports.Workspaces = require('./workspaces'); diff --git a/lib/services/machinelearning/lib/workspaces/operations/operations.js b/lib/services/machinelearning/lib/workspaces/operations/operations.js new file mode 100644 index 0000000000..ad3ed00565 --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/operations/operations.js @@ -0,0 +1,241 @@ +/* + * 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 of the available Azure Machine Learning Studio REST API + * operations. + * + * @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 OperationListResult} 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(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.MachineLearning/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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationListResult']().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 Operations. */ +class Operations { + /** + * Create a Operations. + * @param {MachineLearningWorkspacesManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + } + + /** + * Lists all of the available Azure Machine Learning Studio REST API + * operations. + * + * @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(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(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 of the available Azure Machine Learning Studio REST API + * operations. + * + * @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 {OperationListResult} - 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 OperationListResult} 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(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(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + +} + +module.exports = Operations; diff --git a/lib/services/machinelearning/lib/workspaces/operations/workspaces.js b/lib/services/machinelearning/lib/workspaces/operations/workspaces.js new file mode 100644 index 0000000000..6174f1ac42 --- /dev/null +++ b/lib/services/machinelearning/lib/workspaces/operations/workspaces.js @@ -0,0 +1,2408 @@ +/* + * 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 the properties of the specified machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @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 Workspace} 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, workspaceName, 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.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 (workspaceName === null || workspaceName === undefined || typeof workspaceName.valueOf() !== 'string') { + throw new Error('workspaceName 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.MachineLearning/workspaces/{workspaceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{workspaceName}', encodeURIComponent(workspaceName)); + 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Workspace']().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 or updates a workspace with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {object} parameters The parameters for creating or updating a machine + * learning workspace. + * + * @param {string} parameters.userStorageAccountId The fully qualified arm id + * of the storage account associated with this workspace. + * + * @param {string} [parameters.ownerEmail] The email id of the owner for this + * workspace. + * + * @param {string} [parameters.keyVaultIdentifierId] The key vault identifier + * used for encrypted workspaces. + * + * @param {string} parameters.location The location of the resource. This + * cannot be changed after the resource is created. + * + * @param {object} [parameters.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 Workspace} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, workspaceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // 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.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 (workspaceName === null || workspaceName === undefined || typeof workspaceName.valueOf() !== 'string') { + throw new Error('workspaceName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.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.MachineLearning/workspaces/{workspaceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{workspaceName}', encodeURIComponent(workspaceName)); + 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 = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['Workspace']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Workspace']().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 machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @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, workspaceName, 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.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 (workspaceName === null || workspaceName === undefined || typeof workspaceName.valueOf() !== 'string') { + throw new Error('workspaceName 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.MachineLearning/workspaces/{workspaceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{workspaceName}', encodeURIComponent(workspaceName)); + 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 = '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 !== 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates a machine learning workspace with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {object} parameters The parameters for updating a machine learning + * workspace. + * + * @param {object} [parameters.tags] The resource tags for the machine learning + * workspace. + * + * @param {string} [parameters.workspaceState] The current state of workspace + * resource. Possible values include: 'Deleted', 'Enabled', 'Disabled', + * 'Migrated', 'Updated', 'Registered', 'Unregistered' + * + * @param {string} [parameters.keyVaultIdentifierId] The key vault identifier + * used for encrypted workspaces. + * + * @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 Workspace} 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, workspaceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // 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.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 (workspaceName === null || workspaceName === undefined || typeof workspaceName.valueOf() !== 'string') { + throw new Error('workspaceName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.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.MachineLearning/workspaces/{workspaceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{workspaceName}', encodeURIComponent(workspaceName)); + 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 = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['WorkspaceUpdateParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Workspace']().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); + }); +} + +/** + * Resync storage keys associated with this workspace. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @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 _resyncStorageKeys(workspaceName, resourceGroupName, 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.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 (workspaceName === null || workspaceName === undefined || typeof workspaceName.valueOf() !== 'string') { + throw new Error('workspaceName 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 (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.MachineLearning/workspaces/{workspaceName}/resyncStorageKeys'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{workspaceName}', encodeURIComponent(workspaceName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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 = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * List the authorization keys associated with this workspace. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @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 WorkspaceKeysResponse} 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 _listWorkspaceKeys(workspaceName, resourceGroupName, 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.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 (workspaceName === null || workspaceName === undefined || typeof workspaceName.valueOf() !== 'string') { + throw new Error('workspaceName 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 (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.MachineLearning/workspaces/{workspaceName}/listWorkspaceKeys'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{workspaceName}', encodeURIComponent(workspaceName)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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 = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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['WorkspaceKeysResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all the available machine learning workspaces under the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @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 WorkspaceListResult} 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 _listByResourceGroup(resourceGroupName, 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.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 (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.MachineLearning/workspaces'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WorkspaceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all the available machine learning workspaces under the specified + * subscription. + * + * @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 WorkspaceListResult} 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(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.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/workspaces'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + 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['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WorkspaceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all the available machine learning workspaces under the specified + * resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WorkspaceListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WorkspaceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all the available machine learning workspaces under the specified + * subscription. + * + * @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 WorkspaceListResult} 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WorkspaceListResult']().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 Workspaces. */ +class Workspaces { + /** + * Create a Workspaces. + * @param {MachineLearningWorkspacesManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._resyncStorageKeys = _resyncStorageKeys; + this._listWorkspaceKeys = _listWorkspaceKeys; + this._listByResourceGroup = _listByResourceGroup; + this._list = _list; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listNext = _listNext; + } + + /** + * Gets the properties of the specified machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @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, workspaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, workspaceName, 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 properties of the specified machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @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 {Workspace} - 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 Workspace} 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, workspaceName, 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, workspaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, workspaceName, options, optionalCallback); + } + } + + /** + * Creates or updates a workspace with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {object} parameters The parameters for creating or updating a machine + * learning workspace. + * + * @param {string} parameters.userStorageAccountId The fully qualified arm id + * of the storage account associated with this workspace. + * + * @param {string} [parameters.ownerEmail] The email id of the owner for this + * workspace. + * + * @param {string} [parameters.keyVaultIdentifierId] The key vault identifier + * used for encrypted workspaces. + * + * @param {string} parameters.location The location of the resource. This + * cannot be changed after the resource is created. + * + * @param {object} [parameters.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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, workspaceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, workspaceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a workspace with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {object} parameters The parameters for creating or updating a machine + * learning workspace. + * + * @param {string} parameters.userStorageAccountId The fully qualified arm id + * of the storage account associated with this workspace. + * + * @param {string} [parameters.ownerEmail] The email id of the owner for this + * workspace. + * + * @param {string} [parameters.keyVaultIdentifierId] The key vault identifier + * used for encrypted workspaces. + * + * @param {string} parameters.location The location of the resource. This + * cannot be changed after the resource is created. + * + * @param {object} [parameters.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 {Workspace} - 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 Workspace} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, workspaceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, workspaceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, workspaceName, parameters, options, optionalCallback); + } + } + + /** + * Deletes a machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @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, workspaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, workspaceName, 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 machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @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, workspaceName, 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, workspaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, workspaceName, options, optionalCallback); + } + } + + /** + * Updates a machine learning workspace with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {object} parameters The parameters for updating a machine learning + * workspace. + * + * @param {object} [parameters.tags] The resource tags for the machine learning + * workspace. + * + * @param {string} [parameters.workspaceState] The current state of workspace + * resource. Possible values include: 'Deleted', 'Enabled', 'Disabled', + * 'Migrated', 'Updated', 'Registered', 'Unregistered' + * + * @param {string} [parameters.keyVaultIdentifierId] The key vault identifier + * used for encrypted workspaces. + * + * @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, workspaceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, workspaceName, parameters, 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 machine learning workspace with the specified parameters. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {object} parameters The parameters for updating a machine learning + * workspace. + * + * @param {object} [parameters.tags] The resource tags for the machine learning + * workspace. + * + * @param {string} [parameters.workspaceState] The current state of workspace + * resource. Possible values include: 'Deleted', 'Enabled', 'Disabled', + * 'Migrated', 'Updated', 'Registered', 'Unregistered' + * + * @param {string} [parameters.keyVaultIdentifierId] The key vault identifier + * used for encrypted workspaces. + * + * @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 {Workspace} - 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 Workspace} 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, workspaceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, workspaceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, workspaceName, parameters, options, optionalCallback); + } + } + + /** + * Resync storage keys associated with this workspace. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @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. + */ + resyncStorageKeysWithHttpOperationResponse(workspaceName, resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._resyncStorageKeys(workspaceName, resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Resync storage keys associated with this workspace. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @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. + */ + resyncStorageKeys(workspaceName, resourceGroupName, 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._resyncStorageKeys(workspaceName, resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resyncStorageKeys(workspaceName, resourceGroupName, options, optionalCallback); + } + } + + /** + * List the authorization keys associated with this workspace. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @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. + */ + listWorkspaceKeysWithHttpOperationResponse(workspaceName, resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWorkspaceKeys(workspaceName, resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List the authorization keys associated with this workspace. + * + * @param {string} workspaceName The name of the machine learning workspace. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @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 {WorkspaceKeysResponse} - 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 WorkspaceKeysResponse} 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. + */ + listWorkspaceKeys(workspaceName, resourceGroupName, 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._listWorkspaceKeys(workspaceName, resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWorkspaceKeys(workspaceName, resourceGroupName, options, optionalCallback); + } + } + + /** + * Lists all the available machine learning workspaces under the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, 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 available machine learning workspaces under the specified + * resource group. + * + * @param {string} resourceGroupName The name of the resource group to which + * the machine learning workspace belongs. + * + * @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 {WorkspaceListResult} - 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 WorkspaceListResult} 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. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Lists all the available machine learning workspaces under the specified + * subscription. + * + * @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(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(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 available machine learning workspaces under the specified + * subscription. + * + * @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 {WorkspaceListResult} - 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 WorkspaceListResult} 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(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(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * Lists all the available machine learning workspaces under the specified + * resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(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 available machine learning workspaces under the specified + * resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [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 {WorkspaceListResult} - 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 WorkspaceListResult} 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. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists all the available machine learning workspaces under the specified + * subscription. + * + * @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 available machine learning workspaces under the specified + * subscription. + * + * @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 {WorkspaceListResult} - 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 WorkspaceListResult} 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 = Workspaces;