Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

[AutoPR cognitiveservices/resource-manager] [Cognitive Services] Add Microsoft.CognitiveServices/skus operation #2587

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 CognitiveServicesManagementClient extends AzureServiceClient {
export default class CognitiveServicesManagementClient extends AzureServiceClient {
/**
* Initializes a new instance of the CognitiveServicesManagementClient class.
* @constructor
Expand Down Expand Up @@ -56,8 +57,9 @@ declare class CognitiveServicesManagementClient extends AzureServiceClient {

// Operation groups
accounts: operations.Accounts;
resourceSkus: operations.ResourceSkus;
operations: operations.Operations;
checkSkuAvailability: operations.CheckSkuAvailability;
}

export = CognitiveServicesManagementClient;
export { CognitiveServicesManagementClient, models as CognitiveServicesManagementModels };
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class CognitiveServicesManagementClient extends ServiceClient {
this.generateClientRequestId = options.generateClientRequestId;
}
this.accounts = new operations.Accounts(this);
this.resourceSkus = new operations.ResourceSkus(this);
this.operations = new operations.Operations(this);
this.checkSkuAvailability = new operations.CheckSkuAvailability(this);
this.models = models;
Expand All @@ -82,3 +83,6 @@ class CognitiveServicesManagementClient extends ServiceClient {
}

module.exports = CognitiveServicesManagementClient;
module.exports['default'] = CognitiveServicesManagementClient;
module.exports.CognitiveServicesManagementClient = CognitiveServicesManagementClient;
module.exports.CognitiveServicesManagementModels = models;
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ class CheckSkuAvailabilityParameter {
* Create a CheckSkuAvailabilityParameter.
* @member {array} skus The SKU of the resource.
* @member {string} kind The Kind of the resource. Possible values include:
* 'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech',
* 'Bing.SpellCheck', 'ComputerVision', 'ContentModerator', 'CustomSpeech',
* 'Emotion', 'Face', 'LUIS', 'Recommendations', 'SpeakerRecognition',
* 'Speech', 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM'
* 'Bing.Autosuggest.v7', 'Bing.CustomSearch', 'Bing.Search.v7',
* 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision', 'ContentModerator',
* 'CustomSpeech', 'CustomVision.Prediction', 'CustomVision.Training',
* 'Emotion', 'Face', 'LUIS', 'QnAMaker', 'SpeakerRecognition',
* 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM'
* @member {string} type The Type of the resource.
*/
constructor() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ class CheckSkuAvailabilityResult {
/**
* Create a CheckSkuAvailabilityResult.
* @member {string} [kind] The Kind of the resource. Possible values include:
* 'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech',
* 'Bing.SpellCheck', 'ComputerVision', 'ContentModerator', 'CustomSpeech',
* 'Emotion', 'Face', 'LUIS', 'Recommendations', 'SpeakerRecognition',
* 'Speech', 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM'
* 'Bing.Autosuggest.v7', 'Bing.CustomSearch', 'Bing.Search.v7',
* 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision', 'ContentModerator',
* 'CustomSpeech', 'CustomVision.Prediction', 'CustomVision.Training',
* 'Emotion', 'Face', 'LUIS', 'QnAMaker', 'SpeakerRecognition',
* 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM'
* @member {string} [type] The Type of the resource.
* @member {string} [skuName] The SKU of Cognitive Services account. Possible
* values include: 'F0', 'P0', 'P1', 'P2', 'S0', 'S1', 'S2', 'S3', 'S4',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class CognitiveServicesAccount extends models['BaseResource'] {
* @member {string} [name] The name of the created account
* @member {string} [provisioningState] Gets the status of the cognitive
* services account at the time the operation was called. Possible values
* include: 'Creating', 'ResolvingDNS', 'Succeeded', 'Failed'
* include: 'Creating', 'ResolvingDNS', 'Moving', 'Deleting', 'Succeeded',
* 'Failed'
* @member {string} [endpoint] Endpoint of the created account.
* @member {string} [internalId] The internal identifier.
* @member {object} [sku] The SKU of Cognitive Services account.
Expand Down Expand Up @@ -104,8 +105,7 @@ class CognitiveServicesAccount extends models['BaseResource'] {
readOnly: true,
serializedName: 'properties.provisioningState',
type: {
name: 'Enum',
allowedValues: [ 'Creating', 'ResolvingDNS', 'Succeeded', 'Failed' ]
name: 'String'
}
},
endpoint: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ class CognitiveServicesAccountCreateParameters {
* @member {string} [sku.tier] Gets the sku tier. This is based on the SKU
* name. Possible values include: 'Free', 'Standard', 'Premium'
* @member {string} kind Required. Gets or sets the Kind of the resource.
* Possible values include: 'Academic', 'Bing.Autosuggest', 'Bing.Search',
* 'Bing.Speech', 'Bing.SpellCheck', 'ComputerVision', 'ContentModerator',
* 'CustomSpeech', 'Emotion', 'Face', 'LUIS', 'Recommendations',
* 'SpeakerRecognition', 'Speech', 'SpeechTranslation', 'TextAnalytics',
* Possible values include: 'Bing.Autosuggest.v7', 'Bing.CustomSearch',
* 'Bing.Search.v7', 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision',
* 'ContentModerator', 'CustomSpeech', 'CustomVision.Prediction',
* 'CustomVision.Training', 'Emotion', 'Face', 'LUIS', 'QnAMaker',
* 'SpeakerRecognition', 'SpeechTranslation', 'TextAnalytics',
* 'TextTranslation', 'WebLM'
* @member {string} location Required. Gets or sets the location of the
* resource. This will be one of the supported and registered Azure Geo
Expand Down
162 changes: 149 additions & 13 deletions lib/services/cognitiveServicesManagement/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ export interface Sku {
* @member {string} [sku.tier] Gets the sku tier. This is based on the SKU
* name. Possible values include: 'Free', 'Standard', 'Premium'
* @member {string} kind Required. Gets or sets the Kind of the resource.
* Possible values include: 'Academic', 'Bing.Autosuggest', 'Bing.Search',
* 'Bing.Speech', 'Bing.SpellCheck', 'ComputerVision', 'ContentModerator',
* 'CustomSpeech', 'Emotion', 'Face', 'LUIS', 'Recommendations',
* 'SpeakerRecognition', 'Speech', 'SpeechTranslation', 'TextAnalytics',
* Possible values include: 'Bing.Autosuggest.v7', 'Bing.CustomSearch',
* 'Bing.Search.v7', 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision',
* 'ContentModerator', 'CustomSpeech', 'CustomVision.Prediction',
* 'CustomVision.Training', 'Emotion', 'Face', 'LUIS', 'QnAMaker',
* 'SpeakerRecognition', 'SpeechTranslation', 'TextAnalytics',
* 'TextTranslation', 'WebLM'
* @member {string} location Required. Gets or sets the location of the
* resource. This will be one of the supported and registered Azure Geo Regions
Expand Down Expand Up @@ -109,7 +110,8 @@ export interface CognitiveServicesAccountUpdateParameters {
* @member {string} [name] The name of the created account
* @member {string} [provisioningState] Gets the status of the cognitive
* services account at the time the operation was called. Possible values
* include: 'Creating', 'ResolvingDNS', 'Succeeded', 'Failed'
* include: 'Creating', 'ResolvingDNS', 'Moving', 'Deleting', 'Succeeded',
* 'Failed'
* @member {string} [endpoint] Endpoint of the created account.
* @member {string} [internalId] The internal identifier.
* @member {object} [sku] The SKU of Cognitive Services account.
Expand Down Expand Up @@ -198,6 +200,62 @@ export interface CognitiveServicesAccountEnumerateSkusResult {
readonly value?: CognitiveServicesResourceAndSku[];
}

/**
* @class
* Initializes a new instance of the MetricName class.
* @constructor
* A metric name.
*
* @member {string} [value] The name of the metric.
* @member {string} [localizedValue] The friendly name of the metric.
*/
export interface MetricName {
readonly value?: string;
readonly localizedValue?: string;
}

/**
* @class
* Initializes a new instance of the Usage class.
* @constructor
* The usage data for a usage request.
*
* @member {string} [unit] The unit of the metric. Possible values include:
* 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond',
* 'Milliseconds'
* @member {object} [name] The name information for the metric.
* @member {string} [name.value] The name of the metric.
* @member {string} [name.localizedValue] The friendly name of the metric.
* @member {string} [quotaPeriod] The quota period used to summarize the usage
* values.
* @member {number} [limit] Maximum value for this metric.
* @member {number} [currentValue] Current value for this metric.
* @member {string} [nextResetTime] Next reset time for current quota.
* @member {string} [status] Cognitive Services account quota usage status.
* Possible values include: 'Included', 'Blocked', 'InOverage', 'Unknown'
*/
export interface Usage {
unit?: string;
readonly name?: MetricName;
readonly quotaPeriod?: string;
readonly limit?: number;
readonly currentValue?: number;
readonly nextResetTime?: string;
status?: string;
}

/**
* @class
* Initializes a new instance of the UsagesResult class.
* @constructor
* The response to a list usage request.
*
* @member {array} [value] The list of usages for Cognitive Service account.
*/
export interface UsagesResult {
readonly value?: Usage[];
}

/**
* @class
* Initializes a new instance of the ErrorBody class.
Expand Down Expand Up @@ -278,10 +336,11 @@ export interface OperationEntity {
*
* @member {array} skus The SKU of the resource.
* @member {string} kind The Kind of the resource. Possible values include:
* 'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech',
* 'Bing.SpellCheck', 'ComputerVision', 'ContentModerator', 'CustomSpeech',
* 'Emotion', 'Face', 'LUIS', 'Recommendations', 'SpeakerRecognition',
* 'Speech', 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM'
* 'Bing.Autosuggest.v7', 'Bing.CustomSearch', 'Bing.Search.v7', 'Bing.Speech',
* 'Bing.SpellCheck.v7', 'ComputerVision', 'ContentModerator', 'CustomSpeech',
* 'CustomVision.Prediction', 'CustomVision.Training', 'Emotion', 'Face',
* 'LUIS', 'QnAMaker', 'SpeakerRecognition', 'SpeechTranslation',
* 'TextAnalytics', 'TextTranslation', 'WebLM'
* @member {string} type The Type of the resource.
*/
export interface CheckSkuAvailabilityParameter {
Expand All @@ -297,10 +356,11 @@ export interface CheckSkuAvailabilityParameter {
* Check SKU availability result.
*
* @member {string} [kind] The Kind of the resource. Possible values include:
* 'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech',
* 'Bing.SpellCheck', 'ComputerVision', 'ContentModerator', 'CustomSpeech',
* 'Emotion', 'Face', 'LUIS', 'Recommendations', 'SpeakerRecognition',
* 'Speech', 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM'
* 'Bing.Autosuggest.v7', 'Bing.CustomSearch', 'Bing.Search.v7', 'Bing.Speech',
* 'Bing.SpellCheck.v7', 'ComputerVision', 'ContentModerator', 'CustomSpeech',
* 'CustomVision.Prediction', 'CustomVision.Training', 'Emotion', 'Face',
* 'LUIS', 'QnAMaker', 'SpeakerRecognition', 'SpeechTranslation',
* 'TextAnalytics', 'TextTranslation', 'WebLM'
* @member {string} [type] The Type of the resource.
* @member {string} [skuName] The SKU of Cognitive Services account. Possible
* values include: 'F0', 'P0', 'P1', 'P2', 'S0', 'S1', 'S2', 'S3', 'S4', 'S5',
Expand Down Expand Up @@ -331,6 +391,70 @@ export interface CheckSkuAvailabilityResultList {
value?: CheckSkuAvailabilityResult[];
}

/**
* @class
* Initializes a new instance of the ResourceSkuRestrictionInfo class.
* @constructor
* @member {array} [locations] Locations where the SKU is restricted
* @member {array} [zones] List of availability zones where the SKU is
* restricted.
*/
export interface ResourceSkuRestrictionInfo {
readonly locations?: string[];
readonly zones?: string[];
}

/**
* @class
* Initializes a new instance of the ResourceSkuRestrictions class.
* @constructor
* Describes restrictions of a SKU.
*
* @member {string} [type] The type of restrictions. Possible values include:
* 'Location', 'Zone'
* @member {array} [values] The value of restrictions. If the restriction type
* is set to location. This would be different locations where the SKU is
* restricted.
* @member {object} [restrictionInfo] The information about the restriction
* where the SKU cannot be used.
* @member {array} [restrictionInfo.locations] Locations where the SKU is
* restricted
* @member {array} [restrictionInfo.zones] List of availability zones where the
* SKU is restricted.
* @member {string} [reasonCode] The reason for restriction. Possible values
* include: 'QuotaId', 'NotAvailableForSubscription'
*/
export interface ResourceSkuRestrictions {
readonly type?: string;
readonly values?: string[];
readonly restrictionInfo?: ResourceSkuRestrictionInfo;
readonly reasonCode?: string;
}

/**
* @class
* Initializes a new instance of the ResourceSku class.
* @constructor
* Describes an available Cognitive Services SKU.
*
* @member {string} [resourceType] The type of resource the SKU applies to.
* @member {string} [name] The name of SKU.
* @member {string} [tier] Specifies the tier of Cognitive Services account.
* @member {string} [kind] The Kind of resources that are supported in this
* SKU.
* @member {array} [locations] The set of locations that the SKU is available.
* @member {array} [restrictions] The restrictions because of which SKU cannot
* be used. This is empty if there are no restrictions.
*/
export interface ResourceSku {
readonly resourceType?: string;
readonly name?: string;
readonly tier?: string;
readonly kind?: string;
readonly locations?: string[];
readonly restrictions?: ResourceSkuRestrictions[];
}


/**
* @class
Expand All @@ -344,6 +468,18 @@ export interface CognitiveServicesAccountListResult extends Array<CognitiveServi
nextLink?: string;
}

/**
* @class
* Initializes a new instance of the ResourceSkusResult class.
* @constructor
* The Get Skus operation response.
*
* @member {string} [nextLink] The uri to fetch the next page of Skus.
*/
export interface ResourceSkusResult extends Array<ResourceSku> {
nextLink?: string;
}

/**
* @class
* Initializes a new instance of the OperationEntityListResult class.
Expand Down
7 changes: 7 additions & 0 deletions lib/services/cognitiveServicesManagement/lib/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,19 @@ exports.CognitiveServicesAccountKeys = require('./cognitiveServicesAccountKeys')
exports.RegenerateKeyParameters = require('./regenerateKeyParameters');
exports.CognitiveServicesResourceAndSku = require('./cognitiveServicesResourceAndSku');
exports.CognitiveServicesAccountEnumerateSkusResult = require('./cognitiveServicesAccountEnumerateSkusResult');
exports.MetricName = require('./metricName');
exports.Usage = require('./usage');
exports.UsagesResult = require('./usagesResult');
exports.ErrorBody = require('./errorBody');
exports.ErrorModel = require('./errorModel');
exports.OperationDisplayInfo = require('./operationDisplayInfo');
exports.OperationEntity = require('./operationEntity');
exports.CheckSkuAvailabilityParameter = require('./checkSkuAvailabilityParameter');
exports.CheckSkuAvailabilityResult = require('./checkSkuAvailabilityResult');
exports.CheckSkuAvailabilityResultList = require('./checkSkuAvailabilityResultList');
exports.ResourceSkuRestrictionInfo = require('./resourceSkuRestrictionInfo');
exports.ResourceSkuRestrictions = require('./resourceSkuRestrictions');
exports.ResourceSku = require('./resourceSku');
exports.CognitiveServicesAccountListResult = require('./cognitiveServicesAccountListResult');
exports.ResourceSkusResult = require('./resourceSkusResult');
exports.OperationEntityListResult = require('./operationEntityListResult');
62 changes: 62 additions & 0 deletions lib/services/cognitiveServicesManagement/lib/models/metricName.js
Original file line number Diff line number Diff line change
@@ -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';

/**
* A metric name.
*
*/
class MetricName {
/**
* Create a MetricName.
* @member {string} [value] The name of the metric.
* @member {string} [localizedValue] The friendly name of the metric.
*/
constructor() {
}

/**
* Defines the metadata of MetricName
*
* @returns {object} metadata of MetricName
*
*/
mapper() {
return {
required: false,
serializedName: 'MetricName',
type: {
name: 'Composite',
className: 'MetricName',
modelProperties: {
value: {
required: false,
readOnly: true,
serializedName: 'value',
type: {
name: 'String'
}
},
localizedValue: {
required: false,
readOnly: true,
serializedName: 'localizedValue',
type: {
name: 'String'
}
}
}
}
};
}
}

module.exports = MetricName;
Loading