Skip to content

Commit cb9510a

Browse files
author
SDKAuto
committed
CodeGen from PR 22067 in Azure/azure-rest-api-specs
Merge 4694f6b82d0210249881a5109b2dbbd6d60dd078 into 3de956a007e6b8629617b8968409311253927947
1 parent 1cca1f1 commit cb9510a

File tree

19 files changed

+301
-163
lines changed

19 files changed

+301
-163
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 15 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/iothub/arm-iothub/CHANGELOG.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
# Release History
2-
3-
## 6.3.0-beta.2 (Unreleased)
4-
5-
### Features Added
6-
7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
12-
13-
## 6.3.0-beta.1 (2022-12-06)
2+
3+
## 6.3.0-beta.2 (2023-03-09)
144

155
**Features**
166

177
- Added Interface EncryptionPropertiesDescription
8+
- Added Interface IotHubManualFailoverHeaders
189
- Added Interface IotHubPropertiesDeviceStreams
1910
- Added Interface IotHubResourceCreateOrUpdateHeaders
2011
- Added Interface IotHubResourceDeleteHeaders
@@ -24,13 +15,17 @@
2415
- Added Interface PrivateEndpointConnectionsUpdateHeaders
2516
- Added Interface RootCertificateProperties
2617
- Added Interface RoutingCosmosDBSqlApiProperties
18+
- Added Type Alias IpVersion
2719
- Interface IotHubProperties has a new optional parameter deviceStreams
2820
- Interface IotHubProperties has a new optional parameter encryption
21+
- Interface IotHubProperties has a new optional parameter ipVersion
2922
- Interface IotHubProperties has a new optional parameter rootCertificate
3023
- Interface RoutingEndpoints has a new optional parameter cosmosDBSqlCollections
3124
- Add parameters of IotHubResourceUpdateHeaders to TypeAlias IotHubResourceUpdateResponse
25+
- Added Enum KnownIpVersion
3226
- Enum KnownRoutingSource has a new value DigitalTwinChangeEvents
3327
- Enum KnownRoutingSource has a new value MqttBrokerMessages
28+
- Added function getContinuationToken
3429

3530

3631
## 6.2.0 (2022-08-18)

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) 2022 Microsoft
3+
Copyright (c) 2023 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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"commit": "54b41d3d0aa9fc3085a5822638136bf0d84f5e57",
2+
"commit": "9c70cfee55905a5b755a7b056c6fa12b2a16a7be",
33
"readme": "specification/iothub/resource-manager/readme.md",
4-
"autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\iothub\\resource-manager\\readme.md --use=@autorest/[email protected].4 --generate-sample=true",
4+
"autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/iothub/resource-manager/readme.md --use=@autorest/[email protected].9",
55
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
6-
"release_tool": "@azure-tools/js-sdk-release-tools@2.5.2",
7-
"use": "@autorest/[email protected].4"
6+
"release_tool": "@azure-tools/js-sdk-release-tools@2.6.2",
7+
"use": "@autorest/[email protected].9"
88
}

sdk/iothub/arm-iothub/package.json

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
"node": ">=14.0.0"
99
},
1010
"dependencies": {
11-
"@azure/core-lro": "^2.2.0",
11+
"@azure/core-lro": "^2.5.0",
1212
"@azure/abort-controller": "^1.0.0",
1313
"@azure/core-paging": "^1.2.0",
14-
"@azure/core-client": "^1.6.1",
14+
"@azure/core-client": "^1.7.0",
1515
"@azure/core-auth": "^1.3.0",
1616
"@azure/core-rest-pipeline": "^1.8.0",
1717
"tslib": "^2.2.0"
@@ -33,14 +33,15 @@
3333
"@rollup/plugin-json": "^6.0.0",
3434
"@rollup/plugin-multi-entry": "^6.0.0",
3535
"@rollup/plugin-node-resolve": "^13.1.3",
36-
"mkdirp": "^1.0.4",
36+
"mkdirp": "^2.1.2",
3737
"rollup": "^2.66.1",
3838
"rollup-plugin-sourcemaps": "^0.6.3",
3939
"typescript": "~4.8.0",
4040
"uglify-js": "^3.4.9",
4141
"rimraf": "^3.0.0",
42+
"dotenv": "^16.0.0",
4243
"@azure/identity": "^2.0.1",
43-
"@azure-tools/test-recorder": "^3.0.0",
44+
"@azure-tools/test-recorder": "^2.0.0",
4445
"@azure-tools/test-credential": "^1.0.0",
4546
"mocha": "^7.1.1",
4647
"@types/chai": "^4.2.8",
@@ -49,7 +50,6 @@
4950
"@types/node": "^14.0.0",
5051
"@azure/dev-tool": "^1.0.0"
5152
},
52-
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/iothub/arm-iothub",
5353
"repository": {
5454
"type": "git",
5555
"url": "https://github.com/Azure/azure-sdk-for-js.git"
@@ -111,12 +111,5 @@
111111
]
112112
},
113113
"autoPublish": true,
114-
"//sampleConfiguration": {
115-
"productName": "",
116-
"productSlugs": [
117-
"azure"
118-
],
119-
"disableDocsMs": true,
120-
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-iothub?view=azure-node-preview"
121-
}
122-
}
114+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/iothub/arm-iothub"
115+
}

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

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
import * as coreAuth from '@azure/core-auth';
88
import * as coreClient from '@azure/core-client';
9+
import { OperationState } from '@azure/core-lro';
910
import { PagedAsyncIterableIterator } from '@azure/core-paging';
10-
import { PollerLike } from '@azure/core-lro';
11-
import { PollOperationState } from '@azure/core-lro';
11+
import { SimplePollerLike } from '@azure/core-lro';
1212

1313
// @public
1414
export type AccessRights = "RegistryRead" | "RegistryWrite" | "ServiceConnect" | "DeviceConnect" | "RegistryRead, RegistryWrite" | "RegistryRead, ServiceConnect" | "RegistryRead, DeviceConnect" | "RegistryWrite, ServiceConnect" | "RegistryWrite, DeviceConnect" | "ServiceConnect, DeviceConnect" | "RegistryRead, RegistryWrite, ServiceConnect" | "RegistryRead, RegistryWrite, DeviceConnect" | "RegistryRead, ServiceConnect, DeviceConnect" | "RegistryWrite, ServiceConnect, DeviceConnect" | "RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect";
@@ -295,7 +295,7 @@ export interface ImportDevicesRequest {
295295

296296
// @public
297297
export interface IotHub {
298-
beginManualFailover(iotHubName: string, resourceGroupName: string, failoverInput: FailoverInput, options?: IotHubManualFailoverOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
298+
beginManualFailover(iotHubName: string, resourceGroupName: string, failoverInput: FailoverInput, options?: IotHubManualFailoverOptionalParams): Promise<SimplePollerLike<OperationState<void>, void>>;
299299
beginManualFailoverAndWait(iotHubName: string, resourceGroupName: string, failoverInput: FailoverInput, options?: IotHubManualFailoverOptionalParams): Promise<void>;
300300
}
301301

@@ -360,6 +360,13 @@ export interface IotHubLocationDescription {
360360
role?: IotHubReplicaRoleType;
361361
}
362362

363+
// @public
364+
export interface IotHubManualFailoverHeaders {
365+
azureAsyncOperation?: string;
366+
// (undocumented)
367+
location?: string;
368+
}
369+
363370
// @public
364371
export interface IotHubManualFailoverOptionalParams extends coreClient.OperationOptions {
365372
resumeFrom?: string;
@@ -395,6 +402,7 @@ export interface IotHubProperties {
395402
features?: Capabilities;
396403
readonly hostName?: string;
397404
ipFilterRules?: IpFilterRule[];
405+
ipVersion?: IpVersion;
398406
readonly locations?: IotHubLocationDescription[];
399407
messagingEndpoints?: {
400408
[propertyName: string]: MessagingEndpointProperties;
@@ -436,11 +444,11 @@ export type IotHubReplicaRoleType = string;
436444

437445
// @public
438446
export interface IotHubResource {
439-
beginCreateOrUpdate(resourceGroupName: string, resourceName: string, iotHubDescription: IotHubDescription, options?: IotHubResourceCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<IotHubResourceCreateOrUpdateResponse>, IotHubResourceCreateOrUpdateResponse>>;
447+
beginCreateOrUpdate(resourceGroupName: string, resourceName: string, iotHubDescription: IotHubDescription, options?: IotHubResourceCreateOrUpdateOptionalParams): Promise<SimplePollerLike<OperationState<IotHubResourceCreateOrUpdateResponse>, IotHubResourceCreateOrUpdateResponse>>;
440448
beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, iotHubDescription: IotHubDescription, options?: IotHubResourceCreateOrUpdateOptionalParams): Promise<IotHubResourceCreateOrUpdateResponse>;
441-
beginDelete(resourceGroupName: string, resourceName: string, options?: IotHubResourceDeleteOptionalParams): Promise<PollerLike<PollOperationState<IotHubResourceDeleteResponse>, IotHubResourceDeleteResponse>>;
449+
beginDelete(resourceGroupName: string, resourceName: string, options?: IotHubResourceDeleteOptionalParams): Promise<SimplePollerLike<OperationState<IotHubResourceDeleteResponse>, IotHubResourceDeleteResponse>>;
442450
beginDeleteAndWait(resourceGroupName: string, resourceName: string, options?: IotHubResourceDeleteOptionalParams): Promise<IotHubResourceDeleteResponse>;
443-
beginUpdate(resourceGroupName: string, resourceName: string, iotHubTags: TagsResource, options?: IotHubResourceUpdateOptionalParams): Promise<PollerLike<PollOperationState<IotHubResourceUpdateResponse>, IotHubResourceUpdateResponse>>;
451+
beginUpdate(resourceGroupName: string, resourceName: string, iotHubTags: TagsResource, options?: IotHubResourceUpdateOptionalParams): Promise<SimplePollerLike<OperationState<IotHubResourceUpdateResponse>, IotHubResourceUpdateResponse>>;
444452
beginUpdateAndWait(resourceGroupName: string, resourceName: string, iotHubTags: TagsResource, options?: IotHubResourceUpdateOptionalParams): Promise<IotHubResourceUpdateResponse>;
445453
checkNameAvailability(operationInputs: OperationInputs, options?: IotHubResourceCheckNameAvailabilityOptionalParams): Promise<IotHubResourceCheckNameAvailabilityResponse>;
446454
createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, consumerGroupBody: EventHubConsumerGroupBodyDescription, options?: IotHubResourceCreateEventHubConsumerGroupOptionalParams): Promise<IotHubResourceCreateEventHubConsumerGroupResponse>;
@@ -739,6 +747,9 @@ export interface IpFilterRule {
739747
ipMask: string;
740748
}
741749

750+
// @public
751+
export type IpVersion = string;
752+
742753
// @public
743754
export interface JobResponse {
744755
readonly endTimeUtc?: Date;
@@ -821,6 +832,13 @@ export enum KnownIotHubSku {
821832
S3 = "S3"
822833
}
823834

835+
// @public
836+
export enum KnownIpVersion {
837+
Ipv4 = "ipv4",
838+
Ipv4Ipv6 = "ipv4ipv6",
839+
Ipv6 = "ipv6"
840+
}
841+
824842
// @public
825843
export enum KnownJobType {
826844
Backup = "backup",
@@ -991,9 +1009,9 @@ export interface PrivateEndpointConnectionProperties {
9911009

9921010
// @public
9931011
export interface PrivateEndpointConnections {
994-
beginDelete(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise<PollerLike<PollOperationState<PrivateEndpointConnectionsDeleteResponse>, PrivateEndpointConnectionsDeleteResponse>>;
1012+
beginDelete(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise<SimplePollerLike<OperationState<PrivateEndpointConnectionsDeleteResponse>, PrivateEndpointConnectionsDeleteResponse>>;
9951013
beginDeleteAndWait(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise<PrivateEndpointConnectionsDeleteResponse>;
996-
beginUpdate(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: PrivateEndpointConnectionsUpdateOptionalParams): Promise<PollerLike<PollOperationState<PrivateEndpointConnectionsUpdateResponse>, PrivateEndpointConnectionsUpdateResponse>>;
1014+
beginUpdate(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: PrivateEndpointConnectionsUpdateOptionalParams): Promise<SimplePollerLike<OperationState<PrivateEndpointConnectionsUpdateResponse>, PrivateEndpointConnectionsUpdateResponse>>;
9971015
beginUpdateAndWait(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: PrivateEndpointConnectionsUpdateOptionalParams): Promise<PrivateEndpointConnectionsUpdateResponse>;
9981016
get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise<PrivateEndpointConnectionsGetResponse>;
9991017
list(resourceGroupName: string, resourceName: string, options?: PrivateEndpointConnectionsListOptionalParams): Promise<PrivateEndpointConnectionsListResponse>;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class IotHubClient extends coreClient.ServiceClient {
119119

120120
// Assigning values to Constant parameters
121121
this.$host = options.$host || "https://management.azure.com";
122-
this.apiVersion = options.apiVersion || "2022-04-30-preview";
122+
this.apiVersion = options.apiVersion || "2022-11-15-preview";
123123
this.operations = new OperationsImpl(this);
124124
this.iotHubResource = new IotHubResourceImpl(this);
125125
this.resourceProviderCommon = new ResourceProviderCommonImpl(this);

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

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,37 @@
66
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
*/
88

9+
// Copyright (c) Microsoft Corporation.
10+
// Licensed under the MIT license.
11+
12+
import { AbortSignalLike } from "@azure/abort-controller";
913
import { LongRunningOperation, LroResponse } from "@azure/core-lro";
1014

11-
export class LroImpl<T> implements LongRunningOperation<T> {
12-
constructor(
13-
private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
14-
private args: Record<string, unknown>,
15-
private spec: {
16-
readonly requestBody?: unknown;
17-
readonly path?: string;
18-
readonly httpMethod: string;
19-
} & Record<string, any>,
20-
public requestPath: string = spec.path!,
21-
public requestMethod: string = spec.httpMethod
22-
) {}
23-
public async sendInitialRequest(): Promise<LroResponse<T>> {
24-
return this.sendOperationFn(this.args, this.spec);
25-
}
26-
public async sendPollRequest(path: string): Promise<LroResponse<T>> {
27-
const { requestBody, ...restSpec } = this.spec;
28-
return this.sendOperationFn(this.args, {
29-
...restSpec,
30-
path,
31-
httpMethod: "GET"
32-
});
33-
}
15+
export function createLroSpec<T>(inputs: {
16+
sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>;
17+
args: Record<string, unknown>;
18+
spec: {
19+
readonly requestBody?: unknown;
20+
readonly path?: string;
21+
readonly httpMethod: string;
22+
} & Record<string, any>;
23+
}): LongRunningOperation<T> {
24+
const { args, spec, sendOperationFn } = inputs;
25+
return {
26+
requestMethod: spec.httpMethod,
27+
requestPath: spec.path!,
28+
sendInitialRequest: () => sendOperationFn(args, spec),
29+
sendPollRequest: (
30+
path: string,
31+
options?: { abortSignal?: AbortSignalLike }
32+
) => {
33+
const { requestBody, ...restSpec } = spec;
34+
return sendOperationFn(args, {
35+
...restSpec,
36+
httpMethod: "GET",
37+
path,
38+
abortSignal: options?.abortSignal
39+
});
40+
}
41+
};
3442
}

0 commit comments

Comments
 (0)