Skip to content

Commit eace120

Browse files
authored
Arm iothub release (Azure#15213)
* arm-iothub-release * arm-iothub-release
1 parent 143fdee commit eace120

24 files changed

+2446
-1475
lines changed

sdk/iothub/arm-iothub/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) 2020 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/iothub/arm-iothub/README.md

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,37 @@ npm install @azure/arm-iothub
1515

1616
### How to use
1717

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

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

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

2728
##### Sample code
2829

30+
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
31+
2932
```typescript
30-
import * as msRest from "@azure/ms-rest-js";
31-
import * as msRestAzure from "@azure/ms-rest-azure-js";
32-
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth";
33-
import { IotHubClient, IotHubModels, IotHubMappers } from "@azure/arm-iothub";
33+
const msRestNodeAuth = require("@azure/ms-rest-nodeauth");
34+
const { IotHubClient } = require("@azure/arm-iothub");
3435
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];
3536

36-
msRestNodeAuth.interactiveLogin().then((creds) => {
37-
const client = new IotHubClient(creds, subscriptionId);
38-
client.operations.list().then((result) => {
39-
console.log("The result is:");
40-
console.log(result);
37+
msRestNodeAuth
38+
.interactiveLogin()
39+
.then((creds) => {
40+
const client = new IotHubClient(creds, subscriptionId);
41+
client.operations.list().then((result) => {
42+
console.log("The result is:");
43+
console.log(result);
44+
});
45+
})
46+
.catch((err) => {
47+
console.error(err);
4148
});
42-
}).catch((err) => {
43-
console.error(err);
44-
});
4549
```
4650

4751
#### browser - Authentication, client creation and list operations as an example written in JavaScript.
@@ -57,6 +61,7 @@ npm install @azure/ms-rest-browserauth
5761
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser.
5862

5963
- index.html
64+
6065
```html
6166
<!DOCTYPE html>
6267
<html lang="en">
@@ -78,13 +83,16 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
7883
authManager.login();
7984
}
8085
const client = new Azure.ArmIothub.IotHubClient(res.creds, subscriptionId);
81-
client.operations.list().then((result) => {
82-
console.log("The result is:");
83-
console.log(result);
84-
}).catch((err) => {
85-
console.log("An error occurred:");
86-
console.error(err);
87-
});
86+
client.operations
87+
.list()
88+
.then((result) => {
89+
console.log("The result is:");
90+
console.log(result);
91+
})
92+
.catch((err) => {
93+
console.log("An error occurred:");
94+
console.error(err);
95+
});
8896
});
8997
</script>
9098
</head>

sdk/iothub/arm-iothub/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@azure/arm-iothub",
33
"author": "Microsoft Corporation",
44
"description": "IotHubClient Library with typescript type definitions for node.js and browser.",
5-
"version": "4.0.0",
5+
"version": "5.0.0",
66
"dependencies": {
77
"@azure/ms-rest-azure-js": "^2.0.1",
88
"@azure/ms-rest-js": "^2.0.4",

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ import sourcemaps from "rollup-plugin-sourcemaps";
77
*/
88
const config = {
99
input: "./esm/iotHubClient.js",
10-
external: [
11-
"@azure/ms-rest-js",
12-
"@azure/ms-rest-azure-js"
13-
],
10+
external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
1411
output: {
1512
file: "./dist/arm-iothub.js",
1613
format: "umd",
@@ -21,17 +18,14 @@ const config = {
2118
"@azure/ms-rest-azure-js": "msRestAzure"
2219
},
2320
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.
21+
* Copyright (c) Microsoft Corporation.
22+
* Licensed under the MIT License.
2623
*
2724
* Code generated by Microsoft (R) AutoRest Code Generator.
2825
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
2926
*/`
3027
},
31-
plugins: [
32-
nodeResolve({ mainFields: ['module', 'main'] }),
33-
sourcemaps()
34-
]
28+
plugins: [nodeResolve({ mainFields: ["module", "main"] }), sourcemaps()]
3529
};
3630

3731
export default config;

sdk/iothub/arm-iothub/src/iotHubClient.ts

Lines changed: 8 additions & 11 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
@@ -14,7 +13,6 @@ import * as Mappers from "./models/mappers";
1413
import * as operations from "./operations";
1514
import { IotHubClientContext } from "./iotHubClientContext";
1615

17-
1816
class IotHubClient extends IotHubClientContext {
1917
// Operation groups
2018
operations: operations.Operations;
@@ -31,7 +29,11 @@ class IotHubClient extends IotHubClientContext {
3129
* @param subscriptionId The subscription identifier.
3230
* @param [options] The parameter options
3331
*/
34-
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.IotHubClientOptions) {
32+
constructor(
33+
credentials: msRest.ServiceClientCredentials,
34+
subscriptionId: string,
35+
options?: Models.IotHubClientOptions
36+
) {
3537
super(credentials, subscriptionId, options);
3638
this.operations = new operations.Operations(this);
3739
this.iotHubResource = new operations.IotHubResource(this);
@@ -45,10 +47,5 @@ class IotHubClient extends IotHubClientContext {
4547

4648
// Operation Specifications
4749

48-
export {
49-
IotHubClient,
50-
IotHubClientContext,
51-
Models as IotHubModels,
52-
Mappers as IotHubMappers
53-
};
50+
export { IotHubClient, IotHubClientContext, Models as IotHubModels, Mappers as IotHubMappers };
5451
export * from "./operations";

sdk/iothub/arm-iothub/src/iotHubClientContext.ts

Lines changed: 18 additions & 12 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
@@ -13,7 +12,7 @@ import * as msRest from "@azure/ms-rest-js";
1312
import * as msRestAzure from "@azure/ms-rest-azure-js";
1413

1514
const packageName = "@azure/arm-iothub";
16-
const packageVersion = "4.0.0";
15+
const packageVersion = "5.0.0";
1716

1817
export class IotHubClientContext extends msRestAzure.AzureServiceClient {
1918
credentials: msRest.ServiceClientCredentials;
@@ -26,36 +25,43 @@ export class IotHubClientContext extends msRestAzure.AzureServiceClient {
2625
* @param subscriptionId The subscription identifier.
2726
* @param [options] The parameter options
2827
*/
29-
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.IotHubClientOptions) {
28+
constructor(
29+
credentials: msRest.ServiceClientCredentials,
30+
subscriptionId: string,
31+
options?: Models.IotHubClientOptions
32+
) {
3033
if (credentials == undefined) {
31-
throw new Error('\'credentials\' cannot be null.');
34+
throw new Error("'credentials' cannot be null.");
3235
}
3336
if (subscriptionId == undefined) {
34-
throw new Error('\'subscriptionId\' cannot be null.');
37+
throw new Error("'subscriptionId' cannot be null.");
3538
}
3639

3740
if (!options) {
3841
options = {};
3942
}
40-
if(!options.userAgent) {
43+
if (!options.userAgent) {
4144
const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
4245
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
4346
}
4447

4548
super(credentials, options);
4649

47-
this.apiVersion = '2020-07-10-preview';
48-
this.acceptLanguage = 'en-US';
50+
this.apiVersion = "2021-03-31";
51+
this.acceptLanguage = "en-US";
4952
this.longRunningOperationRetryTimeout = 30;
5053
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
5154
this.requestContentType = "application/json; charset=utf-8";
5255
this.credentials = credentials;
5356
this.subscriptionId = subscriptionId;
5457

55-
if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
58+
if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
5659
this.acceptLanguage = options.acceptLanguage;
5760
}
58-
if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
61+
if (
62+
options.longRunningOperationRetryTimeout !== null &&
63+
options.longRunningOperationRetryTimeout !== undefined
64+
) {
5965
this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
6066
}
6167
}

sdk/iothub/arm-iothub/src/models/certificatesMappers.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +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+
ArmIdentity,
11+
ArmUserIdentity,
1012
BaseResource,
1113
CertificateDescription,
1214
CertificateListDescription,
@@ -15,7 +17,6 @@ export {
1517
CertificateVerificationDescription,
1618
CertificateWithNonceDescription,
1719
CloudToDeviceProperties,
18-
EncryptionPropertiesDescription,
1920
EnrichmentProperties,
2021
ErrorDetails,
2122
EventHubConsumerGroupInfo,
@@ -25,11 +26,12 @@ export {
2526
IotHubDescription,
2627
IotHubLocationDescription,
2728
IotHubProperties,
28-
IotHubPropertiesDeviceStreams,
2929
IotHubSkuInfo,
3030
IpFilterRule,
31-
KeyVaultKeyProperties,
31+
ManagedIdentity,
3232
MessagingEndpointProperties,
33+
NetworkRuleSetIpRule,
34+
NetworkRuleSetProperties,
3335
PrivateEndpoint,
3436
PrivateEndpointConnection,
3537
PrivateEndpointConnectionProperties,

0 commit comments

Comments
 (0)