From a4ead6d7a7c77fc6a55a514b53d16d7bac1dd4d7 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 18 Oct 2021 03:08:41 +0000 Subject: [PATCH] CodeGen from PR 16431 in Azure/azure-rest-api-specs Merge 55237cfe8ea393799b30c95c029cfee68aa09574 into 62ec79080af0d0d609650d67155ef4a93ae11482 --- .../arm-cognitiveservices/README.md | 57 +- .../arm-cognitiveservices/package.json | 2 +- .../arm-cognitiveservices/rollup.config.js | 10 +- .../src/cognitiveServicesManagementClient.ts | 104 +-- ...ognitiveServicesManagementClientContext.ts | 19 +- .../arm-cognitiveservices/src/models/index.ts | 597 +++++++++--------- .../src/models/mappers.ts | 19 +- .../src/models/parameters.ts | 10 +- .../src/operations/accounts.ts | 487 ++++++-------- .../src/operations/deletedAccounts.ts | 134 ++-- .../src/operations/operations.ts | 58 +- .../operations/privateEndpointConnections.ts | 169 ++--- .../src/operations/privateLinkResources.ts | 48 +- .../src/operations/resourceSkus.ts | 62 +- 14 files changed, 739 insertions(+), 1037 deletions(-) diff --git a/sdk/cognitiveservices/arm-cognitiveservices/README.md b/sdk/cognitiveservices/arm-cognitiveservices/README.md index 4f9966388d76..47783a6e66f4 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/README.md +++ b/sdk/cognitiveservices/arm-cognitiveservices/README.md @@ -4,8 +4,8 @@ This package contains an isomorphic SDK (runs both in node.js and in browsers) f ### Currently supported environments -- Node.js version 8.x.x or higher -- Browser JavaScript +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites @@ -14,18 +14,15 @@ You must have an [Azure subscription](https://azure.microsoft.com/free/). ### How to install To use this SDK in your project, you will need to install two packages. - - `@azure/arm-cognitiveservices` that contains the client. - `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. Install both packages using the below command: - ```bash npm install --save @azure/arm-cognitiveservices @azure/identity ``` - > **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. -> If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. +If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. ### How to use @@ -39,7 +36,6 @@ npm install --save @azure/arm-cognitiveservices @azure/identity In the below samples, we pass the credential and the Azure subscription id to instantiate the client. Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. - #### nodejs - Authentication, client creation, and get accounts as an example written in JavaScript. ##### Sample code @@ -55,24 +51,20 @@ const creds = new DefaultAzureCredential(); const client = new CognitiveServicesManagementClient(creds, subscriptionId); const resourceGroupName = "testresourceGroupName"; const accountName = "testaccountName"; -client.accounts - .get(resourceGroupName, accountName) - .then((result) => { - console.log("The result is:"); - console.log(result); - }) - .catch((err) => { - console.log("An error occurred:"); - console.error(err); - }); +client.accounts.get(resourceGroupName, accountName).then((result) => { + console.log("The result is:"); + console.log(result); +}).catch((err) => { + console.log("An error occurred:"); + console.error(err); +}); ``` #### browser - Authentication, client creation, and get accounts as an example written in JavaScript. In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. - -- See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. -- Note down the client Id from the previous step and use it in the browser sample below. + - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. + - Note down the client Id from the previous step and use it in the browser sample below. ##### Sample code @@ -90,26 +82,21 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t const subscriptionId = ""; // Create credentials using the `@azure/identity` package. // Please note that you can also use credentials from the `@azure/ms-rest-browserauth` package instead. - const credential = new InteractiveBrowserCredential({ + const credential = new InteractiveBrowserCredential( + { clientId: "", tenant: "" }); - const client = new Azure.ArmCognitiveservices.CognitiveServicesManagementClient( - creds, - subscriptionId - ); + const client = new Azure.ArmCognitiveservices.CognitiveServicesManagementClient(creds, subscriptionId); const resourceGroupName = "testresourceGroupName"; const accountName = "testaccountName"; - client.accounts - .get(resourceGroupName, accountName) - .then((result) => { - console.log("The result is:"); - console.log(result); - }) - .catch((err) => { - console.log("An error occurred:"); - console.error(err); - }); + client.accounts.get(resourceGroupName, accountName).then((result) => { + console.log("The result is:"); + console.log(result); + }).catch((err) => { + console.log("An error occurred:"); + console.error(err); + }); diff --git a/sdk/cognitiveservices/arm-cognitiveservices/package.json b/sdk/cognitiveservices/arm-cognitiveservices/package.json index 73d8eda1c7c7..6a28cf07432a 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/package.json +++ b/sdk/cognitiveservices/arm-cognitiveservices/package.json @@ -27,7 +27,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/feature/v4/sdk/cognitiveservices/arm-cognitiveservices", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/cognitiveservices/arm-cognitiveservices", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" diff --git a/sdk/cognitiveservices/arm-cognitiveservices/rollup.config.js b/sdk/cognitiveservices/arm-cognitiveservices/rollup.config.js index b382652c9995..189fc7c46598 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/rollup.config.js +++ b/sdk/cognitiveservices/arm-cognitiveservices/rollup.config.js @@ -7,7 +7,10 @@ import sourcemaps from "rollup-plugin-sourcemaps"; */ const config = { input: "./esm/cognitiveServicesManagementClient.js", - external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"], + external: [ + "@azure/ms-rest-js", + "@azure/ms-rest-azure-js" + ], output: { file: "./dist/arm-cognitiveservices.js", format: "umd", @@ -25,7 +28,10 @@ const config = { * Changes may cause incorrect behavior and will be lost if the code is regenerated. */` }, - plugins: [nodeResolve({ mainFields: ["module", "main"] }), sourcemaps()] + plugins: [ + nodeResolve({ mainFields: ['module', 'main'] }), + sourcemaps() + ] }; export default config; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts index b42ee5916b15..5ac989b510f5 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClient.ts @@ -15,6 +15,7 @@ import * as Parameters from "./models/parameters"; import * as operations from "./operations"; import { CognitiveServicesManagementClientContext } from "./cognitiveServicesManagementClientContext"; + class CognitiveServicesManagementClient extends CognitiveServicesManagementClientContext { // Operation groups accounts: operations.Accounts; @@ -35,11 +36,7 @@ class CognitiveServicesManagementClient extends CognitiveServicesManagementClien * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ - constructor( - credentials: msRest.ServiceClientCredentials | TokenCredential, - subscriptionId: string, - options?: Models.CognitiveServicesManagementClientOptions - ) { + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.CognitiveServicesManagementClientOptions) { super(credentials, subscriptionId, options); this.accounts = new operations.Accounts(this); this.deletedAccounts = new operations.DeletedAccounts(this); @@ -58,13 +55,7 @@ class CognitiveServicesManagementClient extends CognitiveServicesManagementClien * @param [options] The optional parameters * @returns Promise */ - checkSkuAvailability( - location: string, - skus: string[], - kind: string, - type: string, - options?: msRest.RequestOptionsBase - ): Promise; + checkSkuAvailability(location: string, skus: string[], kind: string, type: string, options?: msRest.RequestOptionsBase): Promise; /** * @param location Resource location. * @param skus The SKU of the resource. @@ -72,13 +63,7 @@ class CognitiveServicesManagementClient extends CognitiveServicesManagementClien * @param type The Type of the resource. * @param callback The callback */ - checkSkuAvailability( - location: string, - skus: string[], - kind: string, - type: string, - callback: msRest.ServiceCallback - ): void; + checkSkuAvailability(location: string, skus: string[], kind: string, type: string, callback: msRest.ServiceCallback): void; /** * @param location Resource location. * @param skus The SKU of the resource. @@ -87,22 +72,8 @@ class CognitiveServicesManagementClient extends CognitiveServicesManagementClien * @param options The optional parameters * @param callback The callback */ - checkSkuAvailability( - location: string, - skus: string[], - kind: string, - type: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - checkSkuAvailability( - location: string, - skus: string[], - kind: string, - type: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + checkSkuAvailability(location: string, skus: string[], kind: string, type: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkSkuAvailability(location: string, skus: string[], kind: string, type: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.sendOperationRequest( { location, @@ -112,8 +83,7 @@ class CognitiveServicesManagementClient extends CognitiveServicesManagementClien options }, checkSkuAvailabilityOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -123,39 +93,21 @@ class CognitiveServicesManagementClient extends CognitiveServicesManagementClien * @param [options] The optional parameters * @returns Promise */ - checkDomainAvailability( - subdomainName: string, - type: string, - options?: msRest.RequestOptionsBase - ): Promise; + checkDomainAvailability(subdomainName: string, type: string, options?: msRest.RequestOptionsBase): Promise; /** * @param subdomainName The subdomain name to use. * @param type The Type of the resource. * @param callback The callback */ - checkDomainAvailability( - subdomainName: string, - type: string, - callback: msRest.ServiceCallback - ): void; + checkDomainAvailability(subdomainName: string, type: string, callback: msRest.ServiceCallback): void; /** * @param subdomainName The subdomain name to use. * @param type The Type of the resource. * @param options The optional parameters * @param callback The callback */ - checkDomainAvailability( - subdomainName: string, - type: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - checkDomainAvailability( - subdomainName: string, - type: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + checkDomainAvailability(subdomainName: string, type: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + checkDomainAvailability(subdomainName: string, type: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.sendOperationRequest( { subdomainName, @@ -163,8 +115,7 @@ class CognitiveServicesManagementClient extends CognitiveServicesManagementClien options }, checkDomainAvailabilityOperationSpec, - callback - ) as Promise; + callback) as Promise; } } @@ -172,11 +123,17 @@ class CognitiveServicesManagementClient extends CognitiveServicesManagementClien const serializer = new msRest.Serializer(Mappers); const checkSkuAvailabilityOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability", - urlParameters: [Parameters.subscriptionId, Parameters.location], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability", + urlParameters: [ + Parameters.subscriptionId, + Parameters.location + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], requestBody: { parameterPath: { skus: "skus", @@ -201,11 +158,16 @@ const checkSkuAvailabilityOperationSpec: msRest.OperationSpec = { const checkDomainAvailabilityOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/checkDomainAvailability", + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], requestBody: { parameterPath: { subdomainName: "subdomainName", diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClientContext.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClientContext.ts index d4c54b88d630..d7e0d72c7e90 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClientContext.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/cognitiveServicesManagementClientContext.ts @@ -31,16 +31,12 @@ export class CognitiveServicesManagementClientContext extends msRestAzure.AzureS * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ - constructor( - credentials: msRest.ServiceClientCredentials | TokenCredential, - subscriptionId: string, - options?: Models.CognitiveServicesManagementClientOptions - ) { + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.CognitiveServicesManagementClientOptions) { if (credentials == undefined) { - throw new Error("'credentials' cannot be null."); + throw new Error('\'credentials\' cannot be null.'); } if (subscriptionId == undefined) { - throw new Error("'subscriptionId' cannot be null."); + throw new Error('\'subscriptionId\' cannot be null.'); } if (!options) { @@ -53,8 +49,8 @@ export class CognitiveServicesManagementClientContext extends msRestAzure.AzureS super(credentials, options); - this.apiVersion = "2021-04-30"; - this.acceptLanguage = "en-US"; + this.apiVersion = '2021-04-30'; + this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; this.requestContentType = "application/json; charset=utf-8"; @@ -64,10 +60,7 @@ export class CognitiveServicesManagementClientContext extends msRestAzure.AzureS if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if ( - options.longRunningOperationRetryTimeout !== null && - options.longRunningOperationRetryTimeout !== undefined - ) { + if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; } } diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts index 542a075d3629..b3f02814ae39 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/index.ts @@ -899,7 +899,8 @@ export interface PrivateLinkResourceListResult { * and a location * @summary Proxy Resource */ -export interface ProxyResource extends Resource {} +export interface ProxyResource extends Resource { +} /** * The resource model definition for an Azure Resource Manager tracked top level resource which has @@ -1104,7 +1105,7 @@ export interface OperationListResult extends Array { * @readonly * @enum {string} */ -export type SkuTier = "Free" | "Basic" | "Standard" | "Premium" | "Enterprise"; +export type SkuTier = 'Free' | 'Basic' | 'Standard' | 'Premium' | 'Enterprise'; /** * Defines values for ResourceIdentityType. @@ -1113,11 +1114,7 @@ export type SkuTier = "Free" | "Basic" | "Standard" | "Premium" | "Enterprise"; * @readonly * @enum {string} */ -export type ResourceIdentityType = - | "None" - | "SystemAssigned" - | "UserAssigned" - | "SystemAssigned, UserAssigned"; +export type ResourceIdentityType = 'None' | 'SystemAssigned' | 'UserAssigned' | 'SystemAssigned, UserAssigned'; /** * Defines values for CreatedByType. @@ -1125,7 +1122,7 @@ export type ResourceIdentityType = * @readonly * @enum {string} */ -export type CreatedByType = "User" | "Application" | "ManagedIdentity" | "Key"; +export type CreatedByType = 'User' | 'Application' | 'ManagedIdentity' | 'Key'; /** * Defines values for ProvisioningState. @@ -1134,14 +1131,7 @@ export type CreatedByType = "User" | "Application" | "ManagedIdentity" | "Key"; * @readonly * @enum {string} */ -export type ProvisioningState = - | "Accepted" - | "Creating" - | "Deleting" - | "Moving" - | "Failed" - | "Succeeded" - | "ResolvingDNS"; +export type ProvisioningState = 'Accepted' | 'Creating' | 'Deleting' | 'Moving' | 'Failed' | 'Succeeded' | 'ResolvingDNS'; /** * Defines values for NetworkRuleAction. @@ -1149,7 +1139,7 @@ export type ProvisioningState = * @readonly * @enum {string} */ -export type NetworkRuleAction = "Allow" | "Deny"; +export type NetworkRuleAction = 'Allow' | 'Deny'; /** * Defines values for KeySource. @@ -1157,7 +1147,7 @@ export type NetworkRuleAction = "Allow" | "Deny"; * @readonly * @enum {string} */ -export type KeySource = "Microsoft.CognitiveServices" | "Microsoft.KeyVault"; +export type KeySource = 'Microsoft.CognitiveServices' | 'Microsoft.KeyVault'; /** * Defines values for PrivateEndpointServiceConnectionStatus. @@ -1165,7 +1155,7 @@ export type KeySource = "Microsoft.CognitiveServices" | "Microsoft.KeyVault"; * @readonly * @enum {string} */ -export type PrivateEndpointServiceConnectionStatus = "Pending" | "Approved" | "Rejected"; +export type PrivateEndpointServiceConnectionStatus = 'Pending' | 'Approved' | 'Rejected'; /** * Defines values for PrivateEndpointConnectionProvisioningState. @@ -1173,11 +1163,7 @@ export type PrivateEndpointServiceConnectionStatus = "Pending" | "Approved" | "R * @readonly * @enum {string} */ -export type PrivateEndpointConnectionProvisioningState = - | "Succeeded" - | "Creating" - | "Deleting" - | "Failed"; +export type PrivateEndpointConnectionProvisioningState = 'Succeeded' | 'Creating' | 'Deleting' | 'Failed'; /** * Defines values for PublicNetworkAccess. @@ -1185,7 +1171,7 @@ export type PrivateEndpointConnectionProvisioningState = * @readonly * @enum {string} */ -export type PublicNetworkAccess = "Enabled" | "Disabled"; +export type PublicNetworkAccess = 'Enabled' | 'Disabled'; /** * Defines values for KeyName. @@ -1193,7 +1179,7 @@ export type PublicNetworkAccess = "Enabled" | "Disabled"; * @readonly * @enum {string} */ -export type KeyName = "Key1" | "Key2"; +export type KeyName = 'Key1' | 'Key2'; /** * Defines values for UnitType. @@ -1202,14 +1188,7 @@ export type KeyName = "Key1" | "Key2"; * @readonly * @enum {string} */ -export type UnitType = - | "Count" - | "Bytes" - | "Seconds" - | "Percent" - | "CountPerSecond" - | "BytesPerSecond" - | "Milliseconds"; +export type UnitType = 'Count' | 'Bytes' | 'Seconds' | 'Percent' | 'CountPerSecond' | 'BytesPerSecond' | 'Milliseconds'; /** * Defines values for QuotaUsageStatus. @@ -1217,7 +1196,7 @@ export type UnitType = * @readonly * @enum {string} */ -export type QuotaUsageStatus = "Included" | "Blocked" | "InOverage" | "Unknown"; +export type QuotaUsageStatus = 'Included' | 'Blocked' | 'InOverage' | 'Unknown'; /** * Defines values for ResourceSkuRestrictionsType. @@ -1225,7 +1204,7 @@ export type QuotaUsageStatus = "Included" | "Blocked" | "InOverage" | "Unknown"; * @readonly * @enum {string} */ -export type ResourceSkuRestrictionsType = "Location" | "Zone"; +export type ResourceSkuRestrictionsType = 'Location' | 'Zone'; /** * Defines values for ResourceSkuRestrictionsReasonCode. @@ -1233,7 +1212,7 @@ export type ResourceSkuRestrictionsType = "Location" | "Zone"; * @readonly * @enum {string} */ -export type ResourceSkuRestrictionsReasonCode = "QuotaId" | "NotAvailableForSubscription"; +export type ResourceSkuRestrictionsReasonCode = 'QuotaId' | 'NotAvailableForSubscription'; /** * Defines values for Origin. @@ -1241,7 +1220,7 @@ export type ResourceSkuRestrictionsReasonCode = "QuotaId" | "NotAvailableForSubs * @readonly * @enum {string} */ -export type Origin = "user" | "system" | "user,system"; +export type Origin = 'user' | 'system' | 'user,system'; /** * Defines values for ActionType. @@ -1249,7 +1228,7 @@ export type Origin = "user" | "system" | "user,system"; * @readonly * @enum {string} */ -export type ActionType = "Internal"; +export type ActionType = 'Internal'; /** * Contains response data for the create operation. @@ -1259,16 +1238,16 @@ export type AccountsCreateResponse = Account & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Account; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Account; + }; }; /** @@ -1279,16 +1258,16 @@ export type AccountsUpdateResponse = Account & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Account; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Account; + }; }; /** @@ -1299,16 +1278,16 @@ export type AccountsGetResponse = Account & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Account; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Account; + }; }; /** @@ -1319,16 +1298,16 @@ export type AccountsListByResourceGroupResponse = AccountListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccountListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AccountListResult; + }; }; /** @@ -1339,16 +1318,16 @@ export type AccountsListResponse = AccountListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccountListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AccountListResult; + }; }; /** @@ -1359,16 +1338,16 @@ export type AccountsListKeysResponse = ApiKeys & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApiKeys; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ApiKeys; + }; }; /** @@ -1379,16 +1358,16 @@ export type AccountsRegenerateKeyResponse = ApiKeys & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ApiKeys; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ApiKeys; + }; }; /** @@ -1399,16 +1378,16 @@ export type AccountsListSkusResponse = AccountSkuListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccountSkuListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AccountSkuListResult; + }; }; /** @@ -1419,16 +1398,16 @@ export type AccountsListUsagesResponse = UsageListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: UsageListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: UsageListResult; + }; }; /** @@ -1439,16 +1418,16 @@ export type AccountsBeginCreateResponse = Account & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Account; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Account; + }; }; /** @@ -1459,16 +1438,16 @@ export type AccountsBeginUpdateResponse = Account & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Account; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Account; + }; }; /** @@ -1479,16 +1458,16 @@ export type AccountsListByResourceGroupNextResponse = AccountListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccountListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AccountListResult; + }; }; /** @@ -1499,16 +1478,16 @@ export type AccountsListNextResponse = AccountListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccountListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AccountListResult; + }; }; /** @@ -1519,16 +1498,16 @@ export type DeletedAccountsGetResponse = Account & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: Account; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: Account; + }; }; /** @@ -1539,16 +1518,16 @@ export type DeletedAccountsListResponse = AccountListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccountListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AccountListResult; + }; }; /** @@ -1559,16 +1538,16 @@ export type DeletedAccountsListNextResponse = AccountListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: AccountListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: AccountListResult; + }; }; /** @@ -1579,16 +1558,16 @@ export type ResourceSkusListResponse = ResourceSkuListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResourceSkuListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceSkuListResult; + }; }; /** @@ -1599,16 +1578,16 @@ export type ResourceSkusListNextResponse = ResourceSkuListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: ResourceSkuListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: ResourceSkuListResult; + }; }; /** @@ -1619,16 +1598,16 @@ export type OperationsListResponse = OperationListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationListResult; + }; }; /** @@ -1639,16 +1618,16 @@ export type OperationsListNextResponse = OperationListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: OperationListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: OperationListResult; + }; }; /** @@ -1659,16 +1638,16 @@ export type CheckSkuAvailabilityResponse = SkuAvailabilityListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: SkuAvailabilityListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SkuAvailabilityListResult; + }; }; /** @@ -1679,16 +1658,16 @@ export type CheckDomainAvailabilityResponse = DomainAvailability & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: DomainAvailability; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: DomainAvailability; + }; }; /** @@ -1699,16 +1678,16 @@ export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionLi * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnectionListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateEndpointConnectionListResult; + }; }; /** @@ -1719,16 +1698,16 @@ export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection & * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateEndpointConnection; + }; }; /** @@ -1739,16 +1718,16 @@ export type PrivateEndpointConnectionsCreateOrUpdateResponse = PrivateEndpointCo * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateEndpointConnection; + }; }; /** @@ -1759,16 +1738,16 @@ export type PrivateEndpointConnectionsBeginCreateOrUpdateResponse = PrivateEndpo * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateEndpointConnection; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateEndpointConnection; + }; }; /** @@ -1779,14 +1758,14 @@ export type PrivateLinkResourcesListResponse = PrivateLinkResourceListResult & { * The underlying HTTP response. */ _response: msRest.HttpResponse & { - /** - * The response body as text (string format) - */ - bodyAsText: string; - - /** - * The response body as parsed JSON or XML - */ - parsedBody: PrivateLinkResourceListResult; - }; + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateLinkResourceListResult; + }; }; diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts index 01db7aed0126..a723202d649a 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/mappers.ts @@ -87,7 +87,12 @@ export const Identity: msRest.CompositeMapper = { serializedName: "type", type: { name: "Enum", - allowedValues: ["None", "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned"] + allowedValues: [ + "None", + "SystemAssigned", + "UserAssigned", + "SystemAssigned, UserAssigned" + ] } }, tenantId: { @@ -351,7 +356,7 @@ export const Encryption: msRest.CompositeMapper = { }, keySource: { serializedName: "keySource", - defaultValue: "Microsoft.KeyVault", + defaultValue: 'Microsoft.KeyVault', type: { name: "String" } @@ -1075,7 +1080,10 @@ export const RegenerateKeyParameters: msRest.CompositeMapper = { serializedName: "keyName", type: { name: "Enum", - allowedValues: ["Key1", "Key2"] + allowedValues: [ + "Key1", + "Key2" + ] } } } @@ -1428,7 +1436,10 @@ export const ResourceSkuRestrictions: msRest.CompositeMapper = { serializedName: "type", type: { name: "Enum", - allowedValues: ["Location", "Zone"] + allowedValues: [ + "Location", + "Zone" + ] } }, values: { diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts index 4169981b6abc..20052de44c43 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/models/parameters.ts @@ -13,7 +13,7 @@ export const acceptLanguage: msRest.OperationParameter = { parameterPath: "acceptLanguage", mapper: { serializedName: "accept-language", - defaultValue: "en-US", + defaultValue: 'en-US', type: { name: "String" } @@ -48,7 +48,10 @@ export const apiVersion: msRest.OperationQueryParameter = { } }; export const filter: msRest.OperationQueryParameter = { - parameterPath: ["options", "filter"], + parameterPath: [ + "options", + "filter" + ], mapper: { serializedName: "$filter", type: { @@ -94,8 +97,7 @@ export const resourceGroupName: msRest.OperationURLParameter = { serializedName: "resourceGroupName", constraints: { MaxLength: 90, - MinLength: 1, - Pattern: /^[-\w\._\(\)]+$/ + MinLength: 1 }, type: { name: "String" diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts index 55bbb392c4f8..aacb15d61478 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/accounts.ts @@ -35,15 +35,9 @@ export class Accounts { * @param [options] The optional parameters * @returns Promise */ - create( - resourceGroupName: string, - accountName: string, - account: Models.Account, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginCreate(resourceGroupName, accountName, account, options).then((lroPoller) => - lroPoller.pollUntilFinished() - ) as Promise; + create(resourceGroupName: string, accountName: string, account: Models.Account, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreate(resourceGroupName,accountName,account,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } /** @@ -54,15 +48,9 @@ export class Accounts { * @param [options] The optional parameters * @returns Promise */ - update( - resourceGroupName: string, - accountName: string, - account: Models.Account, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginUpdate(resourceGroupName, accountName, account, options).then((lroPoller) => - lroPoller.pollUntilFinished() - ) as Promise; + update(resourceGroupName: string, accountName: string, account: Models.Account, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,accountName,account,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } /** @@ -72,14 +60,9 @@ export class Accounts { * @param [options] The optional parameters * @returns Promise */ - deleteMethod( - resourceGroupName: string, - accountName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginDeleteMethod(resourceGroupName, accountName, options).then((lroPoller) => - lroPoller.pollUntilFinished() - ); + deleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,accountName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); } /** @@ -89,39 +72,21 @@ export class Accounts { * @param [options] The optional parameters * @returns Promise */ - get( - resourceGroupName: string, - accountName: string, - options?: msRest.RequestOptionsBase - ): Promise; + get(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param callback The callback */ - get( - resourceGroupName: string, - accountName: string, - callback: msRest.ServiceCallback - ): void; + get(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param options The optional parameters * @param callback The callback */ - get( - resourceGroupName: string, - accountName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - resourceGroupName: string, - accountName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + get(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -129,8 +94,7 @@ export class Accounts { options }, getOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -139,41 +103,26 @@ export class Accounts { * @param [options] The optional parameters * @returns Promise */ - listByResourceGroup( - resourceGroupName: string, - options?: msRest.RequestOptionsBase - ): Promise; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param callback The callback */ - listByResourceGroup( - resourceGroupName: string, - callback: msRest.ServiceCallback - ): void; + listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The optional parameters * @param callback The callback */ - listByResourceGroup( - resourceGroupName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByResourceGroup( - resourceGroupName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, listByResourceGroupOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -190,21 +139,14 @@ export class Accounts { * @param options The optional parameters * @param callback The callback */ - list( - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options }, listOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -214,39 +156,21 @@ export class Accounts { * @param [options] The optional parameters * @returns Promise */ - listKeys( - resourceGroupName: string, - accountName: string, - options?: msRest.RequestOptionsBase - ): Promise; + listKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param callback The callback */ - listKeys( - resourceGroupName: string, - accountName: string, - callback: msRest.ServiceCallback - ): void; + listKeys(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param options The optional parameters * @param callback The callback */ - listKeys( - resourceGroupName: string, - accountName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listKeys( - resourceGroupName: string, - accountName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listKeys(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -254,8 +178,7 @@ export class Accounts { options }, listKeysOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -266,24 +189,14 @@ export class Accounts { * @param [options] The optional parameters * @returns Promise */ - regenerateKey( - resourceGroupName: string, - accountName: string, - keyName: Models.KeyName, - options?: msRest.RequestOptionsBase - ): Promise; + regenerateKey(resourceGroupName: string, accountName: string, keyName: Models.KeyName, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param keyName key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2' * @param callback The callback */ - regenerateKey( - resourceGroupName: string, - accountName: string, - keyName: Models.KeyName, - callback: msRest.ServiceCallback - ): void; + regenerateKey(resourceGroupName: string, accountName: string, keyName: Models.KeyName, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -291,20 +204,8 @@ export class Accounts { * @param options The optional parameters * @param callback The callback */ - regenerateKey( - resourceGroupName: string, - accountName: string, - keyName: Models.KeyName, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - regenerateKey( - resourceGroupName: string, - accountName: string, - keyName: Models.KeyName, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + regenerateKey(resourceGroupName: string, accountName: string, keyName: Models.KeyName, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + regenerateKey(resourceGroupName: string, accountName: string, keyName: Models.KeyName, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -313,8 +214,7 @@ export class Accounts { options }, regenerateKeyOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -324,39 +224,21 @@ export class Accounts { * @param [options] The optional parameters * @returns Promise */ - listSkus( - resourceGroupName: string, - accountName: string, - options?: msRest.RequestOptionsBase - ): Promise; + listSkus(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param callback The callback */ - listSkus( - resourceGroupName: string, - accountName: string, - callback: msRest.ServiceCallback - ): void; + listSkus(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param options The optional parameters * @param callback The callback */ - listSkus( - resourceGroupName: string, - accountName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listSkus( - resourceGroupName: string, - accountName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listSkus(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listSkus(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -364,8 +246,7 @@ export class Accounts { options }, listSkusOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -375,41 +256,21 @@ export class Accounts { * @param [options] The optional parameters * @returns Promise */ - listUsages( - resourceGroupName: string, - accountName: string, - options?: Models.AccountsListUsagesOptionalParams - ): Promise; + listUsages(resourceGroupName: string, accountName: string, options?: Models.AccountsListUsagesOptionalParams): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param callback The callback */ - listUsages( - resourceGroupName: string, - accountName: string, - callback: msRest.ServiceCallback - ): void; + listUsages(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param options The optional parameters * @param callback The callback */ - listUsages( - resourceGroupName: string, - accountName: string, - options: Models.AccountsListUsagesOptionalParams, - callback: msRest.ServiceCallback - ): void; - listUsages( - resourceGroupName: string, - accountName: string, - options?: - | Models.AccountsListUsagesOptionalParams - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listUsages(resourceGroupName: string, accountName: string, options: Models.AccountsListUsagesOptionalParams, callback: msRest.ServiceCallback): void; + listUsages(resourceGroupName: string, accountName: string, options?: Models.AccountsListUsagesOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -417,8 +278,7 @@ export class Accounts { options }, listUsagesOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -430,12 +290,7 @@ export class Accounts { * @param [options] The optional parameters * @returns Promise */ - beginCreate( - resourceGroupName: string, - accountName: string, - account: Models.Account, - options?: msRest.RequestOptionsBase - ): Promise { + beginCreate(resourceGroupName: string, accountName: string, account: Models.Account, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceGroupName, @@ -444,8 +299,7 @@ export class Accounts { options }, beginCreateOperationSpec, - options - ); + options); } /** @@ -456,12 +310,7 @@ export class Accounts { * @param [options] The optional parameters * @returns Promise */ - beginUpdate( - resourceGroupName: string, - accountName: string, - account: Models.Account, - options?: msRest.RequestOptionsBase - ): Promise { + beginUpdate(resourceGroupName: string, accountName: string, account: Models.Account, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceGroupName, @@ -470,8 +319,7 @@ export class Accounts { options }, beginUpdateOperationSpec, - options - ); + options); } /** @@ -481,11 +329,7 @@ export class Accounts { * @param [options] The optional parameters * @returns Promise */ - beginDeleteMethod( - resourceGroupName: string, - accountName: string, - options?: msRest.RequestOptionsBase - ): Promise { + beginDeleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceGroupName, @@ -493,8 +337,7 @@ export class Accounts { options }, beginDeleteMethodOperationSpec, - options - ); + options); } /** @@ -503,41 +346,26 @@ export class Accounts { * @param [options] The optional parameters * @returns Promise */ - listByResourceGroupNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listByResourceGroupNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback): void; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param options The optional parameters * @param callback The callback */ - listByResourceGroupNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listByResourceGroupNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, options }, listByResourceGroupNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -546,10 +374,7 @@ export class Accounts { * @param [options] The optional parameters * @returns Promise */ - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -560,24 +385,15 @@ export class Accounts { * @param options The optional parameters * @param callback The callback */ - listNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, options }, listNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } } @@ -585,11 +401,18 @@ export class Accounts { const serializer = new msRest.Serializer(Mappers); const getOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", - urlParameters: [Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.Account @@ -603,11 +426,17 @@ const getOperationSpec: msRest.OperationSpec = { const listByResourceGroupOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts", - urlParameters: [Parameters.resourceGroupName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.AccountListResult @@ -622,9 +451,15 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.AccountListResult @@ -638,11 +473,18 @@ const listOperationSpec: msRest.OperationSpec = { const listKeysOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys", - urlParameters: [Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.ApiKeys @@ -656,11 +498,18 @@ const listKeysOperationSpec: msRest.OperationSpec = { const regenerateKeyOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey", - urlParameters: [Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], requestBody: { parameterPath: { keyName: "keyName" @@ -683,11 +532,18 @@ const regenerateKeyOperationSpec: msRest.OperationSpec = { const listSkusOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus", - urlParameters: [Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.AccountSkuListResult @@ -701,11 +557,19 @@ const listSkusOperationSpec: msRest.OperationSpec = { const listUsagesOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages", - urlParameters: [Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion, Parameters.filter], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion, + Parameters.filter + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.UsageListResult @@ -719,11 +583,18 @@ const listUsagesOperationSpec: msRest.OperationSpec = { const beginCreateOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", - urlParameters: [Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], requestBody: { parameterPath: "account", mapper: { @@ -750,11 +621,18 @@ const beginCreateOperationSpec: msRest.OperationSpec = { const beginUpdateOperationSpec: msRest.OperationSpec = { httpMethod: "PATCH", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", - urlParameters: [Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], requestBody: { parameterPath: "account", mapper: { @@ -778,11 +656,18 @@ const beginUpdateOperationSpec: msRest.OperationSpec = { const beginDeleteMethodOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", - urlParameters: [Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: {}, 202: {}, @@ -798,9 +683,15 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.AccountListResult @@ -816,9 +707,15 @@ const listNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.AccountListResult diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deletedAccounts.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deletedAccounts.ts index 8412d80bea1e..55d04b3f4de3 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deletedAccounts.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/deletedAccounts.ts @@ -34,24 +34,14 @@ export class DeletedAccounts { * @param [options] The optional parameters * @returns Promise */ - get( - location: string, - resourceGroupName: string, - accountName: string, - options?: msRest.RequestOptionsBase - ): Promise; + get(location: string, resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param location Resource location. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param callback The callback */ - get( - location: string, - resourceGroupName: string, - accountName: string, - callback: msRest.ServiceCallback - ): void; + get(location: string, resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; /** * @param location Resource location. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -59,20 +49,8 @@ export class DeletedAccounts { * @param options The optional parameters * @param callback The callback */ - get( - location: string, - resourceGroupName: string, - accountName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - location: string, - resourceGroupName: string, - accountName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + get(location: string, resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(location: string, resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { location, @@ -81,8 +59,7 @@ export class DeletedAccounts { options }, getOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -93,15 +70,9 @@ export class DeletedAccounts { * @param [options] The optional parameters * @returns Promise */ - purge( - location: string, - resourceGroupName: string, - accountName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginPurge(location, resourceGroupName, accountName, options).then((lroPoller) => - lroPoller.pollUntilFinished() - ); + purge(location: string, resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginPurge(location,resourceGroupName,accountName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); } /** @@ -118,21 +89,14 @@ export class DeletedAccounts { * @param options The optional parameters * @param callback The callback */ - list( - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options }, listOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -143,12 +107,7 @@ export class DeletedAccounts { * @param [options] The optional parameters * @returns Promise */ - beginPurge( - location: string, - resourceGroupName: string, - accountName: string, - options?: msRest.RequestOptionsBase - ): Promise { + beginPurge(location: string, resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { location, @@ -157,8 +116,7 @@ export class DeletedAccounts { options }, beginPurgeOperationSpec, - options - ); + options); } /** @@ -167,10 +125,7 @@ export class DeletedAccounts { * @param [options] The optional parameters * @returns Promise */ - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback @@ -181,24 +136,15 @@ export class DeletedAccounts { * @param options The optional parameters * @param callback The callback */ - listNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, options }, listNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } } @@ -206,16 +152,19 @@ export class DeletedAccounts { const serializer = new msRest.Serializer(Mappers); const getOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}", + path: "subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}", urlParameters: [ Parameters.location, Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.Account @@ -230,9 +179,15 @@ const getOperationSpec: msRest.OperationSpec = { const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/deletedAccounts", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.AccountListResult @@ -246,16 +201,19 @@ const listOperationSpec: msRest.OperationSpec = { const beginPurgeOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", - path: - "subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}", + path: "subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/resourceGroups/{resourceGroupName}/deletedAccounts/{accountName}", urlParameters: [ Parameters.location, Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: {}, 202: {}, @@ -271,9 +229,15 @@ const listNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.AccountListResult diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/operations.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/operations.ts index b87c98234ec4..5d284184597b 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/operations.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/operations.ts @@ -39,21 +39,14 @@ export class Operations { * @param options The optional parameters * @param callback The callback */ - list( - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options }, listOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -62,41 +55,26 @@ export class Operations { * @param [options] The optional parameters * @returns Promise */ - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param options The optional parameters * @param callback The callback */ - listNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, options }, listNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } } @@ -105,8 +83,12 @@ const serializer = new msRest.Serializer(Mappers); const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "providers/Microsoft.CognitiveServices/operations", - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.OperationListResult @@ -122,9 +104,15 @@ const listNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.OperationListResult diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateEndpointConnections.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateEndpointConnections.ts index 57b6c3d748c7..9e89a93fc6a3 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateEndpointConnections.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateEndpointConnections.ts @@ -33,41 +33,21 @@ export class PrivateEndpointConnections { * @param [options] The optional parameters * @returns Promise */ - list( - resourceGroupName: string, - accountName: string, - options?: msRest.RequestOptionsBase - ): Promise; + list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param callback The callback */ - list( - resourceGroupName: string, - accountName: string, - callback: msRest.ServiceCallback - ): void; + list(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param options The optional parameters * @param callback The callback */ - list( - resourceGroupName: string, - accountName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - resourceGroupName: string, - accountName: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + list(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -75,8 +55,7 @@ export class PrivateEndpointConnections { options }, listOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -88,12 +67,7 @@ export class PrivateEndpointConnections { * @param [options] The optional parameters * @returns Promise */ - get( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - options?: msRest.RequestOptionsBase - ): Promise; + get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -101,12 +75,7 @@ export class PrivateEndpointConnections { * the Cognitive Services Account * @param callback The callback */ - get( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - callback: msRest.ServiceCallback - ): void; + get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. @@ -115,20 +84,8 @@ export class PrivateEndpointConnections { * @param options The optional parameters * @param callback The callback */ - get( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - get( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -137,8 +94,7 @@ export class PrivateEndpointConnections { options }, getOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -152,22 +108,9 @@ export class PrivateEndpointConnections { * @param [options] The optional parameters * @returns Promise */ - createOrUpdate( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - properties: Models.PrivateEndpointConnection, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginCreateOrUpdate( - resourceGroupName, - accountName, - privateEndpointConnectionName, - properties, - options - ).then((lroPoller) => lroPoller.pollUntilFinished()) as Promise< - Models.PrivateEndpointConnectionsCreateOrUpdateResponse - >; + createOrUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,accountName,privateEndpointConnectionName,properties,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; } /** @@ -180,18 +123,9 @@ export class PrivateEndpointConnections { * @param [options] The optional parameters * @returns Promise */ - deleteMethod( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - options?: msRest.RequestOptionsBase - ): Promise { - return this.beginDeleteMethod( - resourceGroupName, - accountName, - privateEndpointConnectionName, - options - ).then((lroPoller) => lroPoller.pollUntilFinished()); + deleteMethod(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,accountName,privateEndpointConnectionName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); } /** @@ -205,13 +139,7 @@ export class PrivateEndpointConnections { * @param [options] The optional parameters * @returns Promise */ - beginCreateOrUpdate( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - properties: Models.PrivateEndpointConnection, - options?: msRest.RequestOptionsBase - ): Promise { + beginCreateOrUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceGroupName, @@ -221,8 +149,7 @@ export class PrivateEndpointConnections { options }, beginCreateOrUpdateOperationSpec, - options - ); + options); } /** @@ -235,12 +162,7 @@ export class PrivateEndpointConnections { * @param [options] The optional parameters * @returns Promise */ - beginDeleteMethod( - resourceGroupName: string, - accountName: string, - privateEndpointConnectionName: string, - options?: msRest.RequestOptionsBase - ): Promise { + beginDeleteMethod(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise { return this.client.sendLRORequest( { resourceGroupName, @@ -249,8 +171,7 @@ export class PrivateEndpointConnections { options }, beginDeleteMethodOperationSpec, - options - ); + options); } } @@ -258,11 +179,18 @@ export class PrivateEndpointConnections { const serializer = new msRest.Serializer(Mappers); const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections", - urlParameters: [Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnectionListResult @@ -276,16 +204,19 @@ const listOperationSpec: msRest.OperationSpec = { const getOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", urlParameters: [ Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, Parameters.privateEndpointConnectionName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PrivateEndpointConnection @@ -299,16 +230,19 @@ const getOperationSpec: msRest.OperationSpec = { const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { httpMethod: "PUT", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", urlParameters: [ Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, Parameters.privateEndpointConnectionName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], requestBody: { parameterPath: "properties", mapper: { @@ -332,16 +266,19 @@ const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { const beginDeleteMethodOperationSpec: msRest.OperationSpec = { httpMethod: "DELETE", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", urlParameters: [ Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId, Parameters.privateEndpointConnectionName ], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: {}, 202: {}, diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateLinkResources.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateLinkResources.ts index d506bba885af..beed3c0d2f86 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateLinkResources.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/privateLinkResources.ts @@ -32,41 +32,21 @@ export class PrivateLinkResources { * @param [options] The optional parameters * @returns Promise */ - list( - resourceGroupName: string, - accountName: string, - options?: msRest.RequestOptionsBase - ): Promise; + list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param callback The callback */ - list( - resourceGroupName: string, - accountName: string, - callback: msRest.ServiceCallback - ): void; + list(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback): void; /** * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param options The optional parameters * @param callback The callback */ - list( - resourceGroupName: string, - accountName: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - resourceGroupName: string, - accountName: string, - options?: - | msRest.RequestOptionsBase - | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + list(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -74,8 +54,7 @@ export class PrivateLinkResources { options }, listOperationSpec, - callback - ) as Promise; + callback) as Promise; } } @@ -83,11 +62,18 @@ export class PrivateLinkResources { const serializer = new msRest.Serializer(Mappers); const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", - path: - "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources", - urlParameters: [Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources", + urlParameters: [ + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.PrivateLinkResourceListResult diff --git a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/resourceSkus.ts b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/resourceSkus.ts index d30406a8965b..e6d04e307e37 100644 --- a/sdk/cognitiveservices/arm-cognitiveservices/src/operations/resourceSkus.ts +++ b/sdk/cognitiveservices/arm-cognitiveservices/src/operations/resourceSkus.ts @@ -39,21 +39,14 @@ export class ResourceSkus { * @param options The optional parameters * @param callback The callback */ - list( - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - list( - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { options }, listOperationSpec, - callback - ) as Promise; + callback) as Promise; } /** @@ -62,41 +55,26 @@ export class ResourceSkus { * @param [options] The optional parameters * @returns Promise */ - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase - ): Promise; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param callback The callback */ - listNext( - nextPageLink: string, - callback: msRest.ServiceCallback - ): void; + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; /** * @param nextPageLink The NextLink from the previous successful call to List operation. * @param options The optional parameters * @param callback The callback */ - listNext( - nextPageLink: string, - options: msRest.RequestOptionsBase, - callback: msRest.ServiceCallback - ): void; - listNext( - nextPageLink: string, - options?: msRest.RequestOptionsBase | msRest.ServiceCallback, - callback?: msRest.ServiceCallback - ): Promise { + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { nextPageLink, options }, listNextOperationSpec, - callback - ) as Promise; + callback) as Promise; } } @@ -105,9 +83,15 @@ const serializer = new msRest.Serializer(Mappers); const listOperationSpec: msRest.OperationSpec = { httpMethod: "GET", path: "subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus", - urlParameters: [Parameters.subscriptionId], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.ResourceSkuListResult @@ -123,9 +107,15 @@ const listNextOperationSpec: msRest.OperationSpec = { httpMethod: "GET", baseUrl: "https://management.azure.com", path: "{nextLink}", - urlParameters: [Parameters.nextPageLink], - queryParameters: [Parameters.apiVersion], - headerParameters: [Parameters.acceptLanguage], + urlParameters: [ + Parameters.nextPageLink + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], responses: { 200: { bodyMapper: Mappers.ResourceSkuListResult