From bd36c912f6be892e1953751e8f00e9ff7566e704 Mon Sep 17 00:00:00 2001 From: Phoenix He Date: Thu, 24 Oct 2019 14:40:18 +0800 Subject: [PATCH 1/3] Update swagger_to_sdk_config.json --- swagger_to_sdk_config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swagger_to_sdk_config.json b/swagger_to_sdk_config.json index 720a73b16905..ddf47295f0db 100644 --- a/swagger_to_sdk_config.json +++ b/swagger_to_sdk_config.json @@ -6,7 +6,8 @@ "typescript": "", "license-header": "MICROSOFT_MIT_NO_VERSION", "sdkrel:typescript-sdks-folder": ".", - "use": "@microsoft.azure/autorest.typescript@4.4.1" + "go.clear-output-folder": "", + "use": "@microsoft.azure/autorest.typescript@4.2.2" }, "advanced_options": { "clone_dir": "./azure-sdk-for-js", From 44ddbb683f61a7ae6e0e4f90c47eb1df30bc5e70 Mon Sep 17 00:00:00 2001 From: Phoenix He Date: Thu, 24 Oct 2019 14:49:49 +0800 Subject: [PATCH 2/3] Update swagger_to_sdk_config.json --- swagger_to_sdk_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swagger_to_sdk_config.json b/swagger_to_sdk_config.json index ddf47295f0db..4579a20351e5 100644 --- a/swagger_to_sdk_config.json +++ b/swagger_to_sdk_config.json @@ -6,7 +6,7 @@ "typescript": "", "license-header": "MICROSOFT_MIT_NO_VERSION", "sdkrel:typescript-sdks-folder": ".", - "go.clear-output-folder": "", + "typescript.clear-output-folder": "", "use": "@microsoft.azure/autorest.typescript@4.2.2" }, "advanced_options": { From 041b849ba9692a534890a0e0dbb494a106143c1f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 4 Nov 2020 19:05:19 +0000 Subject: [PATCH 3/3] CodeGen from PR 1872 in test-repo-billy/azure-rest-api-specs Merge 421d4bb3ada35db5f377f8d03aa941ed790534dd into 6151addcf8b460e169b46e633dbaaa7c4f93e315 --- sdk/iothub/arm-iothub/LICENSE.txt | 2 +- sdk/iothub/arm-iothub/README.md | 6 +- sdk/iothub/arm-iothub/package.json | 20 +- sdk/iothub/arm-iothub/rollup.config.js | 2 +- sdk/iothub/arm-iothub/src/iotHubClient.ts | 4 + .../arm-iothub/src/iotHubClientContext.ts | 2 +- .../src/models/certificatesMappers.ts | 7 +- sdk/iothub/arm-iothub/src/models/index.ts | 510 +++++++++++++++++- .../src/models/iotHubResourceMappers.ts | 8 +- sdk/iothub/arm-iothub/src/models/mappers.ts | 494 ++++++++++++++++- .../arm-iothub/src/models/parameters.ts | 20 + .../privateEndpointConnectionsMappers.ts | 42 ++ .../privateLinkResourcesOperationsMappers.ts | 14 + .../arm-iothub/src/operations/certificates.ts | 6 +- sdk/iothub/arm-iothub/src/operations/index.ts | 2 + .../arm-iothub/src/operations/iotHub.ts | 18 +- .../src/operations/iotHubResource.ts | 18 +- .../operations/privateEndpointConnections.ts | 304 +++++++++++ .../privateLinkResourcesOperations.ts | 151 ++++++ sdk/iothub/arm-iothub/tsconfig.json | 2 +- 20 files changed, 1556 insertions(+), 76 deletions(-) create mode 100644 sdk/iothub/arm-iothub/src/models/privateEndpointConnectionsMappers.ts create mode 100644 sdk/iothub/arm-iothub/src/models/privateLinkResourcesOperationsMappers.ts create mode 100644 sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts create mode 100644 sdk/iothub/arm-iothub/src/operations/privateLinkResourcesOperations.ts diff --git a/sdk/iothub/arm-iothub/LICENSE.txt b/sdk/iothub/arm-iothub/LICENSE.txt index b73b4a1293c3..ea8fb1516028 100644 --- a/sdk/iothub/arm-iothub/LICENSE.txt +++ b/sdk/iothub/arm-iothub/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2019 Microsoft +Copyright (c) 2020 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/README.md b/sdk/iothub/arm-iothub/README.md index ffef2771e11b..2b1111bb8182 100644 --- a/sdk/iothub/arm-iothub/README.md +++ b/sdk/iothub/arm-iothub/README.md @@ -19,8 +19,9 @@ npm install @azure/arm-iothub ##### Install @azure/ms-rest-nodeauth +- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. ```bash -npm install @azure/ms-rest-nodeauth +npm install @azure/ms-rest-nodeauth@"^3.0.0" ``` ##### Sample code @@ -95,5 +96,4 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fiothub%2Farm-iothub%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/iothub/arm-iothub/README.png) diff --git a/sdk/iothub/arm-iothub/package.json b/sdk/iothub/arm-iothub/package.json index e3e5e78fe65f..24c367861684 100644 --- a/sdk/iothub/arm-iothub/package.json +++ b/sdk/iothub/arm-iothub/package.json @@ -4,9 +4,9 @@ "description": "IotHubClient Library with typescript type definitions for node.js and browser.", "version": "3.0.0", "dependencies": { - "@azure/ms-rest-azure-js": "^1.3.2", - "@azure/ms-rest-js": "^1.8.1", - "tslib": "^1.9.3" + "@azure/ms-rest-azure-js": "^2.0.1", + "@azure/ms-rest-js": "^2.0.4", + "tslib": "^1.10.0" }, "keywords": [ "node", @@ -20,19 +20,19 @@ "module": "./esm/iotHubClient.js", "types": "./esm/iotHubClient.d.ts", "devDependencies": { - "typescript": "^3.1.1", - "rollup": "^0.66.2", - "rollup-plugin-node-resolve": "^3.4.0", + "typescript": "^3.5.3", + "rollup": "^1.18.0", + "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-sourcemaps": "^0.4.2", - "uglify-js": "^3.4.9" + "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/azure/azure-sdk-for-js", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/iothub/arm-iothub", "repository": { "type": "git", - "url": "https://github.com/azure/azure-sdk-for-js.git" + "url": "https://github.com/Azure/azure-sdk-for-js.git" }, "bugs": { - "url": "https://github.com/azure/azure-sdk-for-js/issues" + "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, "files": [ "dist/**/*.js", diff --git a/sdk/iothub/arm-iothub/rollup.config.js b/sdk/iothub/arm-iothub/rollup.config.js index 8464171f6338..c38caace5654 100644 --- a/sdk/iothub/arm-iothub/rollup.config.js +++ b/sdk/iothub/arm-iothub/rollup.config.js @@ -29,7 +29,7 @@ const config = { */` }, plugins: [ - nodeResolve({ module: true }), + nodeResolve({ mainFields: ['module', 'main'] }), sourcemaps() ] }; diff --git a/sdk/iothub/arm-iothub/src/iotHubClient.ts b/sdk/iothub/arm-iothub/src/iotHubClient.ts index acbec4a87d10..4d85c1a6c854 100644 --- a/sdk/iothub/arm-iothub/src/iotHubClient.ts +++ b/sdk/iothub/arm-iothub/src/iotHubClient.ts @@ -22,6 +22,8 @@ class IotHubClient extends IotHubClientContext { resourceProviderCommon: operations.ResourceProviderCommon; certificates: operations.Certificates; iotHub: operations.IotHub; + privateLinkResources: operations.PrivateLinkResourcesOperations; + privateEndpointConnections: operations.PrivateEndpointConnections; /** * Initializes a new instance of the IotHubClient class. @@ -36,6 +38,8 @@ class IotHubClient extends IotHubClientContext { this.resourceProviderCommon = new operations.ResourceProviderCommon(this); this.certificates = new operations.Certificates(this); this.iotHub = new operations.IotHub(this); + this.privateLinkResources = new operations.PrivateLinkResourcesOperations(this); + this.privateEndpointConnections = new operations.PrivateEndpointConnections(this); } } diff --git a/sdk/iothub/arm-iothub/src/iotHubClientContext.ts b/sdk/iothub/arm-iothub/src/iotHubClientContext.ts index a7ed3e93f0b7..82abacd3f995 100644 --- a/sdk/iothub/arm-iothub/src/iotHubClientContext.ts +++ b/sdk/iothub/arm-iothub/src/iotHubClientContext.ts @@ -44,7 +44,7 @@ export class IotHubClientContext extends msRestAzure.AzureServiceClient { super(credentials, options); - this.apiVersion = '2019-03-22-preview'; + this.apiVersion = '2020-08-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com"; diff --git a/sdk/iothub/arm-iothub/src/models/certificatesMappers.ts b/sdk/iothub/arm-iothub/src/models/certificatesMappers.ts index 1be3b19c89d5..e6d7ca990213 100644 --- a/sdk/iothub/arm-iothub/src/models/certificatesMappers.ts +++ b/sdk/iothub/arm-iothub/src/models/certificatesMappers.ts @@ -8,7 +8,6 @@ export { BaseResource, - CertificateBodyDescription, CertificateDescription, CertificateListDescription, CertificateProperties, @@ -23,11 +22,15 @@ export { FallbackRouteProperties, FeedbackProperties, IotHubDescription, + IotHubLocationDescription, IotHubProperties, - IotHubPropertiesDeviceStreams, IotHubSkuInfo, IpFilterRule, MessagingEndpointProperties, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateLinkServiceConnectionState, Resource, RouteProperties, RoutingEndpoints, diff --git a/sdk/iothub/arm-iothub/src/models/index.ts b/sdk/iothub/arm-iothub/src/models/index.ts index d6d48dd3b916..1d1091080e83 100644 --- a/sdk/iothub/arm-iothub/src/models/index.ts +++ b/sdk/iothub/arm-iothub/src/models/index.ts @@ -229,6 +229,66 @@ export interface IpFilterRule { ipMask: string; } +/** + * The private endpoint property of a private endpoint connection + */ +export interface PrivateEndpoint { + /** + * The resource identifier. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; +} + +/** + * The current state of a private endpoint connection + */ +export interface PrivateLinkServiceConnectionState { + /** + * The status of a private endpoint connection. Possible values include: 'Pending', 'Approved', + * 'Rejected', 'Disconnected' + */ + status: PrivateLinkServiceConnectionStatus; + /** + * The description for the current state of a private endpoint connection + */ + description: string; + /** + * Actions required for a private endpoint connection + */ + actionsRequired?: string; +} + +/** + * The properties of a private endpoint connection + */ +export interface PrivateEndpointConnectionProperties { + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; +} + +/** + * The private endpoint connection of an IotHub + */ +export interface PrivateEndpointConnection extends BaseResource { + /** + * The resource identifier. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The resource name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The resource type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + properties: PrivateEndpointConnectionProperties; +} + /** * The properties of the provisioned Event Hub-compatible endpoint used by the IoT hub. */ @@ -265,10 +325,27 @@ export interface EventHubProperties { * The properties related to service bus queue endpoint types. */ export interface RoutingServiceBusQueueEndpointProperties { + /** + * Id of the service bus queue endpoint + */ + id?: string; /** * The connection string of the service bus queue endpoint. */ - connectionString: string; + connectionString?: string; + /** + * The url of the service bus queue endpoint. It must include the protocol sb:// + */ + endpointUri?: string; + /** + * Queue name on the service bus namespace + */ + entityPath?: string; + /** + * Method used to authenticate against the service bus queue endpoint. Possible values include: + * 'keyBased', 'identityBased' + */ + authenticationType?: AuthenticationType; /** * The name that identifies this endpoint. The name can only include alphanumeric characters, * periods, underscores, hyphens and has a maximum length of 64 characters. The following names @@ -290,10 +367,27 @@ export interface RoutingServiceBusQueueEndpointProperties { * The properties related to service bus topic endpoint types. */ export interface RoutingServiceBusTopicEndpointProperties { + /** + * Id of the service bus topic endpoint + */ + id?: string; /** * The connection string of the service bus topic endpoint. */ - connectionString: string; + connectionString?: string; + /** + * The url of the service bus topic endpoint. It must include the protocol sb:// + */ + endpointUri?: string; + /** + * Queue name on the service bus topic + */ + entityPath?: string; + /** + * Method used to authenticate against the service bus topic endpoint. Possible values include: + * 'keyBased', 'identityBased' + */ + authenticationType?: AuthenticationType; /** * The name that identifies this endpoint. The name can only include alphanumeric characters, * periods, underscores, hyphens and has a maximum length of 64 characters. The following names @@ -315,10 +409,27 @@ export interface RoutingServiceBusTopicEndpointProperties { * The properties related to an event hub endpoint. */ export interface RoutingEventHubProperties { + /** + * Id of the event hub endpoint + */ + id?: string; /** * The connection string of the event hub endpoint. */ - connectionString: string; + connectionString?: string; + /** + * The url of the event hub endpoint. It must include the protocol sb:// + */ + endpointUri?: string; + /** + * Event hub name on the event hub namespace + */ + entityPath?: string; + /** + * Method used to authenticate against the event hub endpoint. Possible values include: + * 'keyBased', 'identityBased' + */ + authenticationType?: AuthenticationType; /** * The name that identifies this endpoint. The name can only include alphanumeric characters, * periods, underscores, hyphens and has a maximum length of 64 characters. The following names @@ -340,10 +451,23 @@ export interface RoutingEventHubProperties { * The properties related to a storage container endpoint. */ export interface RoutingStorageContainerProperties { + /** + * Id of the storage container endpoint + */ + id?: string; /** * The connection string of the storage account. */ - connectionString: string; + connectionString?: string; + /** + * The url of the storage endpoint. It must include the protocol https:// + */ + endpointUri?: string; + /** + * Method used to authenticate against the storage endpoint. Possible values include: 'keyBased', + * 'identityBased' + */ + authenticationType?: AuthenticationType; /** * The name that identifies this endpoint. The name can only include alphanumeric characters, * periods, underscores, hyphens and has a maximum length of 64 characters. The following names @@ -513,7 +637,7 @@ export interface RoutingProperties { fallbackRoute?: FallbackRouteProperties; /** * The list of user-provided enrichments that the IoT hub applies to messages to be delivered to - * built-in and custom endpoints. See: https://aka.ms/iotmsgenrich + * built-in and custom endpoints. See: https://aka.ms/telemetryoneventgrid */ enrichments?: EnrichmentProperties[]; } @@ -536,6 +660,11 @@ export interface StorageEndpointProperties { * be creatable using the connectionString specified. */ containerName: string; + /** + * Specifies authentication type being used for connecting to the storage account. Possible + * values include: 'keyBased', 'identityBased' + */ + authenticationType?: AuthenticationType; } /** @@ -598,13 +727,20 @@ export interface CloudToDeviceProperties { } /** - * The device streams properties of iothub. + * Public representation of one of the locations where a resource is provisioned. */ -export interface IotHubPropertiesDeviceStreams { +export interface IotHubLocationDescription { + /** + * The name of the Azure region + */ + location?: string; /** - * List of Device Streams Endpoints. + * The role of the region, can be either primary or secondary. The primary region is where the + * IoT hub is currently provisioned. The secondary region is the Azure disaster recovery (DR) + * paired region and also the region where the IoT hub can failover to. Possible values include: + * 'primary', 'secondary' */ - streamingEndpoints?: string[]; + role?: IotHubReplicaRoleType; } /** @@ -615,10 +751,24 @@ export interface IotHubProperties { * The shared access policies you can use to secure a connection to the IoT hub. */ authorizationPolicies?: SharedAccessSignatureAuthorizationRule[]; + /** + * Whether requests from Public Network are allowed. Possible values include: 'Enabled', + * 'Disabled' + */ + publicNetworkAccess?: PublicNetworkAccess; /** * The IP filter rules. */ ipFilterRules?: IpFilterRule[]; + /** + * Specifies the minimum TLS version to support for this hub. Can be set to "1.2" to have clients + * that use a TLS version below 1.2 to be rejected. + */ + minTlsVersion?: string; + /** + * Private endpoint connections created on this IotHub + */ + privateEndpointConnections?: PrivateEndpointConnection[]; /** * The provisioning state. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -661,15 +811,16 @@ export interface IotHubProperties { * IoT hub comments. */ comments?: string; - /** - * The device streams properties of iothub. - */ - deviceStreams?: IotHubPropertiesDeviceStreams; /** * The capabilities and features enabled for the IoT hub. Possible values include: 'None', * 'DeviceManagement' */ features?: Capabilities; + /** + * Primary and secondary location for iot hub + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly locations?: IotHubLocationDescription[]; } /** @@ -692,6 +843,56 @@ export interface IotHubSkuInfo { capacity?: number; } +/** + * The properties for a group information object + */ +export interface GroupIdInformationProperties { + /** + * The group id + */ + groupId?: string; + /** + * The required members for a specific group id + */ + requiredMembers?: string[]; + /** + * The required DNS zones for a specific group id + */ + requiredZoneNames?: string[]; +} + +/** + * The group information for creating a private endpoint on an IotHub + */ +export interface GroupIdInformation { + /** + * The resource identifier. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly id?: string; + /** + * The resource name. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly name?: string; + /** + * The resource type. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly type?: string; + properties: GroupIdInformationProperties; +} + +/** + * The available private link resources for an IotHub + */ +export interface PrivateLinkResources { + /** + * The list of available private link resources for an IotHub + */ + value?: GroupIdInformation[]; +} + /** * The common properties of an Azure resource. */ @@ -846,9 +1047,25 @@ export interface EndpointHealthData { * metrics to identify errors and monitor issues with endpoints. The 'unknown' status shows that * the IoT Hub has not established a connection with the endpoint. No messages have been * delivered to or rejected from this endpoint. Possible values include: 'unknown', 'healthy', - * 'unhealthy', 'dead' + * 'degraded', 'unhealthy', 'dead' */ healthStatus?: EndpointHealthStatus; + /** + * Last error obtained when a message failed to be delivered to iot hub + */ + lastKnownError?: string; + /** + * Time at which the last known error occurred + */ + lastKnownErrorTime?: Date; + /** + * Last time iot hub successfully sent a message to the endpoint + */ + lastSuccessfulSendAttemptTime?: Date; + /** + * Last time iot hub tried to send a message to the endpoint + */ + lastSendAttemptTime?: Date; } /** @@ -1007,6 +1224,23 @@ export interface EventHubConsumerGroupInfo extends BaseResource { readonly etag?: string; } +/** + * The EventHub consumer group name. + */ +export interface EventHubConsumerGroupName { + /** + * EventHub consumer group name + */ + name?: string; +} + +/** + * The EventHub consumer group. + */ +export interface EventHubConsumerGroupBodyDescription { + properties?: EventHubConsumerGroupName; +} + /** * Input values. */ @@ -1274,6 +1508,25 @@ export interface ExportDevicesRequest { * The value indicating whether keys should be excluded during export. */ excludeKeys: boolean; + /** + * The name of the blob that will be created in the provided output blob container. This blob + * will contain the exported device registry information for the IoT Hub. + */ + exportBlobName?: string; + /** + * Specifies authentication type being used for connecting to the storage account. Possible + * values include: 'keyBased', 'identityBased' + */ + authenticationType?: AuthenticationType; + /** + * The value indicating whether configurations should be exported. + */ + includeConfigurations?: boolean; + /** + * The name of the blob that will be created in the provided output blob container. This blob + * will contain the exported configurations for the Iot Hub. + */ + configurationsBlobName?: string; } /** @@ -1288,6 +1541,27 @@ export interface ImportDevicesRequest { * The output blob container URI. */ outputBlobContainerUri: string; + /** + * The blob name to be used when importing from the provided input blob container. + */ + inputBlobName?: string; + /** + * The blob name to use for storing the status of the import job. + */ + outputBlobName?: string; + /** + * Specifies authentication type being used for connecting to the storage account. Possible + * values include: 'keyBased', 'identityBased' + */ + authenticationType?: AuthenticationType; + /** + * The value indicating whether configurations should be imported. + */ + includeConfigurations?: boolean; + /** + * The blob name to be used when importing configurations from the provided input blob container. + */ + configurationsBlobName?: string; } /** @@ -1321,6 +1595,13 @@ export interface IotHubResourceUpdateOptionalParams extends msRest.RequestOption tags?: { [propertyName: string]: string }; } +/** + * Optional Parameters. + */ +export interface IotHubResourceCreateEventHubConsumerGroupOptionalParams extends msRest.RequestOptionsBase { + properties?: EventHubConsumerGroupName; +} + /** * Optional Parameters. */ @@ -1351,10 +1632,7 @@ export interface CertificatesCreateOrUpdateOptionalParams extends msRest.Request * update an existing certificate. */ ifMatch?: string; - /** - * base-64 representation of the X509 leaf certificate .cer file or just .pem file content. - */ - certificate?: string; + properties?: CertificateProperties; } /** @@ -1492,6 +1770,14 @@ export interface SharedAccessSignatureAuthorizationRuleListResult extends Array< */ 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'; +/** + * Defines values for PublicNetworkAccess. + * Possible values include: 'Enabled', 'Disabled' + * @readonly + * @enum {string} + */ +export type PublicNetworkAccess = 'Enabled' | 'Disabled'; + /** * Defines values for IpFilterActionType. * Possible values include: 'Accept', 'Reject' @@ -1500,6 +1786,22 @@ export type AccessRights = 'RegistryRead' | 'RegistryWrite' | 'ServiceConnect' | */ export type IpFilterActionType = 'Accept' | 'Reject'; +/** + * Defines values for PrivateLinkServiceConnectionStatus. + * Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + * @readonly + * @enum {string} + */ +export type PrivateLinkServiceConnectionStatus = 'Pending' | 'Approved' | 'Rejected' | 'Disconnected'; + +/** + * Defines values for AuthenticationType. + * Possible values include: 'keyBased', 'identityBased' + * @readonly + * @enum {string} + */ +export type AuthenticationType = 'keyBased' | 'identityBased'; + /** * Defines values for RoutingSource. * Possible values include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', @@ -1517,6 +1819,14 @@ export type RoutingSource = 'Invalid' | 'DeviceMessages' | 'TwinChangeEvents' | */ export type Capabilities = 'None' | 'DeviceManagement'; +/** + * Defines values for IotHubReplicaRoleType. + * Possible values include: 'primary', 'secondary' + * @readonly + * @enum {string} + */ +export type IotHubReplicaRoleType = 'primary' | 'secondary'; + /** * Defines values for IotHubSku. * Possible values include: 'F1', 'S1', 'S2', 'S3', 'B1', 'B2', 'B3' @@ -1535,11 +1845,11 @@ export type IotHubSkuTier = 'Free' | 'Standard' | 'Basic'; /** * Defines values for EndpointHealthStatus. - * Possible values include: 'unknown', 'healthy', 'unhealthy', 'dead' + * Possible values include: 'unknown', 'healthy', 'degraded', 'unhealthy', 'dead' * @readonly * @enum {string} */ -export type EndpointHealthStatus = 'unknown' | 'healthy' | 'unhealthy' | 'dead'; +export type EndpointHealthStatus = 'unknown' | 'healthy' | 'degraded' | 'unhealthy' | 'dead'; /** * Defines values for JobType. @@ -2428,3 +2738,163 @@ export type CertificatesVerifyResponse = CertificateDescription & { parsedBody: CertificateDescription; }; }; + +/** + * Contains response data for the list operation. + */ +export type PrivateLinkResourcesListResponse = PrivateLinkResources & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateLinkResources; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PrivateLinkResourcesGetResponse = GroupIdInformation & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: GroupIdInformation; + }; +}; + +/** + * Contains response data for the list operation. + */ +export type PrivateEndpointConnectionsListResponse = Array & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateEndpointConnection[]; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateEndpointConnection; + }; +}; + +/** + * Contains response data for the update operation. + */ +export type PrivateEndpointConnectionsUpdateResponse = PrivateEndpointConnection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateEndpointConnection; + }; +}; + +/** + * Contains response data for the deleteMethod operation. + */ +export type PrivateEndpointConnectionsDeleteMethodResponse = PrivateEndpointConnection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateEndpointConnection; + }; +}; + +/** + * Contains response data for the beginUpdate operation. + */ +export type PrivateEndpointConnectionsBeginUpdateResponse = PrivateEndpointConnection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateEndpointConnection; + }; +}; + +/** + * Contains response data for the beginDeleteMethod operation. + */ +export type PrivateEndpointConnectionsBeginDeleteMethodResponse = PrivateEndpointConnection & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: PrivateEndpointConnection; + }; +}; diff --git a/sdk/iothub/arm-iothub/src/models/iotHubResourceMappers.ts b/sdk/iothub/arm-iothub/src/models/iotHubResourceMappers.ts index ab4c4252953b..92a9788ce55c 100644 --- a/sdk/iothub/arm-iothub/src/models/iotHubResourceMappers.ts +++ b/sdk/iothub/arm-iothub/src/models/iotHubResourceMappers.ts @@ -18,7 +18,9 @@ export { EndpointHealthDataListResult, EnrichmentProperties, ErrorDetails, + EventHubConsumerGroupBodyDescription, EventHubConsumerGroupInfo, + EventHubConsumerGroupName, EventHubConsumerGroupsListResult, EventHubProperties, ExportDevicesRequest, @@ -28,9 +30,9 @@ export { IotHubCapacity, IotHubDescription, IotHubDescriptionListResult, + IotHubLocationDescription, IotHubNameAvailabilityInfo, IotHubProperties, - IotHubPropertiesDeviceStreams, IotHubQuotaMetricInfo, IotHubQuotaMetricInfoListResult, IotHubSkuDescription, @@ -42,6 +44,10 @@ export { MatchedRoute, MessagingEndpointProperties, OperationInputs, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateLinkServiceConnectionState, RegistryStatistics, Resource, RouteCompilationError, diff --git a/sdk/iothub/arm-iothub/src/models/mappers.ts b/sdk/iothub/arm-iothub/src/models/mappers.ts index 89d81a23b79e..c88826050dc4 100644 --- a/sdk/iothub/arm-iothub/src/models/mappers.ts +++ b/sdk/iothub/arm-iothub/src/models/mappers.ts @@ -368,6 +368,120 @@ export const IpFilterRule: msRest.CompositeMapper = { } }; +export const PrivateEndpoint: msRest.CompositeMapper = { + serializedName: "PrivateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkServiceConnectionState: msRest.CompositeMapper = { + serializedName: "PrivateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + modelProperties: { + status: { + required: true, + serializedName: "status", + type: { + name: "String" + } + }, + description: { + required: true, + serializedName: "description", + type: { + name: "String" + } + }, + actionsRequired: { + serializedName: "actionsRequired", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnectionProperties: msRest.CompositeMapper = { + serializedName: "PrivateEndpointConnectionProperties", + type: { + name: "Composite", + className: "PrivateEndpointConnectionProperties", + modelProperties: { + privateEndpoint: { + serializedName: "privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint" + } + }, + privateLinkServiceConnectionState: { + required: true, + serializedName: "privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState" + } + } + } + } +}; + +export const PrivateEndpointConnection: msRest.CompositeMapper = { + serializedName: "PrivateEndpointConnection", + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + constraints: { + Pattern: /^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$/ + }, + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + properties: { + required: true, + serializedName: "properties", + type: { + name: "Composite", + className: "PrivateEndpointConnectionProperties" + } + } + } + } +}; + export const EventHubProperties: msRest.CompositeMapper = { serializedName: "EventHubProperties", type: { @@ -422,13 +536,36 @@ export const RoutingServiceBusQueueEndpointProperties: msRest.CompositeMapper = name: "Composite", className: "RoutingServiceBusQueueEndpointProperties", modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, connectionString: { - required: true, serializedName: "connectionString", type: { name: "String" } }, + endpointUri: { + serializedName: "endpointUri", + type: { + name: "String" + } + }, + entityPath: { + serializedName: "entityPath", + type: { + name: "String" + } + }, + authenticationType: { + serializedName: "authenticationType", + type: { + name: "String" + } + }, name: { required: true, serializedName: "name", @@ -461,13 +598,36 @@ export const RoutingServiceBusTopicEndpointProperties: msRest.CompositeMapper = name: "Composite", className: "RoutingServiceBusTopicEndpointProperties", modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, connectionString: { - required: true, serializedName: "connectionString", type: { name: "String" } }, + endpointUri: { + serializedName: "endpointUri", + type: { + name: "String" + } + }, + entityPath: { + serializedName: "entityPath", + type: { + name: "String" + } + }, + authenticationType: { + serializedName: "authenticationType", + type: { + name: "String" + } + }, name: { required: true, serializedName: "name", @@ -500,13 +660,36 @@ export const RoutingEventHubProperties: msRest.CompositeMapper = { name: "Composite", className: "RoutingEventHubProperties", modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, connectionString: { - required: true, serializedName: "connectionString", type: { name: "String" } }, + endpointUri: { + serializedName: "endpointUri", + type: { + name: "String" + } + }, + entityPath: { + serializedName: "entityPath", + type: { + name: "String" + } + }, + authenticationType: { + serializedName: "authenticationType", + type: { + name: "String" + } + }, name: { required: true, serializedName: "name", @@ -539,13 +722,30 @@ export const RoutingStorageContainerProperties: msRest.CompositeMapper = { name: "Composite", className: "RoutingStorageContainerProperties", modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } + }, connectionString: { - required: true, serializedName: "connectionString", type: { name: "String" } }, + endpointUri: { + serializedName: "endpointUri", + type: { + name: "String" + } + }, + authenticationType: { + serializedName: "authenticationType", + type: { + name: "String" + } + }, name: { required: true, serializedName: "name", @@ -891,6 +1091,12 @@ export const StorageEndpointProperties: msRest.CompositeMapper = { type: { name: "String" } + }, + authenticationType: { + serializedName: "authenticationType", + type: { + name: "String" + } } } } @@ -993,21 +1199,22 @@ export const CloudToDeviceProperties: msRest.CompositeMapper = { } }; -export const IotHubPropertiesDeviceStreams: msRest.CompositeMapper = { - serializedName: "IotHubProperties_deviceStreams", +export const IotHubLocationDescription: msRest.CompositeMapper = { + serializedName: "IotHubLocationDescription", type: { name: "Composite", - className: "IotHubPropertiesDeviceStreams", + className: "IotHubLocationDescription", modelProperties: { - streamingEndpoints: { - serializedName: "streamingEndpoints", + location: { + serializedName: "location", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" + } + }, + role: { + serializedName: "role", + type: { + name: "String" } } } @@ -1032,6 +1239,12 @@ export const IotHubProperties: msRest.CompositeMapper = { } } }, + publicNetworkAccess: { + serializedName: "publicNetworkAccess", + type: { + name: "String" + } + }, ipFilterRules: { serializedName: "ipFilterRules", type: { @@ -1044,6 +1257,24 @@ export const IotHubProperties: msRest.CompositeMapper = { } } }, + minTlsVersion: { + serializedName: "minTlsVersion", + type: { + name: "String" + } + }, + privateEndpointConnections: { + serializedName: "privateEndpointConnections", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + }, provisioningState: { readOnly: true, serializedName: "provisioningState", @@ -1127,18 +1358,24 @@ export const IotHubProperties: msRest.CompositeMapper = { name: "String" } }, - deviceStreams: { - serializedName: "deviceStreams", - type: { - name: "Composite", - className: "IotHubPropertiesDeviceStreams" - } - }, features: { serializedName: "features", type: { name: "String" } + }, + locations: { + readOnly: true, + serializedName: "locations", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "IotHubLocationDescription" + } + } + } } } } @@ -1179,6 +1416,108 @@ export const IotHubSkuInfo: msRest.CompositeMapper = { } }; +export const GroupIdInformationProperties: msRest.CompositeMapper = { + serializedName: "GroupIdInformationProperties", + type: { + name: "Composite", + className: "GroupIdInformationProperties", + modelProperties: { + groupId: { + serializedName: "groupId", + type: { + name: "String" + } + }, + requiredMembers: { + serializedName: "requiredMembers", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + requiredZoneNames: { + serializedName: "requiredZoneNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const GroupIdInformation: msRest.CompositeMapper = { + serializedName: "GroupIdInformation", + type: { + name: "Composite", + className: "GroupIdInformation", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + constraints: { + Pattern: /^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$/ + }, + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + }, + properties: { + required: true, + serializedName: "properties", + type: { + name: "Composite", + className: "GroupIdInformationProperties" + } + } + } + } +}; + +export const PrivateLinkResources: msRest.CompositeMapper = { + serializedName: "PrivateLinkResources", + type: { + name: "Composite", + className: "PrivateLinkResources", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GroupIdInformation" + } + } + } + } + } + } +}; + export const Resource: msRest.CompositeMapper = { serializedName: "Resource", type: { @@ -1411,6 +1750,30 @@ export const EndpointHealthData: msRest.CompositeMapper = { type: { name: "String" } + }, + lastKnownError: { + serializedName: "lastKnownError", + type: { + name: "String" + } + }, + lastKnownErrorTime: { + serializedName: "lastKnownErrorTime", + type: { + name: "DateTimeRfc1123" + } + }, + lastSuccessfulSendAttemptTime: { + serializedName: "lastSuccessfulSendAttemptTime", + type: { + name: "DateTimeRfc1123" + } + }, + lastSendAttemptTime: { + serializedName: "lastSendAttemptTime", + type: { + name: "DateTimeRfc1123" + } } } } @@ -1671,6 +2034,39 @@ export const EventHubConsumerGroupInfo: msRest.CompositeMapper = { } }; +export const EventHubConsumerGroupName: msRest.CompositeMapper = { + serializedName: "EventHubConsumerGroupName", + type: { + name: "Composite", + className: "EventHubConsumerGroupName", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const EventHubConsumerGroupBodyDescription: msRest.CompositeMapper = { + serializedName: "EventHubConsumerGroupBodyDescription", + type: { + name: "Composite", + className: "EventHubConsumerGroupBodyDescription", + modelProperties: { + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "EventHubConsumerGroupName" + } + } + } + } +}; + export const OperationInputs: msRest.CompositeMapper = { serializedName: "OperationInputs", type: { @@ -2143,6 +2539,30 @@ export const ExportDevicesRequest: msRest.CompositeMapper = { type: { name: "Boolean" } + }, + exportBlobName: { + serializedName: "exportBlobName", + type: { + name: "String" + } + }, + authenticationType: { + serializedName: "authenticationType", + type: { + name: "String" + } + }, + includeConfigurations: { + serializedName: "includeConfigurations", + type: { + name: "Boolean" + } + }, + configurationsBlobName: { + serializedName: "configurationsBlobName", + type: { + name: "String" + } } } } @@ -2167,6 +2587,36 @@ export const ImportDevicesRequest: msRest.CompositeMapper = { type: { name: "String" } + }, + inputBlobName: { + serializedName: "inputBlobName", + type: { + name: "String" + } + }, + outputBlobName: { + serializedName: "outputBlobName", + type: { + name: "String" + } + }, + authenticationType: { + serializedName: "authenticationType", + type: { + name: "String" + } + }, + includeConfigurations: { + serializedName: "includeConfigurations", + type: { + name: "Boolean" + } + }, + configurationsBlobName: { + serializedName: "configurationsBlobName", + type: { + name: "String" + } } } } diff --git a/sdk/iothub/arm-iothub/src/models/parameters.ts b/sdk/iothub/arm-iothub/src/models/parameters.ts index d31ab76d3439..d6af8b8b325d 100644 --- a/sdk/iothub/arm-iothub/src/models/parameters.ts +++ b/sdk/iothub/arm-iothub/src/models/parameters.ts @@ -53,6 +53,16 @@ export const eventHubEndpointName: msRest.OperationURLParameter = { } } }; +export const groupId: msRest.OperationURLParameter = { + parameterPath: "groupId", + mapper: { + required: true, + serializedName: "groupId", + type: { + name: "String" + } + } +}; export const ifMatch0: msRest.OperationParameter = { parameterPath: [ "options", @@ -126,6 +136,16 @@ export const nextPageLink: msRest.OperationURLParameter = { }, skipEncoding: true }; +export const privateEndpointConnectionName: msRest.OperationURLParameter = { + parameterPath: "privateEndpointConnectionName", + mapper: { + required: true, + serializedName: "privateEndpointConnectionName", + type: { + name: "String" + } + } +}; export const resourceGroupName: msRest.OperationURLParameter = { parameterPath: "resourceGroupName", mapper: { diff --git a/sdk/iothub/arm-iothub/src/models/privateEndpointConnectionsMappers.ts b/sdk/iothub/arm-iothub/src/models/privateEndpointConnectionsMappers.ts new file mode 100644 index 000000000000..ae3bdccf89d6 --- /dev/null +++ b/sdk/iothub/arm-iothub/src/models/privateEndpointConnectionsMappers.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + BaseResource, + CertificateDescription, + CertificateProperties, + CertificatePropertiesWithNonce, + CertificateWithNonceDescription, + CloudToDeviceProperties, + EnrichmentProperties, + ErrorDetails, + EventHubConsumerGroupInfo, + EventHubProperties, + FallbackRouteProperties, + FeedbackProperties, + IotHubDescription, + IotHubLocationDescription, + IotHubProperties, + IotHubSkuInfo, + IpFilterRule, + MessagingEndpointProperties, + PrivateEndpoint, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateLinkServiceConnectionState, + Resource, + RouteProperties, + RoutingEndpoints, + RoutingEventHubProperties, + RoutingProperties, + RoutingServiceBusQueueEndpointProperties, + RoutingServiceBusTopicEndpointProperties, + RoutingStorageContainerProperties, + SharedAccessSignatureAuthorizationRule, + StorageEndpointProperties +} from "../models/mappers"; diff --git a/sdk/iothub/arm-iothub/src/models/privateLinkResourcesOperationsMappers.ts b/sdk/iothub/arm-iothub/src/models/privateLinkResourcesOperationsMappers.ts new file mode 100644 index 000000000000..31b1880fa611 --- /dev/null +++ b/sdk/iothub/arm-iothub/src/models/privateLinkResourcesOperationsMappers.ts @@ -0,0 +1,14 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export { + ErrorDetails, + GroupIdInformation, + GroupIdInformationProperties, + PrivateLinkResources +} from "../models/mappers"; diff --git a/sdk/iothub/arm-iothub/src/operations/certificates.ts b/sdk/iothub/arm-iothub/src/operations/certificates.ts index c1d660fd08ef..6bce1e641031 100644 --- a/sdk/iothub/arm-iothub/src/operations/certificates.ts +++ b/sdk/iothub/arm-iothub/src/operations/certificates.ts @@ -330,13 +330,13 @@ const createOrUpdateOperationSpec: msRest.OperationSpec = { ], requestBody: { parameterPath: { - certificate: [ + properties: [ "options", - "certificate" + "properties" ] }, mapper: { - ...Mappers.CertificateBodyDescription, + ...Mappers.CertificateDescription, required: true } }, diff --git a/sdk/iothub/arm-iothub/src/operations/index.ts b/sdk/iothub/arm-iothub/src/operations/index.ts index 9c561acd7985..5219b2ebc987 100644 --- a/sdk/iothub/arm-iothub/src/operations/index.ts +++ b/sdk/iothub/arm-iothub/src/operations/index.ts @@ -13,3 +13,5 @@ export * from "./iotHubResource"; export * from "./resourceProviderCommon"; export * from "./certificates"; export * from "./iotHub"; +export * from "./privateLinkResourcesOperations"; +export * from "./privateEndpointConnections"; diff --git a/sdk/iothub/arm-iothub/src/operations/iotHub.ts b/sdk/iothub/arm-iothub/src/operations/iotHub.ts index a37d6e109ad6..efa557569c3a 100644 --- a/sdk/iothub/arm-iothub/src/operations/iotHub.ts +++ b/sdk/iothub/arm-iothub/src/operations/iotHub.ts @@ -27,10 +27,11 @@ export class IotHub { } /** - * Perform manual fail over of given hub - * @summary Manual Failover Fail over - * @param iotHubName IotHub to fail over - * @param resourceGroupName resource group which Iot Hub belongs to + * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see + * https://aka.ms/manualfailover + * @summary Manually initiate a failover for the IoT Hub to its secondary region + * @param iotHubName Name of the IoT hub to failover + * @param resourceGroupName Name of the resource group containing the IoT hub resource * @param failoverRegion Region the hub will be failed over to * @param [options] The optional parameters * @returns Promise @@ -41,10 +42,11 @@ export class IotHub { } /** - * Perform manual fail over of given hub - * @summary Manual Failover Fail over - * @param iotHubName IotHub to fail over - * @param resourceGroupName resource group which Iot Hub belongs to + * Manually initiate a failover for the IoT Hub to its secondary region. To learn more, see + * https://aka.ms/manualfailover + * @summary Manually initiate a failover for the IoT Hub to its secondary region + * @param iotHubName Name of the IoT hub to failover + * @param resourceGroupName Name of the resource group containing the IoT hub resource * @param failoverRegion Region the hub will be failed over to * @param [options] The optional parameters * @returns Promise diff --git a/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts b/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts index 19266d2904fa..f7f4d226fb59 100644 --- a/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts +++ b/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts @@ -313,7 +313,7 @@ export class IotHubResource { * @param [options] The optional parameters * @returns Promise */ - createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, options?: msRest.RequestOptionsBase): Promise; + createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, options?: Models.IotHubResourceCreateEventHubConsumerGroupOptionalParams): Promise; /** * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -330,8 +330,8 @@ export class IotHubResource { * @param options The optional parameters * @param callback The callback */ - createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, options: Models.IotHubResourceCreateEventHubConsumerGroupOptionalParams, callback: msRest.ServiceCallback): void; + createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, options?: Models.IotHubResourceCreateEventHubConsumerGroupOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, @@ -1277,6 +1277,18 @@ const createEventHubConsumerGroupOperationSpec: msRest.OperationSpec = { headerParameters: [ Parameters.acceptLanguage ], + requestBody: { + parameterPath: { + properties: [ + "options", + "properties" + ] + }, + mapper: { + ...Mappers.EventHubConsumerGroupBodyDescription, + required: true + } + }, responses: { 200: { bodyMapper: Mappers.EventHubConsumerGroupInfo diff --git a/sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts b/sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts new file mode 100644 index 000000000000..65fe4595b6a7 --- /dev/null +++ b/sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts @@ -0,0 +1,304 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/privateEndpointConnectionsMappers"; +import * as Parameters from "../models/parameters"; +import { IotHubClientContext } from "../iotHubClientContext"; + +/** Class representing a PrivateEndpointConnections. */ +export class PrivateEndpointConnections { + private readonly client: IotHubClientContext; + + /** + * Create a PrivateEndpointConnections. + * @param {IotHubClientContext} client Reference to the service client. + */ + constructor(client: IotHubClientContext) { + this.client = client; + } + + /** + * List private endpoint connection properties + * @summary List private endpoint connections + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param callback The callback + */ + list(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Get private endpoint connection properties + * @summary Get private endpoint connection + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param callback The callback + */ + get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceName, + privateEndpointConnectionName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Update the status of a private endpoint connection with the specified name + * @summary Update private endpoint connection + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param properties + * @param [options] The optional parameters + * @returns Promise + */ + update(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnectionProperties, options?: msRest.RequestOptionsBase): Promise { + return this.beginUpdate(resourceGroupName,resourceName,privateEndpointConnectionName,properties,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Delete private endpoint connection with the specified name + * @summary Delete private endpoint connection + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,resourceName,privateEndpointConnectionName,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Update the status of a private endpoint connection with the specified name + * @summary Update private endpoint connection + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param properties + * @param [options] The optional parameters + * @returns Promise + */ + beginUpdate(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnectionProperties, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + resourceName, + privateEndpointConnectionName, + properties, + options + }, + beginUpdateOperationSpec, + options); + } + + /** + * Delete private endpoint connection with the specified name + * @summary Delete private endpoint connection + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param privateEndpointConnectionName The name of the private endpoint connection + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, resourceName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + resourceName, + privateEndpointConnectionName, + options + }, + beginDeleteMethodOperationSpec, + options); + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } + } + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const beginUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: { + properties: "properties" + }, + mapper: { + ...Mappers.PrivateEndpointConnection, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 201: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.privateEndpointConnectionName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 202: { + bodyMapper: Mappers.PrivateEndpointConnection + }, + 204: {}, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; diff --git a/sdk/iothub/arm-iothub/src/operations/privateLinkResourcesOperations.ts b/sdk/iothub/arm-iothub/src/operations/privateLinkResourcesOperations.ts new file mode 100644 index 000000000000..3063510eb6d8 --- /dev/null +++ b/sdk/iothub/arm-iothub/src/operations/privateLinkResourcesOperations.ts @@ -0,0 +1,151 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as Models from "../models"; +import * as Mappers from "../models/privateLinkResourcesOperationsMappers"; +import * as Parameters from "../models/parameters"; +import { IotHubClientContext } from "../iotHubClientContext"; + +/** Class representing a PrivateLinkResourcesOperations. */ +export class PrivateLinkResourcesOperations { + private readonly client: IotHubClientContext; + + /** + * Create a PrivateLinkResourcesOperations. + * @param {IotHubClientContext} client Reference to the service client. + */ + constructor(client: IotHubClientContext) { + this.client = client; + } + + /** + * List private link resources for the given IotHub + * @summary List private link resources + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param [options] The optional parameters + * @returns Promise + */ + list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param callback The callback + */ + list(resourceGroupName: string, resourceName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param options The optional parameters + * @param callback The callback + */ + list(resourceGroupName: string, resourceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(resourceGroupName: string, resourceName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Get the specified private link resource for the given IotHub + * @summary Get the specified private link resource + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param groupId The name of the private link resource + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, resourceName: string, groupId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param groupId The name of the private link resource + * @param callback The callback + */ + get(resourceGroupName: string, resourceName: string, groupId: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group that contains the IoT hub. + * @param resourceName The name of the IoT hub. + * @param groupId The name of the private link resource + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, resourceName: string, groupId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, resourceName: string, groupId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + resourceName, + groupId, + options + }, + getOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.PrivateLinkResources + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources/{groupId}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName, + Parameters.groupId + ], + queryParameters: [ + Parameters.apiVersion + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.GroupIdInformation + }, + default: { + bodyMapper: Mappers.ErrorDetails + } + }, + serializer +}; diff --git a/sdk/iothub/arm-iothub/tsconfig.json b/sdk/iothub/arm-iothub/tsconfig.json index 87bbf5b5fa49..422b584abd5e 100644 --- a/sdk/iothub/arm-iothub/tsconfig.json +++ b/sdk/iothub/arm-iothub/tsconfig.json @@ -9,7 +9,7 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6"], + "lib": ["es6", "dom"], "declaration": true, "outDir": "./esm", "importHelpers": true