Skip to content

Commit 30256e7

Browse files
author
SDKAuto
committed
CodeGen from PR 20103 in Azure/azure-rest-api-specs
Merge da2ba759acb6bc1c01ef3b80c396a6da5603a055 into 6f0c7d58c0a923917c2b3467ee756f21dbd2f8e2
1 parent e561bcb commit 30256e7

File tree

8 files changed

+133
-101
lines changed

8 files changed

+133
-101
lines changed

sdk/compute/arm-compute/_meta.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"commit": "fda2db441da3f1fab31bb235e97da3e33c8e3903",
2+
"commit": "f70ac60ffff09732e98a5b1d9dbb1c3f1baab9b9",
33
"readme": "specification/compute/resource-manager/readme.md",
4-
"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/[email protected] --generate-sample=true",
4+
"autorest_command": "",
55
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
6-
"release_tool": "@azure-tools/js-sdk-release-tools@2.3.2",
6+
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.1",
77
"use": "@autorest/[email protected]"
88
}

sdk/compute/arm-compute/package.json

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646
"@types/chai": "^4.2.8",
4747
"chai": "^4.2.0",
4848
"cross-env": "^7.0.2",
49-
"@azure/dev-tool": "^1.0.0",
50-
"@azure/arm-network": "^26.0.0"
49+
"@azure/dev-tool": "^1.0.0"
5150
},
5251
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute",
5352
"repository": {
@@ -110,13 +109,5 @@
110109
}
111110
]
112111
},
113-
"autoPublish": true,
114-
"//sampleConfiguration": {
115-
"productName": "",
116-
"productSlugs": [
117-
"azure"
118-
],
119-
"disableDocsMs": true,
120-
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-compute?view=azure-node-preview"
121-
}
122-
}
112+
"autoPublish": true
113+
}

sdk/compute/arm-compute/review/arm-compute.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4992,7 +4992,7 @@ export interface ShareInfoElement {
49924992

49934993
// @public
49944994
export interface SharingProfile {
4995-
communityGalleryInfo?: any;
4995+
communityGalleryInfo?: CommunityGalleryInfo;
49964996
readonly groups?: SharingProfileGroup[];
49974997
permissions?: GallerySharingPermissionTypes;
49984998
}

sdk/compute/arm-compute/src/computeManagementClient.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ export class ComputeManagementClient extends coreClient.ServiceClient {
151151
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
152152
: `${packageDetails}`;
153153

154+
if (!options.credentialScopes) {
155+
options.credentialScopes = ["https://management.azure.com/.default"];
156+
}
154157
const optionsWithDefaults = {
155158
...defaults,
156159
...options,

sdk/compute/arm-compute/src/models/index.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3221,7 +3221,7 @@ export interface SharingProfile {
32213221
*/
32223222
readonly groups?: SharingProfileGroup[];
32233223
/** Information of community gallery if current gallery is shared to community. */
3224-
communityGalleryInfo?: any;
3224+
communityGalleryInfo?: CommunityGalleryInfo;
32253225
}
32263226

32273227
/** Group of the gallery sharing profile */
@@ -3232,6 +3232,28 @@ export interface SharingProfileGroup {
32323232
ids?: string[];
32333233
}
32343234

3235+
/** Information of community gallery if current gallery is shared to community */
3236+
export interface CommunityGalleryInfo {
3237+
/** The link to the publisher website. Visible to all users. */
3238+
publisherUri?: string;
3239+
/** Community gallery publisher support email. The email address of the publisher. Visible to all users. */
3240+
publisherContact?: string;
3241+
/** End-user license agreement for community gallery image. */
3242+
eula?: string;
3243+
/** The prefix of the gallery name that will be displayed publicly. Visible to all users. */
3244+
publicNamePrefix?: string;
3245+
/**
3246+
* Contains info about whether community gallery sharing is enabled.
3247+
* NOTE: This property will not be serialized. It can only be populated by the server.
3248+
*/
3249+
readonly communityGalleryEnabled?: boolean;
3250+
/**
3251+
* Community gallery public name list.
3252+
* NOTE: This property will not be serialized. It can only be populated by the server.
3253+
*/
3254+
readonly publicNames?: string[];
3255+
}
3256+
32353257
/** Contains information about the soft deletion policy of the gallery. */
32363258
export interface SoftDeletePolicy {
32373259
/** Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time. */
@@ -4275,28 +4297,6 @@ export interface OSFamilyListResult {
42754297
nextLink?: string;
42764298
}
42774299

4278-
/** Information of community gallery if current gallery is shared to community */
4279-
export interface CommunityGalleryInfo {
4280-
/** The link to the publisher website. Visible to all users. */
4281-
publisherUri?: string;
4282-
/** Community gallery publisher support email. The email address of the publisher. Visible to all users. */
4283-
publisherContact?: string;
4284-
/** End-user license agreement for community gallery image. */
4285-
eula?: string;
4286-
/** The prefix of the gallery name that will be displayed publicly. Visible to all users. */
4287-
publicNamePrefix?: string;
4288-
/**
4289-
* Contains info about whether community gallery sharing is enabled.
4290-
* NOTE: This property will not be serialized. It can only be populated by the server.
4291-
*/
4292-
readonly communityGalleryEnabled?: boolean;
4293-
/**
4294-
* Community gallery public name list.
4295-
* NOTE: This property will not be serialized. It can only be populated by the server.
4296-
*/
4297-
readonly publicNames?: string[];
4298-
}
4299-
43004300
/** The source image from which the Image Version is going to be created. */
43014301
export interface GalleryArtifactSource {
43024302
/** The managed artifact. */
@@ -5860,7 +5860,7 @@ export interface DedicatedHostInstanceViewWithName
58605860
export interface ImageOSDisk extends ImageDisk {
58615861
/** 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. <br><br> Possible values are: <br><br> **Windows** <br><br> **Linux** */
58625862
osType: OperatingSystemTypes;
5863-
/** The OS State. */
5863+
/** The OS State. For managed images, use Generalized. */
58645864
osState: OperatingSystemStateTypes;
58655865
}
58665866

sdk/compute/arm-compute/src/models/mappers.ts

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -8374,7 +8374,8 @@ export const SharingProfile: coreClient.CompositeMapper = {
83748374
communityGalleryInfo: {
83758375
serializedName: "communityGalleryInfo",
83768376
type: {
8377-
name: "any"
8377+
name: "Composite",
8378+
className: "CommunityGalleryInfo"
83788379
}
83798380
}
83808381
}
@@ -8407,6 +8408,58 @@ export const SharingProfileGroup: coreClient.CompositeMapper = {
84078408
}
84088409
};
84098410

8411+
export const CommunityGalleryInfo: coreClient.CompositeMapper = {
8412+
type: {
8413+
name: "Composite",
8414+
className: "CommunityGalleryInfo",
8415+
modelProperties: {
8416+
publisherUri: {
8417+
serializedName: "publisherUri",
8418+
type: {
8419+
name: "String"
8420+
}
8421+
},
8422+
publisherContact: {
8423+
serializedName: "publisherContact",
8424+
type: {
8425+
name: "String"
8426+
}
8427+
},
8428+
eula: {
8429+
serializedName: "eula",
8430+
type: {
8431+
name: "String"
8432+
}
8433+
},
8434+
publicNamePrefix: {
8435+
serializedName: "publicNamePrefix",
8436+
type: {
8437+
name: "String"
8438+
}
8439+
},
8440+
communityGalleryEnabled: {
8441+
serializedName: "communityGalleryEnabled",
8442+
readOnly: true,
8443+
type: {
8444+
name: "Boolean"
8445+
}
8446+
},
8447+
publicNames: {
8448+
serializedName: "publicNames",
8449+
readOnly: true,
8450+
type: {
8451+
name: "Sequence",
8452+
element: {
8453+
type: {
8454+
name: "String"
8455+
}
8456+
}
8457+
}
8458+
}
8459+
}
8460+
}
8461+
};
8462+
84108463
export const SoftDeletePolicy: coreClient.CompositeMapper = {
84118464
type: {
84128465
name: "Composite",
@@ -10923,58 +10976,6 @@ export const OSFamilyListResult: coreClient.CompositeMapper = {
1092310976
}
1092410977
};
1092510978

10926-
export const CommunityGalleryInfo: coreClient.CompositeMapper = {
10927-
type: {
10928-
name: "Composite",
10929-
className: "CommunityGalleryInfo",
10930-
modelProperties: {
10931-
publisherUri: {
10932-
serializedName: "publisherUri",
10933-
type: {
10934-
name: "String"
10935-
}
10936-
},
10937-
publisherContact: {
10938-
serializedName: "publisherContact",
10939-
type: {
10940-
name: "String"
10941-
}
10942-
},
10943-
eula: {
10944-
serializedName: "eula",
10945-
type: {
10946-
name: "String"
10947-
}
10948-
},
10949-
publicNamePrefix: {
10950-
serializedName: "publicNamePrefix",
10951-
type: {
10952-
name: "String"
10953-
}
10954-
},
10955-
communityGalleryEnabled: {
10956-
serializedName: "communityGalleryEnabled",
10957-
readOnly: true,
10958-
type: {
10959-
name: "Boolean"
10960-
}
10961-
},
10962-
publicNames: {
10963-
serializedName: "publicNames",
10964-
readOnly: true,
10965-
type: {
10966-
name: "Sequence",
10967-
element: {
10968-
type: {
10969-
name: "String"
10970-
}
10971-
}
10972-
}
10973-
}
10974-
}
10975-
}
10976-
};
10977-
1097810979
export const GalleryArtifactSource: coreClient.CompositeMapper = {
1097910980
type: {
1098010981
name: "Composite",
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
4+
*
5+
* Code generated by Microsoft (R) AutoRest Code Generator.
6+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
*/
8+
9+
import {
10+
Recorder,
11+
RecorderStartOptions,
12+
env
13+
} from "@azure-tools/test-recorder";
14+
import { assert } from "chai";
15+
import { Context } from "mocha";
16+
17+
const replaceableVariables: Record<string, string> = {
18+
AZURE_CLIENT_ID: "azure_client_id",
19+
AZURE_CLIENT_SECRET: "azure_client_secret",
20+
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
21+
SUBSCRIPTION_ID: "azure_subscription_id"
22+
};
23+
24+
const recorderOptions: RecorderStartOptions = {
25+
envSetupForPlayback: replaceableVariables
26+
};
27+
28+
describe("My test", () => {
29+
let recorder: Recorder;
30+
31+
beforeEach(async function(this: Context) {
32+
recorder = new Recorder(this.currentTest);
33+
await recorder.start(recorderOptions);
34+
});
35+
36+
afterEach(async function() {
37+
await recorder.stop();
38+
});
39+
40+
it("sample test", async function() {
41+
console.log("Hi, I'm a test!");
42+
});
43+
});

sdk/compute/arm-compute/tsconfig.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,11 @@
1515
],
1616
"declaration": true,
1717
"outDir": "./dist-esm",
18-
"importHelpers": true,
19-
"paths": {
20-
"@azure/arm-compute": [
21-
"./src/index"
22-
]
23-
}
18+
"importHelpers": true
2419
},
2520
"include": [
2621
"./src/**/*.ts",
27-
"./test/**/*.ts",
28-
"samples-dev/**/*.ts"
22+
"./test/**/*.ts"
2923
],
3024
"exclude": [
3125
"node_modules"

0 commit comments

Comments
 (0)