From 1cb57cd28e76a1897f322613c2fc219ab5b2d6fd Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 25 Jul 2024 21:46:19 +0000 Subject: [PATCH] CodeGen from PR 29976 in Azure/azure-rest-api-specs Merge 8b2d77b017227728b8cd7856304f59b1e0073fa1 into a805ed385cb9b24ba13b520d19b7d9d62e6d5841 --- sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md | 7 +++ sdk/cosmosdb/arm-cosmosdb/_meta.json | 8 ++-- sdk/cosmosdb/arm-cosmosdb/package.json | 18 +++----- .../arm-cosmosdb/review/arm-cosmosdb.api.md | 1 + .../src/cosmosDBManagementClient.ts | 4 +- sdk/cosmosdb/arm-cosmosdb/src/models/index.ts | 13 +++--- .../arm-cosmosdb/src/models/parameters.ts | 2 +- sdk/cosmosdb/arm-cosmosdb/test/sampleTest.ts | 43 +++++++++++++++++++ sdk/cosmosdb/arm-cosmosdb/tsconfig.json | 10 +---- 9 files changed, 73 insertions(+), 33 deletions(-) create mode 100644 sdk/cosmosdb/arm-cosmosdb/test/sampleTest.ts diff --git a/sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md b/sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md index d957a66d4735..a972dcbf1aed 100644 --- a/sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md +++ b/sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## 16.1.0 (2024-07-25) + +**Features** + + - Enum KnownServerVersion has a new value Seven0 + + ## 16.0.0 (2024-06-24) ### Features Added diff --git a/sdk/cosmosdb/arm-cosmosdb/_meta.json b/sdk/cosmosdb/arm-cosmosdb/_meta.json index e5a73d993a01..1b1f0a185313 100644 --- a/sdk/cosmosdb/arm-cosmosdb/_meta.json +++ b/sdk/cosmosdb/arm-cosmosdb/_meta.json @@ -1,8 +1,8 @@ { - "commit": "768c1f32bbfdcea80bdadf92dc2fba2c114c2dda", + "commit": "347b99490a5e689e95303fbdf982f1d5bbabd359", "readme": "specification/cosmos-db/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\cosmos-db\\resource-manager\\readme.md --use=@autorest/typescript@6.0.23 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.11", - "use": "@autorest/typescript@6.0.23" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.10", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/cosmosdb/arm-cosmosdb/package.json b/sdk/cosmosdb/arm-cosmosdb/package.json index d356790980c5..aacd1055d5de 100644 --- a/sdk/cosmosdb/arm-cosmosdb/package.json +++ b/sdk/cosmosdb/arm-cosmosdb/package.json @@ -3,13 +3,13 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for CosmosDBManagementClient.", - "version": "16.0.0", + "version": "16.1.0", "engines": { "node": ">=18.0.0" }, "dependencies": { "@azure/core-lro": "^2.5.4", - "@azure/abort-controller": "^1.0.0", + "@azure/abort-controller": "^2.1.2", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.6.0", @@ -35,7 +35,7 @@ "rimraf": "^5.0.0", "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", + "@azure/identity": "^4.2.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.1.0", "mocha": "^10.0.0", @@ -106,13 +106,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cosmosdb/arm-cosmosdb", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-cosmosdb?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cosmosdb/arm-cosmosdb" +} \ No newline at end of file diff --git a/sdk/cosmosdb/arm-cosmosdb/review/arm-cosmosdb.api.md b/sdk/cosmosdb/arm-cosmosdb/review/arm-cosmosdb.api.md index 1972c32abd7b..89b4917a3c45 100644 --- a/sdk/cosmosdb/arm-cosmosdb/review/arm-cosmosdb.api.md +++ b/sdk/cosmosdb/arm-cosmosdb/review/arm-cosmosdb.api.md @@ -2114,6 +2114,7 @@ export enum KnownServerVersion { Five0 = "5.0", Four0 = "4.0", Four2 = "4.2", + Seven0 = "7.0", Six0 = "6.0", Three2 = "3.2", Three6 = "3.6" diff --git a/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts b/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts index cd653b95f4e4..aad44db44e45 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts @@ -126,7 +126,7 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { credential: credentials, }; - const packageDetails = `azsdk-js-arm-cosmosdb/16.0.0`; + const packageDetails = `azsdk-js-arm-cosmosdb/16.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -180,7 +180,7 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2024-05-15"; + this.apiVersion = options.apiVersion || "2024-08-15"; this.databaseAccounts = new DatabaseAccountsImpl(this); this.operations = new OperationsImpl(this); this.database = new DatabaseImpl(this); diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts index c8de29f49c13..55080b0775af 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts @@ -167,7 +167,7 @@ export interface Resource { } export interface ApiProperties { - /** Describes the ServerVersion of an a MongoDB account. */ + /** Describes the version of the MongoDB account. */ serverVersion?: ServerVersion; } @@ -376,7 +376,7 @@ export interface DatabaseAccountUpdateParameters { enablePartitionMerge?: boolean; /** Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. */ minimalTlsVersion?: MinimalTlsVersion; - /** Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account */ + /** Flag to indicate enabling/disabling of Burst Capacity feature on the account */ enableBurstCapacity?: boolean; /** Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. */ customerManagedKeyStatus?: string; @@ -2766,7 +2766,7 @@ export interface DatabaseAccountGetResults extends ARMResourceProperties { enablePartitionMerge?: boolean; /** Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. */ minimalTlsVersion?: MinimalTlsVersion; - /** Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account */ + /** Flag to indicate enabling/disabling of Burst Capacity feature on the account */ enableBurstCapacity?: boolean; /** Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. */ customerManagedKeyStatus?: string; @@ -2842,7 +2842,7 @@ export interface DatabaseAccountCreateUpdateParameters enablePartitionMerge?: boolean; /** Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. */ minimalTlsVersion?: MinimalTlsVersion; - /** Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account */ + /** Flag to indicate enabling/disabling of Burst Capacity feature on the account */ enableBurstCapacity?: boolean; /** Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. */ customerManagedKeyStatus?: string; @@ -4017,6 +4017,8 @@ export enum KnownServerVersion { Five0 = "5.0", /** Six0 */ Six0 = "6.0", + /** Seven0 */ + Seven0 = "7.0", } /** @@ -4029,7 +4031,8 @@ export enum KnownServerVersion { * **4.0** \ * **4.2** \ * **5.0** \ - * **6.0** + * **6.0** \ + * **7.0** */ export type ServerVersion = string; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts index d554d121614d..847caefc23cd 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts @@ -116,7 +116,7 @@ export const accountName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2024-05-15", + defaultValue: "2024-08-15", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/cosmosdb/arm-cosmosdb/test/sampleTest.ts b/sdk/cosmosdb/arm-cosmosdb/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env, +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function (this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function () { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/cosmosdb/arm-cosmosdb/tsconfig.json b/sdk/cosmosdb/arm-cosmosdb/tsconfig.json index bbcdce662fee..3e6ae96443f3 100644 --- a/sdk/cosmosdb/arm-cosmosdb/tsconfig.json +++ b/sdk/cosmosdb/arm-cosmosdb/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-cosmosdb": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"