Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions sdk/iothub/arm-iothub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Release History

## 6.0.1 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes


## 6.1.0 (2022-01-13)

**Features**

- Added Interface SystemData
- Added Type Alias CreatedByType
- Interface IotHubProperties has a new optional parameter enableDataResidency
- Type Alias IotHubDescription has a new parameter systemData
- Added Enum KnownCreatedByType


## 6.0.0 (2021-12-17)

The package of @azure/arm-iothub is using our next generation design principles since version 6.0.0, which contains breaking changes.
Expand Down
2 changes: 1 addition & 1 deletion sdk/iothub/arm-iothub/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 Microsoft
Copyright (c) 2022 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions sdk/iothub/arm-iothub/_meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"commit": "e6d1396612965f2af8df6bb941be19681147930a",
"commit": "4f44a827fe027fc5ccef37af91bf2b30aef18847",
"readme": "specification/iothub/resource-manager/readme.md",
"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",
"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",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"use": "@autorest/[email protected].20211207.1"
"use": "@autorest/[email protected].20220105.1"
}
18 changes: 4 additions & 14 deletions sdk/iothub/arm-iothub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for IotHubClient.",
"version": "6.0.1",
"engines": {
"node": ">=12.0.0"
},
"version": "6.1.0",
"engines": { "node": ">=12.0.0" },
"dependencies": {
"@azure/core-lro": "^2.2.0",
"@azure/abort-controller": "^1.0.0",
Expand All @@ -16,13 +14,7 @@
"@azure/core-rest-pipeline": "^1.1.0",
"tslib": "^2.2.0"
},
"keywords": [
"node",
"azure",
"typescript",
"browser",
"isomorphic"
],
"keywords": ["node", "azure", "typescript", "browser", "isomorphic"],
"license": "MIT",
"main": "./dist/index.js",
"module": "./dist-esm/src/index.js",
Expand All @@ -49,9 +41,7 @@
"type": "git",
"url": "https://github.com/Azure/azure-sdk-for-js.git"
},
"bugs": {
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
},
"bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" },
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
Expand Down
27 changes: 27 additions & 0 deletions sdk/iothub/arm-iothub/review/arm-iothub.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ export interface CloudToDeviceProperties {
maxDeliveryCount?: number;
}

// @public
export type CreatedByType = string;

// @public
export type DefaultAction = string;

Expand Down Expand Up @@ -333,6 +336,7 @@ export type IotHubDescription = Resource & {
properties?: IotHubProperties;
sku: IotHubSkuInfo;
identity?: ArmIdentity;
readonly systemData?: SystemData;
};

// @public
Expand Down Expand Up @@ -372,6 +376,7 @@ export interface IotHubProperties {
disableDeviceSAS?: boolean;
disableLocalAuth?: boolean;
disableModuleSAS?: boolean;
enableDataResidency?: boolean;
enableFileUploadNotifications?: boolean;
eventHubEndpoints?: {
[propertyName: string]: EventHubProperties;
Expand Down Expand Up @@ -742,6 +747,18 @@ export enum KnownCapabilities {
None = "None"
}

// @public
export enum KnownCreatedByType {
// (undocumented)
Application = "Application",
// (undocumented)
Key = "Key",
// (undocumented)
ManagedIdentity = "ManagedIdentity",
// (undocumented)
User = "User"
}

// @public
export enum KnownDefaultAction {
// (undocumented)
Expand Down Expand Up @@ -1256,6 +1273,16 @@ export interface StorageEndpointProperties {
sasTtlAsIso8601?: string;
}

// @public
export interface SystemData {
createdAt?: Date;
createdBy?: string;
createdByType?: CreatedByType;
lastModifiedAt?: Date;
lastModifiedBy?: string;
lastModifiedByType?: CreatedByType;
}

// @public
export interface TagsResource {
tags?: {
Expand Down
4 changes: 2 additions & 2 deletions sdk/iothub/arm-iothub/src/iotHubClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class IotHubClient extends coreClient.ServiceClient {
credential: credentials
};

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

// Assigning values to Constant parameters
this.$host = options.$host || "https://management.azure.com";
this.apiVersion = options.apiVersion || "2021-07-01";
this.apiVersion = options.apiVersion || "2021-07-02";
this.operations = new OperationsImpl(this);
this.iotHubResource = new IotHubResourceImpl(this);
this.resourceProviderCommon = new ResourceProviderCommonImpl(this);
Expand Down
43 changes: 43 additions & 0 deletions sdk/iothub/arm-iothub/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ export interface IotHubProperties {
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly locations?: IotHubLocationDescription[];
/** This property when set to true, will enable data residency, thus, disabling disaster recovery. */
enableDataResidency?: boolean;
}

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

/** Metadata pertaining to creation and last modification of the resource. */
export interface SystemData {
/** The identity that created the resource. */
createdBy?: string;
/** The type of identity that created the resource. */
createdByType?: CreatedByType;
/** The timestamp of resource creation (UTC). */
createdAt?: Date;
/** The identity that last modified the resource. */
lastModifiedBy?: string;
/** The type of identity that last modified the resource. */
lastModifiedByType?: CreatedByType;
/** The timestamp of resource last modification (UTC) */
lastModifiedAt?: Date;
}

/** The common properties of an Azure resource. */
export interface Resource {
/**
Expand Down Expand Up @@ -1177,6 +1195,11 @@ export type IotHubDescription = Resource & {
sku: IotHubSkuInfo;
/** The managed identities for the IotHub. */
identity?: ArmIdentity;
/**
* The system meta data relating to this resource.
* NOTE: This property will not be serialized. It can only be populated by the server.
*/
readonly systemData?: SystemData;
};

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

/** Known values of {@link CreatedByType} that the service accepts. */
export enum KnownCreatedByType {
User = "User",
Application = "Application",
ManagedIdentity = "ManagedIdentity",
Key = "Key"
}

/**
* Defines values for CreatedByType. \
* {@link KnownCreatedByType} can be used interchangeably with CreatedByType,
* this enum contains the known values that the service supports.
* ### Known values supported by the service
* **User** \
* **Application** \
* **ManagedIdentity** \
* **Key**
*/
export type CreatedByType = string;

/** Known values of {@link JobType} that the service accepts. */
export enum KnownJobType {
Unknown = "unknown",
Expand Down
58 changes: 58 additions & 0 deletions sdk/iothub/arm-iothub/src/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,12 @@ export const IotHubProperties: coreClient.CompositeMapper = {
}
}
}
},
enableDataResidency: {
serializedName: "enableDataResidency",
type: {
name: "Boolean"
}
}
}
}
Expand Down Expand Up @@ -1450,6 +1456,51 @@ export const ArmUserIdentity: coreClient.CompositeMapper = {
}
};

export const SystemData: coreClient.CompositeMapper = {
type: {
name: "Composite",
className: "SystemData",
modelProperties: {
createdBy: {
serializedName: "createdBy",
type: {
name: "String"
}
},
createdByType: {
serializedName: "createdByType",
type: {
name: "String"
}
},
createdAt: {
serializedName: "createdAt",
type: {
name: "DateTime"
}
},
lastModifiedBy: {
serializedName: "lastModifiedBy",
type: {
name: "String"
}
},
lastModifiedByType: {
serializedName: "lastModifiedByType",
type: {
name: "String"
}
},
lastModifiedAt: {
serializedName: "lastModifiedAt",
type: {
name: "DateTime"
}
}
}
}
};

export const Resource: coreClient.CompositeMapper = {
type: {
name: "Composite",
Expand Down Expand Up @@ -2985,6 +3036,13 @@ export const IotHubDescription: coreClient.CompositeMapper = {
name: "Composite",
className: "ArmIdentity"
}
},
systemData: {
serializedName: "systemData",
type: {
name: "Composite",
className: "SystemData"
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/iothub/arm-iothub/src/models/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const $host: OperationURLParameter = {
export const apiVersion: OperationQueryParameter = {
parameterPath: "apiVersion",
mapper: {
defaultValue: "2021-07-01",
defaultValue: "2021-07-02",
isConstant: true,
serializedName: "api-version",
type: {
Expand Down
48 changes: 48 additions & 0 deletions sdk/iothub/arm-iothub/test/sampleTest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT License.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
*/

import {
env,
record,
RecorderEnvironmentSetup,
Recorder
} from "@azure-tools/test-recorder";
import * as assert from "assert";

const recorderEnvSetup: RecorderEnvironmentSetup = {
replaceableVariables: {
AZURE_CLIENT_ID: "azure_client_id",
AZURE_CLIENT_SECRET: "azure_client_secret",
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
SUBSCRIPTION_ID: "azure_subscription_id"
},
customizationsOnRecordings: [
(recording: any): any =>
recording.replace(
/"access_token":"[^"]*"/g,
`"access_token":"access_token"`
)
],
queryParametersToSkip: []
};

describe("My test", () => {
let recorder: Recorder;

beforeEach(async function() {
recorder = record(this, recorderEnvSetup);
});

afterEach(async function() {
await recorder.stop();
});

it("sample test", async function() {
console.log("Hi, I'm a test!");
});
});