Skip to content

Commit 806fddb

Browse files
author
SDKAuto
committed
CodeGen from PR 12691 in Azure/azure-rest-api-specs
Merge 871f9bfe97bec579e91636d9d2d815e346cff54b into 3227f9795b09642afb975f40d45ed481192b43a2
1 parent 1cdf789 commit 806fddb

25 files changed

+290
-3344
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: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,41 @@ npm install @azure/arm-authorization
1515

1616
### How to use
1717

18-
#### nodejs - Authentication, client creation and list classicAdministrators as an example written in TypeScript.
18+
#### nodejs - client creation and listForResource roleAssignments as an example written in TypeScript.
1919

2020
##### Install @azure/ms-rest-nodeauth
2121

22+
- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`.
2223
```bash
23-
npm install @azure/ms-rest-nodeauth
24+
npm install @azure/ms-rest-nodeauth@"^3.0.0"
2425
```
2526

2627
##### Sample code
2728

28-
```javascript
29+
While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package
30+
```typescript
31+
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
2932
const { AuthorizationManagementClient } = require("@azure/arm-authorization");
30-
const { interactiveLogin } = require("@azure/ms-rest-nodeauth");
31-
3233
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
3334

34-
interactiveLogin()
35-
.then((creds) => {
36-
const client = new AuthorizationManagementClient(creds, subscriptionId);
37-
client.classicAdministrators.list().then((result) => {
38-
console.log("The result is:");
39-
console.log(result);
40-
});
41-
})
42-
.catch((err) => {
43-
console.error(err);
35+
msRestNodeAuth.interactiveLogin().then((creds) => {
36+
const client = new AuthorizationManagementClient(creds, subscriptionId);
37+
const resourceGroupName = "testresourceGroupName";
38+
const resourceProviderNamespace = "testresourceProviderNamespace";
39+
const parentResourcePath = "testparentResourcePath";
40+
const resourceType = "testresourceType";
41+
const resourceName = "testresourceName";
42+
const filter = "testfilter";
43+
client.roleAssignments.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter).then((result) => {
44+
console.log("The result is:");
45+
console.log(result);
4446
});
47+
}).catch((err) => {
48+
console.error(err);
49+
});
4550
```
4651

47-
#### browser - Authentication, client creation and list classicAdministrators as an example written in JavaScript.
52+
#### browser - Authentication, client creation and listForResource roleAssignments as an example written in JavaScript.
4853

4954
##### Install @azure/ms-rest-browserauth
5055

@@ -57,7 +62,6 @@ npm install @azure/ms-rest-browserauth
5762
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.
5863

5964
- index.html
60-
6165
```html
6266
<!DOCTYPE html>
6367
<html lang="en">
@@ -71,27 +75,27 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
7175
const subscriptionId = "<Subscription_Id>";
7276
const authManager = new msAuth.AuthManager({
7377
clientId: "<client id for your Azure AD app>",
74-
tenant: "<optional tenant for your organization>",
78+
tenant: "<optional tenant for your organization>"
7579
});
7680
authManager.finalizeLogin().then((res) => {
7781
if (!res.isLoggedIn) {
7882
// may cause redirects
7983
authManager.login();
8084
}
81-
const client = new Azure.ArmAuthorization.AuthorizationManagementClient(
82-
res.creds,
83-
subscriptionId
84-
);
85-
client.classicAdministrators
86-
.list()
87-
.then((result) => {
88-
console.log("The result is:");
89-
console.log(result);
90-
})
91-
.catch((err) => {
92-
console.log("An error occurred:");
93-
console.error(err);
94-
});
85+
const client = new Azure.ArmAuthorization.AuthorizationManagementClient(res.creds, subscriptionId);
86+
const resourceGroupName = "testresourceGroupName";
87+
const resourceProviderNamespace = "testresourceProviderNamespace";
88+
const parentResourcePath = "testparentResourcePath";
89+
const resourceType = "testresourceType";
90+
const resourceName = "testresourceName";
91+
const filter = "testfilter";
92+
client.roleAssignments.listForResource(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter).then((result) => {
93+
console.log("The result is:");
94+
console.log(result);
95+
}).catch((err) => {
96+
console.log("An error occurred:");
97+
console.error(err);
98+
});
9599
});
96100
</script>
97101
</head>
@@ -103,4 +107,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
103107

104108
- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)
105109

106-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fauthorization%2Farm-authorization%2FREADME.png)
110+
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/authorization/arm-authorization/README.png)

sdk/authorization/arm-authorization/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"description": "AuthorizationManagementClient Library with typescript type definitions for node.js and browser.",
55
"version": "8.3.3",
66
"dependencies": {
7-
"@azure/ms-rest-azure-js": "^2.0.0",
8-
"@azure/ms-rest-js": "^2.0.3",
9-
"tslib": "^1.9.3"
7+
"@azure/ms-rest-azure-js": "^2.0.1",
8+
"@azure/ms-rest-js": "^2.0.4",
9+
"tslib": "^1.10.0"
1010
},
1111
"keywords": [
1212
"node",
@@ -20,11 +20,11 @@
2020
"module": "./esm/authorizationManagementClient.js",
2121
"types": "./esm/authorizationManagementClient.d.ts",
2222
"devDependencies": {
23-
"typescript": "^3.1.1",
24-
"rollup": "^0.66.2",
25-
"rollup-plugin-node-resolve": "^3.4.0",
23+
"typescript": "^3.5.3",
24+
"rollup": "^1.18.0",
25+
"rollup-plugin-node-resolve": "^5.2.0",
2626
"rollup-plugin-sourcemaps": "^0.4.2",
27-
"uglify-js": "^3.4.9"
27+
"uglify-js": "^3.6.0"
2828
},
2929
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/authorization/arm-authorization",
3030
"repository": {

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
@@ -17,13 +16,7 @@ import { AuthorizationManagementClientContext } from "./authorizationManagementC
1716

1817
class AuthorizationManagementClient extends AuthorizationManagementClientContext {
1918
// Operation groups
20-
classicAdministrators: operations.ClassicAdministrators;
21-
globalAdministrator: operations.GlobalAdministrator;
22-
providerOperationsMetadata: operations.ProviderOperationsMetadataOperations;
2319
roleAssignments: operations.RoleAssignments;
24-
permissions: operations.Permissions;
25-
roleDefinitions: operations.RoleDefinitions;
26-
denyAssignments: operations.DenyAssignments;
2720

2821
/**
2922
* Initializes a new instance of the AuthorizationManagementClient class.
@@ -33,13 +26,7 @@ class AuthorizationManagementClient extends AuthorizationManagementClientContext
3326
*/
3427
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.AuthorizationManagementClientOptions) {
3528
super(credentials, subscriptionId, options);
36-
this.classicAdministrators = new operations.ClassicAdministrators(this);
37-
this.globalAdministrator = new operations.GlobalAdministrator(this);
38-
this.providerOperationsMetadata = new operations.ProviderOperationsMetadataOperations(this);
3929
this.roleAssignments = new operations.RoleAssignments(this);
40-
this.permissions = new operations.Permissions(this);
41-
this.roleDefinitions = new operations.RoleDefinitions(this);
42-
this.denyAssignments = new operations.DenyAssignments(this);
4330
}
4431
}
4532

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

Lines changed: 4 additions & 3 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,6 +17,7 @@ const packageVersion = "8.3.3";
1817
export class AuthorizationManagementClientContext extends msRestAzure.AzureServiceClient {
1918
credentials: msRest.ServiceClientCredentials;
2019
subscriptionId: string;
20+
apiVersion?: string;
2121

2222
/**
2323
* Initializes a new instance of the AuthorizationManagementClient class.
@@ -43,6 +43,7 @@ export class AuthorizationManagementClientContext extends msRestAzure.AzureServi
4343

4444
super(credentials, options);
4545

46+
this.apiVersion = '2020-04-01-preview';
4647
this.acceptLanguage = 'en-US';
4748
this.longRunningOperationRetryTimeout = 30;
4849
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";

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)