Skip to content

Commit a6adb52

Browse files
author
SDKAuto
committed
CodeGen from PR 14560 in Azure/azure-rest-api-specs
Merge 585055674324f39b8cfabeb9bec58c5130705227 into 444d527ca9ba163e65ad4ce9fc888a6f69940a4c
1 parent 33602ff commit a6adb52

25 files changed

+473
-3403
lines changed

sdk/authorization/arm-authorization/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/authorization/arm-authorization/README.md

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

3-
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for AuthorizationManagementClient.
3+
This package contains an isomorphic SDK (runs both in node.js and in browsers) for AuthorizationManagementClient.
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-authorization @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 list classicAdministrators as an example written in JavaScript.
39+
#### nodejs - Authentication, client creation, and listForResource roleAssignments as an example written in JavaScript.
4240

4341
##### Sample code
4442

@@ -51,8 +49,14 @@ 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 AuthorizationManagementClient(creds, subscriptionId);
54-
55-
client.classicAdministrators.list().then((result) => {
52+
const resourceGroupName = "testresourceGroupName";
53+
const resourceProviderNamespace = "testresourceProviderNamespace";
54+
const parentResourcePath = "testparentResourcePath";
55+
const resourceType = "testresourceType";
56+
const resourceName = "testresourceName";
57+
const filter = "testfilter";
58+
const tenantId = "testtenantId";
59+
client.roleAssignments.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter, tenantId).then((result) => {
5660
console.log("The result is:");
5761
console.log(result);
5862
}).catch((err) => {
@@ -61,7 +65,7 @@ client.classicAdministrators.list().then((result) => {
6165
});
6266
```
6367

64-
#### browser - Authentication, client creation, and list classicAdministrators as an example written in JavaScript.
68+
#### browser - Authentication, client creation, and listForResource roleAssignments as an example written in JavaScript.
6569

6670
In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser.
6771
- 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 +90,17 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t
8690
const credential = new InteractiveBrowserCredential(
8791
{
8892
clientId: "<client id for your Azure AD app>",
89-
tenantId: "<optional tenant for your organization>"
93+
tenant: "<optional tenant for your organization>"
9094
});
9195
const client = new Azure.ArmAuthorization.AuthorizationManagementClient(creds, subscriptionId);
92-
client.classicAdministrators.list().then((result) => {
96+
const resourceGroupName = "testresourceGroupName";
97+
const resourceProviderNamespace = "testresourceProviderNamespace";
98+
const parentResourcePath = "testparentResourcePath";
99+
const resourceType = "testresourceType";
100+
const resourceName = "testresourceName";
101+
const filter = "testfilter";
102+
const tenantId = "testtenantId";
103+
client.roleAssignments.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter, tenantId).then((result) => {
93104
console.log("The result is:");
94105
console.log(result);
95106
}).catch((err) => {

sdk/authorization/arm-authorization/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"@azure/ms-rest-azure-js": "^2.1.0",
88
"@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/authorizationManagementClient.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/main/sdk/authorization/arm-authorization",
30+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/authorization/arm-authorization",
3131
"repository": {
3232
"type": "git",
3333
"url": "https://github.com/Azure/azure-sdk-for-js.git"

sdk/authorization/arm-authorization/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/authorization/arm-authorization/src/authorizationManagementClient.ts

Lines changed: 2 additions & 15 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
@@ -18,13 +17,7 @@ import { AuthorizationManagementClientContext } from "./authorizationManagementC
1817

1918
class AuthorizationManagementClient extends AuthorizationManagementClientContext {
2019
// Operation groups
21-
classicAdministrators: operations.ClassicAdministrators;
22-
globalAdministrator: operations.GlobalAdministrator;
23-
providerOperationsMetadata: operations.ProviderOperationsMetadataOperations;
2420
roleAssignments: operations.RoleAssignments;
25-
permissions: operations.Permissions;
26-
roleDefinitions: operations.RoleDefinitions;
27-
denyAssignments: operations.DenyAssignments;
2821

2922
/**
3023
* Initializes a new instance of the AuthorizationManagementClient class.
@@ -39,13 +32,7 @@ class AuthorizationManagementClient extends AuthorizationManagementClientContext
3932
*/
4033
constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.AuthorizationManagementClientOptions) {
4134
super(credentials, subscriptionId, options);
42-
this.classicAdministrators = new operations.ClassicAdministrators(this);
43-
this.globalAdministrator = new operations.GlobalAdministrator(this);
44-
this.providerOperationsMetadata = new operations.ProviderOperationsMetadataOperations(this);
4535
this.roleAssignments = new operations.RoleAssignments(this);
46-
this.permissions = new operations.Permissions(this);
47-
this.roleDefinitions = new operations.RoleDefinitions(this);
48-
this.denyAssignments = new operations.DenyAssignments(this);
4936
}
5037
}
5138

sdk/authorization/arm-authorization/src/authorizationManagementClientContext.ts

Lines changed: 8 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,14 +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-authorization";
1716
const packageVersion = "8.4.0";
1817

1918
export class AuthorizationManagementClientContext extends msRestAzure.AzureServiceClient {
2019
credentials: msRest.ServiceClientCredentials | TokenCredential;
20+
apiVersion?: string;
2121
subscriptionId: string;
2222

2323
/**
@@ -42,24 +42,25 @@ export class AuthorizationManagementClientContext extends msRestAzure.AzureServi
4242
if (!options) {
4343
options = {};
4444
}
45-
if(!options.userAgent) {
45+
if (!options.userAgent) {
4646
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
4747
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
4848
}
4949

5050
super(credentials, options);
5151

52+
this.apiVersion = '2020-04-01-preview';
5253
this.acceptLanguage = 'en-US';
5354
this.longRunningOperationRetryTimeout = 30;
5455
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
5556
this.requestContentType = "application/json; charset=utf-8";
5657
this.credentials = credentials;
5758
this.subscriptionId = subscriptionId;
5859

59-
if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
60+
if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
6061
this.acceptLanguage = options.acceptLanguage;
6162
}
62-
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
63+
if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
6364
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
6465
}
6566
}

sdk/authorization/arm-authorization/src/models/classicAdministratorsMappers.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

sdk/authorization/arm-authorization/src/models/denyAssignmentsMappers.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

sdk/authorization/arm-authorization/src/models/globalAdministratorMappers.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)