From d09a971d6ea860a52366d3e8413ce04f19d99848 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 14 Nov 2022 22:27:02 +0000 Subject: [PATCH] CodeGen from PR 21508 in Azure/azure-rest-api-specs Merge 6cffed7d053dd50a1404c2f80dc3ca5a0d7bb59a into 32f95c52f44cd2e7002c8c7ff75ff6d894483b5a --- sdk/iothub/arm-iothub/CHANGELOG.md | 35 +- sdk/iothub/arm-iothub/README.md | 2 +- sdk/iothub/arm-iothub/_meta.json | 8 +- sdk/iothub/arm-iothub/package.json | 14 +- .../arm-iothub/review/arm-iothub.api.md | 79 ++++- sdk/iothub/arm-iothub/src/iotHubClient.ts | 4 +- sdk/iothub/arm-iothub/src/models/index.ts | 124 ++++++- sdk/iothub/arm-iothub/src/models/mappers.ts | 315 ++++++++++++++++++ .../arm-iothub/src/models/parameters.ts | 2 +- .../src/operations/iotHubResource.ts | 18 +- .../operationsInterfaces/iotHubResource.ts | 6 +- sdk/iothub/arm-iothub/test/sampleTest.ts | 43 +++ sdk/iothub/arm-iothub/tsconfig.json | 10 +- 13 files changed, 606 insertions(+), 54 deletions(-) create mode 100644 sdk/iothub/arm-iothub/test/sampleTest.ts diff --git a/sdk/iothub/arm-iothub/CHANGELOG.md b/sdk/iothub/arm-iothub/CHANGELOG.md index 1bc2cdd932a5..6cd38885740b 100644 --- a/sdk/iothub/arm-iothub/CHANGELOG.md +++ b/sdk/iothub/arm-iothub/CHANGELOG.md @@ -1,15 +1,30 @@ # Release History + +## 6.3.0-beta.1 (2022-11-14) + +**Features** -## 6.2.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added Interface EncryptionPropertiesDescription + - Added Interface IotHubManualFailoverHeaders + - Added Interface IotHubPropertiesDeviceStreams + - Added Interface IotHubResourceCreateOrUpdateHeaders + - Added Interface IotHubResourceDeleteHeaders + - Added Interface IotHubResourceUpdateHeaders + - Added Interface KeyVaultKeyProperties + - Added Interface PrivateEndpointConnectionsDeleteHeaders + - Added Interface PrivateEndpointConnectionsUpdateHeaders + - Added Interface RootCertificateProperties + - Added Interface RoutingCosmosDBSqlApiProperties + - Interface IotHubProperties has a new optional parameter allowDataPlanePreviewFeatures + - Interface IotHubProperties has a new optional parameter deviceStreams + - Interface IotHubProperties has a new optional parameter encryption + - Interface IotHubProperties has a new optional parameter rootCertificate + - Interface RoutingEndpoints has a new optional parameter cosmosDBSqlCollections + - Add parameters of IotHubResourceUpdateHeaders to TypeAlias IotHubResourceUpdateResponse + - Enum KnownRoutingSource has a new value DigitalTwinChangeEvents + - Enum KnownRoutingSource has a new value MqttBrokerMessages + + ## 6.2.0 (2022-08-18) **Features** diff --git a/sdk/iothub/arm-iothub/README.md b/sdk/iothub/arm-iothub/README.md index 186f152837c5..fa95cd7516b0 100644 --- a/sdk/iothub/arm-iothub/README.md +++ b/sdk/iothub/arm-iothub/README.md @@ -6,7 +6,7 @@ Use this API to manage the IoT hubs in your Azure subscription. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/iothub/arm-iothub) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-iothub) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-iothub) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-iothub?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/iothub/arm-iothub/_meta.json b/sdk/iothub/arm-iothub/_meta.json index 57c6ed3f2870..d23647baad9d 100644 --- a/sdk/iothub/arm-iothub/_meta.json +++ b/sdk/iothub/arm-iothub/_meta.json @@ -1,8 +1,8 @@ { - "commit": "1dd79c416cdccde274113ec03b92b75069fad464", + "commit": "d33cf91bc983498849e3ad89af8de486bc038c56", "readme": "specification/iothub/resource-manager/readme.md", - "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\iothub\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220727.1 --generate-sample=true", + "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/iothub/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.2", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.1.20220727.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.5.1", + "use": "@autorest/typescript@6.0.0-rc.2" } \ No newline at end of file diff --git a/sdk/iothub/arm-iothub/package.json b/sdk/iothub/arm-iothub/package.json index c7c03f59c910..41ad2a3e3706 100644 --- a/sdk/iothub/arm-iothub/package.json +++ b/sdk/iothub/arm-iothub/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for IotHubClient.", - "version": "6.2.1", + "version": "6.3.0-beta.1", "engines": { "node": ">=14.0.0" }, @@ -109,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-iothub?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/iothub/arm-iothub/review/arm-iothub.api.md b/sdk/iothub/arm-iothub/review/arm-iothub.api.md index 7f4c69d2277c..874f02f94c42 100644 --- a/sdk/iothub/arm-iothub/review/arm-iothub.api.md +++ b/sdk/iothub/arm-iothub/review/arm-iothub.api.md @@ -155,6 +155,12 @@ export type CreatedByType = string; // @public export type DefaultAction = string; +// @public +export interface EncryptionPropertiesDescription { + keySource?: string; + keyVaultProperties?: KeyVaultKeyProperties[]; +} + // @public export interface EndpointHealthData { endpointId?: string; @@ -351,6 +357,11 @@ export interface IotHubLocationDescription { role?: IotHubReplicaRoleType; } +// @public +export interface IotHubManualFailoverHeaders { + location?: string; +} + // @public export interface IotHubManualFailoverOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -369,15 +380,18 @@ export type IotHubNameUnavailabilityReason = "Invalid" | "AlreadyExists"; // @public export interface IotHubProperties { + allowDataPlanePreviewFeatures?: boolean; allowedFqdnList?: string[]; authorizationPolicies?: SharedAccessSignatureAuthorizationRule[]; cloudToDevice?: CloudToDeviceProperties; comments?: string; + deviceStreams?: IotHubPropertiesDeviceStreams; disableDeviceSAS?: boolean; disableLocalAuth?: boolean; disableModuleSAS?: boolean; enableDataResidency?: boolean; enableFileUploadNotifications?: boolean; + encryption?: EncryptionPropertiesDescription; eventHubEndpoints?: { [propertyName: string]: EventHubProperties; }; @@ -394,6 +408,7 @@ export interface IotHubProperties { readonly provisioningState?: string; publicNetworkAccess?: PublicNetworkAccess; restrictOutboundNetworkAccess?: boolean; + rootCertificate?: RootCertificateProperties; routing?: RoutingProperties; readonly state?: string; storageEndpoints?: { @@ -401,6 +416,11 @@ export interface IotHubProperties { }; } +// @public +export interface IotHubPropertiesDeviceStreams { + streamingEndpoints?: string[]; +} + // @public export interface IotHubQuotaMetricInfo { readonly currentValue?: number; @@ -461,6 +481,11 @@ export interface IotHubResourceCreateEventHubConsumerGroupOptionalParams extends // @public export type IotHubResourceCreateEventHubConsumerGroupResponse = EventHubConsumerGroupInfo; +// @public +export interface IotHubResourceCreateOrUpdateHeaders { + azureAsyncOperation?: string; +} + // @public export interface IotHubResourceCreateOrUpdateOptionalParams extends coreClient.OperationOptions { ifMatch?: string; @@ -475,6 +500,11 @@ export type IotHubResourceCreateOrUpdateResponse = IotHubDescription; export interface IotHubResourceDeleteEventHubConsumerGroupOptionalParams extends coreClient.OperationOptions { } +// @public +export interface IotHubResourceDeleteHeaders { + azureAsyncOperation?: string; +} + // @public export interface IotHubResourceDeleteOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -659,6 +689,11 @@ export interface IotHubResourceTestRouteOptionalParams extends coreClient.Operat // @public export type IotHubResourceTestRouteResponse = TestRouteResult; +// @public +export interface IotHubResourceUpdateHeaders { + azureAsyncOperation?: string; +} + // @public export interface IotHubResourceUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -666,7 +701,7 @@ export interface IotHubResourceUpdateOptionalParams extends coreClient.Operation } // @public -export type IotHubResourceUpdateResponse = IotHubDescription; +export type IotHubResourceUpdateResponse = IotHubResourceUpdateHeaders & IotHubDescription; // @public export type IotHubScaleType = "Automatic" | "Manual" | "None"; @@ -731,6 +766,12 @@ export type JobStatus = "unknown" | "enqueued" | "running" | "completed" | "fail // @public export type JobType = string; +// @public +export interface KeyVaultKeyProperties { + identity?: ManagedIdentity; + keyIdentifier?: string; +} + // @public export enum KnownAuthenticationType { IdentityBased = "identityBased", @@ -828,7 +869,9 @@ export enum KnownRoutingSource { DeviceJobLifecycleEvents = "DeviceJobLifecycleEvents", DeviceLifecycleEvents = "DeviceLifecycleEvents", DeviceMessages = "DeviceMessages", + DigitalTwinChangeEvents = "DigitalTwinChangeEvents", Invalid = "Invalid", + MqttBrokerMessages = "MqttBrokerMessages", TwinChangeEvents = "TwinChangeEvents" } @@ -959,6 +1002,11 @@ export interface PrivateEndpointConnections { list(resourceGroupName: string, resourceName: string, options?: PrivateEndpointConnectionsListOptionalParams): Promise; } +// @public +export interface PrivateEndpointConnectionsDeleteHeaders { + azureAsyncOperation?: string; +} + // @public export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -982,6 +1030,11 @@ export interface PrivateEndpointConnectionsListOptionalParams extends coreClient // @public export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnection[]; +// @public +export interface PrivateEndpointConnectionsUpdateHeaders { + azureAsyncOperation?: string; +} + // @public export interface PrivateEndpointConnectionsUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -1062,6 +1115,12 @@ export interface ResourceProviderCommonGetSubscriptionQuotaOptionalParams extend // @public export type ResourceProviderCommonGetSubscriptionQuotaResponse = UserSubscriptionQuotaListResult; +// @public +export interface RootCertificateProperties { + enableRootCertificateV2?: boolean; + readonly lastUpdatedTimeUtc?: Date; +} + // @public export interface RouteCompilationError { location?: RouteErrorRange; @@ -1093,8 +1152,26 @@ export interface RouteProperties { source: RoutingSource; } +// @public +export interface RoutingCosmosDBSqlApiProperties { + authenticationType?: AuthenticationType; + collectionName: string; + databaseName: string; + endpointUri: string; + id?: string; + identity?: ManagedIdentity; + name: string; + partitionKeyName?: string; + partitionKeyTemplate?: string; + primaryKey?: string; + resourceGroup?: string; + secondaryKey?: string; + subscriptionId?: string; +} + // @public export interface RoutingEndpoints { + cosmosDBSqlCollections?: RoutingCosmosDBSqlApiProperties[]; eventHubs?: RoutingEventHubProperties[]; serviceBusQueues?: RoutingServiceBusQueueEndpointProperties[]; serviceBusTopics?: RoutingServiceBusTopicEndpointProperties[]; diff --git a/sdk/iothub/arm-iothub/src/iotHubClient.ts b/sdk/iothub/arm-iothub/src/iotHubClient.ts index 2fed2931d02a..712902cae711 100644 --- a/sdk/iothub/arm-iothub/src/iotHubClient.ts +++ b/sdk/iothub/arm-iothub/src/iotHubClient.ts @@ -66,7 +66,7 @@ export class IotHubClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-iothub/6.2.1`; + const packageDetails = `azsdk-js-arm-iothub/6.3.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -120,7 +120,7 @@ export class IotHubClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-07-02"; + this.apiVersion = options.apiVersion || "2022-11-01-preview"; this.operations = new OperationsImpl(this); this.iotHubResource = new IotHubResourceImpl(this); this.resourceProviderCommon = new ResourceProviderCommonImpl(this); diff --git a/sdk/iothub/arm-iothub/src/models/index.ts b/sdk/iothub/arm-iothub/src/models/index.ts index d37bd04f3810..04e3d52f2b63 100644 --- a/sdk/iothub/arm-iothub/src/models/index.ts +++ b/sdk/iothub/arm-iothub/src/models/index.ts @@ -134,8 +134,12 @@ export interface IotHubProperties { cloudToDevice?: CloudToDeviceProperties; /** IoT hub comments. */ comments?: string; + /** The device streams properties of iothub. */ + deviceStreams?: IotHubPropertiesDeviceStreams; /** The capabilities and features enabled for the IoT hub. */ 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. @@ -143,6 +147,10 @@ export interface IotHubProperties { readonly locations?: IotHubLocationDescription[]; /** This property when set to true, will enable data residency, thus, disabling disaster recovery. */ enableDataResidency?: boolean; + /** This property store root certificate related information */ + rootCertificate?: RootCertificateProperties; + /** When this property is set to true, the hub receives all data plane preview features at all times. */ + allowDataPlanePreviewFeatures?: boolean; } /** The properties of an IoT hub shared access policy. */ @@ -280,6 +288,8 @@ export interface RoutingEndpoints { eventHubs?: RoutingEventHubProperties[]; /** The list of storage container endpoints that IoT hub routes messages to, based on the routing rules. */ storageContainers?: RoutingStorageContainerProperties[]; + /** The list of Cosmos DB collection endpoints that IoT hub routes messages to, based on the routing rules. */ + cosmosDBSqlCollections?: RoutingCosmosDBSqlApiProperties[]; } /** The properties related to service bus queue endpoint types. */ @@ -384,6 +394,36 @@ export interface RoutingStorageContainerProperties { encoding?: RoutingStorageContainerPropertiesEncoding; } +/** The properties related to a cosmos DB sql collection endpoint. */ +export interface RoutingCosmosDBSqlApiProperties { + /** 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 are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. */ + name: string; + /** Id of the cosmos DB sql collection endpoint */ + id?: string; + /** The subscription identifier of the cosmos DB account. */ + subscriptionId?: string; + /** The name of the resource group of the cosmos DB account. */ + resourceGroup?: string; + /** The url of the cosmos DB account. It must include the protocol https:// */ + endpointUri: string; + /** Method used to authenticate against the cosmos DB sql collection endpoint */ + authenticationType?: AuthenticationType; + /** Managed identity properties of routing cosmos DB collection endpoint. */ + identity?: ManagedIdentity; + /** The primary key of the cosmos DB account. */ + primaryKey?: string; + /** The secondary key of the cosmos DB account. */ + secondaryKey?: string; + /** The name of the cosmos DB database in the cosmos DB account. */ + databaseName: string; + /** The name of the cosmos DB sql collection in the cosmos DB database. */ + collectionName: string; + /** The name of the partition key associated with this cosmos DB sql collection if one exists. This is an optional parameter. */ + partitionKeyName?: string; + /** The template for generating a synthetic partition key value for use with this cosmos DB sql collection. The template must include at least one of the following placeholders: {iothub}, {deviceid}, {DD}, {MM}, and {YYYY}. Any one placeholder may be specified at most once, but order and non-placeholder components are arbitrary. This parameter is only required if PartitionKeyName is specified. */ + partitionKeyTemplate?: string; +} + /** The properties of a routing rule that your IoT hub uses to route messages to endpoints. */ export interface RouteProperties { /** The name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique. */ @@ -466,6 +506,28 @@ export interface FeedbackProperties { maxDeliveryCount?: number; } +/** The device streams properties of iothub. */ +export interface IotHubPropertiesDeviceStreams { + /** List of Device Streams Endpoints. */ + streamingEndpoints?: 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[]; +} + +/** The properties of the KeyVault key. */ +export interface KeyVaultKeyProperties { + /** The identifier of the key. */ + keyIdentifier?: string; + /** Managed identity properties of KeyVault Key. */ + identity?: ManagedIdentity; +} + /** Public representation of one of the locations where a resource is provisioned. */ export interface IotHubLocationDescription { /** The name of the Azure region */ @@ -474,6 +536,17 @@ export interface IotHubLocationDescription { role?: IotHubReplicaRoleType; } +/** This property store root certificate related information */ +export interface RootCertificateProperties { + /** This property when set to true, hub will use G2 cert; while it's set to false, hub uses Baltimore Cert. */ + enableRootCertificateV2?: boolean; + /** + * the last update time to root certificate flag. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lastUpdatedTimeUtc?: Date; +} + /** Information about the SKU of the IoT hub. */ export interface IotHubSkuInfo { /** The name of the SKU. */ @@ -498,7 +571,7 @@ export interface ArmIdentity { * 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. */ + /** 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. */ type?: ResourceIdentityType; /** Dictionary of */ userAssignedIdentities?: { [propertyName: string]: ArmUserIdentity }; @@ -1202,6 +1275,42 @@ export interface IotHubDescription extends Resource { readonly systemData?: SystemData; } +/** Defines headers for IotHubResource_createOrUpdate operation. */ +export interface IotHubResourceCreateOrUpdateHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for IotHubResource_update operation. */ +export interface IotHubResourceUpdateHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for IotHubResource_delete operation. */ +export interface IotHubResourceDeleteHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for IotHub_manualFailover operation. */ +export interface IotHubManualFailoverHeaders { + /** URL to query for status of the operation. */ + location?: string; +} + +/** Defines headers for PrivateEndpointConnections_update operation. */ +export interface PrivateEndpointConnectionsUpdateHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; +} + +/** Defines headers for PrivateEndpointConnections_delete operation. */ +export interface PrivateEndpointConnectionsDeleteHeaders { + /** URL to query for status of the operation. */ + azureAsyncOperation?: string; +} + /** Known values of {@link PublicNetworkAccess} that the service accepts. */ export enum KnownPublicNetworkAccess { /** Enabled */ @@ -1328,8 +1437,12 @@ export enum KnownRoutingSource { DeviceLifecycleEvents = "DeviceLifecycleEvents", /** DeviceJobLifecycleEvents */ DeviceJobLifecycleEvents = "DeviceJobLifecycleEvents", + /** DigitalTwinChangeEvents */ + DigitalTwinChangeEvents = "DigitalTwinChangeEvents", /** DeviceConnectionStateEvents */ - DeviceConnectionStateEvents = "DeviceConnectionStateEvents" + DeviceConnectionStateEvents = "DeviceConnectionStateEvents", + /** MqttBrokerMessages */ + MqttBrokerMessages = "MqttBrokerMessages" } /** @@ -1342,7 +1455,9 @@ export enum KnownRoutingSource { * **TwinChangeEvents** \ * **DeviceLifecycleEvents** \ * **DeviceJobLifecycleEvents** \ - * **DeviceConnectionStateEvents** + * **DigitalTwinChangeEvents** \ + * **DeviceConnectionStateEvents** \ + * **MqttBrokerMessages** */ export type RoutingSource = string; @@ -1631,7 +1746,8 @@ export interface IotHubResourceUpdateOptionalParams } /** Contains response data for the update operation. */ -export type IotHubResourceUpdateResponse = IotHubDescription; +export type IotHubResourceUpdateResponse = IotHubResourceUpdateHeaders & + IotHubDescription; /** Optional parameters. */ export interface IotHubResourceDeleteOptionalParams diff --git a/sdk/iothub/arm-iothub/src/models/mappers.ts b/sdk/iothub/arm-iothub/src/models/mappers.ts index 3a67045a8d62..8208b58f7972 100644 --- a/sdk/iothub/arm-iothub/src/models/mappers.ts +++ b/sdk/iothub/arm-iothub/src/models/mappers.ts @@ -306,12 +306,26 @@ export const IotHubProperties: coreClient.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: { serializedName: "locations", readOnly: true, @@ -330,6 +344,19 @@ export const IotHubProperties: coreClient.CompositeMapper = { type: { name: "Boolean" } + }, + rootCertificate: { + serializedName: "rootCertificate", + type: { + name: "Composite", + className: "RootCertificateProperties" + } + }, + allowDataPlanePreviewFeatures: { + serializedName: "allowDataPlanePreviewFeatures", + type: { + name: "Boolean" + } } } } @@ -735,6 +762,18 @@ export const RoutingEndpoints: coreClient.CompositeMapper = { } } } + }, + cosmosDBSqlCollections: { + serializedName: "cosmosDBSqlCollections", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoutingCosmosDBSqlApiProperties" + } + } + } } } } @@ -1060,6 +1099,101 @@ export const RoutingStorageContainerProperties: coreClient.CompositeMapper = { } }; +export const RoutingCosmosDBSqlApiProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RoutingCosmosDBSqlApiProperties", + modelProperties: { + name: { + constraints: { + Pattern: new RegExp("^[A-Za-z0-9-._]{1,64}$") + }, + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + id: { + serializedName: "id", + type: { + name: "String" + } + }, + subscriptionId: { + serializedName: "subscriptionId", + type: { + name: "String" + } + }, + resourceGroup: { + serializedName: "resourceGroup", + type: { + name: "String" + } + }, + endpointUri: { + serializedName: "endpointUri", + required: true, + type: { + name: "String" + } + }, + authenticationType: { + serializedName: "authenticationType", + type: { + name: "String" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedIdentity" + } + }, + primaryKey: { + serializedName: "primaryKey", + type: { + name: "String" + } + }, + secondaryKey: { + serializedName: "secondaryKey", + type: { + name: "String" + } + }, + databaseName: { + serializedName: "databaseName", + required: true, + type: { + name: "String" + } + }, + collectionName: { + serializedName: "collectionName", + required: true, + type: { + name: "String" + } + }, + partitionKeyName: { + serializedName: "partitionKeyName", + type: { + name: "String" + } + }, + partitionKeyTemplate: { + serializedName: "partitionKeyTemplate", + type: { + name: "String" + } + } + } + } +}; + export const RouteProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1340,6 +1474,75 @@ export const FeedbackProperties: coreClient.CompositeMapper = { } }; +export const IotHubPropertiesDeviceStreams: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotHubPropertiesDeviceStreams", + modelProperties: { + streamingEndpoints: { + serializedName: "streamingEndpoints", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const EncryptionPropertiesDescription: coreClient.CompositeMapper = { + 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 KeyVaultKeyProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "KeyVaultKeyProperties", + modelProperties: { + keyIdentifier: { + serializedName: "keyIdentifier", + type: { + name: "String" + } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedIdentity" + } + } + } + } +}; + export const IotHubLocationDescription: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1361,6 +1564,28 @@ export const IotHubLocationDescription: coreClient.CompositeMapper = { } }; +export const RootCertificateProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RootCertificateProperties", + modelProperties: { + enableRootCertificateV2: { + serializedName: "enableRootCertificateV2", + type: { + name: "Boolean" + } + }, + lastUpdatedTimeUtc: { + serializedName: "lastUpdatedTimeUtc", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + export const IotHubSkuInfo: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3047,3 +3272,93 @@ export const IotHubDescription: coreClient.CompositeMapper = { } } }; + +export const IotHubResourceCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotHubResourceCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const IotHubResourceUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotHubResourceUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const IotHubResourceDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotHubResourceDeleteHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const IotHubManualFailoverHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "IotHubManualFailoverHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnectionsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionsUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnectionsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionsDeleteHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/iothub/arm-iothub/src/models/parameters.ts b/sdk/iothub/arm-iothub/src/models/parameters.ts index cfd3f334feae..b16b78710818 100644 --- a/sdk/iothub/arm-iothub/src/models/parameters.ts +++ b/sdk/iothub/arm-iothub/src/models/parameters.ts @@ -53,7 +53,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-07-02", + defaultValue: "2022-11-01-preview", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts b/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts index 183274c733ff..c27e8ebd8361 100644 --- a/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts +++ b/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts @@ -650,8 +650,7 @@ export class IotHubResourceImpl implements 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. 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. + * body to update the IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param iotHubDescription The IoT hub metadata and security metadata. @@ -723,8 +722,7 @@ export class IotHubResourceImpl implements 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. 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. + * body to update the IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param iotHubDescription The IoT hub metadata and security metadata. @@ -1507,16 +1505,20 @@ const updateOperationSpec: coreClient.OperationSpec = { httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.IotHubDescription + bodyMapper: Mappers.IotHubDescription, + headersMapper: Mappers.IotHubResourceUpdateHeaders }, 201: { - bodyMapper: Mappers.IotHubDescription + bodyMapper: Mappers.IotHubDescription, + headersMapper: Mappers.IotHubResourceUpdateHeaders }, 202: { - bodyMapper: Mappers.IotHubDescription + bodyMapper: Mappers.IotHubDescription, + headersMapper: Mappers.IotHubResourceUpdateHeaders }, 204: { - bodyMapper: Mappers.IotHubDescription + bodyMapper: Mappers.IotHubDescription, + headersMapper: Mappers.IotHubResourceUpdateHeaders } }, requestBody: Parameters.iotHubTags, diff --git a/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHubResource.ts b/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHubResource.ts index f07c95da16b2..5fb2acabb49f 100644 --- a/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHubResource.ts +++ b/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHubResource.ts @@ -166,8 +166,7 @@ export interface 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. 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. + * body to update the IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param iotHubDescription The IoT hub metadata and security metadata. @@ -187,8 +186,7 @@ export interface 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. 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. + * body to update the IoT hub. * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. * @param iotHubDescription The IoT hub metadata and security metadata. diff --git a/sdk/iothub/arm-iothub/test/sampleTest.ts b/sdk/iothub/arm-iothub/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/iothub/arm-iothub/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/iothub/arm-iothub/tsconfig.json b/sdk/iothub/arm-iothub/tsconfig.json index 651a71da11eb..3e6ae96443f3 100644 --- a/sdk/iothub/arm-iothub/tsconfig.json +++ b/sdk/iothub/arm-iothub/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-iothub": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"