From 04fed916012f4c2dfcaf3081d7260d5d798496f5 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 11 Mar 2022 07:31:11 +0000 Subject: [PATCH] CodeGen from PR 18179 in Azure/azure-rest-api-specs Merge 32a02bdb34d532d5b284667e4b45d51fa43dfe14 into e14d80ab3f3630e8640ccd3b01e5ec9df647dc73 --- sdk/iothub/arm-iothub/README.md | 2 +- sdk/iothub/arm-iothub/_meta.json | 7 ++-- sdk/iothub/arm-iothub/package.json | 20 +--------- sdk/iothub/arm-iothub/src/iotHubClient.ts | 2 +- sdk/iothub/arm-iothub/test/sampleTest.ts | 48 +++++++++++++++++++++++ sdk/iothub/arm-iothub/tsconfig.json | 7 +--- sdk/iothub/ci.mgmt.yml | 2 + 7 files changed, 59 insertions(+), 29 deletions(-) create mode 100644 sdk/iothub/arm-iothub/test/sampleTest.ts diff --git a/sdk/iothub/arm-iothub/README.md b/sdk/iothub/arm-iothub/README.md index 81af5383d079..27ce6ea23df1 100644 --- a/sdk/iothub/arm-iothub/README.md +++ b/sdk/iothub/arm-iothub/README.md @@ -6,7 +6,7 @@ Use this API to manage the IoT hubs in your Azure subscription. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/iothub/arm-iothub) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-iothub) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-iothub) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-iothub?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/iothub/arm-iothub/_meta.json b/sdk/iothub/arm-iothub/_meta.json index b0805ebbd492..9e47d1b52cd0 100644 --- a/sdk/iothub/arm-iothub/_meta.json +++ b/sdk/iothub/arm-iothub/_meta.json @@ -1,7 +1,8 @@ { - "commit": "5b02f0befa6eaaaf93afc11274795c651e6e3c0c", + "commit": "76117c6d52cd33ab3f78441f8a002db95281589e", "readme": "specification/iothub/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/iothub/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220128.1 --generate-sample=true", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/iothub/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "use": "@autorest/typescript@6.0.0-alpha.16.20220128.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.1.1", + "use": "@autorest/typescript@6.0.0-alpha.16.20220105.1" } \ No newline at end of file diff --git a/sdk/iothub/arm-iothub/package.json b/sdk/iothub/arm-iothub/package.json index c40a59456074..5d2720480a91 100644 --- a/sdk/iothub/arm-iothub/package.json +++ b/sdk/iothub/arm-iothub/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for IotHubClient.", - "version": "6.1.0", + "version": "1.0.0-beta.1", "engines": { "node": ">=12.0.0" }, @@ -98,21 +98,5 @@ "docs": "echo skipped" }, "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/iotHubClient.ts", - "prefix": "packageDetails" - } - ] - }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-iothub?view=azure-node-preview" - } + "autoPublish": true } \ No newline at end of file diff --git a/sdk/iothub/arm-iothub/src/iotHubClient.ts b/sdk/iothub/arm-iothub/src/iotHubClient.ts index 11051ed65934..c4a05c25f77c 100644 --- a/sdk/iothub/arm-iothub/src/iotHubClient.ts +++ b/sdk/iothub/arm-iothub/src/iotHubClient.ts @@ -60,7 +60,7 @@ export class IotHubClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-iothub/6.1.0`; + const packageDetails = `azsdk-js-arm-iothub/1.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/iothub/arm-iothub/test/sampleTest.ts b/sdk/iothub/arm-iothub/test/sampleTest.ts new file mode 100644 index 000000000000..7ed89b043e1b --- /dev/null +++ b/sdk/iothub/arm-iothub/test/sampleTest.ts @@ -0,0 +1,48 @@ +/* + * 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 { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import * as assert from "assert"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + 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" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ) + ], + queryParametersToSkip: [] +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = record(this, recorderEnvSetup); + }); + + 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 a89ae98f4120..3e6ae96443f3 100644 --- a/sdk/iothub/arm-iothub/tsconfig.json +++ b/sdk/iothub/arm-iothub/tsconfig.json @@ -15,12 +15,7 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-iothub": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", diff --git a/sdk/iothub/ci.mgmt.yml b/sdk/iothub/ci.mgmt.yml index d880276af560..656e83c5955a 100644 --- a/sdk/iothub/ci.mgmt.yml +++ b/sdk/iothub/ci.mgmt.yml @@ -11,6 +11,7 @@ trigger: - sdk/iothub/ci.mgmt.yml - sdk/iothub/arm-iothub/ - sdk/iothub/arm-iothub-profile-2020-09-01-hybrid + - sdk/iothub/arm-iothub pr: branches: include: @@ -25,6 +26,7 @@ pr: - sdk/iothub/ci.mgmt.yml - sdk/iothub/arm-iothub/ - sdk/iothub/arm-iothub-profile-2020-09-01-hybrid + - sdk/iothub/arm-iothub extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: