diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 6007bdbd61fb..2558ae11400a 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4030,7 +4030,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.1.0-dev.20230308 + typescript: 5.1.0-dev.20230309 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8961,8 +8961,8 @@ packages: hasBin: true dev: false - /typescript/5.1.0-dev.20230308: - resolution: {integrity: sha512-CSITPpBYNdPYujl36d9VhNNCLE+isuwm/ArFbYgPsWsLniLCcfBl+NcaOkVqyjV0XEjP+uN1yywiglCkEzed1w==} + /typescript/5.1.0-dev.20230309: + resolution: {integrity: sha512-pCqgzbHDsuACtq0v+pjNY6Zf7cdWZstY38Jq7FfD1HqAeEGnFKhrZgSRh7kS/QE5UOctGAqbp1ynTGdVI7s4Mw==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -10052,7 +10052,7 @@ packages: dev: false file:projects/app-configuration.tgz: - resolution: {integrity: sha512-11s7ELWUeURBhvG90Ip9QP+D7uTS5DHZn7dZutSnzjDw4dBouxuHwLTuxXxEWx/SN30pCbc52inHwNVVb6RufA==, tarball: file:projects/app-configuration.tgz} + resolution: {integrity: sha512-CLn6BAgagKUJw0cSu2Ku91Zxkk7GoUYJ4z++Nu0D2QPN7hymevKMong9VGUFrCp9WomQF1+qW7qNzxyOXuWrdA==, tarball: file:projects/app-configuration.tgz} name: '@rush-temp/app-configuration' version: 0.0.0 dependencies: @@ -12708,10 +12708,11 @@ packages: dev: false file:projects/arm-iothub.tgz: - resolution: {integrity: sha512-lA57nqDA5i4UuZQtvwI/K8J7XPXuen3IrwMPsQZ5bRTScUz1ozDjhtkGVpzK+ESIQrvJ0tkXyDV0idHCkum6Qg==, tarball: file:projects/arm-iothub.tgz} + resolution: {integrity: sha512-akfs9jZt105SA4039Yv3Ik+oDGJADfu1nhUjo4/k9f+L7iO7s5CF/B+krMkpmymdf6HB/QqvQY3tylk+XM6yfA==, tarball: file:projects/arm-iothub.tgz} name: '@rush-temp/arm-iothub' version: 0.0.0 dependencies: + '@azure-tools/test-recorder': 2.0.0 '@azure/identity': 2.1.0 '@microsoft/api-extractor': 7.34.4_@types+node@14.18.37 '@rollup/plugin-commonjs': 24.0.1_rollup@2.79.1 @@ -12722,7 +12723,8 @@ packages: '@types/node': 14.18.37 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.5 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 @@ -12731,6 +12733,7 @@ packages: typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: + - encoding - supports-color dev: false @@ -17465,7 +17468,7 @@ packages: dev: false file:projects/identity.tgz: - resolution: {integrity: sha512-PNVGSQgrV74ZaOtZm6TtRIFPjkRsml2P7B7UhyT9EiQ0F1WLTv4nvg5VO0o74HN4qK0ZDLXxjg3CNEgxqd5LTg==, tarball: file:projects/identity.tgz} + resolution: {integrity: sha512-D6xmkAXr5zwZ2B2DbCiC9wxYe0i7auXwa/E5SMB7/Amy9mnzJDRuO9dNDdHM6Ib0VjRzZ45rf1eGwBs+eOBjqA==, tarball: file:projects/identity.tgz} name: '@rush-temp/identity' version: 0.0.0 dependencies: @@ -17615,7 +17618,7 @@ packages: dev: false file:projects/keyvault-admin.tgz: - resolution: {integrity: sha512-1aR1s+cEC5T8rkebkJA2gFgWPwR5RVR7qOAyWvslFGqg4Up4bqVNI6q8YhpL/15gPijjjk5RTcUOT22wqfwnJw==, tarball: file:projects/keyvault-admin.tgz} + resolution: {integrity: sha512-s4NxTw0qqENCSJYvtlPyCXPgueoVmiy1iB5nUV6ZZIXDein+SiGbPDe9AqhQaMLIIPYuOIYqNqUZzSkF/UVsow==, tarball: file:projects/keyvault-admin.tgz} name: '@rush-temp/keyvault-admin' version: 0.0.0 dependencies: @@ -17645,7 +17648,7 @@ packages: dev: false file:projects/keyvault-certificates.tgz: - resolution: {integrity: sha512-g8Wgna15TiEQooet1FkrlWzfZDl1cUueV0s3kd3y+g55OuL34cOTY5k0Q7Jc6lpQ8aB629YDfkDw6L7zgFdj7Q==, tarball: file:projects/keyvault-certificates.tgz} + resolution: {integrity: sha512-bAOUuJYxu7UjhLiiTrxlGZh1kv+QqyLkBI1f10AdzZxOsd3bWAqdO/wnFr1WT7irLzYkrx3e1M2yNZsSlZG1yQ==, tarball: file:projects/keyvault-certificates.tgz} name: '@rush-temp/keyvault-certificates' version: 0.0.0 dependencies: @@ -18669,7 +18672,7 @@ packages: dev: false file:projects/perf-keyvault-certificates.tgz: - resolution: {integrity: sha512-VRd1Fnp27eLm8oKYYFQCcXvnz2trIEutUMv6Ii6/DAUdPCzQm5yXJZmEO07bxwXKv1vSdMDZknW62M/nDQ+Dag==, tarball: file:projects/perf-keyvault-certificates.tgz} + resolution: {integrity: sha512-y0b7TFibUwxWIft7IQU79eCCYEEjeDQpLM3naIAbL5kd0OoY4FbGeweB1vbG2vqtmqUQLWQxdFkxzUNsOVjEYw==, tarball: file:projects/perf-keyvault-certificates.tgz} name: '@rush-temp/perf-keyvault-certificates' version: 0.0.0 dependencies: @@ -18692,7 +18695,7 @@ packages: dev: false file:projects/perf-keyvault-keys.tgz: - resolution: {integrity: sha512-ueAWRbfdi9lmOGge9FsNKesnXqDFeZVEzpEx0oTDYZK2vhIKaEvJjlysfzxUe3eyNPIsUsi30wa2jHrOk9g5qQ==, tarball: file:projects/perf-keyvault-keys.tgz} + resolution: {integrity: sha512-hA+SW0QnCcnQtEuOYvyXBVQnbMy373bLX/wVDpzcWqMSipB79qJZqccf4idCdMsdqLyLyNq+rgpYvVrYp5s+hA==, tarball: file:projects/perf-keyvault-keys.tgz} name: '@rush-temp/perf-keyvault-keys' version: 0.0.0 dependencies: @@ -18715,7 +18718,7 @@ packages: dev: false file:projects/perf-keyvault-secrets.tgz: - resolution: {integrity: sha512-uNewvxAIj7J9/amvOLrSo6/ofWG8sbxRz55gPJjJxPSpuk4iYjM+jETM7sE9XW+qI6Jr4gGDqDs9rBpLwHtfnA==, tarball: file:projects/perf-keyvault-secrets.tgz} + resolution: {integrity: sha512-QEpuPQgCBR4qGDKkWOzbCN+z0jOsboUOvPuel0wImAEprlJcsnpzEHrR2MRb9oPy/ZiJDnuJaobp2ysdnUXzUw==, tarball: file:projects/perf-keyvault-secrets.tgz} name: '@rush-temp/perf-keyvault-secrets' version: 0.0.0 dependencies: diff --git a/sdk/iothub/arm-iothub/CHANGELOG.md b/sdk/iothub/arm-iothub/CHANGELOG.md index 9c6cb4e494b4..3317a8c3a765 100644 --- a/sdk/iothub/arm-iothub/CHANGELOG.md +++ b/sdk/iothub/arm-iothub/CHANGELOG.md @@ -1,20 +1,11 @@ # Release History - -## 6.3.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 6.3.0-beta.1 (2022-12-06) + +## 6.3.0-beta.2 (2023-03-09) **Features** - Added Interface EncryptionPropertiesDescription + - Added Interface IotHubManualFailoverHeaders - Added Interface IotHubPropertiesDeviceStreams - Added Interface IotHubResourceCreateOrUpdateHeaders - Added Interface IotHubResourceDeleteHeaders @@ -24,13 +15,17 @@ - Added Interface PrivateEndpointConnectionsUpdateHeaders - Added Interface RootCertificateProperties - Added Interface RoutingCosmosDBSqlApiProperties + - Added Type Alias IpVersion - Interface IotHubProperties has a new optional parameter deviceStreams - Interface IotHubProperties has a new optional parameter encryption + - Interface IotHubProperties has a new optional parameter ipVersion - Interface IotHubProperties has a new optional parameter rootCertificate - Interface RoutingEndpoints has a new optional parameter cosmosDBSqlCollections - Add parameters of IotHubResourceUpdateHeaders to TypeAlias IotHubResourceUpdateResponse + - Added Enum KnownIpVersion - Enum KnownRoutingSource has a new value DigitalTwinChangeEvents - Enum KnownRoutingSource has a new value MqttBrokerMessages + - Added function getContinuationToken ## 6.2.0 (2022-08-18) diff --git a/sdk/iothub/arm-iothub/LICENSE b/sdk/iothub/arm-iothub/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/iothub/arm-iothub/LICENSE +++ b/sdk/iothub/arm-iothub/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 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 diff --git a/sdk/iothub/arm-iothub/_meta.json b/sdk/iothub/arm-iothub/_meta.json index a5d51ebf197e..3a1e542a8571 100644 --- a/sdk/iothub/arm-iothub/_meta.json +++ b/sdk/iothub/arm-iothub/_meta.json @@ -1,8 +1,8 @@ { - "commit": "54b41d3d0aa9fc3085a5822638136bf0d84f5e57", + "commit": "9c70cfee55905a5b755a7b056c6fa12b2a16a7be", "readme": "specification/iothub/resource-manager/readme.md", - "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/typescript@6.0.0-rc.4 --generate-sample=true", + "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/typescript@6.0.0-rc.9", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.5.2", - "use": "@autorest/typescript@6.0.0-rc.4" + "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", + "use": "@autorest/typescript@6.0.0-rc.9" } \ No newline at end of file diff --git a/sdk/iothub/arm-iothub/package.json b/sdk/iothub/arm-iothub/package.json index 0a7a611b4f57..dcf4cd2fb75a 100644 --- a/sdk/iothub/arm-iothub/package.json +++ b/sdk/iothub/arm-iothub/package.json @@ -8,10 +8,10 @@ "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^2.5.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -33,14 +33,15 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^13.1.3", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", + "dotenv": "^16.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-recorder": "^2.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", "@types/chai": "^4.2.8", @@ -49,7 +50,6 @@ "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/iothub/arm-iothub", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -111,12 +111,5 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-iothub?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/iothub/arm-iothub" +} \ No newline at end of file diff --git a/sdk/iothub/arm-iothub/review/arm-iothub.api.md b/sdk/iothub/arm-iothub/review/arm-iothub.api.md index e8b0943a4be6..29147d26aee1 100644 --- a/sdk/iothub/arm-iothub/review/arm-iothub.api.md +++ b/sdk/iothub/arm-iothub/review/arm-iothub.api.md @@ -6,9 +6,9 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; +import { SimplePollerLike } from '@azure/core-lro'; // @public 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 { // @public export interface IotHub { - beginManualFailover(iotHubName: string, resourceGroupName: string, failoverInput: FailoverInput, options?: IotHubManualFailoverOptionalParams): Promise, void>>; + beginManualFailover(iotHubName: string, resourceGroupName: string, failoverInput: FailoverInput, options?: IotHubManualFailoverOptionalParams): Promise, void>>; beginManualFailoverAndWait(iotHubName: string, resourceGroupName: string, failoverInput: FailoverInput, options?: IotHubManualFailoverOptionalParams): Promise; } @@ -360,6 +360,13 @@ export interface IotHubLocationDescription { role?: IotHubReplicaRoleType; } +// @public +export interface IotHubManualFailoverHeaders { + azureAsyncOperation?: string; + // (undocumented) + location?: string; +} + // @public export interface IotHubManualFailoverOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -395,6 +402,7 @@ export interface IotHubProperties { features?: Capabilities; readonly hostName?: string; ipFilterRules?: IpFilterRule[]; + ipVersion?: IpVersion; readonly locations?: IotHubLocationDescription[]; messagingEndpoints?: { [propertyName: string]: MessagingEndpointProperties; @@ -436,11 +444,11 @@ export type IotHubReplicaRoleType = string; // @public export interface IotHubResource { - beginCreateOrUpdate(resourceGroupName: string, resourceName: string, iotHubDescription: IotHubDescription, options?: IotHubResourceCreateOrUpdateOptionalParams): Promise, IotHubResourceCreateOrUpdateResponse>>; + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, iotHubDescription: IotHubDescription, options?: IotHubResourceCreateOrUpdateOptionalParams): Promise, IotHubResourceCreateOrUpdateResponse>>; beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, iotHubDescription: IotHubDescription, options?: IotHubResourceCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, resourceName: string, options?: IotHubResourceDeleteOptionalParams): Promise, IotHubResourceDeleteResponse>>; + beginDelete(resourceGroupName: string, resourceName: string, options?: IotHubResourceDeleteOptionalParams): Promise, IotHubResourceDeleteResponse>>; beginDeleteAndWait(resourceGroupName: string, resourceName: string, options?: IotHubResourceDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, resourceName: string, iotHubTags: TagsResource, options?: IotHubResourceUpdateOptionalParams): Promise, IotHubResourceUpdateResponse>>; + beginUpdate(resourceGroupName: string, resourceName: string, iotHubTags: TagsResource, options?: IotHubResourceUpdateOptionalParams): Promise, IotHubResourceUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, resourceName: string, iotHubTags: TagsResource, options?: IotHubResourceUpdateOptionalParams): Promise; checkNameAvailability(operationInputs: OperationInputs, options?: IotHubResourceCheckNameAvailabilityOptionalParams): Promise; createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, consumerGroupBody: EventHubConsumerGroupBodyDescription, options?: IotHubResourceCreateEventHubConsumerGroupOptionalParams): Promise; @@ -739,6 +747,9 @@ export interface IpFilterRule { ipMask: string; } +// @public +export type IpVersion = string; + // @public export interface JobResponse { readonly endTimeUtc?: Date; @@ -821,6 +832,13 @@ export enum KnownIotHubSku { S3 = "S3" } +// @public +export enum KnownIpVersion { + Ipv4 = "ipv4", + Ipv4Ipv6 = "ipv4ipv6", + Ipv6 = "ipv6" +} + // @public export enum KnownJobType { Backup = "backup", @@ -991,9 +1009,9 @@ export interface PrivateEndpointConnectionProperties { // @public export interface PrivateEndpointConnections { - beginDelete(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, PrivateEndpointConnectionsDeleteResponse>>; + beginDelete(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, PrivateEndpointConnectionsDeleteResponse>>; beginDeleteAndWait(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: PrivateEndpointConnectionsUpdateOptionalParams): Promise, PrivateEndpointConnectionsUpdateResponse>>; + beginUpdate(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: PrivateEndpointConnectionsUpdateOptionalParams): Promise, PrivateEndpointConnectionsUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, privateEndpointConnection: PrivateEndpointConnection, options?: PrivateEndpointConnectionsUpdateOptionalParams): Promise; get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; list(resourceGroupName: string, resourceName: string, options?: PrivateEndpointConnectionsListOptionalParams): Promise; diff --git a/sdk/iothub/arm-iothub/src/iotHubClient.ts b/sdk/iothub/arm-iothub/src/iotHubClient.ts index 6b9a885635bc..39aed273d410 100644 --- a/sdk/iothub/arm-iothub/src/iotHubClient.ts +++ b/sdk/iothub/arm-iothub/src/iotHubClient.ts @@ -119,7 +119,7 @@ export class IotHubClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-04-30-preview"; + this.apiVersion = options.apiVersion || "2022-11-15-preview"; this.operations = new OperationsImpl(this); this.iotHubResource = new IotHubResourceImpl(this); this.resourceProviderCommon = new ResourceProviderCommonImpl(this); diff --git a/sdk/iothub/arm-iothub/src/lroImpl.ts b/sdk/iothub/arm-iothub/src/lroImpl.ts index 518d5f053b4e..dd803cd5e28c 100644 --- a/sdk/iothub/arm-iothub/src/lroImpl.ts +++ b/sdk/iothub/arm-iothub/src/lroImpl.ts @@ -6,29 +6,37 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; -export class LroImpl implements LongRunningOperation { - constructor( - private sendOperationFn: (args: any, spec: any) => Promise>, - private args: Record, - private spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record, - public requestPath: string = spec.path!, - public requestMethod: string = spec.httpMethod - ) {} - public async sendInitialRequest(): Promise> { - return this.sendOperationFn(this.args, this.spec); - } - public async sendPollRequest(path: string): Promise> { - const { requestBody, ...restSpec } = this.spec; - return this.sendOperationFn(this.args, { - ...restSpec, - path, - httpMethod: "GET" - }); - } +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike } + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal + }); + } + }; } diff --git a/sdk/iothub/arm-iothub/src/models/index.ts b/sdk/iothub/arm-iothub/src/models/index.ts index 81cdc47282ab..5c59657a2c22 100644 --- a/sdk/iothub/arm-iothub/src/models/index.ts +++ b/sdk/iothub/arm-iothub/src/models/index.ts @@ -149,6 +149,8 @@ export interface IotHubProperties { enableDataResidency?: boolean; /** This property store root certificate related information */ rootCertificate?: RootCertificateProperties; + /** This property specifies the IP Version the hub is currently utilizing. */ + ipVersion?: IpVersion; } /** The properties of an IoT hub shared access policy. */ @@ -1291,6 +1293,13 @@ export interface IotHubResourceDeleteHeaders { azureAsyncOperation?: string; } +/** Defines headers for IotHub_manualFailover operation. */ +export interface IotHubManualFailoverHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; + location?: string; +} + /** Defines headers for PrivateEndpointConnections_update operation. */ export interface PrivateEndpointConnectionsUpdateHeaders { /** URL to query for status of the operation. */ @@ -1489,6 +1498,27 @@ export enum KnownIotHubReplicaRoleType { */ export type IotHubReplicaRoleType = string; +/** Known values of {@link IpVersion} that the service accepts. */ +export enum KnownIpVersion { + /** Ipv4 */ + Ipv4 = "ipv4", + /** Ipv6 */ + Ipv6 = "ipv6", + /** Ipv4Ipv6 */ + Ipv4Ipv6 = "ipv4ipv6" +} + +/** + * Defines values for IpVersion. \ + * {@link KnownIpVersion} can be used interchangeably with IpVersion, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **ipv4** \ + * **ipv6** \ + * **ipv4ipv6** + */ +export type IpVersion = string; + /** Known values of {@link IotHubSku} that the service accepts. */ export enum KnownIotHubSku { /** F1 */ diff --git a/sdk/iothub/arm-iothub/src/models/mappers.ts b/sdk/iothub/arm-iothub/src/models/mappers.ts index 8ccd6435ec82..fc4b3e46909f 100644 --- a/sdk/iothub/arm-iothub/src/models/mappers.ts +++ b/sdk/iothub/arm-iothub/src/models/mappers.ts @@ -351,6 +351,12 @@ export const IotHubProperties: coreClient.CompositeMapper = { name: "Composite", className: "RootCertificateProperties" } + }, + ipVersion: { + serializedName: "ipVersion", + type: { + name: "String" + } } } } @@ -3312,6 +3318,27 @@ export const IotHubResourceDeleteHeaders: coreClient.CompositeMapper = { } }; +export const IotHubManualFailoverHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotHubManualFailoverHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export const PrivateEndpointConnectionsUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/iothub/arm-iothub/src/models/parameters.ts b/sdk/iothub/arm-iothub/src/models/parameters.ts index ad379429b5b7..efd0f67a1123 100644 --- a/sdk/iothub/arm-iothub/src/models/parameters.ts +++ b/sdk/iothub/arm-iothub/src/models/parameters.ts @@ -53,7 +53,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-04-30-preview", + defaultValue: "2022-11-15-preview", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/iothub/arm-iothub/src/operations/iotHub.ts b/sdk/iothub/arm-iothub/src/operations/iotHub.ts index bbe912957782..d70448c7d543 100644 --- a/sdk/iothub/arm-iothub/src/operations/iotHub.ts +++ b/sdk/iothub/arm-iothub/src/operations/iotHub.ts @@ -11,8 +11,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { IotHubClient } from "../iotHubClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { FailoverInput, IotHubManualFailoverOptionalParams } from "../models"; /** Class containing IotHub operations. */ @@ -42,14 +46,14 @@ export class IotHubImpl implements IotHub { resourceGroupName: string, failoverInput: FailoverInput, options?: IotHubManualFailoverOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -82,13 +86,13 @@ export class IotHubImpl implements IotHub { }; }; - const lro = new LroImpl( - sendOperation, - { iotHubName, resourceGroupName, failoverInput, options }, - manualFailoverOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { iotHubName, resourceGroupName, failoverInput, options }, + spec: manualFailoverOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); diff --git a/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts b/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts index 4ccc2e65fc4c..9ddb0c203304 100644 --- a/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts +++ b/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { IotHubClient } from "../iotHubClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { IotHubDescription, IotHubResourceListBySubscriptionNextOptionalParams, @@ -769,8 +773,8 @@ export class IotHubResourceImpl implements IotHubResource { iotHubDescription: IotHubDescription, options?: IotHubResourceCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, IotHubResourceCreateOrUpdateResponse > > { @@ -780,7 +784,7 @@ export class IotHubResourceImpl implements IotHubResource { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -813,13 +817,16 @@ export class IotHubResourceImpl implements IotHubResource { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, resourceName, iotHubDescription, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, resourceName, iotHubDescription, options }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + IotHubResourceCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -863,8 +870,8 @@ export class IotHubResourceImpl implements IotHubResource { iotHubTags: TagsResource, options?: IotHubResourceUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, IotHubResourceUpdateResponse > > { @@ -874,7 +881,7 @@ export class IotHubResourceImpl implements IotHubResource { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -907,13 +914,16 @@ export class IotHubResourceImpl implements IotHubResource { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, resourceName, iotHubTags, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, resourceName, iotHubTags, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + IotHubResourceUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -953,8 +963,8 @@ export class IotHubResourceImpl implements IotHubResource { resourceName: string, options?: IotHubResourceDeleteOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, IotHubResourceDeleteResponse > > { @@ -964,7 +974,7 @@ export class IotHubResourceImpl implements IotHubResource { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -997,13 +1007,16 @@ export class IotHubResourceImpl implements IotHubResource { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, resourceName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, resourceName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + IotHubResourceDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); diff --git a/sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts b/sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts index 8fe0da860dbc..8feb8d2a5433 100644 --- a/sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts +++ b/sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts @@ -11,8 +11,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { IotHubClient } from "../iotHubClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { PrivateEndpointConnectionsListOptionalParams, PrivateEndpointConnectionsListResponse, @@ -94,8 +98,8 @@ export class PrivateEndpointConnectionsImpl privateEndpointConnection: PrivateEndpointConnection, options?: PrivateEndpointConnectionsUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, PrivateEndpointConnectionsUpdateResponse > > { @@ -105,7 +109,7 @@ export class PrivateEndpointConnectionsImpl ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -138,19 +142,22 @@ export class PrivateEndpointConnectionsImpl }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + PrivateEndpointConnectionsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -195,8 +202,8 @@ export class PrivateEndpointConnectionsImpl privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, PrivateEndpointConnectionsDeleteResponse > > { @@ -206,7 +213,7 @@ export class PrivateEndpointConnectionsImpl ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -239,18 +246,21 @@ export class PrivateEndpointConnectionsImpl }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, resourceName, privateEndpointConnectionName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller< + PrivateEndpointConnectionsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); diff --git a/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHub.ts b/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHub.ts index 8181784133c5..7bfa138df366 100644 --- a/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHub.ts +++ b/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHub.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { FailoverInput, IotHubManualFailoverOptionalParams } from "../models"; /** Interface representing a IotHub. */ @@ -26,7 +26,7 @@ export interface IotHub { resourceGroupName: string, failoverInput: FailoverInput, options?: IotHubManualFailoverOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see * https://aka.ms/manualfailover diff --git a/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHubResource.ts b/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHubResource.ts index 5fb2acabb49f..095ec574fe08 100644 --- a/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHubResource.ts +++ b/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHubResource.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { IotHubDescription, IotHubResourceListBySubscriptionOptionalParams, @@ -178,8 +178,8 @@ export interface IotHubResource { iotHubDescription: IotHubDescription, options?: IotHubResourceCreateOrUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, IotHubResourceCreateOrUpdateResponse > >; @@ -211,8 +211,8 @@ export interface IotHubResource { iotHubTags: TagsResource, options?: IotHubResourceUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, IotHubResourceUpdateResponse > >; @@ -240,8 +240,8 @@ export interface IotHubResource { resourceName: string, options?: IotHubResourceDeleteOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, IotHubResourceDeleteResponse > >; diff --git a/sdk/iothub/arm-iothub/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/iothub/arm-iothub/src/operationsInterfaces/privateEndpointConnections.ts index 016cd27cb620..1bc02ccf99f6 100644 --- a/sdk/iothub/arm-iothub/src/operationsInterfaces/privateEndpointConnections.ts +++ b/sdk/iothub/arm-iothub/src/operationsInterfaces/privateEndpointConnections.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { PrivateEndpointConnectionsListOptionalParams, PrivateEndpointConnectionsListResponse, @@ -60,8 +60,8 @@ export interface PrivateEndpointConnections { privateEndpointConnection: PrivateEndpointConnection, options?: PrivateEndpointConnectionsUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, PrivateEndpointConnectionsUpdateResponse > >; @@ -93,8 +93,8 @@ export interface PrivateEndpointConnections { privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, PrivateEndpointConnectionsDeleteResponse > >; diff --git a/sdk/iothub/arm-iothub/test/sampleTest.ts b/sdk/iothub/arm-iothub/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/iothub/arm-iothub/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * 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 { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + 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" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/iothub/arm-iothub/tsconfig.json b/sdk/iothub/arm-iothub/tsconfig.json index 651a71da11eb..3e6ae96443f3 100644 --- a/sdk/iothub/arm-iothub/tsconfig.json +++ b/sdk/iothub/arm-iothub/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-iothub": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"