diff --git a/sdk/iothub/arm-iothub/CHANGELOG.md b/sdk/iothub/arm-iothub/CHANGELOG.md index 3cc6fb29339b..323f70827d39 100644 --- a/sdk/iothub/arm-iothub/CHANGELOG.md +++ b/sdk/iothub/arm-iothub/CHANGELOG.md @@ -1,15 +1,28 @@ # Release History + +## 6.2.0-beta.1 (2022-08-05) + +**Features** -## 6.1.3 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added Interface EncryptionPropertiesDescription + - Added Interface IotHubDescription + - 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.1.2 (2022-06-14) **Features** diff --git a/sdk/iothub/arm-iothub/README.md b/sdk/iothub/arm-iothub/README.md index eea70e3a6aac..f5beb9fc6fcd 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 49e20fc3b678..241e1fd2b202 100644 --- a/sdk/iothub/arm-iothub/_meta.json +++ b/sdk/iothub/arm-iothub/_meta.json @@ -1,8 +1,8 @@ { - "commit": "c6b48ac6b32da8f18d9228a1f565880b02c5191d", + "commit": "234e79c235f2bfdf9d97f0a8f8ed44b3ac8dda50", "readme": "specification/iothub/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --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-beta.20 --generate-sample=true", + "autorest_command": "", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", - "use": "@autorest/typescript@6.0.0-beta.20" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.1", + "use": "@autorest/typescript@6.0.0-rc.1" } \ No newline at end of file diff --git a/sdk/iothub/arm-iothub/package.json b/sdk/iothub/arm-iothub/package.json index cec500677024..62ca02282aa8 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.1.3", + "version": "6.2.0-beta.1", "engines": { "node": ">=12.0.0" }, @@ -98,8 +98,7 @@ "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "integration-test:browser": "echo skipped", - "docs": "echo skipped" + "integration-test:browser": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -110,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 c5b7abffb6c8..9ade1a340c7a 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; @@ -331,13 +337,13 @@ export interface IotHubClientOptionalParams extends coreClient.ServiceClientOpti } // @public -export type IotHubDescription = Resource & { +export interface IotHubDescription extends Resource { etag?: string; + identity?: ArmIdentity; properties?: IotHubProperties; sku: IotHubSkuInfo; - identity?: ArmIdentity; readonly systemData?: SystemData; -}; +} // @public export interface IotHubDescriptionListResult { @@ -373,11 +379,13 @@ 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; }; @@ -394,6 +402,7 @@ export interface IotHubProperties { readonly provisioningState?: string; publicNetworkAccess?: PublicNetworkAccess; restrictOutboundNetworkAccess?: boolean; + rootCertificate?: RootCertificateProperties; routing?: RoutingProperties; readonly state?: string; storageEndpoints?: { @@ -401,6 +410,11 @@ export interface IotHubProperties { }; } +// @public +export interface IotHubPropertiesDeviceStreams { + streamingEndpoints?: string[]; +} + // @public export interface IotHubQuotaMetricInfo { readonly currentValue?: number; @@ -461,6 +475,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 +494,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 +683,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 +695,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,173 +760,126 @@ 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 { - // (undocumented) IdentityBased = "identityBased", - // (undocumented) KeyBased = "keyBased" } // @public export enum KnownCapabilities { - // (undocumented) DeviceManagement = "DeviceManagement", - // (undocumented) None = "None" } // @public export enum KnownCreatedByType { - // (undocumented) Application = "Application", - // (undocumented) Key = "Key", - // (undocumented) ManagedIdentity = "ManagedIdentity", - // (undocumented) User = "User" } // @public export enum KnownDefaultAction { - // (undocumented) Allow = "Allow", - // (undocumented) Deny = "Deny" } // @public export enum KnownEndpointHealthStatus { - // (undocumented) Dead = "dead", - // (undocumented) Degraded = "degraded", - // (undocumented) Healthy = "healthy", - // (undocumented) Unhealthy = "unhealthy", - // (undocumented) Unknown = "unknown" } // @public export enum KnownIotHubReplicaRoleType { - // (undocumented) Primary = "primary", - // (undocumented) Secondary = "secondary" } // @public export enum KnownIotHubSku { - // (undocumented) B1 = "B1", - // (undocumented) B2 = "B2", - // (undocumented) B3 = "B3", - // (undocumented) F1 = "F1", - // (undocumented) S1 = "S1", - // (undocumented) S2 = "S2", - // (undocumented) S3 = "S3" } // @public export enum KnownJobType { - // (undocumented) Backup = "backup", - // (undocumented) Export = "export", - // (undocumented) FactoryResetDevice = "factoryResetDevice", - // (undocumented) FirmwareUpdate = "firmwareUpdate", - // (undocumented) Import = "import", - // (undocumented) ReadDeviceProperties = "readDeviceProperties", - // (undocumented) RebootDevice = "rebootDevice", - // (undocumented) Unknown = "unknown", - // (undocumented) UpdateDeviceConfiguration = "updateDeviceConfiguration", - // (undocumented) WriteDeviceProperties = "writeDeviceProperties" } // @public export enum KnownNetworkRuleIPAction { - // (undocumented) Allow = "Allow" } // @public export enum KnownPrivateLinkServiceConnectionStatus { - // (undocumented) Approved = "Approved", - // (undocumented) Disconnected = "Disconnected", - // (undocumented) Pending = "Pending", - // (undocumented) Rejected = "Rejected" } // @public export enum KnownPublicNetworkAccess { - // (undocumented) Disabled = "Disabled", - // (undocumented) Enabled = "Enabled" } // @public export enum KnownRouteErrorSeverity { - // (undocumented) Error = "error", - // (undocumented) Warning = "warning" } // @public export enum KnownRoutingSource { - // (undocumented) DeviceConnectionStateEvents = "DeviceConnectionStateEvents", - // (undocumented) DeviceJobLifecycleEvents = "DeviceJobLifecycleEvents", - // (undocumented) DeviceLifecycleEvents = "DeviceLifecycleEvents", - // (undocumented) DeviceMessages = "DeviceMessages", - // (undocumented) + DigitalTwinChangeEvents = "DigitalTwinChangeEvents", Invalid = "Invalid", - // (undocumented) + MqttBrokerMessages = "MqttBrokerMessages", TwinChangeEvents = "TwinChangeEvents" } // @public export enum KnownRoutingStorageContainerPropertiesEncoding { - // (undocumented) Avro = "Avro", - // (undocumented) AvroDeflate = "AvroDeflate", - // (undocumented) Json = "JSON" } // @public export enum KnownTestResultStatus { - // (undocumented) False = "false", - // (undocumented) True = "true", - // (undocumented) Undefined = "undefined" } @@ -1014,6 +996,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; @@ -1037,6 +1024,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; @@ -1117,6 +1109,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; @@ -1148,8 +1146,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 dca56e6be03d..6cb4b7110ccc 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.1.3`; + const packageDetails = `azsdk-js-arm-iothub/6.2.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -113,7 +113,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-04-30-preview"; this.operations = new OperationsImpl(this); this.iotHubResource = new IotHubResourceImpl(this); this.resourceProviderCommon = new ResourceProviderCommonImpl(this); @@ -141,7 +141,7 @@ export class IotHubClient extends coreClient.ServiceClient { if (param.length > 1) { const newParams = param[1].split("&").map((item) => { if (item.indexOf("api-version") > -1) { - return item.replace(/(?<==).*$/, apiVersion); + return "api-version=" + apiVersion; } else { return item; } diff --git a/sdk/iothub/arm-iothub/src/models/index.ts b/sdk/iothub/arm-iothub/src/models/index.ts index de2928bce2aa..81cdc47282ab 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,8 @@ 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; } /** The properties of an IoT hub shared access policy. */ @@ -280,6 +286,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 +392,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 +504,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 +534,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 +569,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 }; @@ -1186,7 +1257,7 @@ export interface CertificateBodyDescription { } /** The description of the IoT hub. */ -export type IotHubDescription = Resource & { +export interface IotHubDescription extends Resource { /** The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention. */ etag?: string; /** IotHub properties */ @@ -1200,11 +1271,43 @@ export type IotHubDescription = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ 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 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 */ Enabled = "Enabled", + /** Disabled */ Disabled = "Disabled" } @@ -1220,7 +1323,9 @@ export type PublicNetworkAccess = string; /** Known values of {@link DefaultAction} that the service accepts. */ export enum KnownDefaultAction { + /** Deny */ Deny = "Deny", + /** Allow */ Allow = "Allow" } @@ -1236,6 +1341,7 @@ export type DefaultAction = string; /** Known values of {@link NetworkRuleIPAction} that the service accepts. */ export enum KnownNetworkRuleIPAction { + /** Allow */ Allow = "Allow" } @@ -1250,9 +1356,13 @@ export type NetworkRuleIPAction = string; /** Known values of {@link PrivateLinkServiceConnectionStatus} that the service accepts. */ export enum KnownPrivateLinkServiceConnectionStatus { + /** Pending */ Pending = "Pending", + /** Approved */ Approved = "Approved", + /** Rejected */ Rejected = "Rejected", + /** Disconnected */ Disconnected = "Disconnected" } @@ -1270,7 +1380,9 @@ export type PrivateLinkServiceConnectionStatus = string; /** Known values of {@link AuthenticationType} that the service accepts. */ export enum KnownAuthenticationType { + /** KeyBased */ KeyBased = "keyBased", + /** IdentityBased */ IdentityBased = "identityBased" } @@ -1286,8 +1398,11 @@ export type AuthenticationType = string; /** Known values of {@link RoutingStorageContainerPropertiesEncoding} that the service accepts. */ export enum KnownRoutingStorageContainerPropertiesEncoding { + /** Avro */ Avro = "Avro", + /** AvroDeflate */ AvroDeflate = "AvroDeflate", + /** Json */ Json = "JSON" } @@ -1304,12 +1419,22 @@ export type RoutingStorageContainerPropertiesEncoding = string; /** Known values of {@link RoutingSource} that the service accepts. */ export enum KnownRoutingSource { + /** Invalid */ Invalid = "Invalid", + /** DeviceMessages */ DeviceMessages = "DeviceMessages", + /** TwinChangeEvents */ TwinChangeEvents = "TwinChangeEvents", + /** DeviceLifecycleEvents */ DeviceLifecycleEvents = "DeviceLifecycleEvents", + /** DeviceJobLifecycleEvents */ DeviceJobLifecycleEvents = "DeviceJobLifecycleEvents", - DeviceConnectionStateEvents = "DeviceConnectionStateEvents" + /** DigitalTwinChangeEvents */ + DigitalTwinChangeEvents = "DigitalTwinChangeEvents", + /** DeviceConnectionStateEvents */ + DeviceConnectionStateEvents = "DeviceConnectionStateEvents", + /** MqttBrokerMessages */ + MqttBrokerMessages = "MqttBrokerMessages" } /** @@ -1322,13 +1447,17 @@ export enum KnownRoutingSource { * **TwinChangeEvents** \ * **DeviceLifecycleEvents** \ * **DeviceJobLifecycleEvents** \ - * **DeviceConnectionStateEvents** + * **DigitalTwinChangeEvents** \ + * **DeviceConnectionStateEvents** \ + * **MqttBrokerMessages** */ export type RoutingSource = string; /** Known values of {@link Capabilities} that the service accepts. */ export enum KnownCapabilities { + /** None */ None = "None", + /** DeviceManagement */ DeviceManagement = "DeviceManagement" } @@ -1344,7 +1473,9 @@ export type Capabilities = string; /** Known values of {@link IotHubReplicaRoleType} that the service accepts. */ export enum KnownIotHubReplicaRoleType { + /** Primary */ Primary = "primary", + /** Secondary */ Secondary = "secondary" } @@ -1360,12 +1491,19 @@ export type IotHubReplicaRoleType = string; /** Known values of {@link IotHubSku} that the service accepts. */ export enum KnownIotHubSku { + /** F1 */ F1 = "F1", + /** S1 */ S1 = "S1", + /** S2 */ S2 = "S2", + /** S3 */ S3 = "S3", + /** B1 */ B1 = "B1", + /** B2 */ B2 = "B2", + /** B3 */ B3 = "B3" } @@ -1386,9 +1524,13 @@ export type IotHubSku = string; /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { + /** User */ User = "User", + /** Application */ Application = "Application", + /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", + /** Key */ Key = "Key" } @@ -1406,15 +1548,25 @@ export type CreatedByType = string; /** Known values of {@link JobType} that the service accepts. */ export enum KnownJobType { + /** Unknown */ Unknown = "unknown", + /** Export */ Export = "export", + /** Import */ Import = "import", + /** Backup */ Backup = "backup", + /** ReadDeviceProperties */ ReadDeviceProperties = "readDeviceProperties", + /** WriteDeviceProperties */ WriteDeviceProperties = "writeDeviceProperties", + /** UpdateDeviceConfiguration */ UpdateDeviceConfiguration = "updateDeviceConfiguration", + /** RebootDevice */ RebootDevice = "rebootDevice", + /** FactoryResetDevice */ FactoryResetDevice = "factoryResetDevice", + /** FirmwareUpdate */ FirmwareUpdate = "firmwareUpdate" } @@ -1438,10 +1590,15 @@ export type JobType = string; /** Known values of {@link EndpointHealthStatus} that the service accepts. */ export enum KnownEndpointHealthStatus { + /** Unknown */ Unknown = "unknown", + /** Healthy */ Healthy = "healthy", + /** Degraded */ Degraded = "degraded", + /** Unhealthy */ Unhealthy = "unhealthy", + /** Dead */ Dead = "dead" } @@ -1460,8 +1617,11 @@ export type EndpointHealthStatus = string; /** Known values of {@link TestResultStatus} that the service accepts. */ export enum KnownTestResultStatus { + /** Undefined */ Undefined = "undefined", + /** False */ False = "false", + /** True */ True = "true" } @@ -1478,7 +1638,9 @@ export type TestResultStatus = string; /** Known values of {@link RouteErrorSeverity} that the service accepts. */ export enum KnownRouteErrorSeverity { + /** Error */ Error = "error", + /** Warning */ Warning = "warning" } @@ -1576,7 +1738,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..8ccd6435ec82 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,13 @@ export const IotHubProperties: coreClient.CompositeMapper = { type: { name: "Boolean" } + }, + rootCertificate: { + serializedName: "rootCertificate", + type: { + name: "Composite", + className: "RootCertificateProperties" + } } } } @@ -735,6 +756,18 @@ export const RoutingEndpoints: coreClient.CompositeMapper = { } } } + }, + cosmosDBSqlCollections: { + serializedName: "cosmosDBSqlCollections", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RoutingCosmosDBSqlApiProperties" + } + } + } } } } @@ -1060,6 +1093,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 +1468,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 +1558,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 +3266,78 @@ 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 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..ad379429b5b7 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-04-30-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"