From 1bb0cc9d95b222ed25762fa95be168a1d3c6dc16 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 16 Aug 2023 03:08:37 +0000 Subject: [PATCH] CodeGen from PR 25320 in Azure/azure-rest-api-specs Merge 76beafbe96c121f2560e476036650eeb889a21a5 into 895c9c994480fb8e9d34b0d1973d57717ab0c979 --- common/config/rush/pnpm-lock.yaml | 11 +++-- sdk/iothub/arm-iothub/CHANGELOG.md | 37 ++-------------- sdk/iothub/arm-iothub/_meta.json | 8 ++-- sdk/iothub/arm-iothub/package.json | 17 +++----- .../arm-iothub/review/arm-iothub.api.md | 4 +- sdk/iothub/arm-iothub/src/iotHubClient.ts | 2 +- sdk/iothub/arm-iothub/src/models/index.ts | 20 ++++----- sdk/iothub/arm-iothub/src/models/mappers.ts | 8 ++-- .../arm-iothub/src/models/parameters.ts | 2 +- sdk/iothub/arm-iothub/test/sampleTest.ts | 43 +++++++++++++++++++ sdk/iothub/arm-iothub/tsconfig.json | 10 +---- 11 files changed, 82 insertions(+), 80 deletions(-) create mode 100644 sdk/iothub/arm-iothub/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 54f1a1847991..801c0f467601 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4132,7 +4132,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.3.0-dev.20230811 + typescript: 5.3.0-dev.20230815 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8717,8 +8717,8 @@ packages: hasBin: true dev: false - /typescript/5.3.0-dev.20230811: - resolution: {integrity: sha512-C4bwx7ZpBwX7bKxrrNl+M1j8yNGmwQ5M58X0mT4VYI1+FHqRvb/uJ4F1uJsVJ+X7iy22iXSICR/Vxnpc1gNk7w==} + /typescript/5.3.0-dev.20230815: + resolution: {integrity: sha512-AB4arWte1oMsTpFUSnkhgLOzWRR6SLMtQ4WjDl+I0mDC3nh0UH5SEJtwjSt7lYIg/xylgXduCFEDoM1Vvv3uPg==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -12659,7 +12659,7 @@ packages: dev: false file:projects/arm-iothub.tgz: - resolution: {integrity: sha512-dqVp/cNWQcLDxLIOrQMaVaCzU1mmbba82eB95Oi6RcKtTdBT3h60IqDD8kWhpoQpgclpssbWIO+XhNUOWWrZ2Q==, tarball: file:projects/arm-iothub.tgz} + resolution: {integrity: sha512-ebXUh3NTS3XnhBot1LGjHqmVMIgLuJqC6CTOBpyd6gu1plGePRPKnCNRnrUF+BHxYrV5qNBbDfIvM8CCP+QsWQ==, tarball: file:projects/arm-iothub.tgz} name: '@rush-temp/arm-iothub' version: 0.0.0 dependencies: @@ -12679,10 +12679,13 @@ packages: rimraf: 3.0.2 rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_dmbj5memikchm63lpeyt6ukdau + ts-node: 10.9.1_n7tz6hmpirns3flqdptizaxofa tslib: 2.6.1 typescript: 5.0.4 uglify-js: 3.17.4 transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' - supports-color dev: false diff --git a/sdk/iothub/arm-iothub/CHANGELOG.md b/sdk/iothub/arm-iothub/CHANGELOG.md index 293f55c5dd38..d24009836fb2 100644 --- a/sdk/iothub/arm-iothub/CHANGELOG.md +++ b/sdk/iothub/arm-iothub/CHANGELOG.md @@ -1,16 +1,6 @@ # Release History - -## 6.3.0-beta.3 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 6.3.0-beta.2 (2023-04-06) + +## 6.3.0-beta.3 (2023-08-16) **Features** @@ -30,35 +20,14 @@ - Interface IotHubProperties has a new optional parameter encryption - Interface IotHubProperties has a new optional parameter ipVersion - Interface IotHubProperties has a new optional parameter rootCertificate - - Interface RoutingEndpoints has a new optional parameter cosmosDBSqlCollections + - Interface RoutingEndpoints has a new optional parameter cosmosDBSqlContainers - Add parameters of IotHubResourceUpdateHeaders to TypeAlias IotHubResourceUpdateResponse - Added Enum KnownIpVersion - Enum KnownRoutingSource has a new value DigitalTwinChangeEvents - Enum KnownRoutingSource has a new value MqttBrokerMessages - Added function getContinuationToken -## 6.3.0-beta.1 (2022-12-06) -**Features** - - - Added Interface EncryptionPropertiesDescription - - Added Interface IotHubPropertiesDeviceStreams - - Added Interface IotHubResourceCreateOrUpdateHeaders - - Added Interface IotHubResourceDeleteHeaders - - Added Interface IotHubResourceUpdateHeaders - - Added Interface KeyVaultKeyProperties - - Added Interface PrivateEndpointConnectionsDeleteHeaders - - Added Interface PrivateEndpointConnectionsUpdateHeaders - - Added Interface RootCertificateProperties - - Added Interface RoutingCosmosDBSqlApiProperties - - Interface IotHubProperties has a new optional parameter deviceStreams - - Interface IotHubProperties has a new optional parameter encryption - - Interface IotHubProperties has a new optional parameter rootCertificate - - Interface RoutingEndpoints has a new optional parameter cosmosDBSqlCollections - - Add parameters of IotHubResourceUpdateHeaders to TypeAlias IotHubResourceUpdateResponse - - Enum KnownRoutingSource has a new value DigitalTwinChangeEvents - - Enum KnownRoutingSource has a new value MqttBrokerMessages - ## 6.2.0 (2022-08-18) **Features** diff --git a/sdk/iothub/arm-iothub/_meta.json b/sdk/iothub/arm-iothub/_meta.json index 1e882c7219fc..3c0d1f4c2168 100644 --- a/sdk/iothub/arm-iothub/_meta.json +++ b/sdk/iothub/arm-iothub/_meta.json @@ -1,8 +1,8 @@ { - "commit": "8725e0700974d2c8cba436b5696728ebc5a80f1b", + "commit": "bcddb87efe7168f472d73482e1185881857be47e", "readme": "specification/iothub/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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\iothub\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.10 --generate-sample=true", + "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/iothub/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.0-rc.10" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.1", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/iothub/arm-iothub/package.json b/sdk/iothub/arm-iothub/package.json index ec25a06e7f49..3e54cf0b0c76 100644 --- a/sdk/iothub/arm-iothub/package.json +++ b/sdk/iothub/arm-iothub/package.json @@ -8,12 +8,12 @@ "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.0", + "@azure/core-lro": "^2.5.4", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -48,6 +48,7 @@ "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^14.0.0", + "ts-node": "^10.0.0", "@azure/dev-tool": "^1.0.0" }, "repository": { @@ -111,13 +112,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/iothub/arm-iothub", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-iothub?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/iothub/arm-iothub" +} \ No newline at end of file diff --git a/sdk/iothub/arm-iothub/review/arm-iothub.api.md b/sdk/iothub/arm-iothub/review/arm-iothub.api.md index 29147d26aee1..daabf07cad6f 100644 --- a/sdk/iothub/arm-iothub/review/arm-iothub.api.md +++ b/sdk/iothub/arm-iothub/review/arm-iothub.api.md @@ -1170,7 +1170,7 @@ export interface RouteProperties { // @public export interface RoutingCosmosDBSqlApiProperties { authenticationType?: AuthenticationType; - collectionName: string; + containerName: string; databaseName: string; endpointUri: string; id?: string; @@ -1186,7 +1186,7 @@ export interface RoutingCosmosDBSqlApiProperties { // @public export interface RoutingEndpoints { - cosmosDBSqlCollections?: RoutingCosmosDBSqlApiProperties[]; + cosmosDBSqlContainers?: RoutingCosmosDBSqlApiProperties[]; eventHubs?: RoutingEventHubProperties[]; serviceBusQueues?: RoutingServiceBusQueueEndpointProperties[]; serviceBusTopics?: RoutingServiceBusTopicEndpointProperties[]; diff --git a/sdk/iothub/arm-iothub/src/iotHubClient.ts b/sdk/iothub/arm-iothub/src/iotHubClient.ts index aaee6c74ba97..7fa3eae9617c 100644 --- a/sdk/iothub/arm-iothub/src/iotHubClient.ts +++ b/sdk/iothub/arm-iothub/src/iotHubClient.ts @@ -119,7 +119,7 @@ export class IotHubClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-11-15-preview"; + this.apiVersion = options.apiVersion || "2023-06-30-preview"; this.operations = new OperationsImpl(this); this.iotHubResource = new IotHubResourceImpl(this); this.resourceProviderCommon = new ResourceProviderCommonImpl(this); diff --git a/sdk/iothub/arm-iothub/src/models/index.ts b/sdk/iothub/arm-iothub/src/models/index.ts index 5c59657a2c22..2a76cb857e01 100644 --- a/sdk/iothub/arm-iothub/src/models/index.ts +++ b/sdk/iothub/arm-iothub/src/models/index.ts @@ -288,8 +288,8 @@ export interface RoutingEndpoints { eventHubs?: RoutingEventHubProperties[]; /** The list of storage container endpoints that IoT hub routes messages to, based on the routing rules. */ storageContainers?: RoutingStorageContainerProperties[]; - /** The list of Cosmos DB collection endpoints that IoT hub routes messages to, based on the routing rules. */ - cosmosDBSqlCollections?: RoutingCosmosDBSqlApiProperties[]; + /** The list of Cosmos DB container endpoints that IoT hub routes messages to, based on the routing rules. */ + cosmosDBSqlContainers?: RoutingCosmosDBSqlApiProperties[]; } /** The properties related to service bus queue endpoint types. */ @@ -394,11 +394,11 @@ export interface RoutingStorageContainerProperties { encoding?: RoutingStorageContainerPropertiesEncoding; } -/** The properties related to a cosmos DB sql collection endpoint. */ +/** The properties related to a cosmos DB sql container endpoint. */ export interface RoutingCosmosDBSqlApiProperties { /** The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. */ name: string; - /** Id of the cosmos DB sql collection endpoint */ + /** Id of the cosmos DB sql container endpoint */ id?: string; /** The subscription identifier of the cosmos DB account. */ subscriptionId?: string; @@ -406,9 +406,9 @@ export interface RoutingCosmosDBSqlApiProperties { resourceGroup?: string; /** The url of the cosmos DB account. It must include the protocol https:// */ endpointUri: string; - /** Method used to authenticate against the cosmos DB sql collection endpoint */ + /** Method used to authenticate against the cosmos DB sql container endpoint */ authenticationType?: AuthenticationType; - /** Managed identity properties of routing cosmos DB collection endpoint. */ + /** Managed identity properties of routing cosmos DB container endpoint. */ identity?: ManagedIdentity; /** The primary key of the cosmos DB account. */ primaryKey?: string; @@ -416,11 +416,11 @@ export interface RoutingCosmosDBSqlApiProperties { secondaryKey?: string; /** The name of the cosmos DB database in the cosmos DB account. */ databaseName: string; - /** The name of the cosmos DB sql collection in the cosmos DB database. */ - collectionName: string; - /** The name of the partition key associated with this cosmos DB sql collection if one exists. This is an optional parameter. */ + /** The name of the cosmos DB sql container in the cosmos DB database. */ + containerName: string; + /** The name of the partition key associated with this cosmos DB sql container if one exists. This is an optional parameter. */ partitionKeyName?: string; - /** The template for generating a synthetic partition key value for use with this cosmos DB sql collection. The template must include at least one of the following placeholders: {iothub}, {deviceid}, {DD}, {MM}, and {YYYY}. Any one placeholder may be specified at most once, but order and non-placeholder components are arbitrary. This parameter is only required if PartitionKeyName is specified. */ + /** The template for generating a synthetic partition key value for use with this cosmos DB sql container. The template must include at least one of the following placeholders: {iothub}, {deviceid}, {DD}, {MM}, and {YYYY}. Any one placeholder may be specified at most once, but order and non-placeholder components are arbitrary. This parameter is only required if PartitionKeyName is specified. */ partitionKeyTemplate?: string; } diff --git a/sdk/iothub/arm-iothub/src/models/mappers.ts b/sdk/iothub/arm-iothub/src/models/mappers.ts index fc4b3e46909f..edf668d0f796 100644 --- a/sdk/iothub/arm-iothub/src/models/mappers.ts +++ b/sdk/iothub/arm-iothub/src/models/mappers.ts @@ -763,8 +763,8 @@ export const RoutingEndpoints: coreClient.CompositeMapper = { } } }, - cosmosDBSqlCollections: { - serializedName: "cosmosDBSqlCollections", + cosmosDBSqlContainers: { + serializedName: "cosmosDBSqlContainers", type: { name: "Sequence", element: { @@ -1171,8 +1171,8 @@ export const RoutingCosmosDBSqlApiProperties: coreClient.CompositeMapper = { name: "String" } }, - collectionName: { - serializedName: "collectionName", + containerName: { + serializedName: "containerName", required: true, type: { name: "String" diff --git a/sdk/iothub/arm-iothub/src/models/parameters.ts b/sdk/iothub/arm-iothub/src/models/parameters.ts index efd0f67a1123..5ad03474fe67 100644 --- a/sdk/iothub/arm-iothub/src/models/parameters.ts +++ b/sdk/iothub/arm-iothub/src/models/parameters.ts @@ -53,7 +53,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-11-15-preview", + defaultValue: "2023-06-30-preview", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/iothub/arm-iothub/test/sampleTest.ts b/sdk/iothub/arm-iothub/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/iothub/arm-iothub/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/iothub/arm-iothub/tsconfig.json b/sdk/iothub/arm-iothub/tsconfig.json index 651a71da11eb..3e6ae96443f3 100644 --- a/sdk/iothub/arm-iothub/tsconfig.json +++ b/sdk/iothub/arm-iothub/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-iothub": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"