From 4ae7ab49933ae3228ba086323930982adb1f47d2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 1 Aug 2022 02:02:48 +0000 Subject: [PATCH] CodeGen from PR 19723 in Azure/azure-rest-api-specs Compute update folder structure (#19723) * update folder structure * small errors and CI check * [Language Text] Update swagger titles (#19835) * [Language Text] Update swagger titles * edits * address feedback * Review request for Microsoft.ContainerService to add version 2022-06-01 (#19848) * Adds base for updating Microsoft.ContainerService from version stable/2022-04-01 to version 2022-06-01 * Updates readme * Updates API version in new specs and examples * update readmes (#19421) * Add key management service profile of a managed cluster for version 2022-06-01 (#19529) * Add NetworkPlugin none option to 2022-06-01 (#19510) * Add NetworkPlugin none option to 2022-06-01 * improve description for none value * Fix violated rule R4041 for 2022-06-01 managedCluster swagger (#19581) * remove useless directive * fix R4041 * GA AKS support for Dedicated Host Group (#19547) * GA AKS support for Dedicated Host Group * fit some format minor issue * add newline in end of files * Defender updates (#19665) * Defender updates * sample * remove old description Co-authored-by: Bin Xia Co-authored-by: Matt Stam Co-authored-by: Jianping Zeng Co-authored-by: Or Parnes * Update resources.json (#19861) * Pattts/predictive autoscale 20221001 (#19765) * Rev Autoscale API from 2021-05-01-preview to 2022-10-01. * Fix minor swagger issue. Default should be 'false' * Fix swagger validation error * Defining a new package 2022-10 * AutoscaleSettingResource now reference allOf 'resource' which is the actual autoscaleSetting resource definition * Fix require property issue * Run prettier against autoscale_API.json * [Maps - Render & Spatial Services] add v2022-08-01 (#19520) * copy old swagger to new folders * set api version to 2022-08-01 * apply api changes Co-authored-by: Gigi Grajo * update appconfiguration (#19330) * update appconfiguration * Update readme.python.md * Update readme.python.md * Update readme.python.md * Update readme.python.md * Update readme.python.md * Update readme.python.md * Update readme.python.md * [Hub Generated] Publish private branch 'main' (#19852) * Add StorageMover specification for PubliC Preview * SpellCheck fix * Update custom-words * Update specification/storagemover/resource-manager/readme.md Co-authored-by: Abhishek Krishna Co-authored-by: Dapeng Zhang * Merging Dynatrace swagger in stable folder (#19862) * Committing base swagger version * Removing preview tag from stable folder api version * Changing version name in all the files * Updating readme.go and readme.md files * [CDN] Fix customDomains property type in Endpoint (#19788) * [CDN] Fix customDomains property type in Endpoint * Fix linter error Co-authored-by: Bo Zhang * Adding Microsoft.Sql AdvancedThreatProtectionSettings APIs for MI on v5 tag for 2022-02-01-preview (#19866) * update folders * [Hub Generated] Review request for Microsoft.KeyVault to add version stable/7.3 (#19844) * Update description of exportable attribute and release_policy.data * Remove submodule azure-reset-api-specs * Fix description for exportable Co-authored-by: Sunny Solanki * Add latest StorageMover updates (#19876) * Add StorageMover specification for PubliC Preview * SpellCheck fix * Update custom-words * Update specification/storagemover/resource-manager/readme.md * Add latest StorageMover updates Co-authored-by: Abhishek Krishna Co-authored-by: Dapeng Zhang * Update readme.python.md (#19899) * Update readme.python.md * Update readme.md * Moving files from azure-rest-spec-pr to azure-rest-spec repo after api review (#19878) * Moving files from azure-rest-spec-pr to azure-rest-spec repo after api review * Add known words * Removed static IP allocation only from examples (#19858) * Removed static IP allocation * Removed static only from examples Co-authored-by: Arpit Gagneja * Update securityinsights readme.python (#19903) * update securityinsights readme.python * Update readme.python.md Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) * fix lint errors in Synapse trigger.json (#19660) * put json files into RP folders * update readme * Add CONTRIBUTING.md (#19257) * Add CONTRIBUTING.md * Apply suggestions from PR review Co-authored-by: Heath Stewart * Apply suggestions from PR review Co-authored-by: Weidong Xu * Regen toc for CONTRIBUTING.md * Address PR review comments * Address PR review comments Co-authored-by: Heath Stewart Co-authored-by: Weidong Xu * fix devcenter readme.go.md config (#19906) * fix readme.go.md config * rename to SkuInfo * add annotation for labservices (#19884) * add to description of OS state (#19764) * [Hub Generated] Review request for Microsoft.KeyVault to add version preview/2021-06-01-preview (#19767) * Updated the managed hsm resource manager spec to include two additional properties for private endpoint connection item * Update managed hsm private endpoint connection item in mhsm spec for latest api version * Address LRO_RESPONSE_HEADER violation for managed hsm Long running operations that are annotated with x-ms-long-running-operation:true must return location header or azure-AsyncOperation in response. Added the missing location header for managed hsm update command as well as to the corresponding examples. * [Microsoft.DeviceUpdate] Adding first stable API version (#19846) * Copied the most recent preview version into the first stable version * Updated api version in new stable version, added the tag to readme.md * Fixed typo * Fixed the wrong path in readme.md * Reverted VS Code automatic breaking change * Fix broken link (#19688) * add aadObjectId property to kustoPool (#19856) Co-authored-by: Amit Elran * Updata securityinsights readme.python (#19917) * update securityinsights readme.python * update readme.python Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) * modify readme.typescripy.md for compute package (#19607) Co-authored-by: ZiWei Chen (WICRESOFT NORTH AMERICA LTD) * Dev gubalasu frontdoor microsoft.network 2021 06 01 (#19578) * Adds base for updating Microsoft.Network from version stable/2020-05-01 to version 2021-06-01 * Updates readme * Updates API version in new specs and examples * update waf configs and examples from 2020-11-01 * Update api version in new specs and examples * Migration api update * Update readme * Fix readme * update readme * Fix readme again * Fix readme * Fix readme * update waf policy provisioning state * Update securityinsights readme.python (#19923) * update securityinsights readme.python * update readme.python * last modify * Update readme.python.md Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) * sync with changes made to master * update folder structure * small errors and CI check * update folders * put json files into RP folders * update readme * resolve capitalization and number misplacement accident Co-authored-by: Theodore Chang Co-authored-by: Deyaaeldeen Almahallawi Co-authored-by: FumingZhang <81607949+FumingZhang@users.noreply.github.com> Co-authored-by: Bin Xia Co-authored-by: Matt Stam Co-authored-by: Jianping Zeng Co-authored-by: Or Parnes Co-authored-by: Alexander Batishchev Co-authored-by: PatrickTseng Co-authored-by: gigi <52640944+gigigoo0@users.noreply.github.com> Co-authored-by: Gigi Grajo Co-authored-by: zhenbiao wei <424401670@qq.com> Co-authored-by: Abhishek Krishna Co-authored-by: Abhishek Krishna Co-authored-by: Dapeng Zhang Co-authored-by: Divyansh Agarwal <83802474+divyansh3131@users.noreply.github.com> Co-authored-by: t-bzhan <61817681+t-bzhan@users.noreply.github.com> Co-authored-by: Bo Zhang Co-authored-by: Uriel Cohen Co-authored-by: susolank <73919400+susolank@users.noreply.github.com> Co-authored-by: Sunny Solanki Co-authored-by: Ralf Beckers Co-authored-by: arpit-gagneja Co-authored-by: Arpit Gagneja Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) Co-authored-by: YanjunGao <85206987+yanjungao718@users.noreply.github.com> Co-authored-by: Mike Kistler Co-authored-by: Heath Stewart Co-authored-by: Weidong Xu Co-authored-by: Jiahui Peng <46921893+Alancere@users.noreply.github.com> Co-authored-by: j-zhong-ms <107880703+j-zhong-ms@users.noreply.github.com> Co-authored-by: Tom FitzMacken Co-authored-by: neeerajaakula <81248992+neeerajaakula@users.noreply.github.com> Co-authored-by: darkoa-msft <61987922+darkoa-msft@users.noreply.github.com> Co-authored-by: Roy Wellington <53838718+roy-work@users.noreply.github.com> Co-authored-by: Amit Elran Co-authored-by: Amit Elran Co-authored-by: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Co-authored-by: ZiWei Chen (WICRESOFT NORTH AMERICA LTD) Co-authored-by: gubalasu <59630928+gubalasu@users.noreply.github.com> --- sdk/compute/arm-compute/_meta.json | 6 +- sdk/compute/arm-compute/package.json | 15 +-- .../arm-compute/review/arm-compute.api.md | 2 +- .../src/computeManagementClient.ts | 3 + sdk/compute/arm-compute/src/models/index.ts | 48 ++++---- sdk/compute/arm-compute/src/models/mappers.ts | 107 +++++++++--------- sdk/compute/arm-compute/test/sampleTest.ts | 43 +++++++ sdk/compute/arm-compute/tsconfig.json | 10 +- 8 files changed, 133 insertions(+), 101 deletions(-) create mode 100644 sdk/compute/arm-compute/test/sampleTest.ts diff --git a/sdk/compute/arm-compute/_meta.json b/sdk/compute/arm-compute/_meta.json index e0d49b3045bdb..5823c6cbe71b4 100644 --- a/sdk/compute/arm-compute/_meta.json +++ b/sdk/compute/arm-compute/_meta.json @@ -1,8 +1,8 @@ { - "commit": "fda2db441da3f1fab31bb235e97da3e33c8e3903", + "commit": "2dcad6d6e9a96882eb6d317e7500a94be007a9c6", "readme": "specification/compute/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:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\compute\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1 --generate-sample=true", + "autorest_command": "", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.3.2", + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.1", "use": "@autorest/typescript@6.0.0-rc.1" } \ No newline at end of file diff --git a/sdk/compute/arm-compute/package.json b/sdk/compute/arm-compute/package.json index be47957c6a14b..3f8275579c8bc 100644 --- a/sdk/compute/arm-compute/package.json +++ b/sdk/compute/arm-compute/package.json @@ -46,8 +46,7 @@ "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", - "@azure/dev-tool": "^1.0.0", - "@azure/arm-network": "^26.0.0" + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute", "repository": { @@ -110,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-compute?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/compute/arm-compute/review/arm-compute.api.md b/sdk/compute/arm-compute/review/arm-compute.api.md index 700a1f1cbb7eb..6064cf81fa01c 100644 --- a/sdk/compute/arm-compute/review/arm-compute.api.md +++ b/sdk/compute/arm-compute/review/arm-compute.api.md @@ -4992,7 +4992,7 @@ export interface ShareInfoElement { // @public export interface SharingProfile { - communityGalleryInfo?: any; + communityGalleryInfo?: CommunityGalleryInfo; readonly groups?: SharingProfileGroup[]; permissions?: GallerySharingPermissionTypes; } diff --git a/sdk/compute/arm-compute/src/computeManagementClient.ts b/sdk/compute/arm-compute/src/computeManagementClient.ts index fcad09ae3ed1f..d404a5244213a 100644 --- a/sdk/compute/arm-compute/src/computeManagementClient.ts +++ b/sdk/compute/arm-compute/src/computeManagementClient.ts @@ -151,6 +151,9 @@ export class ComputeManagementClient extends coreClient.ServiceClient { ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } const optionsWithDefaults = { ...defaults, ...options, diff --git a/sdk/compute/arm-compute/src/models/index.ts b/sdk/compute/arm-compute/src/models/index.ts index 8d5fc8a46e68d..262b8f19c426e 100644 --- a/sdk/compute/arm-compute/src/models/index.ts +++ b/sdk/compute/arm-compute/src/models/index.ts @@ -3221,7 +3221,7 @@ export interface SharingProfile { */ readonly groups?: SharingProfileGroup[]; /** Information of community gallery if current gallery is shared to community. */ - communityGalleryInfo?: any; + communityGalleryInfo?: CommunityGalleryInfo; } /** Group of the gallery sharing profile */ @@ -3232,6 +3232,28 @@ export interface SharingProfileGroup { ids?: string[]; } +/** Information of community gallery if current gallery is shared to community */ +export interface CommunityGalleryInfo { + /** The link to the publisher website. Visible to all users. */ + publisherUri?: string; + /** Community gallery publisher support email. The email address of the publisher. Visible to all users. */ + publisherContact?: string; + /** End-user license agreement for community gallery image. */ + eula?: string; + /** The prefix of the gallery name that will be displayed publicly. Visible to all users. */ + publicNamePrefix?: string; + /** + * Contains info about whether community gallery sharing is enabled. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly communityGalleryEnabled?: boolean; + /** + * Community gallery public name list. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly publicNames?: string[]; +} + /** Contains information about the soft deletion policy of the gallery. */ export interface SoftDeletePolicy { /** Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time. */ @@ -4275,28 +4297,6 @@ export interface OSFamilyListResult { nextLink?: string; } -/** Information of community gallery if current gallery is shared to community */ -export interface CommunityGalleryInfo { - /** The link to the publisher website. Visible to all users. */ - publisherUri?: string; - /** Community gallery publisher support email. The email address of the publisher. Visible to all users. */ - publisherContact?: string; - /** End-user license agreement for community gallery image. */ - eula?: string; - /** The prefix of the gallery name that will be displayed publicly. Visible to all users. */ - publicNamePrefix?: string; - /** - * Contains info about whether community gallery sharing is enabled. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly communityGalleryEnabled?: boolean; - /** - * Community gallery public name list. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly publicNames?: string[]; -} - /** The source image from which the Image Version is going to be created. */ export interface GalleryArtifactSource { /** The managed artifact. */ @@ -5860,7 +5860,7 @@ export interface DedicatedHostInstanceViewWithName export interface ImageOSDisk extends ImageDisk { /** This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image.

Possible values are:

**Windows**

**Linux** */ osType: OperatingSystemTypes; - /** The OS State. */ + /** The OS State. For managed images, use Generalized. */ osState: OperatingSystemStateTypes; } diff --git a/sdk/compute/arm-compute/src/models/mappers.ts b/sdk/compute/arm-compute/src/models/mappers.ts index 36e07b6457b79..23d09c856a2c7 100644 --- a/sdk/compute/arm-compute/src/models/mappers.ts +++ b/sdk/compute/arm-compute/src/models/mappers.ts @@ -8374,7 +8374,8 @@ export const SharingProfile: coreClient.CompositeMapper = { communityGalleryInfo: { serializedName: "communityGalleryInfo", type: { - name: "any" + name: "Composite", + className: "CommunityGalleryInfo" } } } @@ -8407,6 +8408,58 @@ export const SharingProfileGroup: coreClient.CompositeMapper = { } }; +export const CommunityGalleryInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CommunityGalleryInfo", + modelProperties: { + publisherUri: { + serializedName: "publisherUri", + type: { + name: "String" + } + }, + publisherContact: { + serializedName: "publisherContact", + type: { + name: "String" + } + }, + eula: { + serializedName: "eula", + type: { + name: "String" + } + }, + publicNamePrefix: { + serializedName: "publicNamePrefix", + type: { + name: "String" + } + }, + communityGalleryEnabled: { + serializedName: "communityGalleryEnabled", + readOnly: true, + type: { + name: "Boolean" + } + }, + publicNames: { + serializedName: "publicNames", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + export const SoftDeletePolicy: coreClient.CompositeMapper = { type: { name: "Composite", @@ -10923,58 +10976,6 @@ export const OSFamilyListResult: coreClient.CompositeMapper = { } }; -export const CommunityGalleryInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CommunityGalleryInfo", - modelProperties: { - publisherUri: { - serializedName: "publisherUri", - type: { - name: "String" - } - }, - publisherContact: { - serializedName: "publisherContact", - type: { - name: "String" - } - }, - eula: { - serializedName: "eula", - type: { - name: "String" - } - }, - publicNamePrefix: { - serializedName: "publicNamePrefix", - type: { - name: "String" - } - }, - communityGalleryEnabled: { - serializedName: "communityGalleryEnabled", - readOnly: true, - type: { - name: "Boolean" - } - }, - publicNames: { - serializedName: "publicNames", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - export const GalleryArtifactSource: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/compute/arm-compute/test/sampleTest.ts b/sdk/compute/arm-compute/test/sampleTest.ts new file mode 100644 index 0000000000000..25aeb3ebcc367 --- /dev/null +++ b/sdk/compute/arm-compute/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/compute/arm-compute/tsconfig.json b/sdk/compute/arm-compute/tsconfig.json index b84abc8423abf..3e6ae96443f33 100644 --- a/sdk/compute/arm-compute/tsconfig.json +++ b/sdk/compute/arm-compute/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-compute": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"