From 6a3d12d795ae487cca2a89defc617e04114b5104 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 6 Jan 2023 09:11:03 +0000 Subject: [PATCH] CodeGen from PR 22087 in Azure/azure-rest-api-specs Merge 914f6145ddc27c2537c3a5690d0b8b8208d841ba into f69c52dd603c79a8b29ba51483e3aa7fe1b56212 --- sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md | 15 ++----- sdk/cosmosdb/arm-cosmosdb/_meta.json | 8 ++-- sdk/cosmosdb/arm-cosmosdb/package.json | 17 ++------ .../arm-cosmosdb/review/arm-cosmosdb.api.md | 14 +++++- .../src/cosmosDBManagementClient.ts | 2 +- sdk/cosmosdb/arm-cosmosdb/src/models/index.ts | 19 +++++++- .../arm-cosmosdb/src/models/mappers.ts | 29 +++++++++++++ sdk/cosmosdb/arm-cosmosdb/test/sampleTest.ts | 43 +++++++++++++++++++ sdk/cosmosdb/arm-cosmosdb/tsconfig.json | 10 +---- 9 files changed, 116 insertions(+), 41 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 20289d435937..0b722fc5b9ff 100644 --- a/sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md +++ b/sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md @@ -1,16 +1,6 @@ # Release History - -## 16.0.0-beta.6 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 16.0.0-beta.5 (2023-01-03) + +## 15.3.0-beta.1 (2023-01-06) **Features** @@ -93,6 +83,7 @@ - Added Interface ClientEncryptionPolicy - Added Interface ContinuousModeProperties - Added Interface CosmosCassandraDataTransferDataSourceSink + - Added Interface CosmosMongoDataTransferDataSourceSink - Added Interface CosmosSqlDataTransferDataSourceSink - Added Interface CreateJobRequest - Added Interface DataTransferDataSourceSink diff --git a/sdk/cosmosdb/arm-cosmosdb/_meta.json b/sdk/cosmosdb/arm-cosmosdb/_meta.json index e91c8b7472ae..b18d0fa4566c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/_meta.json +++ b/sdk/cosmosdb/arm-cosmosdb/_meta.json @@ -1,8 +1,8 @@ { - "commit": "35388d90dfe0dfb8ef0f43cecaf9dc960fbc917e", - "readme": "specification\\cosmos-db\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\cosmos-db\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.5.20221215.1 --generate-sample=true", + "commit": "db1186ad066d08f5a972ab7777cf05234a6f7dfc", + "readme": "specification/cosmos-db/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.3 --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.0-rc.5", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", "release_tool": "@azure-tools/js-sdk-release-tools@2.5.4", - "use": "@autorest/typescript@6.0.0-rc.5.20221215.1" + "use": "@autorest/typescript@6.0.0-rc.5" } \ No newline at end of file diff --git a/sdk/cosmosdb/arm-cosmosdb/package.json b/sdk/cosmosdb/arm-cosmosdb/package.json index bd3e8a70642c..15dd8ba9c294 100644 --- a/sdk/cosmosdb/arm-cosmosdb/package.json +++ b/sdk/cosmosdb/arm-cosmosdb/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for CosmosDBManagementClient.", - "version": "16.0.0-beta.6", + "version": "15.3.0-beta.1", "engines": { "node": ">=14.0.0" }, @@ -39,7 +39,6 @@ "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", - "dotenv": "^8.2.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^2.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -50,6 +49,7 @@ "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cosmosdb/arm-cosmosdb", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -110,14 +110,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" - } -} + "autoPublish": true +} \ 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 9150d92ae239..06b54b3b3cbb 100644 --- a/sdk/cosmosdb/arm-cosmosdb/review/arm-cosmosdb.api.md +++ b/sdk/cosmosdb/arm-cosmosdb/review/arm-cosmosdb.api.md @@ -1058,6 +1058,15 @@ export interface CosmosDBManagementClientOptionalParams extends coreClient.Servi endpoint?: string; } +// @public +export interface CosmosMongoDataTransferDataSourceSink extends DataTransferDataSourceSink { + // (undocumented) + collectionName: string; + component: "CosmosDBMongo"; + // (undocumented) + databaseName: string; +} + // @public export interface CosmosSqlDataTransferDataSourceSink extends DataTransferDataSourceSink { component: "CosmosDBSql"; @@ -1476,11 +1485,11 @@ export type DataTransferComponent = string; // @public export interface DataTransferDataSourceSink { - component: "CosmosDBCassandra" | "CosmosDBSql" | "AzureBlobStorage"; + component: "CosmosDBCassandra" | "CosmosDBMongo" | "CosmosDBSql" | "AzureBlobStorage"; } // @public (undocumented) -export type DataTransferDataSourceSinkUnion = DataTransferDataSourceSink | CosmosCassandraDataTransferDataSourceSink | CosmosSqlDataTransferDataSourceSink | AzureBlobDataTransferDataSourceSink; +export type DataTransferDataSourceSinkUnion = DataTransferDataSourceSink | CosmosCassandraDataTransferDataSourceSink | CosmosMongoDataTransferDataSourceSink | CosmosSqlDataTransferDataSourceSink | AzureBlobDataTransferDataSourceSink; // @public export interface DataTransferJobFeedResults { @@ -2113,6 +2122,7 @@ export enum KnownDatabaseAccountKind { export enum KnownDataTransferComponent { AzureBlobStorage = "AzureBlobStorage", CosmosDBCassandra = "CosmosDBCassandra", + CosmosDBMongo = "CosmosDBMongo", CosmosDBSql = "CosmosDBSql" } diff --git a/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts b/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts index ccf7c71bc380..7a6327d98b0c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts @@ -130,7 +130,7 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-cosmosdb/16.0.0-beta.6`; + const packageDetails = `azsdk-js-arm-cosmosdb/15.3.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts index 73a7babb64c5..926f3be485c0 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts @@ -15,6 +15,7 @@ export type BackupPolicyUnion = export type DataTransferDataSourceSinkUnion = | DataTransferDataSourceSink | CosmosCassandraDataTransferDataSourceSink + | CosmosMongoDataTransferDataSourceSink | CosmosSqlDataTransferDataSourceSink | AzureBlobDataTransferDataSourceSink; export type ServiceResourcePropertiesUnion = @@ -1454,7 +1455,11 @@ export interface DataTransferJobProperties { /** Base class for all DataTransfer source/sink */ export interface DataTransferDataSourceSink { /** Polymorphic discriminator, which specifies the different types this object can be */ - component: "CosmosDBCassandra" | "CosmosDBSql" | "AzureBlobStorage"; + component: + | "CosmosDBCassandra" + | "CosmosDBMongo" + | "CosmosDBSql" + | "AzureBlobStorage"; } /** The List operation response, that contains the Data Transfer jobs and their properties. */ @@ -3470,6 +3475,15 @@ export interface CosmosCassandraDataTransferDataSourceSink tableName: string; } +/** A CosmosDB Cassandra API data source/sink */ +export interface CosmosMongoDataTransferDataSourceSink + extends DataTransferDataSourceSink { + /** Polymorphic discriminator, which specifies the different types this object can be */ + component: "CosmosDBMongo"; + databaseName: string; + collectionName: string; +} + /** A CosmosDB Cassandra API data source/sink */ export interface CosmosSqlDataTransferDataSourceSink extends DataTransferDataSourceSink { @@ -4112,6 +4126,8 @@ export type BackupStorageRedundancy = string; export enum KnownDataTransferComponent { /** CosmosDBCassandra */ CosmosDBCassandra = "CosmosDBCassandra", + /** CosmosDBMongo */ + CosmosDBMongo = "CosmosDBMongo", /** CosmosDBSql */ CosmosDBSql = "CosmosDBSql", /** AzureBlobStorage */ @@ -4124,6 +4140,7 @@ export enum KnownDataTransferComponent { * this enum contains the known values that the service supports. * ### Known values supported by the service * **CosmosDBCassandra** \ + * **CosmosDBMongo** \ * **CosmosDBSql** \ * **AzureBlobStorage** */ diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts index 82efc1363bbd..8b8d6a28f487 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts @@ -8699,6 +8699,34 @@ export const CosmosCassandraDataTransferDataSourceSink: coreClient.CompositeMapp } }; +export const CosmosMongoDataTransferDataSourceSink: coreClient.CompositeMapper = { + serializedName: "CosmosDBMongo", + type: { + name: "Composite", + className: "CosmosMongoDataTransferDataSourceSink", + uberParent: "DataTransferDataSourceSink", + polymorphicDiscriminator: + DataTransferDataSourceSink.type.polymorphicDiscriminator, + modelProperties: { + ...DataTransferDataSourceSink.type.modelProperties, + databaseName: { + serializedName: "databaseName", + required: true, + type: { + name: "String" + } + }, + collectionName: { + serializedName: "collectionName", + required: true, + type: { + name: "String" + } + } + } + } +}; + export const CosmosSqlDataTransferDataSourceSink: coreClient.CompositeMapper = { serializedName: "CosmosDBSql", type: { @@ -8992,6 +9020,7 @@ export let discriminators = { "BackupPolicy.Periodic": PeriodicModeBackupPolicy, "BackupPolicy.Continuous": ContinuousModeBackupPolicy, "DataTransferDataSourceSink.CosmosDBCassandra": CosmosCassandraDataTransferDataSourceSink, + "DataTransferDataSourceSink.CosmosDBMongo": CosmosMongoDataTransferDataSourceSink, "DataTransferDataSourceSink.CosmosDBSql": CosmosSqlDataTransferDataSourceSink, "DataTransferDataSourceSink.AzureBlobStorage": AzureBlobDataTransferDataSourceSink, "ServiceResourceProperties.DataTransfer": DataTransferServiceResourceProperties, diff --git a/sdk/cosmosdb/arm-cosmosdb/test/sampleTest.ts b/sdk/cosmosdb/arm-cosmosdb/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /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"