Skip to content

Commit 56225ac

Browse files
author
SDKAuto
committed
CodeGen from PR 15181 in Azure/azure-rest-api-specs
Merge 8e60c3c5c3e24d492b4b497270f123c6dce88aaf into 70626b932d16a97361673e0bcba7570284fe0813
1 parent 3b51a6e commit 56225ac

15 files changed

+1281
-89
lines changed

sdk/features/arm-features/LICENSE.txt

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) 2019 Microsoft
3+
Copyright (c) 2021 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/features/arm-features/README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
## Azure FeatureClient SDK for JavaScript
22

3-
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for FeatureClient.
3+
This package contains an isomorphic SDK (runs both in node.js and in browsers) for FeatureClient.
44

55
### Currently supported environments
66

77
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
8-
- Latest versions of Safari, Chrome, Edge, and Firefox.
8+
- Latest versions of Safari, Chrome, Edge and Firefox.
99

1010
### Prerequisites
1111

@@ -21,7 +21,6 @@ Install both packages using the below command:
2121
```bash
2222
npm install --save @azure/arm-features @azure/identity
2323
```
24-
2524
> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features.
2625
If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options.
2726

@@ -37,8 +36,7 @@ If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/
3736

3837
In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
3938
Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started.
40-
41-
#### nodejs - Authentication, client creation, and listOperations as an example written in JavaScript.
39+
#### nodejs - Authentication, client creation, and listOperations as an example written in JavaScript.
4240

4341
##### Sample code
4442

@@ -51,8 +49,8 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
5149
// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead.
5250
const creds = new DefaultAzureCredential();
5351
const client = new FeatureClient(creds, subscriptionId);
54-
55-
client.listOperations().then((result) => {
52+
const apiVersion = "testapiVersion";
53+
client.listOperations(apiVersion).then((result) => {
5654
console.log("The result is:");
5755
console.log(result);
5856
}).catch((err) => {
@@ -61,7 +59,7 @@ client.listOperations().then((result) => {
6159
});
6260
```
6361

64-
#### browser - Authentication, client creation, and listOperations as an example written in JavaScript.
62+
#### browser - Authentication, client creation, and listOperations as an example written in JavaScript.
6563

6664
In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser.
6765
- See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser.
@@ -86,10 +84,11 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t
8684
const credential = new InteractiveBrowserCredential(
8785
{
8886
clientId: "<client id for your Azure AD app>",
89-
tenantId: "<optional tenant for your organization>"
87+
tenant: "<optional tenant for your organization>"
9088
});
9189
const client = new Azure.ArmFeatures.FeatureClient(creds, subscriptionId);
92-
client.listOperations().then((result) => {
90+
const apiVersion = "testapiVersion";
91+
client.listOperations(apiVersion).then((result) => {
9392
console.log("The result is:");
9493
console.log(result);
9594
}).catch((err) => {

sdk/features/arm-features/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"description": "FeatureClient Library with typescript type definitions for node.js and browser.",
55
"version": "1.1.1",
66
"dependencies": {
7-
"@azure/ms-rest-azure-js": "^1.4.0",
8-
"@azure/ms-rest-js": "^1.11.0",
7+
"@azure/ms-rest-azure-js": "^2.1.0",
8+
"@azure/ms-rest-js": "^2.2.0",
99
"@azure/core-auth": "^1.1.4",
10-
"tslib": "^1.9.3"
10+
"tslib": "^1.10.0"
1111
},
1212
"keywords": [
1313
"node",
@@ -22,12 +22,12 @@
2222
"types": "./esm/featureClient.d.ts",
2323
"devDependencies": {
2424
"typescript": "^3.6.0",
25-
"rollup": "^0.66.2",
26-
"rollup-plugin-node-resolve": "^3.4.0",
25+
"rollup": "^1.18.0",
26+
"rollup-plugin-node-resolve": "^5.2.0",
2727
"rollup-plugin-sourcemaps": "^0.4.2",
28-
"uglify-js": "^3.4.9"
28+
"uglify-js": "^3.6.0"
2929
},
30-
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/feature/v4/sdk/features/arm-features",
30+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/features/arm-features",
3131
"repository": {
3232
"type": "git",
3333
"url": "https://github.com/Azure/azure-sdk-for-js.git"

sdk/features/arm-features/rollup.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ const config = {
2121
"@azure/ms-rest-azure-js": "msRestAzure"
2222
},
2323
banner: `/*
24-
* Copyright (c) Microsoft Corporation. All rights reserved.
25-
* Licensed under the MIT License. See License.txt in the project root for license information.
24+
* Copyright (c) Microsoft Corporation.
25+
* Licensed under the MIT License.
2626
*
2727
* Code generated by Microsoft (R) AutoRest Code Generator.
2828
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
2929
*/`
3030
},
3131
plugins: [
32-
nodeResolve({ module: true }),
32+
nodeResolve({ mainFields: ['module', 'main'] }),
3333
sourcemaps()
3434
]
3535
};

sdk/features/arm-features/src/featureClient.ts

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*
2-
* Copyright (c) Microsoft Corporation. All rights reserved.
3-
* Licensed under the MIT License. See License.txt in the project root for
4-
* license information.
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
54
*
65
* Code generated by Microsoft (R) AutoRest Code Generator.
76
* Changes may cause incorrect behavior and will be lost if the code is
@@ -20,6 +19,7 @@ import { FeatureClientContext } from "./featureClientContext";
2019
class FeatureClient extends FeatureClientContext {
2120
// Operation groups
2221
features: operations.Features;
22+
subscriptionFeatureRegistrations: operations.SubscriptionFeatureRegistrations;
2323

2424
/**
2525
* Initializes a new instance of the FeatureClient class.
@@ -29,32 +29,37 @@ class FeatureClient extends FeatureClientContext {
2929
* {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
3030
* ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
3131
* @azure/ms-rest-browserauth are also supported.
32-
* @param subscriptionId The ID of the target subscription.
32+
* @param subscriptionId The Azure subscription ID.
3333
* @param [options] The parameter options
3434
*/
3535
constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.FeatureClientOptions) {
3636
super(credentials, subscriptionId, options);
3737
this.features = new operations.Features(this);
38+
this.subscriptionFeatureRegistrations = new operations.SubscriptionFeatureRegistrations(this);
3839
}
3940

4041
/**
4142
* Lists all of the available Microsoft.Features REST API operations.
43+
* @param apiVersion The API version to use for this operation.
4244
* @param [options] The optional parameters
4345
* @returns Promise<Models.ListOperationsResponse>
4446
*/
45-
listOperations(options?: msRest.RequestOptionsBase): Promise<Models.ListOperationsResponse>;
47+
listOperations(apiVersion: string, options?: msRest.RequestOptionsBase): Promise<Models.ListOperationsResponse>;
4648
/**
49+
* @param apiVersion The API version to use for this operation.
4750
* @param callback The callback
4851
*/
49-
listOperations(callback: msRest.ServiceCallback<Models.OperationListResult>): void;
52+
listOperations(apiVersion: string, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
5053
/**
54+
* @param apiVersion The API version to use for this operation.
5155
* @param options The optional parameters
5256
* @param callback The callback
5357
*/
54-
listOperations(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
55-
listOperations(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationListResult>, callback?: msRest.ServiceCallback<Models.OperationListResult>): Promise<Models.ListOperationsResponse> {
58+
listOperations(apiVersion: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
59+
listOperations(apiVersion: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationListResult>, callback?: msRest.ServiceCallback<Models.OperationListResult>): Promise<Models.ListOperationsResponse> {
5660
return this.sendOperationRequest(
5761
{
62+
apiVersion,
5863
options
5964
},
6065
listOperationsOperationSpec,
@@ -64,25 +69,29 @@ class FeatureClient extends FeatureClientContext {
6469
/**
6570
* Lists all of the available Microsoft.Features REST API operations.
6671
* @param nextPageLink The NextLink from the previous successful call to List operation.
72+
* @param apiVersion The API version to use for this operation.
6773
* @param [options] The optional parameters
6874
* @returns Promise<Models.ListOperationsNextResponse>
6975
*/
70-
listOperationsNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.ListOperationsNextResponse>;
76+
listOperationsNext(nextPageLink: string, apiVersion: string, options?: msRest.RequestOptionsBase): Promise<Models.ListOperationsNextResponse>;
7177
/**
7278
* @param nextPageLink The NextLink from the previous successful call to List operation.
79+
* @param apiVersion The API version to use for this operation.
7380
* @param callback The callback
7481
*/
75-
listOperationsNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
82+
listOperationsNext(nextPageLink: string, apiVersion: string, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
7683
/**
7784
* @param nextPageLink The NextLink from the previous successful call to List operation.
85+
* @param apiVersion The API version to use for this operation.
7886
* @param options The optional parameters
7987
* @param callback The callback
8088
*/
81-
listOperationsNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
82-
listOperationsNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationListResult>, callback?: msRest.ServiceCallback<Models.OperationListResult>): Promise<Models.ListOperationsNextResponse> {
89+
listOperationsNext(nextPageLink: string, apiVersion: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
90+
listOperationsNext(nextPageLink: string, apiVersion: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationListResult>, callback?: msRest.ServiceCallback<Models.OperationListResult>): Promise<Models.ListOperationsNextResponse> {
8391
return this.sendOperationRequest(
8492
{
8593
nextPageLink,
94+
apiVersion,
8695
options
8796
},
8897
listOperationsNextOperationSpec,
@@ -106,7 +115,7 @@ const listOperationsOperationSpec: msRest.OperationSpec = {
106115
bodyMapper: Mappers.OperationListResult
107116
},
108117
default: {
109-
bodyMapper: Mappers.CloudError
118+
bodyMapper: Mappers.ErrorResponse
110119
}
111120
},
112121
serializer
@@ -119,6 +128,9 @@ const listOperationsNextOperationSpec: msRest.OperationSpec = {
119128
urlParameters: [
120129
Parameters.nextPageLink
121130
],
131+
queryParameters: [
132+
Parameters.apiVersion
133+
],
122134
headerParameters: [
123135
Parameters.acceptLanguage
124136
],
@@ -127,7 +139,7 @@ const listOperationsNextOperationSpec: msRest.OperationSpec = {
127139
bodyMapper: Mappers.OperationListResult
128140
},
129141
default: {
130-
bodyMapper: Mappers.CloudError
142+
bodyMapper: Mappers.ErrorResponse
131143
}
132144
},
133145
serializer

sdk/features/arm-features/src/featureClientContext.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*
2-
* Copyright (c) Microsoft Corporation. All rights reserved.
3-
* Licensed under the MIT License. See License.txt in the project root for
4-
* license information.
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
54
*
65
* Code generated by Microsoft (R) AutoRest Code Generator.
76
* Changes may cause incorrect behavior and will be lost if the code is
@@ -10,16 +9,15 @@
109

1110
import * as Models from "./models";
1211
import * as msRest from "@azure/ms-rest-js";
13-
import { TokenCredential } from "@azure/core-auth";
1412
import * as msRestAzure from "@azure/ms-rest-azure-js";
13+
import { TokenCredential } from "@azure/core-auth";
1514

1615
const packageName = "@azure/arm-features";
1716
const packageVersion = "1.1.1";
1817

1918
export class FeatureClientContext extends msRestAzure.AzureServiceClient {
2019
credentials: msRest.ServiceClientCredentials | TokenCredential;
2120
subscriptionId: string;
22-
apiVersion?: string;
2321

2422
/**
2523
* Initializes a new instance of the FeatureClient class.
@@ -29,7 +27,7 @@ export class FeatureClientContext extends msRestAzure.AzureServiceClient {
2927
* {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
3028
* ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
3129
* @azure/ms-rest-browserauth are also supported.
32-
* @param subscriptionId The ID of the target subscription.
30+
* @param subscriptionId The Azure subscription ID.
3331
* @param [options] The parameter options
3432
*/
3533
constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.FeatureClientOptions) {
@@ -50,7 +48,6 @@ export class FeatureClientContext extends msRestAzure.AzureServiceClient {
5048

5149
super(credentials, options);
5250

53-
this.apiVersion = '2015-12-01';
5451
this.acceptLanguage = 'en-US';
5552
this.longRunningOperationRetryTimeout = 30;
5653
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";

sdk/features/arm-features/src/models/featuresMappers.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
/*
2-
* Copyright (c) Microsoft Corporation. All rights reserved.
3-
* Licensed under the MIT License. See License.txt in the project root for license information.
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
44
*
55
* Code generated by Microsoft (R) AutoRest Code Generator.
66
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
*/
88

99
export {
10-
CloudError,
10+
ErrorDefinition,
11+
ErrorResponse,
1112
FeatureOperationsListResult,
1213
FeatureProperties,
1314
FeatureResult

0 commit comments

Comments
 (0)