diff --git a/sdk/iothub/arm-iothub/LICENSE.txt b/sdk/iothub/arm-iothub/LICENSE.txt index ea8fb1516028..2d3163745319 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) 2020 Microsoft +Copyright (c) 2021 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 2b1111bb8182..e288c707c33c 100644 --- a/sdk/iothub/arm-iothub/README.md +++ b/sdk/iothub/arm-iothub/README.md @@ -15,7 +15,7 @@ npm install @azure/arm-iothub ### How to use -#### nodejs - Authentication, client creation and list operations as an example written in TypeScript. +#### nodejs - client creation and list operations as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth @@ -26,11 +26,10 @@ npm install @azure/ms-rest-nodeauth@"^3.0.0" ##### Sample code +While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package ```typescript -import * as msRest from "@azure/ms-rest-js"; -import * as msRestAzure from "@azure/ms-rest-azure-js"; -import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; -import { IotHubClient, IotHubModels, IotHubMappers } from "@azure/arm-iothub"; +const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +const { IotHubClient } = require("@azure/arm-iothub"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { diff --git a/sdk/iothub/arm-iothub/rollup.config.js b/sdk/iothub/arm-iothub/rollup.config.js index c38caace5654..148271feabca 100644 --- a/sdk/iothub/arm-iothub/rollup.config.js +++ b/sdk/iothub/arm-iothub/rollup.config.js @@ -21,8 +21,8 @@ const config = { "@azure/ms-rest-azure-js": "msRestAzure" }, banner: `/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/iothub/arm-iothub/src/iotHubClient.ts b/sdk/iothub/arm-iothub/src/iotHubClient.ts index 4d85c1a6c854..5a1614c70621 100644 --- a/sdk/iothub/arm-iothub/src/iotHubClient.ts +++ b/sdk/iothub/arm-iothub/src/iotHubClient.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 diff --git a/sdk/iothub/arm-iothub/src/iotHubClientContext.ts b/sdk/iothub/arm-iothub/src/iotHubClientContext.ts index 738b6ce032e1..5aae8a8b59ba 100644 --- a/sdk/iothub/arm-iothub/src/iotHubClientContext.ts +++ b/sdk/iothub/arm-iothub/src/iotHubClientContext.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -44,7 +43,7 @@ export class IotHubClientContext extends msRestAzure.AzureServiceClient { super(credentials, options); - this.apiVersion = '2020-07-10-preview'; + this.apiVersion = '2021-03-31'; 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 dc7bfc670f6d..9dcee9e45ec3 100644 --- a/sdk/iothub/arm-iothub/src/models/certificatesMappers.ts +++ b/sdk/iothub/arm-iothub/src/models/certificatesMappers.ts @@ -1,12 +1,14 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. */ export { + ArmIdentity, + ArmUserIdentity, BaseResource, CertificateDescription, CertificateListDescription, @@ -15,7 +17,6 @@ export { CertificateVerificationDescription, CertificateWithNonceDescription, CloudToDeviceProperties, - EncryptionPropertiesDescription, EnrichmentProperties, ErrorDetails, EventHubConsumerGroupInfo, @@ -25,11 +26,12 @@ export { IotHubDescription, IotHubLocationDescription, IotHubProperties, - IotHubPropertiesDeviceStreams, IotHubSkuInfo, IpFilterRule, - KeyVaultKeyProperties, + ManagedIdentity, MessagingEndpointProperties, + NetworkRuleSetIpRule, + NetworkRuleSetProperties, PrivateEndpoint, PrivateEndpointConnection, PrivateEndpointConnectionProperties, diff --git a/sdk/iothub/arm-iothub/src/models/index.ts b/sdk/iothub/arm-iothub/src/models/index.ts index f17e276b9695..0c88695e272d 100644 --- a/sdk/iothub/arm-iothub/src/models/index.ts +++ b/sdk/iothub/arm-iothub/src/models/index.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -229,6 +229,43 @@ export interface IpFilterRule { ipMask: string; } +/** + * IP Rule to be applied as part of Network Rule Set + */ +export interface NetworkRuleSetIpRule { + /** + * Name of the IP filter rule. + */ + filterName: string; + /** + * IP Filter Action. Possible values include: 'Allow'. Default value: 'Allow'. + */ + action?: NetworkRuleIPAction; + /** + * A string that contains the IP address range in CIDR notation for the rule. + */ + ipMask: string; +} + +/** + * Network Rule Set Properties of IotHub + */ +export interface NetworkRuleSetProperties { + /** + * Default Action for Network Rule Set. Possible values include: 'Deny', 'Allow'. Default value: + * 'Deny'. + */ + defaultAction?: DefaultAction; + /** + * If True, then Network Rule Set is also applied to BuiltIn EventHub EndPoint of IotHub + */ + applyToBuiltInEventHubEndpoint: boolean; + /** + * List of IP Rules + */ + ipRules: NetworkRuleSetIpRule[]; +} + /** * The private endpoint property of a private endpoint connection */ @@ -321,6 +358,16 @@ export interface EventHubProperties { readonly endpoint?: string; } +/** + * The properties of the Managed identity. + */ +export interface ManagedIdentity { + /** + * The user assigned identity. + */ + userAssignedIdentity?: string; +} + /** * The properties related to service bus queue endpoint types. */ @@ -346,6 +393,10 @@ export interface RoutingServiceBusQueueEndpointProperties { * 'keyBased', 'identityBased' */ authenticationType?: AuthenticationType; + /** + * Managed identity properties of routing service bus queue endpoint. + */ + identity?: ManagedIdentity; /** * 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 @@ -388,6 +439,10 @@ export interface RoutingServiceBusTopicEndpointProperties { * 'keyBased', 'identityBased' */ authenticationType?: AuthenticationType; + /** + * Managed identity properties of routing service bus topic endpoint. + */ + identity?: ManagedIdentity; /** * 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 @@ -430,6 +485,10 @@ export interface RoutingEventHubProperties { * 'keyBased', 'identityBased' */ authenticationType?: AuthenticationType; + /** + * Managed identity properties of routing event hub endpoint. + */ + identity?: ManagedIdentity; /** * 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 @@ -468,6 +527,10 @@ export interface RoutingStorageContainerProperties { * 'identityBased' */ authenticationType?: AuthenticationType; + /** + * Managed identity properties of routing storage endpoint. + */ + identity?: ManagedIdentity; /** * 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 @@ -551,7 +614,7 @@ export interface RouteProperties { /** * The source that the routing rule is to be applied to, such as DeviceMessages. Possible values * include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents', - * 'DeviceJobLifecycleEvents', 'DigitalTwinChangeEvents' + * 'DeviceJobLifecycleEvents', 'DeviceConnectionStateEvents' */ source: RoutingSource; /** @@ -665,6 +728,10 @@ export interface StorageEndpointProperties { * values include: 'keyBased', 'identityBased' */ authenticationType?: AuthenticationType; + /** + * Managed identity properties of storage endpoint for file upload. + */ + identity?: ManagedIdentity; } /** @@ -726,40 +793,6 @@ export interface CloudToDeviceProperties { feedback?: FeedbackProperties; } -/** - * The device streams properties of iothub. - */ -export interface IotHubPropertiesDeviceStreams { - /** - * List of Device Streams Endpoints. - */ - streamingEndpoints?: string[]; -} - -/** - * The properties of the KeyVault key. - */ -export interface KeyVaultKeyProperties { - /** - * The identifier of the key. - */ - keyIdentifier?: string; -} - -/** - * The encryption properties for the IoT hub. - */ -export interface EncryptionPropertiesDescription { - /** - * The source of the key. - */ - keySource?: string; - /** - * The properties of the KeyVault key. - */ - keyVaultProperties?: KeyVaultKeyProperties[]; -} - /** * Public representation of one of the locations where a resource is provisioned. */ @@ -794,6 +827,7 @@ export interface IotHubProperties { * The IP filter rules. */ ipFilterRules?: IpFilterRule[]; + networkRuleSets?: NetworkRuleSetProperties; /** * 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. @@ -845,19 +879,11 @@ 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; - /** - * The encryption properties for the IoT hub. - */ - encryption?: EncryptionPropertiesDescription; /** * Primary and secondary location for iot hub * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -935,6 +961,44 @@ export interface PrivateLinkResources { value?: GroupIdInformation[]; } +/** + * An interface representing ArmUserIdentity. + */ +export interface ArmUserIdentity { + /** + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly clientId?: string; +} + +/** + * An interface representing ArmIdentity. + */ +export interface ArmIdentity { + /** + * Principal Id + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly principalId?: string; + /** + * Tenant Id + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly tenantId?: string; + /** + * The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes + * both an implicitly created identity and a set of user assigned identities. The type 'None' + * will remove any identities from the service. Possible values include: 'SystemAssigned', + * 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' + */ + type?: ResourceIdentityType; + userAssignedIdentities?: { [propertyName: string]: ArmUserIdentity }; +} + /** * The common properties of an Azure resource. */ @@ -981,6 +1045,10 @@ export interface IotHubDescription extends Resource { * IotHub SKU info */ sku: IotHubSkuInfo; + /** + * The managed identities for the IotHub. + */ + identity?: ArmIdentity; } /** @@ -1243,7 +1311,7 @@ export interface EventHubConsumerGroupInfo extends BaseResource { /** * The tags. */ - properties?: { [propertyName: string]: string }; + properties?: { [propertyName: string]: any }; /** * The Event Hub-compatible consumer group identifier. * **NOTE: This property will not be serialized. It can only be populated by the server.** @@ -1273,14 +1341,14 @@ export interface EventHubConsumerGroupName { /** * EventHub consumer group name */ - name?: string; + name: string; } /** * The EventHub consumer group. */ export interface EventHubConsumerGroupBodyDescription { - properties?: EventHubConsumerGroupName; + properties: EventHubConsumerGroupName; } /** @@ -1417,7 +1485,7 @@ export interface RoutingTwin { export interface TestAllRoutesInput { /** * Routing source. Possible values include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', - * 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents', 'DigitalTwinChangeEvents' + * 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents', 'DeviceConnectionStateEvents' */ routingSource?: RoutingSource; /** @@ -1560,6 +1628,19 @@ export interface ExportDevicesRequest { * values include: 'keyBased', 'identityBased' */ authenticationType?: AuthenticationType; + /** + * Managed identity properties of storage endpoint for export devices. + */ + identity?: ManagedIdentity; + /** + * 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; } /** @@ -1587,6 +1668,18 @@ export interface ImportDevicesRequest { * values include: 'keyBased', 'identityBased' */ authenticationType?: AuthenticationType; + /** + * Managed identity properties of storage endpoint for import devices. + */ + identity?: ManagedIdentity; + /** + * 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; } /** @@ -1620,13 +1713,6 @@ export interface IotHubResourceUpdateOptionalParams extends msRest.RequestOption tags?: { [propertyName: string]: string }; } -/** - * Optional Parameters. - */ -export interface IotHubResourceCreateEventHubConsumerGroupOptionalParams extends msRest.RequestOptionsBase { - properties?: EventHubConsumerGroupName; -} - /** * Optional Parameters. */ @@ -1811,6 +1897,22 @@ export type PublicNetworkAccess = 'Enabled' | 'Disabled'; */ export type IpFilterActionType = 'Accept' | 'Reject'; +/** + * Defines values for DefaultAction. + * Possible values include: 'Deny', 'Allow' + * @readonly + * @enum {string} + */ +export type DefaultAction = 'Deny' | 'Allow'; + +/** + * Defines values for NetworkRuleIPAction. + * Possible values include: 'Allow' + * @readonly + * @enum {string} + */ +export type NetworkRuleIPAction = 'Allow'; + /** * Defines values for PrivateLinkServiceConnectionStatus. * Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' @@ -1830,11 +1932,11 @@ export type AuthenticationType = 'keyBased' | 'identityBased'; /** * Defines values for RoutingSource. * Possible values include: 'Invalid', 'DeviceMessages', 'TwinChangeEvents', - * 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents', 'DigitalTwinChangeEvents' + * 'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents', 'DeviceConnectionStateEvents' * @readonly * @enum {string} */ -export type RoutingSource = 'Invalid' | 'DeviceMessages' | 'TwinChangeEvents' | 'DeviceLifecycleEvents' | 'DeviceJobLifecycleEvents' | 'DigitalTwinChangeEvents'; +export type RoutingSource = 'Invalid' | 'DeviceMessages' | 'TwinChangeEvents' | 'DeviceLifecycleEvents' | 'DeviceJobLifecycleEvents' | 'DeviceConnectionStateEvents'; /** * Defines values for Capabilities. @@ -1868,6 +1970,15 @@ export type IotHubSku = 'F1' | 'S1' | 'S2' | 'S3' | 'B1' | 'B2' | 'B3'; */ export type IotHubSkuTier = 'Free' | 'Standard' | 'Basic'; +/** + * Defines values for ResourceIdentityType. + * Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None' + * @readonly + * @enum {string} + */ +export type ResourceIdentityType = 'SystemAssigned' | 'UserAssigned' | 'SystemAssigned, UserAssigned' | 'None'; + /** * Defines values for EndpointHealthStatus. * Possible values include: 'unknown', 'healthy', 'degraded', 'unhealthy', 'dead' diff --git a/sdk/iothub/arm-iothub/src/models/iotHubMappers.ts b/sdk/iothub/arm-iothub/src/models/iotHubMappers.ts index 7714701e2033..65f15ad87e82 100644 --- a/sdk/iothub/arm-iothub/src/models/iotHubMappers.ts +++ b/sdk/iothub/arm-iothub/src/models/iotHubMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/iothub/arm-iothub/src/models/iotHubResourceMappers.ts b/sdk/iothub/arm-iothub/src/models/iotHubResourceMappers.ts index c23ba0c05f1c..b5969644a878 100644 --- a/sdk/iothub/arm-iothub/src/models/iotHubResourceMappers.ts +++ b/sdk/iothub/arm-iothub/src/models/iotHubResourceMappers.ts @@ -1,12 +1,14 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. */ export { + ArmIdentity, + ArmUserIdentity, BaseResource, CertificateDescription, CertificateProperties, @@ -14,7 +16,6 @@ export { CertificateWithNonceDescription, CloudError, CloudToDeviceProperties, - EncryptionPropertiesDescription, EndpointHealthData, EndpointHealthDataListResult, EnrichmentProperties, @@ -34,7 +35,6 @@ export { IotHubLocationDescription, IotHubNameAvailabilityInfo, IotHubProperties, - IotHubPropertiesDeviceStreams, IotHubQuotaMetricInfo, IotHubQuotaMetricInfoListResult, IotHubSkuDescription, @@ -43,9 +43,11 @@ export { IpFilterRule, JobResponse, JobResponseListResult, - KeyVaultKeyProperties, + ManagedIdentity, MatchedRoute, MessagingEndpointProperties, + NetworkRuleSetIpRule, + NetworkRuleSetProperties, OperationInputs, PrivateEndpoint, PrivateEndpointConnection, diff --git a/sdk/iothub/arm-iothub/src/models/mappers.ts b/sdk/iothub/arm-iothub/src/models/mappers.ts index c31f5a915071..45a4dfa2ee9f 100644 --- a/sdk/iothub/arm-iothub/src/models/mappers.ts +++ b/sdk/iothub/arm-iothub/src/models/mappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. @@ -368,6 +368,74 @@ export const IpFilterRule: msRest.CompositeMapper = { } }; +export const NetworkRuleSetIpRule: msRest.CompositeMapper = { + serializedName: "NetworkRuleSetIpRule", + type: { + name: "Composite", + className: "NetworkRuleSetIpRule", + modelProperties: { + filterName: { + required: true, + serializedName: "filterName", + type: { + name: "String" + } + }, + action: { + serializedName: "action", + defaultValue: 'Allow', + type: { + name: "String" + } + }, + ipMask: { + required: true, + serializedName: "ipMask", + type: { + name: "String" + } + } + } + } +}; + +export const NetworkRuleSetProperties: msRest.CompositeMapper = { + serializedName: "NetworkRuleSetProperties", + type: { + name: "Composite", + className: "NetworkRuleSetProperties", + modelProperties: { + defaultAction: { + serializedName: "defaultAction", + defaultValue: 'Deny', + type: { + name: "String" + } + }, + applyToBuiltInEventHubEndpoint: { + required: true, + serializedName: "applyToBuiltInEventHubEndpoint", + type: { + name: "Boolean" + } + }, + ipRules: { + required: true, + serializedName: "ipRules", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NetworkRuleSetIpRule" + } + } + } + } + } + } +}; + export const PrivateEndpoint: msRest.CompositeMapper = { serializedName: "PrivateEndpoint", type: { @@ -530,6 +598,22 @@ export const EventHubProperties: msRest.CompositeMapper = { } }; +export const ManagedIdentity: msRest.CompositeMapper = { + serializedName: "ManagedIdentity", + type: { + name: "Composite", + className: "ManagedIdentity", + modelProperties: { + userAssignedIdentity: { + serializedName: "userAssignedIdentity", + type: { + name: "String" + } + } + } + } +}; + export const RoutingServiceBusQueueEndpointProperties: msRest.CompositeMapper = { serializedName: "RoutingServiceBusQueueEndpointProperties", type: { @@ -566,6 +650,13 @@ export const RoutingServiceBusQueueEndpointProperties: msRest.CompositeMapper = name: "String" } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedIdentity" + } + }, name: { required: true, serializedName: "name", @@ -628,6 +719,13 @@ export const RoutingServiceBusTopicEndpointProperties: msRest.CompositeMapper = name: "String" } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedIdentity" + } + }, name: { required: true, serializedName: "name", @@ -690,6 +788,13 @@ export const RoutingEventHubProperties: msRest.CompositeMapper = { name: "String" } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedIdentity" + } + }, name: { required: true, serializedName: "name", @@ -746,6 +851,13 @@ export const RoutingStorageContainerProperties: msRest.CompositeMapper = { name: "String" } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedIdentity" + } + }, name: { required: true, serializedName: "name", @@ -1097,6 +1209,13 @@ export const StorageEndpointProperties: msRest.CompositeMapper = { type: { name: "String" } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedIdentity" + } } } } @@ -1199,71 +1318,6 @@ export const CloudToDeviceProperties: msRest.CompositeMapper = { } }; -export const IotHubPropertiesDeviceStreams: msRest.CompositeMapper = { - serializedName: "IotHubProperties_deviceStreams", - type: { - name: "Composite", - className: "IotHubPropertiesDeviceStreams", - modelProperties: { - streamingEndpoints: { - serializedName: "streamingEndpoints", - type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } - } - } - } - } -}; - -export const KeyVaultKeyProperties: msRest.CompositeMapper = { - serializedName: "KeyVaultKeyProperties", - type: { - name: "Composite", - className: "KeyVaultKeyProperties", - modelProperties: { - keyIdentifier: { - serializedName: "keyIdentifier", - type: { - name: "String" - } - } - } - } -}; - -export const EncryptionPropertiesDescription: msRest.CompositeMapper = { - serializedName: "EncryptionPropertiesDescription", - type: { - name: "Composite", - className: "EncryptionPropertiesDescription", - modelProperties: { - keySource: { - serializedName: "keySource", - type: { - name: "String" - } - }, - keyVaultProperties: { - serializedName: "keyVaultProperties", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "KeyVaultKeyProperties" - } - } - } - } - } - } -}; - export const IotHubLocationDescription: msRest.CompositeMapper = { serializedName: "IotHubLocationDescription", type: { @@ -1322,6 +1376,13 @@ export const IotHubProperties: msRest.CompositeMapper = { } } }, + networkRuleSets: { + serializedName: "networkRuleSets", + type: { + name: "Composite", + className: "NetworkRuleSetProperties" + } + }, minTlsVersion: { serializedName: "minTlsVersion", type: { @@ -1423,26 +1484,12 @@ export const IotHubProperties: msRest.CompositeMapper = { name: "String" } }, - deviceStreams: { - serializedName: "deviceStreams", - type: { - name: "Composite", - className: "IotHubPropertiesDeviceStreams" - } - }, features: { serializedName: "features", type: { name: "String" } }, - encryption: { - serializedName: "encryption", - type: { - name: "Composite", - className: "EncryptionPropertiesDescription" - } - }, locations: { readOnly: true, serializedName: "locations", @@ -1597,6 +1644,78 @@ export const PrivateLinkResources: msRest.CompositeMapper = { } }; +export const ArmUserIdentity: msRest.CompositeMapper = { + serializedName: "ArmUserIdentity", + type: { + name: "Composite", + className: "ArmUserIdentity", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + clientId: { + readOnly: true, + serializedName: "clientId", + type: { + name: "String" + } + } + } + } +}; + +export const ArmIdentity: msRest.CompositeMapper = { + serializedName: "ArmIdentity", + type: { + name: "Composite", + className: "ArmIdentity", + modelProperties: { + principalId: { + readOnly: true, + serializedName: "principalId", + type: { + name: "String" + } + }, + tenantId: { + readOnly: true, + serializedName: "tenantId", + type: { + name: "String" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: [ + "SystemAssigned", + "UserAssigned", + "SystemAssigned, UserAssigned", + "None" + ] + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "ArmUserIdentity" + } + } + } + } + } + } +}; + export const Resource: msRest.CompositeMapper = { serializedName: "Resource", type: { @@ -1676,6 +1795,13 @@ export const IotHubDescription: msRest.CompositeMapper = { name: "Composite", className: "IotHubSkuInfo" } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ArmIdentity" + } } } } @@ -2076,7 +2202,7 @@ export const EventHubConsumerGroupInfo: msRest.CompositeMapper = { name: "Dictionary", value: { type: { - name: "String" + name: "Object" } } } @@ -2120,6 +2246,7 @@ export const EventHubConsumerGroupName: msRest.CompositeMapper = { className: "EventHubConsumerGroupName", modelProperties: { name: { + required: true, serializedName: "name", type: { name: "String" @@ -2136,6 +2263,7 @@ export const EventHubConsumerGroupBodyDescription: msRest.CompositeMapper = { className: "EventHubConsumerGroupBodyDescription", modelProperties: { properties: { + required: true, serializedName: "properties", type: { name: "Composite", @@ -2630,6 +2758,25 @@ export const ExportDevicesRequest: msRest.CompositeMapper = { type: { name: "String" } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedIdentity" + } + }, + includeConfigurations: { + serializedName: "includeConfigurations", + type: { + name: "Boolean" + } + }, + configurationsBlobName: { + serializedName: "configurationsBlobName", + type: { + name: "String" + } } } } @@ -2672,6 +2819,25 @@ export const ImportDevicesRequest: msRest.CompositeMapper = { type: { name: "String" } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedIdentity" + } + }, + includeConfigurations: { + serializedName: "includeConfigurations", + type: { + name: "Boolean" + } + }, + configurationsBlobName: { + serializedName: "configurationsBlobName", + type: { + name: "String" + } } } } diff --git a/sdk/iothub/arm-iothub/src/models/operationsMappers.ts b/sdk/iothub/arm-iothub/src/models/operationsMappers.ts index 5d69c8a954f1..b050cda5b1fc 100644 --- a/sdk/iothub/arm-iothub/src/models/operationsMappers.ts +++ b/sdk/iothub/arm-iothub/src/models/operationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/iothub/arm-iothub/src/models/parameters.ts b/sdk/iothub/arm-iothub/src/models/parameters.ts index d6af8b8b325d..bf980b5229d1 100644 --- a/sdk/iothub/arm-iothub/src/models/parameters.ts +++ b/sdk/iothub/arm-iothub/src/models/parameters.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 diff --git a/sdk/iothub/arm-iothub/src/models/privateEndpointConnectionsMappers.ts b/sdk/iothub/arm-iothub/src/models/privateEndpointConnectionsMappers.ts index 7827700fb006..95eafe0d4d86 100644 --- a/sdk/iothub/arm-iothub/src/models/privateEndpointConnectionsMappers.ts +++ b/sdk/iothub/arm-iothub/src/models/privateEndpointConnectionsMappers.ts @@ -1,19 +1,20 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. */ export { + ArmIdentity, + ArmUserIdentity, BaseResource, CertificateDescription, CertificateProperties, CertificatePropertiesWithNonce, CertificateWithNonceDescription, CloudToDeviceProperties, - EncryptionPropertiesDescription, EnrichmentProperties, ErrorDetails, EventHubConsumerGroupInfo, @@ -23,11 +24,12 @@ export { IotHubDescription, IotHubLocationDescription, IotHubProperties, - IotHubPropertiesDeviceStreams, IotHubSkuInfo, IpFilterRule, - KeyVaultKeyProperties, + ManagedIdentity, MessagingEndpointProperties, + NetworkRuleSetIpRule, + NetworkRuleSetProperties, PrivateEndpoint, PrivateEndpointConnection, PrivateEndpointConnectionProperties, diff --git a/sdk/iothub/arm-iothub/src/models/privateLinkResourcesOperationsMappers.ts b/sdk/iothub/arm-iothub/src/models/privateLinkResourcesOperationsMappers.ts index 31b1880fa611..97770ac159b2 100644 --- a/sdk/iothub/arm-iothub/src/models/privateLinkResourcesOperationsMappers.ts +++ b/sdk/iothub/arm-iothub/src/models/privateLinkResourcesOperationsMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/iothub/arm-iothub/src/models/resourceProviderCommonMappers.ts b/sdk/iothub/arm-iothub/src/models/resourceProviderCommonMappers.ts index 232343c4f750..ba9ba8659584 100644 --- a/sdk/iothub/arm-iothub/src/models/resourceProviderCommonMappers.ts +++ b/sdk/iothub/arm-iothub/src/models/resourceProviderCommonMappers.ts @@ -1,6 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. + * 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. diff --git a/sdk/iothub/arm-iothub/src/operations/certificates.ts b/sdk/iothub/arm-iothub/src/operations/certificates.ts index 6bce1e641031..8ea621758896 100644 --- a/sdk/iothub/arm-iothub/src/operations/certificates.ts +++ b/sdk/iothub/arm-iothub/src/operations/certificates.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 diff --git a/sdk/iothub/arm-iothub/src/operations/index.ts b/sdk/iothub/arm-iothub/src/operations/index.ts index 5219b2ebc987..3b1febaa937b 100644 --- a/sdk/iothub/arm-iothub/src/operations/index.ts +++ b/sdk/iothub/arm-iothub/src/operations/index.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 diff --git a/sdk/iothub/arm-iothub/src/operations/iotHub.ts b/sdk/iothub/arm-iothub/src/operations/iotHub.ts index efa557569c3a..0f0f2d75ce7c 100644 --- a/sdk/iothub/arm-iothub/src/operations/iotHub.ts +++ b/sdk/iothub/arm-iothub/src/operations/iotHub.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 diff --git a/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts b/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts index f7f4d226fb59..8067f51cefdf 100644 --- a/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts +++ b/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -63,7 +62,9 @@ export class IotHubResource { /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to * retrieve the IoT hub metadata and security metadata, and then combine them with the modified - * values in a new body to update the IoT hub. + * values in a new body to update the IoT hub. If certain properties are missing in the JSON, + * updating IoT Hub may cause these values to fallback to default, which may lead to unexpected + * behavior. * @summary Create or update the metadata of an IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -310,34 +311,38 @@ export class IotHubResource { * @param resourceName The name of the IoT hub. * @param eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to add. + * @param properties * @param [options] The optional parameters * @returns Promise */ - createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, options?: Models.IotHubResourceCreateEventHubConsumerGroupOptionalParams): Promise; + createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, properties: Models.EventHubConsumerGroupName, 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 eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to add. + * @param properties * @param callback The callback */ - createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, callback: msRest.ServiceCallback): void; + createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, properties: Models.EventHubConsumerGroupName, 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 eventHubEndpointName The name of the Event Hub-compatible endpoint in the IoT hub. * @param name The name of the consumer group to add. + * @param properties * @param options The optional parameters * @param callback The callback */ - 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 { + createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, properties: Models.EventHubConsumerGroupName, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + createEventHubConsumerGroup(resourceGroupName: string, resourceName: string, eventHubEndpointName: string, name: string, properties: Models.EventHubConsumerGroupName, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.client.sendOperationRequest( { resourceGroupName, resourceName, eventHubEndpointName, name, + properties, options }, createEventHubConsumerGroupOperationSpec, @@ -787,7 +792,9 @@ export class IotHubResource { /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to * retrieve the IoT hub metadata and security metadata, and then combine them with the modified - * values in a new body to update the IoT hub. + * values in a new body to update the IoT hub. If certain properties are missing in the JSON, + * updating IoT Hub may cause these values to fallback to default, which may lead to unexpected + * behavior. * @summary Create or update the metadata of an IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -1279,10 +1286,7 @@ const createEventHubConsumerGroupOperationSpec: msRest.OperationSpec = { ], requestBody: { parameterPath: { - properties: [ - "options", - "properties" - ] + properties: "properties" }, mapper: { ...Mappers.EventHubConsumerGroupBodyDescription, @@ -1749,6 +1753,9 @@ const listBySubscriptionNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -1770,6 +1777,9 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -1791,6 +1801,9 @@ const getValidSkusNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -1812,6 +1825,9 @@ const listEventHubConsumerGroupsNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -1833,6 +1849,9 @@ const listJobsNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -1854,6 +1873,9 @@ const getQuotaMetricsNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -1875,6 +1897,9 @@ const getEndpointHealthNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], @@ -1896,6 +1921,9 @@ const listKeysNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/iothub/arm-iothub/src/operations/operations.ts b/sdk/iothub/arm-iothub/src/operations/operations.ts index 1c9480e71f7b..b8ae9766132e 100644 --- a/sdk/iothub/arm-iothub/src/operations/operations.ts +++ b/sdk/iothub/arm-iothub/src/operations/operations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 @@ -108,6 +107,9 @@ const listNextOperationSpec: msRest.OperationSpec = { urlParameters: [ Parameters.nextPageLink ], + queryParameters: [ + Parameters.apiVersion + ], headerParameters: [ Parameters.acceptLanguage ], diff --git a/sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts b/sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts index 65fe4595b6a7..f334cfcd50ec 100644 --- a/sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts +++ b/sdk/iothub/arm-iothub/src/operations/privateEndpointConnections.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 diff --git a/sdk/iothub/arm-iothub/src/operations/privateLinkResourcesOperations.ts b/sdk/iothub/arm-iothub/src/operations/privateLinkResourcesOperations.ts index 3063510eb6d8..ada51e543e33 100644 --- a/sdk/iothub/arm-iothub/src/operations/privateLinkResourcesOperations.ts +++ b/sdk/iothub/arm-iothub/src/operations/privateLinkResourcesOperations.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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 diff --git a/sdk/iothub/arm-iothub/src/operations/resourceProviderCommon.ts b/sdk/iothub/arm-iothub/src/operations/resourceProviderCommon.ts index 40d9058c47cd..b6630c9fe15d 100644 --- a/sdk/iothub/arm-iothub/src/operations/resourceProviderCommon.ts +++ b/sdk/iothub/arm-iothub/src/operations/resourceProviderCommon.ts @@ -1,7 +1,6 @@ /* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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