Skip to content

Commit 8dd0594

Browse files
author
SDKAuto
committed
CodeGen from PR 17304 in Azure/azure-rest-api-specs
Merge fb01001816b87a07df45057f81faac117f911a9d into 3ffc36f7f7623032d3e22f23c99eec36f9ceed09
1 parent 19d0468 commit 8dd0594

File tree

10 files changed

+199
-32
lines changed

10 files changed

+199
-32
lines changed

sdk/iothub/arm-iothub/CHANGELOG.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# Release History
2-
3-
## 6.0.1 (Unreleased)
4-
5-
### Features Added
6-
7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
12-
2+
3+
## 6.1.0 (2022-01-13)
4+
5+
**Features**
6+
7+
- Added Interface SystemData
8+
- Added Type Alias CreatedByType
9+
- Interface IotHubProperties has a new optional parameter enableDataResidency
10+
- Type Alias IotHubDescription has a new parameter systemData
11+
- Added Enum KnownCreatedByType
12+
13+
1314
## 6.0.0 (2021-12-17)
1415

1516
The package of @azure/arm-iothub is using our next generation design principles since version 6.0.0, which contains breaking changes.

sdk/iothub/arm-iothub/LICENSE

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) 2021 Microsoft
3+
Copyright (c) 2022 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/_meta.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"commit": "e6d1396612965f2af8df6bb941be19681147930a",
2+
"commit": "4f44a827fe027fc5ccef37af91bf2b30aef18847",
33
"readme": "specification/iothub/resource-manager/readme.md",
4-
"autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/iothub/resource-manager/readme.md --use=@autorest/[email protected].20211207.1",
4+
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/iothub/resource-manager/readme.md --use=@autorest/[email protected].20220105.1",
55
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
6-
"use": "@autorest/[email protected].20211207.1"
6+
"use": "@autorest/[email protected].20220105.1"
77
}

sdk/iothub/arm-iothub/package.json

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
"sdk-type": "mgmt",
44
"author": "Microsoft Corporation",
55
"description": "A generated SDK for IotHubClient.",
6-
"version": "6.0.1",
7-
"engines": {
8-
"node": ">=12.0.0"
9-
},
6+
"version": "6.1.0",
7+
"engines": { "node": ">=12.0.0" },
108
"dependencies": {
119
"@azure/core-lro": "^2.2.0",
1210
"@azure/abort-controller": "^1.0.0",
@@ -16,13 +14,7 @@
1614
"@azure/core-rest-pipeline": "^1.1.0",
1715
"tslib": "^2.2.0"
1816
},
19-
"keywords": [
20-
"node",
21-
"azure",
22-
"typescript",
23-
"browser",
24-
"isomorphic"
25-
],
17+
"keywords": ["node", "azure", "typescript", "browser", "isomorphic"],
2618
"license": "MIT",
2719
"main": "./dist/index.js",
2820
"module": "./dist-esm/src/index.js",
@@ -49,9 +41,7 @@
4941
"type": "git",
5042
"url": "https://github.com/Azure/azure-sdk-for-js.git"
5143
},
52-
"bugs": {
53-
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
54-
},
44+
"bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" },
5545
"files": [
5646
"dist/**/*.js",
5747
"dist/**/*.js.map",

sdk/iothub/arm-iothub/review/arm-iothub.api.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ export interface CloudToDeviceProperties {
149149
maxDeliveryCount?: number;
150150
}
151151

152+
// @public
153+
export type CreatedByType = string;
154+
152155
// @public
153156
export type DefaultAction = string;
154157

@@ -333,6 +336,7 @@ export type IotHubDescription = Resource & {
333336
properties?: IotHubProperties;
334337
sku: IotHubSkuInfo;
335338
identity?: ArmIdentity;
339+
readonly systemData?: SystemData;
336340
};
337341

338342
// @public
@@ -372,6 +376,7 @@ export interface IotHubProperties {
372376
disableDeviceSAS?: boolean;
373377
disableLocalAuth?: boolean;
374378
disableModuleSAS?: boolean;
379+
enableDataResidency?: boolean;
375380
enableFileUploadNotifications?: boolean;
376381
eventHubEndpoints?: {
377382
[propertyName: string]: EventHubProperties;
@@ -742,6 +747,18 @@ export enum KnownCapabilities {
742747
None = "None"
743748
}
744749

750+
// @public
751+
export enum KnownCreatedByType {
752+
// (undocumented)
753+
Application = "Application",
754+
// (undocumented)
755+
Key = "Key",
756+
// (undocumented)
757+
ManagedIdentity = "ManagedIdentity",
758+
// (undocumented)
759+
User = "User"
760+
}
761+
745762
// @public
746763
export enum KnownDefaultAction {
747764
// (undocumented)
@@ -1256,6 +1273,16 @@ export interface StorageEndpointProperties {
12561273
sasTtlAsIso8601?: string;
12571274
}
12581275

1276+
// @public
1277+
export interface SystemData {
1278+
createdAt?: Date;
1279+
createdBy?: string;
1280+
createdByType?: CreatedByType;
1281+
lastModifiedAt?: Date;
1282+
lastModifiedBy?: string;
1283+
lastModifiedByType?: CreatedByType;
1284+
}
1285+
12591286
// @public
12601287
export interface TagsResource {
12611288
tags?: {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class IotHubClient extends coreClient.ServiceClient {
6060
credential: credentials
6161
};
6262

63-
const packageDetails = `azsdk-js-arm-iothub/6.0.0`;
63+
const packageDetails = `azsdk-js-arm-iothub/6.1.0`;
6464
const userAgentPrefix =
6565
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
6666
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
@@ -83,7 +83,7 @@ export class IotHubClient extends coreClient.ServiceClient {
8383

8484
// Assigning values to Constant parameters
8585
this.$host = options.$host || "https://management.azure.com";
86-
this.apiVersion = options.apiVersion || "2021-07-01";
86+
this.apiVersion = options.apiVersion || "2021-07-02";
8787
this.operations = new OperationsImpl(this);
8888
this.iotHubResource = new IotHubResourceImpl(this);
8989
this.resourceProviderCommon = new ResourceProviderCommonImpl(this);

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

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ export interface IotHubProperties {
141141
* NOTE: This property will not be serialized. It can only be populated by the server.
142142
*/
143143
readonly locations?: IotHubLocationDescription[];
144+
/** This property when set to true, will enable data residency, thus, disabling disaster recovery. */
145+
enableDataResidency?: boolean;
144146
}
145147

146148
/** The properties of an IoT hub shared access policy. */
@@ -509,6 +511,22 @@ export interface ArmUserIdentity {
509511
readonly clientId?: string;
510512
}
511513

514+
/** Metadata pertaining to creation and last modification of the resource. */
515+
export interface SystemData {
516+
/** The identity that created the resource. */
517+
createdBy?: string;
518+
/** The type of identity that created the resource. */
519+
createdByType?: CreatedByType;
520+
/** The timestamp of resource creation (UTC). */
521+
createdAt?: Date;
522+
/** The identity that last modified the resource. */
523+
lastModifiedBy?: string;
524+
/** The type of identity that last modified the resource. */
525+
lastModifiedByType?: CreatedByType;
526+
/** The timestamp of resource last modification (UTC) */
527+
lastModifiedAt?: Date;
528+
}
529+
512530
/** The common properties of an Azure resource. */
513531
export interface Resource {
514532
/**
@@ -1177,6 +1195,11 @@ export type IotHubDescription = Resource & {
11771195
sku: IotHubSkuInfo;
11781196
/** The managed identities for the IotHub. */
11791197
identity?: ArmIdentity;
1198+
/**
1199+
* The system meta data relating to this resource.
1200+
* NOTE: This property will not be serialized. It can only be populated by the server.
1201+
*/
1202+
readonly systemData?: SystemData;
11801203
};
11811204

11821205
/** Known values of {@link PublicNetworkAccess} that the service accepts. */
@@ -1361,6 +1384,26 @@ export enum KnownIotHubSku {
13611384
*/
13621385
export type IotHubSku = string;
13631386

1387+
/** Known values of {@link CreatedByType} that the service accepts. */
1388+
export enum KnownCreatedByType {
1389+
User = "User",
1390+
Application = "Application",
1391+
ManagedIdentity = "ManagedIdentity",
1392+
Key = "Key"
1393+
}
1394+
1395+
/**
1396+
* Defines values for CreatedByType. \
1397+
* {@link KnownCreatedByType} can be used interchangeably with CreatedByType,
1398+
* this enum contains the known values that the service supports.
1399+
* ### Known values supported by the service
1400+
* **User** \
1401+
* **Application** \
1402+
* **ManagedIdentity** \
1403+
* **Key**
1404+
*/
1405+
export type CreatedByType = string;
1406+
13641407
/** Known values of {@link JobType} that the service accepts. */
13651408
export enum KnownJobType {
13661409
Unknown = "unknown",

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

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,12 @@ export const IotHubProperties: coreClient.CompositeMapper = {
324324
}
325325
}
326326
}
327+
},
328+
enableDataResidency: {
329+
serializedName: "enableDataResidency",
330+
type: {
331+
name: "Boolean"
332+
}
327333
}
328334
}
329335
}
@@ -1450,6 +1456,51 @@ export const ArmUserIdentity: coreClient.CompositeMapper = {
14501456
}
14511457
};
14521458

1459+
export const SystemData: coreClient.CompositeMapper = {
1460+
type: {
1461+
name: "Composite",
1462+
className: "SystemData",
1463+
modelProperties: {
1464+
createdBy: {
1465+
serializedName: "createdBy",
1466+
type: {
1467+
name: "String"
1468+
}
1469+
},
1470+
createdByType: {
1471+
serializedName: "createdByType",
1472+
type: {
1473+
name: "String"
1474+
}
1475+
},
1476+
createdAt: {
1477+
serializedName: "createdAt",
1478+
type: {
1479+
name: "DateTime"
1480+
}
1481+
},
1482+
lastModifiedBy: {
1483+
serializedName: "lastModifiedBy",
1484+
type: {
1485+
name: "String"
1486+
}
1487+
},
1488+
lastModifiedByType: {
1489+
serializedName: "lastModifiedByType",
1490+
type: {
1491+
name: "String"
1492+
}
1493+
},
1494+
lastModifiedAt: {
1495+
serializedName: "lastModifiedAt",
1496+
type: {
1497+
name: "DateTime"
1498+
}
1499+
}
1500+
}
1501+
}
1502+
};
1503+
14531504
export const Resource: coreClient.CompositeMapper = {
14541505
type: {
14551506
name: "Composite",
@@ -2985,6 +3036,13 @@ export const IotHubDescription: coreClient.CompositeMapper = {
29853036
name: "Composite",
29863037
className: "ArmIdentity"
29873038
}
3039+
},
3040+
systemData: {
3041+
serializedName: "systemData",
3042+
type: {
3043+
name: "Composite",
3044+
className: "SystemData"
3045+
}
29883046
}
29893047
}
29903048
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const $host: OperationURLParameter = {
5353
export const apiVersion: OperationQueryParameter = {
5454
parameterPath: "apiVersion",
5555
mapper: {
56-
defaultValue: "2021-07-01",
56+
defaultValue: "2021-07-02",
5757
isConstant: true,
5858
serializedName: "api-version",
5959
type: {
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
4+
*
5+
* Code generated by Microsoft (R) AutoRest Code Generator.
6+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
*/
8+
9+
import {
10+
env,
11+
record,
12+
RecorderEnvironmentSetup,
13+
Recorder
14+
} from "@azure-tools/test-recorder";
15+
import * as assert from "assert";
16+
17+
const recorderEnvSetup: RecorderEnvironmentSetup = {
18+
replaceableVariables: {
19+
AZURE_CLIENT_ID: "azure_client_id",
20+
AZURE_CLIENT_SECRET: "azure_client_secret",
21+
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
22+
SUBSCRIPTION_ID: "azure_subscription_id"
23+
},
24+
customizationsOnRecordings: [
25+
(recording: any): any =>
26+
recording.replace(
27+
/"access_token":"[^"]*"/g,
28+
`"access_token":"access_token"`
29+
)
30+
],
31+
queryParametersToSkip: []
32+
};
33+
34+
describe("My test", () => {
35+
let recorder: Recorder;
36+
37+
beforeEach(async function() {
38+
recorder = record(this, recorderEnvSetup);
39+
});
40+
41+
afterEach(async function() {
42+
await recorder.stop();
43+
});
44+
45+
it("sample test", async function() {
46+
console.log("Hi, I'm a test!");
47+
});
48+
});

0 commit comments

Comments
 (0)