diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 54f1a1847991..801c0f467601 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4132,7 +4132,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.3.0-dev.20230811 + typescript: 5.3.0-dev.20230815 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8717,8 +8717,8 @@ packages: hasBin: true dev: false - /typescript/5.3.0-dev.20230811: - resolution: {integrity: sha512-C4bwx7ZpBwX7bKxrrNl+M1j8yNGmwQ5M58X0mT4VYI1+FHqRvb/uJ4F1uJsVJ+X7iy22iXSICR/Vxnpc1gNk7w==} + /typescript/5.3.0-dev.20230815: + resolution: {integrity: sha512-AB4arWte1oMsTpFUSnkhgLOzWRR6SLMtQ4WjDl+I0mDC3nh0UH5SEJtwjSt7lYIg/xylgXduCFEDoM1Vvv3uPg==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -12659,7 +12659,7 @@ packages: dev: false file:projects/arm-iothub.tgz: - resolution: {integrity: sha512-dqVp/cNWQcLDxLIOrQMaVaCzU1mmbba82eB95Oi6RcKtTdBT3h60IqDD8kWhpoQpgclpssbWIO+XhNUOWWrZ2Q==, tarball: file:projects/arm-iothub.tgz} + resolution: {integrity: sha512-ebXUh3NTS3XnhBot1LGjHqmVMIgLuJqC6CTOBpyd6gu1plGePRPKnCNRnrUF+BHxYrV5qNBbDfIvM8CCP+QsWQ==, tarball: file:projects/arm-iothub.tgz} name: '@rush-temp/arm-iothub' version: 0.0.0 dependencies: @@ -12679,10 +12679,13 @@ packages: rimraf: 3.0.2 rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3_dmbj5memikchm63lpeyt6ukdau + ts-node: 10.9.1_n7tz6hmpirns3flqdptizaxofa tslib: 2.6.1 typescript: 5.0.4 uglify-js: 3.17.4 transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' - supports-color dev: false diff --git a/sdk/iothub/arm-iothub/CHANGELOG.md b/sdk/iothub/arm-iothub/CHANGELOG.md index 293f55c5dd38..ef9f3f8994e4 100644 --- a/sdk/iothub/arm-iothub/CHANGELOG.md +++ b/sdk/iothub/arm-iothub/CHANGELOG.md @@ -1,64 +1,17 @@ # Release History - -## 6.3.0-beta.3 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 6.3.0-beta.2 (2023-04-06) + +## 6.3.0 (2023-08-16) **Features** - - 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 - - Added Type Alias IpVersion - - Interface IotHubProperties has a new optional parameter deviceStreams - - Interface IotHubProperties has a new optional parameter encryption - - Interface IotHubProperties has a new optional parameter ipVersion - - Interface IotHubProperties has a new optional parameter rootCertificate - - Interface RoutingEndpoints has a new optional parameter cosmosDBSqlCollections - - Add parameters of IotHubResourceUpdateHeaders to TypeAlias IotHubResourceUpdateResponse - - Added Enum KnownIpVersion - - Enum KnownRoutingSource has a new value DigitalTwinChangeEvents - - Enum KnownRoutingSource has a new value MqttBrokerMessages + - Interface RoutingEndpoints has a new optional parameter cosmosDBSqlContainers - Added function getContinuationToken -## 6.3.0-beta.1 (2022-12-06) -**Features** - - - Added Interface EncryptionPropertiesDescription - - 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 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 fa95cd7516b0..186f152837c5 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?view=azure-node-preview) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-iothub) | [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 1e882c7219fc..2471bf0d3ede 100644 --- a/sdk/iothub/arm-iothub/_meta.json +++ b/sdk/iothub/arm-iothub/_meta.json @@ -1,8 +1,8 @@ { - "commit": "8725e0700974d2c8cba436b5696728ebc5a80f1b", + "commit": "c268b7b1a60779900f77d8d5bcb141ff35c797fb", "readme": "specification/iothub/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\iothub\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.10 --generate-sample=true", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/iothub/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.6.2", - "use": "@autorest/typescript@6.0.0-rc.10" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.1", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/iothub/arm-iothub/package.json b/sdk/iothub/arm-iothub/package.json index ec25a06e7f49..0b314de41ad4 100644 --- a/sdk/iothub/arm-iothub/package.json +++ b/sdk/iothub/arm-iothub/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for IotHubClient.", - "version": "6.3.0-beta.3", + "version": "6.3.0", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.0", + "@azure/core-lro": "^2.5.4", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -48,6 +48,7 @@ "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^14.0.0", + "ts-node": "^10.0.0", "@azure/dev-tool": "^1.0.0" }, "repository": { @@ -111,13 +112,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/iothub/arm-iothub", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-iothub?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/iothub/arm-iothub" +} \ No newline at end of file diff --git a/sdk/iothub/arm-iothub/review/arm-iothub.api.md b/sdk/iothub/arm-iothub/review/arm-iothub.api.md index 29147d26aee1..cdaa161e0e6c 100644 --- a/sdk/iothub/arm-iothub/review/arm-iothub.api.md +++ b/sdk/iothub/arm-iothub/review/arm-iothub.api.md @@ -155,12 +155,6 @@ export type CreatedByType = string; // @public export type DefaultAction = string; -// @public -export interface EncryptionPropertiesDescription { - keySource?: string; - keyVaultProperties?: KeyVaultKeyProperties[]; -} - // @public export interface EndpointHealthData { endpointId?: string; @@ -389,20 +383,17 @@ export interface IotHubProperties { authorizationPolicies?: SharedAccessSignatureAuthorizationRule[]; cloudToDevice?: CloudToDeviceProperties; comments?: string; - deviceStreams?: IotHubPropertiesDeviceStreams; disableDeviceSAS?: boolean; disableLocalAuth?: boolean; disableModuleSAS?: boolean; enableDataResidency?: boolean; enableFileUploadNotifications?: boolean; - encryption?: EncryptionPropertiesDescription; eventHubEndpoints?: { [propertyName: string]: EventHubProperties; }; features?: Capabilities; readonly hostName?: string; ipFilterRules?: IpFilterRule[]; - ipVersion?: IpVersion; readonly locations?: IotHubLocationDescription[]; messagingEndpoints?: { [propertyName: string]: MessagingEndpointProperties; @@ -413,7 +404,6 @@ export interface IotHubProperties { readonly provisioningState?: string; publicNetworkAccess?: PublicNetworkAccess; restrictOutboundNetworkAccess?: boolean; - rootCertificate?: RootCertificateProperties; routing?: RoutingProperties; readonly state?: string; storageEndpoints?: { @@ -421,11 +411,6 @@ export interface IotHubProperties { }; } -// @public -export interface IotHubPropertiesDeviceStreams { - streamingEndpoints?: string[]; -} - // @public export interface IotHubQuotaMetricInfo { readonly currentValue?: number; @@ -486,11 +471,6 @@ export interface IotHubResourceCreateEventHubConsumerGroupOptionalParams extends // @public export type IotHubResourceCreateEventHubConsumerGroupResponse = EventHubConsumerGroupInfo; -// @public -export interface IotHubResourceCreateOrUpdateHeaders { - azureAsyncOperation?: string; -} - // @public export interface IotHubResourceCreateOrUpdateOptionalParams extends coreClient.OperationOptions { ifMatch?: string; @@ -508,6 +488,8 @@ export interface IotHubResourceDeleteEventHubConsumerGroupOptionalParams extends // @public export interface IotHubResourceDeleteHeaders { azureAsyncOperation?: string; + // (undocumented) + location?: string; } // @public @@ -694,11 +676,6 @@ 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; @@ -706,7 +683,7 @@ export interface IotHubResourceUpdateOptionalParams extends coreClient.Operation } // @public -export type IotHubResourceUpdateResponse = IotHubResourceUpdateHeaders & IotHubDescription; +export type IotHubResourceUpdateResponse = IotHubDescription; // @public export type IotHubScaleType = "Automatic" | "Manual" | "None"; @@ -747,9 +724,6 @@ export interface IpFilterRule { ipMask: string; } -// @public -export type IpVersion = string; - // @public export interface JobResponse { readonly endTimeUtc?: Date; @@ -774,12 +748,6 @@ 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", @@ -832,13 +800,6 @@ export enum KnownIotHubSku { S3 = "S3" } -// @public -export enum KnownIpVersion { - Ipv4 = "ipv4", - Ipv4Ipv6 = "ipv4ipv6", - Ipv6 = "ipv6" -} - // @public export enum KnownJobType { Backup = "backup", @@ -884,9 +845,7 @@ export enum KnownRoutingSource { DeviceJobLifecycleEvents = "DeviceJobLifecycleEvents", DeviceLifecycleEvents = "DeviceLifecycleEvents", DeviceMessages = "DeviceMessages", - DigitalTwinChangeEvents = "DigitalTwinChangeEvents", Invalid = "Invalid", - MqttBrokerMessages = "MqttBrokerMessages", TwinChangeEvents = "TwinChangeEvents" } @@ -1020,6 +979,8 @@ export interface PrivateEndpointConnections { // @public export interface PrivateEndpointConnectionsDeleteHeaders { azureAsyncOperation?: string; + // (undocumented) + location?: string; } // @public @@ -1045,11 +1006,6 @@ 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; @@ -1130,12 +1086,6 @@ export interface ResourceProviderCommonGetSubscriptionQuotaOptionalParams extend // @public export type ResourceProviderCommonGetSubscriptionQuotaResponse = UserSubscriptionQuotaListResult; -// @public -export interface RootCertificateProperties { - enableRootCertificateV2?: boolean; - readonly lastUpdatedTimeUtc?: Date; -} - // @public export interface RouteCompilationError { location?: RouteErrorRange; @@ -1170,10 +1120,10 @@ export interface RouteProperties { // @public export interface RoutingCosmosDBSqlApiProperties { authenticationType?: AuthenticationType; - collectionName: string; + containerName: string; databaseName: string; endpointUri: string; - id?: string; + readonly id?: string; identity?: ManagedIdentity; name: string; partitionKeyName?: string; @@ -1186,7 +1136,7 @@ export interface RoutingCosmosDBSqlApiProperties { // @public export interface RoutingEndpoints { - cosmosDBSqlCollections?: RoutingCosmosDBSqlApiProperties[]; + cosmosDBSqlContainers?: 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 aaee6c74ba97..5b59c5b72b9e 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.3.0-beta.3`; + const packageDetails = `azsdk-js-arm-iothub/6.3.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -119,7 +119,7 @@ export class IotHubClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-11-15-preview"; + this.apiVersion = options.apiVersion || "2023-06-30"; 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 5c59657a2c22..b70d18bf2f9d 100644 --- a/sdk/iothub/arm-iothub/src/models/index.ts +++ b/sdk/iothub/arm-iothub/src/models/index.ts @@ -134,12 +134,8 @@ 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. @@ -147,10 +143,6 @@ 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; - /** This property specifies the IP Version the hub is currently utilizing. */ - ipVersion?: IpVersion; } /** The properties of an IoT hub shared access policy. */ @@ -272,7 +264,7 @@ export interface RoutingProperties { endpoints?: RoutingEndpoints; /** The list of user-provided routing rules that the IoT hub uses to route messages to built-in and custom endpoints. A maximum of 100 routing rules are allowed for paid hubs and a maximum of 5 routing rules are allowed for free hubs. */ routes?: RouteProperties[]; - /** The properties of the route that is used as a fall-back route when none of the conditions specified in the 'routes' section are met. This is an optional parameter. When this property is not set, the messages which do not meet any of the conditions specified in the 'routes' section get routed to the built-in eventhub endpoint. */ + /** The properties of the route that is used as a fall-back route when none of the conditions specified in the 'routes' section are met. This is an optional parameter. When this property is not present in the template, the fallback route is disabled by default. */ 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/telemetryoneventgrid */ enrichments?: EnrichmentProperties[]; @@ -288,8 +280,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 list of Cosmos DB container endpoints that IoT hub routes messages to, based on the routing rules. */ + cosmosDBSqlContainers?: RoutingCosmosDBSqlApiProperties[]; } /** The properties related to service bus queue endpoint types. */ @@ -394,21 +386,24 @@ export interface RoutingStorageContainerProperties { encoding?: RoutingStorageContainerPropertiesEncoding; } -/** The properties related to a cosmos DB sql collection endpoint. */ +/** The properties related to a cosmos DB sql container 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; + /** + * Id of the cosmos DB sql container endpoint + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly 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 */ + /** Method used to authenticate against the cosmos DB sql container endpoint */ authenticationType?: AuthenticationType; - /** Managed identity properties of routing cosmos DB collection endpoint. */ + /** Managed identity properties of routing cosmos DB container endpoint. */ identity?: ManagedIdentity; /** The primary key of the cosmos DB account. */ primaryKey?: string; @@ -416,11 +411,11 @@ export interface RoutingCosmosDBSqlApiProperties { 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. */ + /** The name of the cosmos DB sql container in the cosmos DB database. */ + containerName: string; + /** The name of the partition key associated with this cosmos DB sql container 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. */ + /** The template for generating a synthetic partition key value for use with this cosmos DB sql container. 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; } @@ -506,28 +501,6 @@ 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 */ @@ -536,17 +509,6 @@ 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. */ @@ -571,7 +533,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 }; @@ -1275,22 +1237,11 @@ 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; + location?: string; } /** Defines headers for IotHub_manualFailover operation. */ @@ -1300,16 +1251,11 @@ export interface IotHubManualFailoverHeaders { 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; + location?: string; } /** Known values of {@link PublicNetworkAccess} that the service accepts. */ @@ -1438,12 +1384,8 @@ export enum KnownRoutingSource { DeviceLifecycleEvents = "DeviceLifecycleEvents", /** DeviceJobLifecycleEvents */ DeviceJobLifecycleEvents = "DeviceJobLifecycleEvents", - /** DigitalTwinChangeEvents */ - DigitalTwinChangeEvents = "DigitalTwinChangeEvents", /** DeviceConnectionStateEvents */ - DeviceConnectionStateEvents = "DeviceConnectionStateEvents", - /** MqttBrokerMessages */ - MqttBrokerMessages = "MqttBrokerMessages" + DeviceConnectionStateEvents = "DeviceConnectionStateEvents" } /** @@ -1456,9 +1398,7 @@ export enum KnownRoutingSource { * **TwinChangeEvents** \ * **DeviceLifecycleEvents** \ * **DeviceJobLifecycleEvents** \ - * **DigitalTwinChangeEvents** \ - * **DeviceConnectionStateEvents** \ - * **MqttBrokerMessages** + * **DeviceConnectionStateEvents** */ export type RoutingSource = string; @@ -1498,27 +1438,6 @@ export enum KnownIotHubReplicaRoleType { */ export type IotHubReplicaRoleType = string; -/** Known values of {@link IpVersion} that the service accepts. */ -export enum KnownIpVersion { - /** Ipv4 */ - Ipv4 = "ipv4", - /** Ipv6 */ - Ipv6 = "ipv6", - /** Ipv4Ipv6 */ - Ipv4Ipv6 = "ipv4ipv6" -} - -/** - * Defines values for IpVersion. \ - * {@link KnownIpVersion} can be used interchangeably with IpVersion, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **ipv4** \ - * **ipv6** \ - * **ipv4ipv6** - */ -export type IpVersion = string; - /** Known values of {@link IotHubSku} that the service accepts. */ export enum KnownIotHubSku { /** F1 */ @@ -1768,8 +1687,7 @@ export interface IotHubResourceUpdateOptionalParams } /** Contains response data for the update operation. */ -export type IotHubResourceUpdateResponse = IotHubResourceUpdateHeaders & - IotHubDescription; +export type IotHubResourceUpdateResponse = 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 fc4b3e46909f..53869b02aa86 100644 --- a/sdk/iothub/arm-iothub/src/models/mappers.ts +++ b/sdk/iothub/arm-iothub/src/models/mappers.ts @@ -306,26 +306,12 @@ 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, @@ -344,19 +330,6 @@ export const IotHubProperties: coreClient.CompositeMapper = { type: { name: "Boolean" } - }, - rootCertificate: { - serializedName: "rootCertificate", - type: { - name: "Composite", - className: "RootCertificateProperties" - } - }, - ipVersion: { - serializedName: "ipVersion", - type: { - name: "String" - } } } } @@ -763,8 +736,8 @@ export const RoutingEndpoints: coreClient.CompositeMapper = { } } }, - cosmosDBSqlCollections: { - serializedName: "cosmosDBSqlCollections", + cosmosDBSqlContainers: { + serializedName: "cosmosDBSqlContainers", type: { name: "Sequence", element: { @@ -1116,6 +1089,7 @@ export const RoutingCosmosDBSqlApiProperties: coreClient.CompositeMapper = { }, id: { serializedName: "id", + readOnly: true, type: { name: "String" } @@ -1171,8 +1145,8 @@ export const RoutingCosmosDBSqlApiProperties: coreClient.CompositeMapper = { name: "String" } }, - collectionName: { - serializedName: "collectionName", + containerName: { + serializedName: "containerName", required: true, type: { name: "String" @@ -1474,75 +1448,6 @@ 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", @@ -1564,28 +1469,6 @@ 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", @@ -3273,43 +3156,19 @@ 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 = { +export const IotHubResourceDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "IotHubResourceUpdateHeaders", + className: "IotHubResourceDeleteHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", type: { name: "String" } - } - } - } -}; - -export const IotHubResourceDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "IotHubResourceDeleteHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", + }, + location: { + serializedName: "location", type: { name: "String" } @@ -3339,28 +3198,19 @@ export const IotHubManualFailoverHeaders: coreClient.CompositeMapper = { } }; -export const PrivateEndpointConnectionsUpdateHeaders: coreClient.CompositeMapper = { +export const PrivateEndpointConnectionsDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpointConnectionsUpdateHeaders", + className: "PrivateEndpointConnectionsDeleteHeaders", modelProperties: { azureAsyncOperation: { serializedName: "azure-asyncoperation", type: { name: "String" } - } - } - } -}; - -export const PrivateEndpointConnectionsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionsDeleteHeaders", - modelProperties: { - azureAsyncOperation: { - serializedName: "azure-asyncoperation", + }, + location: { + serializedName: "location", type: { name: "String" } diff --git a/sdk/iothub/arm-iothub/src/models/parameters.ts b/sdk/iothub/arm-iothub/src/models/parameters.ts index efd0f67a1123..f00c42620434 100644 --- a/sdk/iothub/arm-iothub/src/models/parameters.ts +++ b/sdk/iothub/arm-iothub/src/models/parameters.ts @@ -53,7 +53,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-11-15-preview", + defaultValue: "2023-06-30", 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 9ddb0c203304..cbff64cef64f 100644 --- a/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts +++ b/sdk/iothub/arm-iothub/src/operations/iotHubResource.ts @@ -761,7 +761,8 @@ 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. + * 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. * @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. @@ -836,7 +837,8 @@ 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. + * 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. * @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. @@ -1625,20 +1627,16 @@ const updateOperationSpec: coreClient.OperationSpec = { httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.IotHubDescription, - headersMapper: Mappers.IotHubResourceUpdateHeaders + bodyMapper: Mappers.IotHubDescription }, 201: { - bodyMapper: Mappers.IotHubDescription, - headersMapper: Mappers.IotHubResourceUpdateHeaders + bodyMapper: Mappers.IotHubDescription }, 202: { - bodyMapper: Mappers.IotHubDescription, - headersMapper: Mappers.IotHubResourceUpdateHeaders + bodyMapper: Mappers.IotHubDescription }, 204: { - bodyMapper: Mappers.IotHubDescription, - headersMapper: Mappers.IotHubResourceUpdateHeaders + bodyMapper: Mappers.IotHubDescription } }, requestBody: Parameters.iotHubTags, diff --git a/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHubResource.ts b/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHubResource.ts index 095ec574fe08..56ad5ae6abed 100644 --- a/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHubResource.ts +++ b/sdk/iothub/arm-iothub/src/operationsInterfaces/iotHubResource.ts @@ -166,7 +166,8 @@ 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. + * 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. * @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. @@ -186,7 +187,8 @@ 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. + * 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. * @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"