From e9ebf227d49e3f5ad9b3fe44c6d615cc02997e86 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 25 Nov 2021 09:57:40 +0000 Subject: [PATCH] CodeGen from PR 16870 in Azure/azure-rest-api-specs Track2 modify readme.go.md (#16870) --- sdk/communication/arm-communication/README.md | 9 +- .../arm-communication/package.json | 2 +- .../communicationServiceManagementClient.ts | 2 - ...unicationServiceManagementClientContext.ts | 2 +- .../arm-communication/src/models/index.ts | 182 ++++--------- .../arm-communication/src/models/mappers.ts | 252 +++++++----------- .../src/models/operationStatusesMappers.ts | 14 - .../src/models/parameters.ts | 23 +- .../arm-communication/src/operations/index.ts | 1 - .../src/operations/operationStatuses.ts | 86 ------ 10 files changed, 163 insertions(+), 410 deletions(-) delete mode 100644 sdk/communication/arm-communication/src/models/operationStatusesMappers.ts delete mode 100644 sdk/communication/arm-communication/src/operations/operationStatuses.ts diff --git a/sdk/communication/arm-communication/README.md b/sdk/communication/arm-communication/README.md index 15ddebb729bf..8fdd3e7f3851 100644 --- a/sdk/communication/arm-communication/README.md +++ b/sdk/communication/arm-communication/README.md @@ -1,11 +1,11 @@ ## Azure CommunicationServiceManagementClient SDK for JavaScript -This package contains an isomorphic SDK (runs both in Node.js and in browsers) for CommunicationServiceManagementClient. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for CommunicationServiceManagementClient. ### Currently supported environments - [LTS versions of Node.js](https://nodejs.org/about/releases/) -- Latest versions of Safari, Chrome, Edge, and Firefox. +- Latest versions of Safari, Chrome, Edge and Firefox. ### Prerequisites @@ -21,7 +21,6 @@ Install both packages using the below command: ```bash npm install --save @azure/arm-communication @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. @@ -37,7 +36,6 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/ 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 list operations as an example written in JavaScript. ##### Sample code @@ -51,7 +49,6 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; // Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. const creds = new DefaultAzureCredential(); const client = new CommunicationServiceManagementClient(creds, subscriptionId); - client.operations.list().then((result) => { console.log("The result is:"); console.log(result); @@ -86,7 +83,7 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t const credential = new InteractiveBrowserCredential( { clientId: "", - tenantId: "" + tenant: "" }); const client = new Azure.ArmCommunication.CommunicationServiceManagementClient(creds, subscriptionId); client.operations.list().then((result) => { diff --git a/sdk/communication/arm-communication/package.json b/sdk/communication/arm-communication/package.json index e38a347769e0..4eb77414834e 100644 --- a/sdk/communication/arm-communication/package.json +++ b/sdk/communication/arm-communication/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/communication/arm-communication", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/communication/arm-communication", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" diff --git a/sdk/communication/arm-communication/src/communicationServiceManagementClient.ts b/sdk/communication/arm-communication/src/communicationServiceManagementClient.ts index fc437ea41185..7bdb0fb3f770 100644 --- a/sdk/communication/arm-communication/src/communicationServiceManagementClient.ts +++ b/sdk/communication/arm-communication/src/communicationServiceManagementClient.ts @@ -19,7 +19,6 @@ class CommunicationServiceManagementClient extends CommunicationServiceManagemen // Operation groups operations: operations.Operations; communicationService: operations.CommunicationService; - operationStatuses: operations.OperationStatuses; /** * Initializes a new instance of the CommunicationServiceManagementClient class. @@ -36,7 +35,6 @@ class CommunicationServiceManagementClient extends CommunicationServiceManagemen super(credentials, subscriptionId, options); this.operations = new operations.Operations(this); this.communicationService = new operations.CommunicationService(this); - this.operationStatuses = new operations.OperationStatuses(this); } } diff --git a/sdk/communication/arm-communication/src/communicationServiceManagementClientContext.ts b/sdk/communication/arm-communication/src/communicationServiceManagementClientContext.ts index fec15657e118..9fa5a53a4932 100644 --- a/sdk/communication/arm-communication/src/communicationServiceManagementClientContext.ts +++ b/sdk/communication/arm-communication/src/communicationServiceManagementClientContext.ts @@ -9,8 +9,8 @@ import * as Models from "./models"; import * as msRest from "@azure/ms-rest-js"; -import { TokenCredential } from "@azure/core-auth"; import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; const packageName = "@azure/arm-communication"; const packageVersion = "2.1.1"; diff --git a/sdk/communication/arm-communication/src/models/index.ts b/sdk/communication/arm-communication/src/models/index.ts index ee60ae75365c..d726a4cada21 100644 --- a/sdk/communication/arm-communication/src/models/index.ts +++ b/sdk/communication/arm-communication/src/models/index.ts @@ -68,101 +68,6 @@ export interface LinkedNotificationHub { resourceId?: string; } -/** - * The resource management error additional info. - */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly type?: string; - /** - * The additional info. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly info?: any; -} - -/** - * The error detail. - */ -export interface ErrorDetail { - /** - * The error code. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly code?: string; - /** - * The error message. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly message?: string; - /** - * The error target. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly target?: string; - /** - * The error details. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly details?: ErrorDetail[]; - /** - * The error additional info. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** - * Common error response for all Azure Resource Manager APIs to return error details for failed - * operations. (This also follows the OData error response format.). - * @summary Error response - */ -export interface ErrorResponse { - /** - * The error object. - */ - error?: ErrorDetail; -} - -/** - * The current status of an async operation - */ -export interface OperationStatus { - /** - * Fully qualified ID for the operation status. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly id?: string; - /** - * Provisioning state of the resource. Possible values include: 'Succeeded', 'Failed', - * 'Canceled', 'Creating', 'Deleting', 'Moving' - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly status?: Status; - /** - * The start time of the operation - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly startTime?: Date; - /** - * The end time of the operation - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly endTime?: Date; - /** - * Percent of the operation that is complete - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly percentComplete?: number; - /** - * The error object. - */ - error?: ErrorDetail; -} - /** * Metadata pertaining to creation and last modification of the resource. */ @@ -371,6 +276,65 @@ export interface AzureEntityResource extends Resource { readonly etag?: string; } +/** + * The resource management error additional info. + */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + /** + * The additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly info?: any; +} + +/** + * The error detail. + */ +export interface ErrorDetail { + /** + * The error code. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly code?: string; + /** + * The error message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * The error target. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly target?: string; + /** + * The error details. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** + * Common error response for all Azure Resource Manager APIs to return error details for failed + * operations. (This also follows the OData error response format.). + * @summary Error response + */ +export interface ErrorResponse { + /** + * The error object. + */ + error?: ErrorDetail; +} + /** * Localized display information for this particular operation. */ @@ -541,14 +505,6 @@ export interface CommunicationServiceResourceList extends Array - */ - get(location: string, operationId: string, options?: msRest.RequestOptionsBase): Promise; - /** - * @param location The Azure region - * @param operationId The ID of an ongoing async operation - * @param callback The callback - */ - get(location: string, operationId: string, callback: msRest.ServiceCallback): void; - /** - * @param location The Azure region - * @param operationId The ID of an ongoing async operation - * @param options The optional parameters - * @param callback The callback - */ - get(location: string, operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - get(location: string, operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { - return this.client.sendOperationRequest( - { - location, - operationId, - options - }, - getOperationSpec, - callback) as Promise; - } -} - -// Operation Specifications -const serializer = new msRest.Serializer(Mappers); -const getOperationSpec: msRest.OperationSpec = { - httpMethod: "GET", - path: "providers/Microsoft.Communication/locations/{location}/operationStatuses/{operationId}", - urlParameters: [ - Parameters.location, - Parameters.operationId - ], - queryParameters: [ - Parameters.apiVersion - ], - headerParameters: [ - Parameters.acceptLanguage - ], - responses: { - 200: { - bodyMapper: Mappers.OperationStatus - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - serializer -};