Skip to content

Commit 2f7e0c1

Browse files
author
SDKAuto
committed
CodeGen from PR 17681 in Azure/azure-rest-api-specs
Merge aeb36ab42b4dd6cf93a368470cda52495faa29d6 into 3f59f46d112c58cb8f6231732e88848f0f97872c
1 parent 2d47bff commit 2f7e0c1

File tree

15 files changed

+170
-188
lines changed

15 files changed

+170
-188
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
## Release History
1+
# Release History
2+
3+
## 1.0.0 (2022-02-17)
24

3-
### 1.0.0-beta.2 (Unreleased)
4-
5-
#### Features Added
6-
7-
#### Breaking Changes
8-
9-
#### Bugs Fixed
10-
11-
#### Other Changes
12-
13-
### 1.0.0-beta.1 (2021-10-08)
14-
15-
- Initial Release
5+
The package of @azure/arm-extendedlocation is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart).

sdk/extendedlocation/arm-extendedlocation/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2021 Microsoft
3+
Copyright (c) 2022 Microsoft
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

sdk/extendedlocation/arm-extendedlocation/README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Azure customLocationsManagement client library for JavaScript
1+
# Azure CustomLocationsManagement client library for JavaScript
22

3-
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure customLocationsManagement client.
3+
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure CustomLocationsManagement client.
44

55
The customLocations Rest API spec.
66

@@ -22,16 +22,16 @@ The customLocations Rest API spec.
2222

2323
### Install the `@azure/arm-extendedlocation` package
2424

25-
Install the Azure customLocationsManagement client library for JavaScript with `npm`:
25+
Install the Azure CustomLocationsManagement client library for JavaScript with `npm`:
2626

2727
```bash
2828
npm install @azure/arm-extendedlocation
2929
```
3030

3131
### Create and authenticate a `CustomLocationsManagementClient`
3232

33-
To create a client object to access the Azure customLocationsManagement API, you will need the `endpoint` of your Azure customLocationsManagement resource and a `credential`. The Azure customLocationsManagement client can use Azure Active Directory credentials to authenticate.
34-
You can find the endpoint for your Azure customLocationsManagement resource in the [Azure Portal][azure_portal].
33+
To create a client object to access the Azure CustomLocationsManagement API, you will need the `endpoint` of your Azure CustomLocationsManagement resource and a `credential`. The Azure CustomLocationsManagement client can use Azure Active Directory credentials to authenticate.
34+
You can find the endpoint for your Azure CustomLocationsManagement resource in the [Azure Portal][azure_portal].
3535

3636
You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).
3737

@@ -41,7 +41,7 @@ To use the [DefaultAzureCredential][defaultazurecredential] provider shown below
4141
npm install @azure/identity
4242
```
4343

44-
You will also need to **register a new AAD application and grant access to Azure customLocationsManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
44+
You will also need to **register a new AAD application and grant access to Azure CustomLocationsManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions).
4545
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`.
4646

4747
For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal).
@@ -53,11 +53,15 @@ const subscriptionId = "00000000-0000-0000-0000-000000000000";
5353
const client = new CustomLocationsManagementClient(new DefaultAzureCredential(), subscriptionId);
5454
```
5555

56+
57+
### JavaScript Bundle
58+
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
59+
5660
## Key concepts
5761

5862
### CustomLocationsManagementClient
5963

60-
`CustomLocationsManagementClient` is the primary interface for developers using the Azure customLocationsManagement client library. Explore the methods on this client object to understand the different features of the Azure customLocationsManagement service that you can access.
64+
`CustomLocationsManagementClient` is the primary interface for developers using the Azure CustomLocationsManagement client library. Explore the methods on this client object to understand the different features of the Azure CustomLocationsManagement service that you can access.
6165

6266
## Troubleshooting
6367

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"commit": "5cf3e4a0c30ad5167088ac839453578b2e8e9afc",
2+
"commit": "3025415dd6fddb314748f848b04aaea203ca59e1",
33
"readme": "specification/extendedlocation/resource-manager/readme.md",
4-
"autorest_command": "autorest --version=3.1.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/extendedlocation/resource-manager/readme.md --use=@autorest/typescript@6.0.0-beta.13",
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=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/extendedlocation/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1",
55
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
6-
"use": "@autorest/typescript@6.0.0-beta.13"
6+
"use": "@autorest/typescript@6.0.0-alpha.16.20220105.1"
77
}
Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
11
{
22
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
33
"mainEntryPointFilePath": "./dist-esm/src/index.d.ts",
4-
"docModel": { "enabled": true },
5-
"apiReport": { "enabled": true, "reportFolder": "./review" },
4+
"docModel": {
5+
"enabled": true
6+
},
7+
"apiReport": {
8+
"enabled": true,
9+
"reportFolder": "./review"
10+
},
611
"dtsRollup": {
712
"enabled": true,
813
"untrimmedFilePath": "",
914
"publicTrimmedFilePath": "./types/arm-extendedlocation.d.ts"
1015
},
1116
"messages": {
12-
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
17+
"tsdocMessageReporting": {
18+
"default": {
19+
"logLevel": "none"
20+
}
21+
},
1322
"extractorMessageReporting": {
14-
"ae-missing-release-tag": { "logLevel": "none" },
15-
"ae-unresolved-link": { "logLevel": "none" }
23+
"ae-missing-release-tag": {
24+
"logLevel": "none"
25+
},
26+
"ae-unresolved-link": {
27+
"logLevel": "none"
28+
}
1629
}
1730
}
18-
}
31+
}

sdk/extendedlocation/arm-extendedlocation/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
"sdk-type": "mgmt",
44
"author": "Microsoft Corporation",
55
"description": "A generated SDK for CustomLocationsManagementClient.",
6-
"version": "1.0.0-beta.2",
6+
"version": "1.0.0",
77
"engines": {
88
"node": ">=12.0.0"
99
},
1010
"dependencies": {
1111
"@azure/core-lro": "^2.2.0",
1212
"@azure/abort-controller": "^1.0.0",
13-
"@azure/core-paging": "^1.1.1",
13+
"@azure/core-paging": "^1.2.0",
1414
"@azure/core-client": "^1.0.0",
1515
"@azure/core-auth": "^1.3.0",
1616
"@azure/core-rest-pipeline": "^1.1.0",
@@ -29,15 +29,16 @@
2929
"types": "./types/arm-extendedlocation.d.ts",
3030
"devDependencies": {
3131
"@microsoft/api-extractor": "^7.18.11",
32-
"@rollup/plugin-commonjs": "^21.0.1",
32+
"@rollup/plugin-commonjs": "11.0.2",
3333
"@rollup/plugin-json": "^4.0.0",
3434
"@rollup/plugin-multi-entry": "^3.0.0",
3535
"@rollup/plugin-node-resolve": "^8.0.0",
3636
"mkdirp": "^1.0.4",
37-
"rollup": "^2.0.0",
37+
"rollup": "^1.16.3",
3838
"rollup-plugin-sourcemaps": "^0.4.2",
3939
"typescript": "~4.2.0",
4040
"uglify-js": "^3.4.9",
41+
"rimraf": "^3.0.0",
4142
"@azure/identity": "^2.0.1",
4243
"@azure-tools/test-recorder": "^1.0.0",
4344
"mocha": "^7.1.1",
@@ -70,14 +71,14 @@
7071
"types/*"
7172
],
7273
"scripts": {
73-
"build": "tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
74+
"build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
7475
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
7576
"prepack": "npm run build",
7677
"pack": "npm pack 2>&1",
7778
"extract-api": "api-extractor run --local",
7879
"lint": "echo skipped",
7980
"audit": "echo skipped",
80-
"clean": "echo skipped",
81+
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
8182
"build:node": "echo skipped",
8283
"build:browser": "echo skipped",
8384
"build:test": "echo skipped",
@@ -86,17 +87,16 @@
8687
"execute:samples": "echo skipped",
8788
"format": "echo skipped",
8889
"test": "npm run integration-test",
89-
"prebuild": "echo skipped",
9090
"test:node": "echo skipped",
9191
"test:browser": "echo skipped",
9292
"unit-test": "npm run unit-test:node && npm run unit-test:browser",
9393
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
9494
"unit-test:browser": "echo skipped",
9595
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
96-
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts",
96+
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
9797
"integration-test:browser": "echo skipped",
9898
"docs": "echo skipped"
9999
},
100100
"sideEffects": false,
101101
"autoPublish": true
102-
}
102+
}

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,20 +148,15 @@ export interface CustomLocationsListOperationsOptionalParams extends coreClient.
148148
export type CustomLocationsListOperationsResponse = CustomLocationOperationsList;
149149

150150
// @public (undocumented)
151-
export class CustomLocationsManagementClient extends CustomLocationsManagementClientContext {
152-
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: CustomLocationsManagementClientOptionalParams);
153-
// (undocumented)
154-
customLocations: CustomLocations;
155-
}
156-
157-
// @public (undocumented)
158-
export class CustomLocationsManagementClientContext extends coreClient.ServiceClient {
151+
export class CustomLocationsManagementClient extends coreClient.ServiceClient {
159152
// (undocumented)
160153
$host: string;
161154
constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: CustomLocationsManagementClientOptionalParams);
162155
// (undocumented)
163156
apiVersion: string;
164157
// (undocumented)
158+
customLocations: CustomLocations;
159+
// (undocumented)
165160
subscriptionId: string;
166161
}
167162

@@ -313,7 +308,6 @@ export type TrackedResource = Resource & {
313308
location: string;
314309
};
315310

316-
317311
// (No @packageDocumentation comment for this package)
318312

319313
```

sdk/extendedlocation/arm-extendedlocation/src/customLocationsManagementClient.ts

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@
66
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
*/
88

9+
import * as coreClient from "@azure/core-client";
910
import * as coreAuth from "@azure/core-auth";
1011
import { CustomLocationsImpl } from "./operations";
1112
import { CustomLocations } from "./operationsInterfaces";
12-
import { CustomLocationsManagementClientContext } from "./customLocationsManagementClientContext";
1313
import { CustomLocationsManagementClientOptionalParams } from "./models";
1414

15-
export class CustomLocationsManagementClient extends CustomLocationsManagementClientContext {
15+
export class CustomLocationsManagementClient extends coreClient.ServiceClient {
16+
$host: string;
17+
apiVersion: string;
18+
subscriptionId: string;
19+
1620
/**
1721
* Initializes a new instance of the CustomLocationsManagementClient class.
1822
* @param credentials Subscription credentials which uniquely identify client subscription.
@@ -24,7 +28,46 @@ export class CustomLocationsManagementClient extends CustomLocationsManagementCl
2428
subscriptionId: string,
2529
options?: CustomLocationsManagementClientOptionalParams
2630
) {
27-
super(credentials, subscriptionId, options);
31+
if (credentials === undefined) {
32+
throw new Error("'credentials' cannot be null");
33+
}
34+
if (subscriptionId === undefined) {
35+
throw new Error("'subscriptionId' cannot be null");
36+
}
37+
38+
// Initializing default values for options
39+
if (!options) {
40+
options = {};
41+
}
42+
const defaults: CustomLocationsManagementClientOptionalParams = {
43+
requestContentType: "application/json; charset=utf-8",
44+
credential: credentials
45+
};
46+
47+
const packageDetails = `azsdk-js-arm-extendedlocation/1.0.0`;
48+
const userAgentPrefix =
49+
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
50+
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
51+
: `${packageDetails}`;
52+
53+
if (!options.credentialScopes) {
54+
options.credentialScopes = ["https://management.azure.com/.default"];
55+
}
56+
const optionsWithDefaults = {
57+
...defaults,
58+
...options,
59+
userAgentOptions: {
60+
userAgentPrefix
61+
},
62+
baseUri: options.endpoint || "https://management.azure.com"
63+
};
64+
super(optionsWithDefaults);
65+
// Parameter assignments
66+
this.subscriptionId = subscriptionId;
67+
68+
// Assigning values to Constant parameters
69+
this.$host = options.$host || "https://management.azure.com";
70+
this.apiVersion = options.apiVersion || "2021-08-15";
2871
this.customLocations = new CustomLocationsImpl(this);
2972
}
3073

0 commit comments

Comments
 (0)