Skip to content

Commit 1a23a1f

Browse files
author
SDKAuto
committed
CodeGen from PR 15050 in Azure/azure-rest-api-specs
Merge af44661236b6a92f7eb938f69d3b09c1bfb032f5 into b5b3ae9a081535b4dabce52a1136eece3e2d469f
1 parent 899fc0a commit 1a23a1f

14 files changed

+1158
-1698
lines changed

sdk/hdinsight/arm-hdinsight/README.md

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ This package contains an isomorphic SDK (runs both in node.js and in browsers) f
44

55
### Currently supported environments
66

7-
- Node.js version 8.x.x or higher
8-
- Browser JavaScript
7+
- [LTS versions of Node.js](https://nodejs.org/about/releases/)
8+
- Latest versions of Safari, Chrome, Edge and Firefox.
99

1010
### Prerequisites
1111

@@ -14,18 +14,15 @@ You must have an [Azure subscription](https://azure.microsoft.com/free/).
1414
### How to install
1515

1616
To use this SDK in your project, you will need to install two packages.
17-
1817
- `@azure/arm-hdinsight` that contains the client.
1918
- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory.
2019

2120
Install both packages using the below command:
22-
2321
```bash
2422
npm install --save @azure/arm-hdinsight @azure/identity
2523
```
26-
2724
> **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.
28-
> 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.
25+
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.
2926

3027
### How to use
3128

@@ -39,7 +36,6 @@ npm install --save @azure/arm-hdinsight @azure/identity
3936

4037
In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
4138
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.
42-
4339
#### nodejs - Authentication, client creation, and get clusters as an example written in JavaScript.
4440

4541
##### Sample code
@@ -55,24 +51,20 @@ const creds = new DefaultAzureCredential();
5551
const client = new HDInsightManagementClient(creds, subscriptionId);
5652
const resourceGroupName = "testresourceGroupName";
5753
const clusterName = "testclusterName";
58-
client.clusters
59-
.get(resourceGroupName, clusterName)
60-
.then((result) => {
61-
console.log("The result is:");
62-
console.log(result);
63-
})
64-
.catch((err) => {
65-
console.log("An error occurred:");
66-
console.error(err);
67-
});
54+
client.clusters.get(resourceGroupName, clusterName).then((result) => {
55+
console.log("The result is:");
56+
console.log(result);
57+
}).catch((err) => {
58+
console.log("An error occurred:");
59+
console.error(err);
60+
});
6861
```
6962

7063
#### browser - Authentication, client creation, and get clusters as an example written in JavaScript.
7164

7265
In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser.
73-
74-
- 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.
75-
- Note down the client Id from the previous step and use it in the browser sample below.
66+
- 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.
67+
- Note down the client Id from the previous step and use it in the browser sample below.
7668

7769
##### Sample code
7870

@@ -90,23 +82,21 @@ In browser applications, we recommend using the `InteractiveBrowserCredential` t
9082
const subscriptionId = "<Subscription_Id>";
9183
// Create credentials using the `@azure/identity` package.
9284
// Please note that you can also use credentials from the `@azure/ms-rest-browserauth` package instead.
93-
const credential = new InteractiveBrowserCredential({
85+
const credential = new InteractiveBrowserCredential(
86+
{
9487
clientId: "<client id for your Azure AD app>",
9588
tenant: "<optional tenant for your organization>"
9689
});
9790
const client = new Azure.ArmHdinsight.HDInsightManagementClient(creds, subscriptionId);
9891
const resourceGroupName = "testresourceGroupName";
9992
const clusterName = "testclusterName";
100-
client.clusters
101-
.get(resourceGroupName, clusterName)
102-
.then((result) => {
103-
console.log("The result is:");
104-
console.log(result);
105-
})
106-
.catch((err) => {
107-
console.log("An error occurred:");
108-
console.error(err);
109-
});
93+
client.clusters.get(resourceGroupName, clusterName).then((result) => {
94+
console.log("The result is:");
95+
console.log(result);
96+
}).catch((err) => {
97+
console.log("An error occurred:");
98+
console.error(err);
99+
});
110100
</script>
111101
</head>
112102
<body></body>

sdk/hdinsight/arm-hdinsight/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"rollup-plugin-sourcemaps": "^0.4.2",
2828
"uglify-js": "^3.6.0"
2929
},
30-
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/hdinsight/arm-hdinsight",
30+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/hdinsight/arm-hdinsight",
3131
"repository": {
3232
"type": "git",
3333
"url": "https://github.com/Azure/azure-sdk-for-js.git"

sdk/hdinsight/arm-hdinsight/src/hDInsightManagementClient.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import * as Mappers from "./models/mappers";
1414
import * as operations from "./operations";
1515
import { HDInsightManagementClientContext } from "./hDInsightManagementClientContext";
1616

17+
1718
class HDInsightManagementClient extends HDInsightManagementClientContext {
1819
// Operation groups
1920
clusters: operations.Clusters;
@@ -38,11 +39,7 @@ class HDInsightManagementClient extends HDInsightManagementClientContext {
3839
* subscription. The subscription ID forms part of the URI for every service call.
3940
* @param [options] The parameter options
4041
*/
41-
constructor(
42-
credentials: msRest.ServiceClientCredentials | TokenCredential,
43-
subscriptionId: string,
44-
options?: Models.HDInsightManagementClientOptions
45-
) {
42+
constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.HDInsightManagementClientOptions) {
4643
super(credentials, subscriptionId, options);
4744
this.clusters = new operations.Clusters(this);
4845
this.applications = new operations.Applications(this);

sdk/hdinsight/arm-hdinsight/src/hDInsightManagementClientContext.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,12 @@ export class HDInsightManagementClientContext extends msRestAzure.AzureServiceCl
3232
* subscription. The subscription ID forms part of the URI for every service call.
3333
* @param [options] The parameter options
3434
*/
35-
constructor(
36-
credentials: msRest.ServiceClientCredentials | TokenCredential,
37-
subscriptionId: string,
38-
options?: Models.HDInsightManagementClientOptions
39-
) {
35+
constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.HDInsightManagementClientOptions) {
4036
if (credentials == undefined) {
41-
throw new Error("'credentials' cannot be null.");
37+
throw new Error('\'credentials\' cannot be null.');
4238
}
4339
if (subscriptionId == undefined) {
44-
throw new Error("'subscriptionId' cannot be null.");
40+
throw new Error('\'subscriptionId\' cannot be null.');
4541
}
4642

4743
if (!options) {
@@ -54,8 +50,8 @@ export class HDInsightManagementClientContext extends msRestAzure.AzureServiceCl
5450

5551
super(credentials, options);
5652

57-
this.apiVersion = "2018-06-01-preview";
58-
this.acceptLanguage = "en-US";
53+
this.apiVersion = '2018-06-01-preview';
54+
this.acceptLanguage = 'en-US';
5955
this.longRunningOperationRetryTimeout = 30;
6056
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
6157
this.requestContentType = "application/json; charset=utf-8";
@@ -65,10 +61,7 @@ export class HDInsightManagementClientContext extends msRestAzure.AzureServiceCl
6561
if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
6662
this.acceptLanguage = options.acceptLanguage;
6763
}
68-
if (
69-
options.longRunningOperationRetryTimeout !== null &&
70-
options.longRunningOperationRetryTimeout !== undefined
71-
) {
64+
if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
7265
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
7366
}
7467
}

0 commit comments

Comments
 (0)