From 18c6a8410fad2be69132e3f58eedaadc50f445b9 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Wed, 25 May 2016 15:08:18 -0700 Subject: [PATCH] Add CognitiveServices test --- .../AcceptanceTests.cs | 6 + ...Generator.AzureResourceSchema.Tests.csproj | 6 + .../Microsoft.CognitiveServices.json | 124 +++ .../2016-02-01-preview/cognitiveservices.json | 758 ++++++++++++++++++ 4 files changed, 894 insertions(+) create mode 100644 AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/Expected/CognitiveServices/2016-02-01-preview/Microsoft.CognitiveServices.json create mode 100644 AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/Swagger/CognitiveServices/2016-02-01-preview/cognitiveservices.json diff --git a/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/AcceptanceTests.cs b/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/AcceptanceTests.cs index 569fa73008..dd876018af 100644 --- a/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/AcceptanceTests.cs +++ b/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/AcceptanceTests.cs @@ -29,6 +29,12 @@ public static void Cdn_2016_04_02() RunSwaggerTest("CDN", "2016-04-02", "cdn.json"); } + [Fact] + public static void CognitiveServices_2016_02_01_preview() + { + RunSwaggerTest("CognitiveServices", "2016-02-01-preview", "cognitiveservices.json"); + } + [Fact] public static void Compute_2015_06_15() { diff --git a/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/AutoRest.Generator.AzureResourceSchema.Tests.csproj b/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/AutoRest.Generator.AzureResourceSchema.Tests.csproj index 81edaf80e3..49b27a2b2e 100644 --- a/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/AutoRest.Generator.AzureResourceSchema.Tests.csproj +++ b/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/AutoRest.Generator.AzureResourceSchema.Tests.csproj @@ -126,6 +126,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest @@ -171,6 +174,9 @@ PreserveNewest + + PreserveNewest + diff --git a/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/Expected/CognitiveServices/2016-02-01-preview/Microsoft.CognitiveServices.json b/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/Expected/CognitiveServices/2016-02-01-preview/Microsoft.CognitiveServices.json new file mode 100644 index 0000000000..3e62c08aaf --- /dev/null +++ b/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/Expected/CognitiveServices/2016-02-01-preview/Microsoft.CognitiveServices.json @@ -0,0 +1,124 @@ +{ + "id": "http://schema.management.azure.com/schemas/2016-02-01-preview/Microsoft.CognitiveServices.json#", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Microsoft.CognitiveServices", + "description": "Microsoft CognitiveServices Resource Types", + "resourceDefinitions": { + "accounts": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "Microsoft.CognitiveServices/accounts" + ] + }, + "apiVersion": { + "type": "string", + "enum": [ + "2016-02-01-preview" + ] + }, + "sku": { + "oneOf": [ + { + "$ref": "#/definitions/Sku" + }, + { + "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression" + } + ] + }, + "kind": { + "oneOf": [ + { + "type": "string", + "enum": [ + "ComputerVision", + "Emotion", + "Face", + "LUIS", + "Recommendations", + "Speech", + "TextAnalytics", + "WebLM" + ] + }, + { + "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression" + } + ], + "description": "Required. Indicates the type of cognitive service account. Possible values include: 'ComputerVision', 'Emotion', 'Face', 'LUIS', 'Recommendations', 'Speech', 'TextAnalytics', 'WebLM'" + }, + "location": { + "type": "string", + "description": "Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update the request will succeed." + }, + "tags": { + "oneOf": [ + { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + { + "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression" + } + ], + "description": "Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters." + }, + "properties": { + "oneOf": [ + { + "type": "object" + }, + { + "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression" + } + ], + "description": "Must exist in the request. Must not be null." + } + }, + "required": [ + "type", + "apiVersion", + "sku", + "kind", + "location", + "properties" + ], + "description": "Microsoft.CognitiveServices/accounts" + } + }, + "definitions": { + "Sku": { + "type": "object", + "properties": { + "name": { + "oneOf": [ + { + "type": "string", + "enum": [ + "F0", + "S0", + "S1", + "S2", + "S3", + "S4" + ] + }, + { + "$ref": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#/definitions/expression" + } + ], + "description": "Gets or sets the sku name. Required for account creation, optional for update. Possible values include: 'F0', 'S0', 'S1', 'S2', 'S3', 'S4'" + } + }, + "required": [ + "name" + ], + "description": "The SKU of the cognitive services account." + } + } +} diff --git a/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/Swagger/CognitiveServices/2016-02-01-preview/cognitiveservices.json b/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/Swagger/CognitiveServices/2016-02-01-preview/cognitiveservices.json new file mode 100644 index 0000000000..c91ab40c4d --- /dev/null +++ b/AutoRest/Generators/AzureResourceSchema/AzureResourceSchema.Tests/Swagger/CognitiveServices/2016-02-01-preview/cognitiveservices.json @@ -0,0 +1,758 @@ +{ + "swagger": "2.0", + "info": { + "title": "CognitiveServicesManagementClient", + "description": "Cognitive Services Management Client", + "version": "2016-02-01-preview" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json", + "text/json" + ], + "produces": [ + "application/json", + "text/json" + ], + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}": { + "put": { + "tags": [ + "CognitiveServicesAccounts" + ], + "description": "Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for developer to access intelligent APIs. It's also the resource type for billing.", + "operationId": "CognitiveServicesAccounts_Create", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group within the user's subscription." + }, + { + "name": "accountName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the cognitive services account within the specified resource group. Cognitive Services account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + "maxLength": 24, + "minLength": 3, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CognitiveServicesAccountCreateParameters" + }, + "description": "The parameters to provide for the created account." + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "If resource is created successfully or already existed, the service should return 200 (OK).", + "schema": { + "$ref": "#/definitions/CognitiveServicesAccount" + } + }, + "201": { + "description": "If resource is created successfully, the service should return 201 (OK).", + "schema": { + "$ref": "#/definitions/CognitiveServicesAccount" + } + }, + "default": { + "description": "Error response describing why the operation failed", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "patch": { + "tags": [ + "CognitiveServicesAccounts" + ], + "description": "Updates a Cognitive Services account", + "operationId": "CognitiveServicesAccounts_Update", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group within the user's subscription." + }, + { + "name": "accountName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the cognitive services account within the specified resource group. Cognitive Services account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + "maxLength": 24, + "minLength": 3, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CognitiveServicesAccountUpdateParameters" + }, + "description": "The parameters to provide for the created account." + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The resource provider should return 200 (OK) to indicate that the operation completed successfully. ", + "schema": { + "$ref": "#/definitions/CognitiveServicesAccount" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource group *or* resource does not exist, 404 (NotFound) should be returned.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "delete": { + "tags": [ + "CognitiveServicesAccounts" + ], + "description": "Deletes a Cognitive Services account from the resource group. ", + "operationId": "CognitiveServicesAccounts_Delete", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group within the user's subscription." + }, + { + "name": "accountName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the cognitive services account within the specified resource group. Cognitive Services account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + "maxLength": 24, + "minLength": 3, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "A 200 (OK) should be returned if the object exists and was deleted successfully;" + }, + "204": { + "description": "a 204 (NoContent) should be used if the resource does not exist and the request is well formed." + }, + "default": { + "description": "Error response describing why the operation failed", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "get": { + "tags": [ + "CognitiveServicesAccounts" + ], + "description": "Returns a Cognitive Services account specified by the parameters.", + "operationId": "CognitiveServicesAccounts_GetProperties", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group within the user's subscription." + }, + { + "name": "accountName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the cognitive services account within the specified resource group. Cognitive Services account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + "maxLength": 24, + "minLength": 3, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The resource provider should return 200 (OK) to indicate that the operation completed successfully.\nFor a detailed explanation of each field in the response body, please refer to the request body description in the PUT resource section. The only GET specific properties are “name,” “type” and “id.”\nField\tDescription\nKind\trequired. String.\n\tThe API set for this API account. It can be \n\t· a single API, for example: Face API, Vision API, Speech API. \n\ta bundle of APIs: Face + Speech, Vision + Emotion, etc.\nsku.name\tRequired.\n\tThe pricing tier/plan of this API. Could be: \n\tF0 - Free\n\tB0 - Basic\n\tS0 - Standard\n\tP0 - Premium\n", + "schema": { + "$ref": "#/definitions/CognitiveServicesAccount" + }, + "examples": { + "application/json": "{\n “id”: “/subscriptions/{id}/resourceGroups/{group}/providers/{rpns}/{type}/{name}”,\n “name”: “{name}”,\n “type”: “Microsoft.CognitiveSerices/accounts”,\n \"location\": \"North US\",\n \"tags\": {\n \"key1\": \"value 1\",\n \"key2\": \"value 2\"\n },\n \"kind\" : \"resource kind\",\n \"sku\": {\n\t \"name\": \"sku code\"\n\t} \n “etag”: “00000000-0000-0000-0000-000000000000”,\n \"properties\": { }\n}" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource does not exist, 404 (NotFound) should be returned.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts": { + "get": { + "tags": [ + "CognitiveServicesAccounts" + ], + "description": "Returns all the resources of a particular type belonging to a resource group", + "operationId": "CognitiveServicesAccounts_ListByResourceGroup", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group within the user's subscription." + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The resource provider should return 200 (OK) to indicate that the operation completed successfully. For other errors (e.g. internal errors) use the appropriate HTTP error code.\nThe nextLink field is expected to point to the URL the client should use to fetch the next page (per server side paging). This matches the OData guidelines for paged responses here. If a resource provider does not support paging, it should return the same body (JSON object with “value” property) but omit nextLink entirely (or set to null, *not* empty string) for future compatibility.\nThe nextLink should be implemented using following query parameters:\n· skipToken: opaque token that allows the resource provider to skip resources already enumerated. This value is defined and returned by the RP after first request via nextLink.\n· top: the optional client query parameter which defines the maximum number of records to be returned by the server.\nImplementation details:\n· NextLink may include all the query parameters (specifically OData $filter) used by the client in the first query. \n· Server may return less records than requested with nextLink. Returning zero records with NextLink is an acceptable response. \nClients must fetch records until the nextLink is not returned back / null. Clients should never rely on number of returned records to determinate if pagination is completed.", + "schema": { + "$ref": "#/definitions/CognitiveServicesAccountListResult" + }, + "examples": { + "application/json": "{\n “value”: [\n {\n “id”: “{url to resource 1}”,\n “name”: “Name1”,\n “type”: “Microsoft.CognitiveServices/accounts”,\n \"location\": \"North US\" \n \"kind\" : \"resource kind\",\n \"sku\": {\n\t \"name\": \"sku code\"\n\t }, \n \"etag\": \"00000000-0000-0000-0000-000000000000\",\n \"properties\": { }\n },\n {\n “id”: “{url to resource 2}”,\n “name”: “Name2”,\n “type”: “Microsoft.CognitiveServices/accounts”,\n \"location\": \"North US\",\n \"kind\" : \"resource kind\",\n \"sku\": {\n\t \"name\": \"sku code\"\n\t }, \n \"etag\": \"00000000-0000-0000-0000-000000000000\",\n \"properties\": { }\n }\n ],\n “nextLink”: “{originalRequestUrl}?$skipToken={opaqueString}”\n}" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource group does not exist, 404 (NotFound) will be returned.", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts": { + "get": { + "tags": [ + "CognitiveServicesAccounts" + ], + "description": "Returns all the resources of a particular type belonging to a subscription.", + "operationId": "CognitiveServicesAccounts_List", + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The resource provider should return 200 (OK) to indicate that the operation completed successfully. For other errors (e.g. internal errors) use the appropriate HTTP error code.\nThe nextLink field is expected to point to the URL the client should use to fetch the next page (per server side paging). This matches the OData guidelines for paged responses. If a resource provider does not support paging, it should return the same body but leave nextLink empty for future compatibility.\nFor a detailed explanation of each field in the response body, please refer to the request body description in the PUT resource section. ", + "schema": { + "$ref": "#/definitions/CognitiveServicesAccountListResult" + }, + "examples": { + "application/json": "{\n “value”: [\n {\n “id”: “{url to resource 1}”,\n “name”: “Name1”,\n “type”: “Microsoft.CognitiveServices/accounts”,\n \"location\": \"North US\" \n \"kind\" : \"resource kind\",\n \"sku\": {\n \"name\": \"sku code\"\n }, \n \"etag\": \"00000000-0000-0000-0000-000000000000\",\n \"properties\": { }\n },\n {\n “id”: “{url to resource 2}”,\n “name”: “Name2”,\n “type”: “Microsoft.CognitiveServices/accounts”,\n \"location\": \"North US\",\n \"kind\" : \"resource kind\",\n \"sku\": {\n \"name\": \"sku code\"\n }, \n \"etag\": \"00000000-0000-0000-0000-000000000000\",\n \"properties\": { }\n }\n ],\n “nextLink”: “{originalRequestUrl}?$skipToken={opaqueString}”\n}\n" + } + }, + "default": { + "description": "Error response describing why the operation failed", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys": { + "post": { + "tags": [ + "CognitiveServicesAccounts" + ], + "operationId": "CognitiveServicesAccounts_ListKeys", + "description": "Lists the account keys for the specified Cognitive Services account.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group within the user's subscription." + }, + { + "name": "accountName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the cognitive services account within the specified resource group. Congitive Services account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. ", + "maxLength": 24, + "minLength": 3, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "Returns with a response body containing the subscription keys for the resource: key1\nThe first API key for authentication when client calls the API endpoint.\n\nkey2\nThe second API key for authentication when client calls the API endpoint.", + "schema": { + "$ref": "#/definitions/CognitiveServicesAccountKeys" + }, + "examples": { + "application/json": { + "key1": "xxxx", + "key2": "xxxxx" + } + } + }, + "default": { + "description": "Error response describing why the operation failed", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey": { + "post": { + "tags": [ + "CognitiveServicesAccounts" + ], + "operationId": "CognitiveServicesAccounts_RegenerateKey", + "description": "Regenerates the specified account key for the specified Cognitive Services account.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group within the user's subscription." + }, + { + "name": "accountName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the cognitive services account within the specified resource group. Cognitive Services account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. ", + "maxLength": 24, + "minLength": 3, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RegenerateKeyParameters" + }, + "description": "regenerate key parameters." + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/CognitiveServicesAccountKeys" + } + }, + "default": { + "description": "Error response describing why the operation failed", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus": { + "get": { + "tags": [ + "CognitiveServicesAccounts" + ], + "description": "List available SKUs for the requested Cognitive Services account", + "operationId": "CognitiveServicesAccounts_ListSkus", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group within the user's subscription." + }, + { + "name": "accountName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the cognitive services account within the specified resource group. Cognitive Services account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. ", + "maxLength": 24, + "minLength": 3, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "The resource provider should return 200 (OK) to indicate that the operation completed successfully.\nFor a detailed explanation of each field in the response body, please refer to the request body description in the PUT resource section. The only GET specific properties are “name,” “type” and “id.”\nField\tDescription\nsku\tRequired, object\n\tThe exact set of keys that define this sku. This matches the fields on the respective resource.\nsku.name\tRequired, string\n\tThe name of the SKU. This is typically a letter + number code, such as A0 or P3\nsku.tier\tRequired, string\n\tThe tier of this particular SKU. Typically one of:\n\t· Free\n\t· Basic\n\t· Standard\n\t· Premium\n", + "schema": { + "$ref": "#/definitions/CognitiveServicesAccountEnumerateSkusResult" + }, + "examples": { + "application/json": "{\n \"value\": [\n {\n \"resourceType\": \"Microsoft.CognitiveServices/accounts\"\n \"sku\": {\n \"name\": \"sku name\",\n \"tier\": \"sku tier\"\n }\n },\n {\n \"resourceType\": \"Microsoft.CognitiveServices/accounts\"\n \"sku\": {\n \"name\": \"sku name\",\n \"tier\": \"sku tier\"\n }\n }\n ]\n}" + } + }, + "default": { + "description": "Error response describing why the operation failed. If the resource does not exist, 404 (NotFound) will be returned.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + } + }, + "definitions": { + "CognitiveServicesAccountCreateParameters": { + "properties": { + "sku": { + "$ref": "#/definitions/Sku" + }, + "kind": { + "type": "string", + "description": "Required. Indicates the type of cognitive service account.", + "enum": [ + "ComputerVision", + "Emotion", + "Face", + "LUIS", + "Recommendations", + "Speech", + "TextAnalytics", + "WebLM" + ], + "x-ms-enum": { + "name": "Kind", + "modelAsString": false + } + }, + "location": { + "type": "string", + "description": "Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update the request will succeed." + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters." + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/CognitiveServicesAccountPropertiesCreateParameters", + "description": "Must exist in the request. Must not be null." + } + }, + "required": [ + "sku", + "kind", + "location", + "properties" + ], + "description": "The parameters to provide for the account." + }, + "CognitiveServicesAccountUpdateParameters": { + "properties": { + "sku": { + "$ref": "#/definitions/Sku" + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters." + } + }, + "description": "The parameters to provide for the account." + }, + "Sku": { + "properties": { + "name": { + "type": "string", + "description": "Gets or sets the sku name. Required for account creation, optional for update.", + "enum": [ + "F0", + "S0", + "S1", + "S2", + "S3", + "S4" + ], + "x-ms-enum": { + "name": "SkuName", + "modelAsString": false + } + }, + "tier": { + "readOnly": true, + "type": "string", + "description": "Gets the sku tier. This is based on the SKU name.", + "enum": [ + "Free", + "Standard", + "Premium" + ], + "x-ms-enum": { + "name": "SkuTier", + "modelAsString": false + } + } + }, + "required": [ + "name" + ], + "description": "The SKU of the cognitive services account." + }, + "CognitiveServicesAccountPropertiesCreateParameters": { + "description": "required empty proprties object. Must be an empty object, and must exist in the request." + }, + "CognitiveServicesAccount": { + "description": "Cognitive Services Account is an Azure resource representing the provisioned account, its type, location and SKU.", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Entity Tag" + }, + "id": { + "type": "string", + "description": "The id of the created account" + }, + "kind": { + "type": "string", + "description": "Type of cognitive service account." + }, + "location": { + "type": "string", + "description": "The location of the resource" + }, + "name": { + "type": "string", + "description": "The name of the created account" + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/CognitiveServicesAccountProperties" + }, + "sku": { + "$ref": "#/definitions/Sku" + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters." + }, + "type": { + "type": "string", + "description": "Resource type" + } + }, + "x-ms-azure-resource": true + }, + "CognitiveServicesAccountListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/CognitiveServicesAccount" + }, + "description": "Gets the list of Cognitive Services accounts and their properties." + } + }, + "description": "The list of cognitive services accounts operation response." + }, + "CognitiveServicesAccountProperties": { + "properties": { + "provisioningState": { + "readOnly": true, + "type": "string", + "description": "Gets the status of the cognitive services account at the time the operation was called.", + "enum": [ + "Creating", + "ResolvingDNS", + "Succeeded", + "Failed" + ], + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": false + } + }, + "endpoint": { + "type": "string", + "description": "Endpoint of the created account" + } + } + }, + "CognitiveServicesAccountKeys": { + "properties": { + "key1": { + "type": "string", + "description": "Gets the value of key 1." + }, + "key2": { + "type": "string", + "description": "Gets the value of key 2." + } + }, + "description": "The access keys for the cognitive services account." + }, + "RegenerateKeyParameters": { + "properties": { + "keyName": { + "type": "string", + "description": "key name to generate (Key1|Key2)", + "enum": [ + "Key1", + "Key2" + ], + "x-ms-enum": { + "name": "KeyName", + "modelAsString": false + } + } + }, + "description": "Regenerate key parameters." + }, + "CognitiveServicesAccountEnumerateSkusResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/CognitiveServicesResourceAndSku" + }, + "description": "Gets the list of Cognitive Services accounts and their properties." + } + }, + "description": "The list of cognitive services accounts operation response." + }, + "CognitiveServicesResourceAndSku": { + "properties": { + "resourceType": { + "type": "string", + "description": "Resource Namespace and Type" + }, + "sku": { + "$ref": "#/definitions/Sku" + } + } + }, + "Error": { + "properties": { + "error": { + "$ref": "#/definitions/ErrorBody" + } + } + }, + "ErrorBody": { + "properties": { + "code": { + "type": "string", + "description": "error code" + }, + "message": { + "type": "string", + "description": "error message" + } + }, + "required": [ + "code", + "message" + ] + } + }, + "parameters": { + "subscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "description": "Azure Subscription ID.", + "required": true, + "type": "string" + }, + "apiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Version of the API to be used with the client request. Current version is 2016-02-01-preview" + } + } +} \ No newline at end of file