diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/CHANGELOG.md b/sdk/deviceregistry/azure-mgmt-deviceregistry/CHANGELOG.md index f4e56bda4d1e..442f2e9eedc1 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/CHANGELOG.md +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/CHANGELOG.md @@ -1,5 +1,93 @@ # Release History +## 2.0.0 (2026-09-10) + +### Features Added + + - Client `DeviceRegistryMgmtClient` added operation group `async_operation_status` + - Client `DeviceRegistryMgmtClient` added operation group `certificate_authorities` + - Client `DeviceRegistryMgmtClient` added operation group `certificate_policies` + - Client `DeviceRegistryMgmtClient` added operation group `registry_devices` + - Model `DeviceStatusEndpoint` added property `health_state` + - Enum `Format` added member `JSON_LD1_1` + - Model `MessagingEndpoint` added property `device_address` + - Model `MessagingEndpoint` added property `inbound_caller_identity` + - Model `MessagingEndpoint` added property `linking_error` + - Model `MessagingEndpoint` added property `linking_state` + - Model `MessagingEndpoint` added property `provisioning` + - Model `NamespaceAssetStatus` added property `health_state` + - Model `NamespaceProperties` added property `management` + - Model `NamespaceProperties` added property `outbound_identity` + - Model `NamespaceProperties` added property `provisioning` + - Model `NamespaceUpdateProperties` added property `management` + - Model `NamespaceUpdateProperties` added property `outbound_identity` + - Model `NamespaceUpdateProperties` added property `provisioning` + - Model `SchemaRegistryProperties` added property `outbound_identity` + - Model `SchemaRegistryUpdateProperties` added property `outbound_identity` + - Enum `SchemaType` added member `THING_DESCRIPTION` + - Enum `SchemaType` added member `THING_MODEL` + - Added model `ActivateCertificateAuthorityRequest` + - Added model `CertificateAuthority` + - Added model `CertificateAuthorityIssuer` + - Added enum `CertificateAuthorityIssuerType` + - Added enum `CertificateAuthorityKeyType` + - Added model `CertificateAuthorityProperties` + - Added enum `CertificateAuthorityStatus` + - Added enum `CertificateAuthorityType` + - Added model `CertificateAuthorityUpdate` + - Added model `CertificatePolicy` + - Added model `CertificatePolicyConfiguration` + - Added model `CertificatePolicyProperties` + - Added model `CertificatePolicyUpdate` + - Added model `CertificatePolicyUpdateProperties` + - Added model `ExternalCertificateAuthorityIssuer` + - Added model `HealthState` + - Added enum `HealthStatus` + - Added model `InboundCallerIdentity` + - Added enum `InboundCallerIdentityType` + - Added model `IntermediateCertificateAuthorityProperties` + - Added model `ManagedServiceIdentity` + - Added enum `ManagedServiceIdentityType` + - Added model `Management` + - Added model `ManagementEndpoint` + - Added enum `MessagingEndpointAvailability` + - Added model `MessagingEndpointProvisioning` + - Added model `MicrosoftCertificateAuthorityIssuer` + - Added model `NamespaceAssetExecuteActionRequest` + - Added model `NamespaceLinkingError` + - Added enum `NamespaceLinkingStateValue` + - Added model `NamespaceProvisioning` + - Added model `OptionalPropertiesCertificatePolicyConfiguration` + - Added model `OutboundIdentity` + - Added enum `OutboundIdentityType` + - Added model `ProvisioningEndpoint` + - Added enum `ProvisioningEndpointType` + - Added model `RegistryDevice` + - Added enum `RegistryDeviceEnablementState` + - Added model `RegistryDeviceProperties` + - Added model `RegistryDeviceUpdate` + - Added model `RegistryDeviceUpdateProperties` + - Added model `RootCertificateAuthorityProperties` + - Added model `UserAssignedIdentity` + - Model `NamespaceAssetsOperations` added method `begin_execute_action` + - Model `NamespaceAssetsOperations` added method `list_by_namespace` + - Model `NamespaceDevicesOperations` added method `list_by_namespace` + - Model `NamespaceDiscoveredAssetsOperations` added method `list_by_namespace` + - Model `NamespaceDiscoveredDevicesOperations` added method `list_by_namespace` + - Added operation group `AsyncOperationStatusOperations` + - Added operation group `CertificateAuthoritiesOperations` + - Added operation group `CertificatePoliciesOperations` + - Added operation group `RegistryDevicesOperations` + +### Breaking Changes + + - Deleted or renamed model `SystemAssignedServiceIdentity` + - Deleted or renamed model `SystemAssignedServiceIdentityType` + - Deleted or renamed method `NamespaceAssetsOperations.list_by_resource_group` + - Deleted or renamed method `NamespaceDevicesOperations.list_by_resource_group` + - Deleted or renamed method `NamespaceDiscoveredAssetsOperations.list_by_resource_group` + - Deleted or renamed method `NamespaceDiscoveredDevicesOperations.list_by_resource_group` + ## 1.2.0b1 (2026-03-27) ### Features Added diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/README.md b/sdk/deviceregistry/azure-mgmt-deviceregistry/README.md index 87b5accf476a..569875b22e1b 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/README.md +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Deviceregistry Management Client Library. -This package has been tested with Python 3.9+. +This package has been tested with Python 3.10+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.9+ is required to use this package. +- Python 3.10+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package @@ -24,7 +24,7 @@ pip install azure-identity ### Authentication -By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables. +By default, [Microsoft Entra](https://learn.microsoft.com/entra/fundamentals/what-is-entra) token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/_metadata.json b/sdk/deviceregistry/azure-mgmt-deviceregistry/_metadata.json index efaf94742c2b..53fe4f4fc437 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/_metadata.json +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/_metadata.json @@ -1,10 +1,11 @@ { - "apiVersion": "2026-03-01-preview", + "apiVersion": "2026-11-01", "apiVersions": { - "Microsoft.DeviceRegistry": "2026-03-01-preview" + "Microsoft.DeviceRegistry": "2026-11-01" }, - "commit": "5038b362fae5e6f54bb6fe7e0a0d18370a946acf", + "commit": "73972b766e47d15a5342c90913a738bb7809ccee", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "typespec_src": "specification/deviceregistry/DeviceRegistry.Management", - "emitterVersion": "0.61.2" + "typespec_src": "specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/DeviceRegistry", + "emitterVersion": "0.63.6", + "httpClientPythonVersion": "^0.37.1" } \ No newline at end of file diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/api.md b/sdk/deviceregistry/azure-mgmt-deviceregistry/api.md new file mode 100644 index 000000000000..d354148a6cd5 --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/api.md @@ -0,0 +1,7752 @@ +```py +namespace azure.mgmt.deviceregistry + + class azure.mgmt.deviceregistry.DeviceRegistryMgmtClient: implements ContextManager + asset_endpoint_profiles: AssetEndpointProfilesOperations + assets: AssetsOperations + async_operation_status: AsyncOperationStatusOperations + billing_containers: BillingContainersOperations + certificate_authorities: CertificateAuthoritiesOperations + certificate_policies: CertificatePoliciesOperations + namespace_assets: NamespaceAssetsOperations + namespace_devices: NamespaceDevicesOperations + namespace_discovered_assets: NamespaceDiscoveredAssetsOperations + namespace_discovered_devices: NamespaceDiscoveredDevicesOperations + namespaces: NamespacesOperations + operation_status: OperationStatusOperations + operations: Operations + registry_devices: RegistryDevicesOperations + schema_registries: SchemaRegistriesOperations + schema_versions: SchemaVersionsOperations + schemas: SchemasOperations + + def __init__( + self, + credential: TokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> HttpResponse: ... + + +namespace azure.mgmt.deviceregistry.aio + + class azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient: implements AsyncContextManager + asset_endpoint_profiles: AssetEndpointProfilesOperations + assets: AssetsOperations + async_operation_status: AsyncOperationStatusOperations + billing_containers: BillingContainersOperations + certificate_authorities: CertificateAuthoritiesOperations + certificate_policies: CertificatePoliciesOperations + namespace_assets: NamespaceAssetsOperations + namespace_devices: NamespaceDevicesOperations + namespace_discovered_assets: NamespaceDiscoveredAssetsOperations + namespace_discovered_devices: NamespaceDiscoveredDevicesOperations + namespaces: NamespacesOperations + operation_status: OperationStatusOperations + operations: Operations + registry_devices: RegistryDevicesOperations + schema_registries: SchemaRegistriesOperations + schema_versions: SchemaVersionsOperations + schemas: SchemasOperations + + def __init__( + self, + credential: AsyncTokenCredential, + subscription_id: str, + base_url: Optional[str] = None, + *, + api_version: str = ..., + cloud_setting: Optional[AzureClouds] = ..., + polling_interval: Optional[int] = ..., + **kwargs: Any + ) -> None: ... + + async def close(self) -> None: ... + + def send_request( + self, + request: HttpRequest, + *, + stream: bool = False, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: ... + + +namespace azure.mgmt.deviceregistry.aio.operations + + class azure.mgmt.deviceregistry.aio.operations.AssetEndpointProfilesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + resource: AssetEndpointProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AssetEndpointProfile]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + resource: AssetEndpointProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AssetEndpointProfile]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AssetEndpointProfile]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + properties: AssetEndpointProfileUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AssetEndpointProfile]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + properties: AssetEndpointProfileUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AssetEndpointProfile]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[AssetEndpointProfile]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + **kwargs: Any + ) -> AssetEndpointProfile: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[AssetEndpointProfile]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[AssetEndpointProfile]: ... + + + class azure.mgmt.deviceregistry.aio.operations.AssetsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + asset_name: str, + resource: Asset, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Asset]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + asset_name: str, + resource: Asset, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Asset]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + asset_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Asset]: ... + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + asset_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + asset_name: str, + properties: AssetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Asset]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + asset_name: str, + properties: AssetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Asset]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + asset_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Asset]: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + asset_name: str, + **kwargs: Any + ) -> Asset: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Asset]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[Asset]: ... + + + class azure.mgmt.deviceregistry.aio.operations.AsyncOperationStatusOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'location', 'operation_id', 'accept']}, api_versions_list=['2026-11-01']) + async def get( + self, + location: str, + operation_id: str, + **kwargs: Any + ) -> OperationStatusResult: ... + + + class azure.mgmt.deviceregistry.aio.operations.BillingContainersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'billing_container_name', 'accept']}, api_versions_list=['2024-09-01-preview', '2024-11-01', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def get( + self, + billing_container_name: str, + **kwargs: Any + ) -> BillingContainer: ... + + @distributed_trace + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'accept']}, api_versions_list=['2024-09-01-preview', '2024-11-01', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[BillingContainer]: ... + + + class azure.mgmt.deviceregistry.aio.operations.CertificateAuthoritiesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_activate( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + body: ActivateCertificateAuthorityRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_activate( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + body: ActivateCertificateAuthorityRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_activate( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + resource: CertificateAuthority, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CertificateAuthority]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + resource: CertificateAuthority, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CertificateAuthority]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CertificateAuthority]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'certificate_authority_name']}, api_versions_list=['2026-11-01']) + async def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'certificate_authority_name']}, api_versions_list=['2026-11-01']) + async def begin_revoke_and_rotate( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: CertificateAuthorityUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CertificateAuthority]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: CertificateAuthorityUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CertificateAuthority]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CertificateAuthority]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'certificate_authority_name', 'accept']}, api_versions_list=['2026-11-01']) + async def get( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + **kwargs: Any + ) -> CertificateAuthority: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'accept']}, api_versions_list=['2026-11-01']) + def list_by_namespace( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> AsyncItemPaged[CertificateAuthority]: ... + + + class azure.mgmt.deviceregistry.aio.operations.CertificatePoliciesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: CertificatePolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CertificatePolicy]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: CertificatePolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CertificatePolicy]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CertificatePolicy]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'certificate_authority_name', 'certificate_policy_name']}, api_versions_list=['2026-11-01']) + async def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: CertificatePolicyUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CertificatePolicy]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: CertificatePolicyUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CertificatePolicy]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[CertificatePolicy]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'certificate_authority_name', 'certificate_policy_name', 'accept']}, api_versions_list=['2026-11-01']) + async def get( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + **kwargs: Any + ) -> CertificatePolicy: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'certificate_authority_name', 'accept']}, api_versions_list=['2026-11-01']) + def list_by_certificate_authority( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + **kwargs: Any + ) -> AsyncItemPaged[CertificatePolicy]: ... + + + class azure.mgmt.deviceregistry.aio.operations.NamespaceAssetsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + resource: NamespaceAsset, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceAsset]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + resource: NamespaceAsset, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceAsset]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceAsset]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'asset_name']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_execute_action( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + body: NamespaceAssetExecuteActionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_execute_action( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + body: NamespaceAssetExecuteActionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_execute_action( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + properties: NamespaceAssetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceAsset]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + properties: NamespaceAssetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceAsset]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceAsset]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'asset_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def get( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + **kwargs: Any + ) -> NamespaceAsset: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_namespace( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> AsyncItemPaged[NamespaceAsset]: ... + + + class azure.mgmt.deviceregistry.aio.operations.NamespaceDevicesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + resource: NamespaceDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDevice]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + resource: NamespaceDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDevice]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDevice]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'device_name']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + properties: NamespaceDeviceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDevice]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + properties: NamespaceDeviceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDevice]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDevice]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'device_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def get( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + **kwargs: Any + ) -> NamespaceDevice: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_namespace( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> AsyncItemPaged[NamespaceDevice]: ... + + + class azure.mgmt.deviceregistry.aio.operations.NamespaceDiscoveredAssetsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + resource: NamespaceDiscoveredAsset, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDiscoveredAsset]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + resource: NamespaceDiscoveredAsset, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDiscoveredAsset]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDiscoveredAsset]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'discovered_asset_name']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + properties: NamespaceDiscoveredAssetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDiscoveredAsset]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + properties: NamespaceDiscoveredAssetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDiscoveredAsset]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDiscoveredAsset]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'discovered_asset_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def get( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + **kwargs: Any + ) -> NamespaceDiscoveredAsset: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_namespace( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> AsyncItemPaged[NamespaceDiscoveredAsset]: ... + + + class azure.mgmt.deviceregistry.aio.operations.NamespaceDiscoveredDevicesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + resource: NamespaceDiscoveredDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDiscoveredDevice]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + resource: NamespaceDiscoveredDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDiscoveredDevice]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDiscoveredDevice]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'discovered_device_name']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + properties: NamespaceDiscoveredDeviceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDiscoveredDevice]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + properties: NamespaceDiscoveredDeviceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDiscoveredDevice]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[NamespaceDiscoveredDevice]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'discovered_device_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def get( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + **kwargs: Any + ) -> NamespaceDiscoveredDevice: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_namespace( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> AsyncItemPaged[NamespaceDiscoveredDevice]: ... + + + class azure.mgmt.deviceregistry.aio.operations.NamespacesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + resource: Namespace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Namespace]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + resource: Namespace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Namespace]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Namespace]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_migrate( + self, + resource_group_name: str, + namespace_name: str, + body: NamespaceMigrateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_migrate( + self, + resource_group_name: str, + namespace_name: str, + body: NamespaceMigrateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_migrate( + self, + resource_group_name: str, + namespace_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + properties: NamespaceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Namespace]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + properties: NamespaceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Namespace]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[Namespace]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def get( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> Namespace: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Namespace]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[Namespace]: ... + + + class azure.mgmt.deviceregistry.aio.operations.OperationStatusOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + location: str, + operation_id: str, + **kwargs: Any + ) -> OperationStatusResult: ... + + + class azure.mgmt.deviceregistry.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + + class azure.mgmt.deviceregistry.aio.operations.RegistryDevicesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: RegistryDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RegistryDevice]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: RegistryDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RegistryDevice]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RegistryDevice]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'registry_device_name']}, api_versions_list=['2026-11-01']) + async def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + properties: RegistryDeviceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RegistryDevice]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + properties: RegistryDeviceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RegistryDevice]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[RegistryDevice]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'registry_device_name', 'accept']}, api_versions_list=['2026-11-01']) + async def get( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + **kwargs: Any + ) -> RegistryDevice: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'accept']}, api_versions_list=['2026-11-01']) + def list_by_namespace( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> AsyncItemPaged[RegistryDevice]: ... + + + class azure.mgmt.deviceregistry.aio.operations.SchemaRegistriesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + resource: SchemaRegistry, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SchemaRegistry]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + resource: SchemaRegistry, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SchemaRegistry]: ... + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SchemaRegistry]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def begin_delete( + self, + resource_group_name: str, + schema_registry_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + schema_registry_name: str, + properties: SchemaRegistryUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SchemaRegistry]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + schema_registry_name: str, + properties: SchemaRegistryUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SchemaRegistry]: ... + + @overload + async def begin_update( + self, + resource_group_name: str, + schema_registry_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[SchemaRegistry]: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name', 'accept']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def get( + self, + resource_group_name: str, + schema_registry_name: str, + **kwargs: Any + ) -> SchemaRegistry: ... + + @distributed_trace + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'accept']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[SchemaRegistry]: ... + + @distributed_trace + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'accept']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[SchemaRegistry]: ... + + + class azure.mgmt.deviceregistry.aio.operations.SchemaVersionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-10-01', params_added_on={'2025-10-01': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name', 'schema_name', 'schema_version_name']}, api_versions_list=['2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def begin_delete( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + resource: SchemaVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemaVersion: ... + + @overload + async def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + resource: SchemaVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemaVersion: ... + + @overload + async def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemaVersion: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name', 'schema_name', 'schema_version_name', 'accept']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def get( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + **kwargs: Any + ) -> SchemaVersion: ... + + @distributed_trace + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name', 'schema_name', 'accept']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_schema( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + **kwargs: Any + ) -> AsyncItemPaged[SchemaVersion]: ... + + + class azure.mgmt.deviceregistry.aio.operations.SchemasOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-10-01', params_added_on={'2025-10-01': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name', 'schema_name']}, api_versions_list=['2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def begin_delete( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + resource: Schema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Schema: ... + + @overload + async def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + resource: Schema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Schema: ... + + @overload + async def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Schema: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name', 'schema_name', 'accept']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + async def get( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + **kwargs: Any + ) -> Schema: ... + + @distributed_trace + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name', 'accept']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_schema_registry( + self, + resource_group_name: str, + schema_registry_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Schema]: ... + + +namespace azure.mgmt.deviceregistry.models + + class azure.mgmt.deviceregistry.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERNAL = "Internal" + + + class azure.mgmt.deviceregistry.models.ActivateCertificateAuthorityRequest(_Model): + certificate_chain: str + + @overload + def __init__( + self, + *, + certificate_chain: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.Asset(TrackedResource): + extended_location: ExtendedLocation + id: str + location: str + name: str + properties: Optional[AssetProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + extended_location: ExtendedLocation, + location: str, + properties: Optional[AssetProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.AssetEndpointProfile(TrackedResource): + extended_location: ExtendedLocation + id: str + location: str + name: str + properties: Optional[AssetEndpointProfileProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + extended_location: ExtendedLocation, + location: str, + properties: Optional[AssetEndpointProfileProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.AssetEndpointProfileProperties(_Model): + additional_configuration: Optional[str] + authentication: Optional[Authentication] + discovered_asset_endpoint_profile_ref: Optional[str] + endpoint_profile_type: str + provisioning_state: Optional[Union[str, ProvisioningState]] + status: Optional[AssetEndpointProfileStatus] + target_address: str + uuid: Optional[str] + + @overload + def __init__( + self, + *, + additional_configuration: Optional[str] = ..., + authentication: Optional[Authentication] = ..., + discovered_asset_endpoint_profile_ref: Optional[str] = ..., + endpoint_profile_type: str, + target_address: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.AssetEndpointProfileStatus(_Model): + errors: Optional[list[AssetEndpointProfileStatusError]] + + + class azure.mgmt.deviceregistry.models.AssetEndpointProfileStatusError(_Model): + code: Optional[int] + message: Optional[str] + + + class azure.mgmt.deviceregistry.models.AssetEndpointProfileUpdate(_Model): + properties: Optional[AssetEndpointProfileUpdateProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[AssetEndpointProfileUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.AssetEndpointProfileUpdateProperties(_Model): + additional_configuration: Optional[str] + authentication: Optional[Authentication] + endpoint_profile_type: Optional[str] + target_address: Optional[str] + + @overload + def __init__( + self, + *, + additional_configuration: Optional[str] = ..., + authentication: Optional[Authentication] = ..., + endpoint_profile_type: Optional[str] = ..., + target_address: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.AssetProperties(_Model): + asset_endpoint_profile_ref: str + attributes: Optional[dict[str, Any]] + datasets: Optional[list[Dataset]] + default_datasets_configuration: Optional[str] + default_events_configuration: Optional[str] + default_topic: Optional[Topic] + description: Optional[str] + discovered_asset_refs: Optional[list[str]] + display_name: Optional[str] + documentation_uri: Optional[str] + enabled: Optional[bool] + events: Optional[list[Event]] + external_asset_id: Optional[str] + hardware_revision: Optional[str] + manufacturer: Optional[str] + manufacturer_uri: Optional[str] + model: Optional[str] + product_code: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + serial_number: Optional[str] + software_revision: Optional[str] + status: Optional[AssetStatus] + uuid: Optional[str] + version: Optional[int] + + @overload + def __init__( + self, + *, + asset_endpoint_profile_ref: str, + attributes: Optional[dict[str, Any]] = ..., + datasets: Optional[list[Dataset]] = ..., + default_datasets_configuration: Optional[str] = ..., + default_events_configuration: Optional[str] = ..., + default_topic: Optional[Topic] = ..., + description: Optional[str] = ..., + discovered_asset_refs: Optional[list[str]] = ..., + display_name: Optional[str] = ..., + documentation_uri: Optional[str] = ..., + enabled: Optional[bool] = ..., + events: Optional[list[Event]] = ..., + external_asset_id: Optional[str] = ..., + hardware_revision: Optional[str] = ..., + manufacturer: Optional[str] = ..., + manufacturer_uri: Optional[str] = ..., + model: Optional[str] = ..., + product_code: Optional[str] = ..., + serial_number: Optional[str] = ..., + software_revision: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.AssetStatus(_Model): + datasets: Optional[list[AssetStatusDataset]] + errors: Optional[list[AssetStatusError]] + events: Optional[list[AssetStatusEvent]] + version: Optional[int] + + + class azure.mgmt.deviceregistry.models.AssetStatusDataset(_Model): + message_schema_reference: Optional[MessageSchemaReference] + name: str + + + class azure.mgmt.deviceregistry.models.AssetStatusError(_Model): + code: Optional[int] + message: Optional[str] + + + class azure.mgmt.deviceregistry.models.AssetStatusEvent(_Model): + message_schema_reference: Optional[MessageSchemaReference] + name: str + + + class azure.mgmt.deviceregistry.models.AssetUpdate(_Model): + properties: Optional[AssetUpdateProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[AssetUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.AssetUpdateProperties(_Model): + attributes: Optional[dict[str, Any]] + datasets: Optional[list[Dataset]] + default_datasets_configuration: Optional[str] + default_events_configuration: Optional[str] + default_topic: Optional[Topic] + description: Optional[str] + display_name: Optional[str] + documentation_uri: Optional[str] + enabled: Optional[bool] + events: Optional[list[Event]] + hardware_revision: Optional[str] + manufacturer: Optional[str] + manufacturer_uri: Optional[str] + model: Optional[str] + product_code: Optional[str] + serial_number: Optional[str] + software_revision: Optional[str] + + @overload + def __init__( + self, + *, + attributes: Optional[dict[str, Any]] = ..., + datasets: Optional[list[Dataset]] = ..., + default_datasets_configuration: Optional[str] = ..., + default_events_configuration: Optional[str] = ..., + default_topic: Optional[Topic] = ..., + description: Optional[str] = ..., + display_name: Optional[str] = ..., + documentation_uri: Optional[str] = ..., + enabled: Optional[bool] = ..., + events: Optional[list[Event]] = ..., + hardware_revision: Optional[str] = ..., + manufacturer: Optional[str] = ..., + manufacturer_uri: Optional[str] = ..., + model: Optional[str] = ..., + product_code: Optional[str] = ..., + serial_number: Optional[str] = ..., + software_revision: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.Authentication(_Model): + method: Union[str, AuthenticationMethod] + username_password_credentials: Optional[UsernamePasswordCredentials] + x509_credentials: Optional[X509Credentials] + + @overload + def __init__( + self, + *, + method: Union[str, AuthenticationMethod], + username_password_credentials: Optional[UsernamePasswordCredentials] = ..., + x509_credentials: Optional[X509Credentials] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.AuthenticationMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANONYMOUS = "Anonymous" + CERTIFICATE = "Certificate" + USERNAME_PASSWORD = "UsernamePassword" + + + class azure.mgmt.deviceregistry.models.BillingContainer(ProxyResource): + etag: Optional[str] + id: str + name: str + properties: Optional[BillingContainerProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[BillingContainerProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.BillingContainerProperties(_Model): + provisioning_state: Optional[Union[str, ProvisioningState]] + + + class azure.mgmt.deviceregistry.models.BrokerStateStoreDestinationConfiguration(_Model): + key: str + + @overload + def __init__( + self, + *, + key: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.CertificateAuthority(TrackedResource): + id: str + location: str + name: str + properties: Optional[CertificateAuthorityProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + location: str, + properties: Optional[CertificateAuthorityProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.CertificateAuthorityIssuer(_Model): + issuer_type: str + + @overload + def __init__( + self, + *, + issuer_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.CertificateAuthorityIssuerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EXTERNAL = "External" + MICROSOFT = "Microsoft" + + + class azure.mgmt.deviceregistry.models.CertificateAuthorityKeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ECC = "ECC" + + + class azure.mgmt.deviceregistry.models.CertificateAuthorityProperties(_Model): + certificate_authority_type: str + key_type: Union[str, CertificateAuthorityKeyType] + provisioning_state: Optional[Union[str, ProvisioningState]] + subject: Optional[str] + uuid: Optional[str] + validity_not_after: Optional[datetime] + validity_not_before: Optional[datetime] + + @overload + def __init__( + self, + *, + certificate_authority_type: str, + key_type: Union[str, CertificateAuthorityKeyType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.CertificateAuthorityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACTIVE = "Active" + ACTIVE_BUT_PENDING_RENEWAL = "ActiveButPendingRenewal" + PENDING_ACTIVATION = "PendingActivation" + + + class azure.mgmt.deviceregistry.models.CertificateAuthorityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ICA = "ICA" + ROOT = "Root" + + + class azure.mgmt.deviceregistry.models.CertificateAuthorityUpdate(_Model): + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.CertificatePolicy(TrackedResource): + id: str + location: str + name: str + properties: Optional[CertificatePolicyProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + location: str, + properties: Optional[CertificatePolicyProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.CertificatePolicyConfiguration(_Model): + validity_period_in_days: int + + @overload + def __init__( + self, + *, + validity_period_in_days: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.CertificatePolicyProperties(_Model): + certificate: Optional[CertificatePolicyConfiguration] + provisioning_state: Optional[Union[str, ProvisioningState]] + uuid: Optional[str] + + @overload + def __init__( + self, + *, + certificate: Optional[CertificatePolicyConfiguration] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.CertificatePolicyUpdate(_Model): + properties: Optional[CertificatePolicyUpdateProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[CertificatePolicyUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.CertificatePolicyUpdateProperties(_Model): + certificate: Optional[OptionalPropertiesCertificatePolicyConfiguration] + + @overload + def __init__( + self, + *, + certificate: Optional[OptionalPropertiesCertificatePolicyConfiguration] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.deviceregistry.models.DataPoint(DataPointBase): + data_point_configuration: str + data_source: str + name: str + observability_mode: Optional[Union[str, DataPointObservabilityMode]] + + @overload + def __init__( + self, + *, + data_point_configuration: Optional[str] = ..., + data_source: str, + name: str, + observability_mode: Optional[Union[str, DataPointObservabilityMode]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.DataPointBase(_Model): + data_point_configuration: Optional[str] + data_source: str + name: str + + @overload + def __init__( + self, + *, + data_point_configuration: Optional[str] = ..., + data_source: str, + name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.DataPointObservabilityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + COUNTER = "Counter" + GAUGE = "Gauge" + HISTOGRAM = "Histogram" + LOG = "Log" + NONE = "None" + + + class azure.mgmt.deviceregistry.models.Dataset(_Model): + data_points: Optional[list[DataPoint]] + dataset_configuration: Optional[str] + name: str + topic: Optional[Topic] + + @overload + def __init__( + self, + *, + data_points: Optional[list[DataPoint]] = ..., + dataset_configuration: Optional[str] = ..., + name: str, + topic: Optional[Topic] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.DatasetBrokerStateStoreDestination(DatasetDestination, discriminator='BrokerStateStore'): + configuration: BrokerStateStoreDestinationConfiguration + target: Literal[DatasetDestinationTarget.BROKER_STATE_STORE] + + @overload + def __init__( + self, + *, + configuration: BrokerStateStoreDestinationConfiguration + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.DatasetDestination(_Model): + target: str + + @overload + def __init__( + self, + *, + target: str = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.DatasetDestinationTarget(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BROKER_STATE_STORE = "BrokerStateStore" + MQTT = "Mqtt" + STORAGE = "Storage" + + + class azure.mgmt.deviceregistry.models.DatasetMqttDestination(DatasetDestination, discriminator='Mqtt'): + configuration: MqttDestinationConfiguration + target: Literal[DatasetDestinationTarget.MQTT] + + @overload + def __init__( + self, + *, + configuration: MqttDestinationConfiguration + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.DatasetStorageDestination(DatasetDestination, discriminator='Storage'): + configuration: StorageDestinationConfiguration + target: Literal[DatasetDestinationTarget.STORAGE] + + @overload + def __init__( + self, + *, + configuration: StorageDestinationConfiguration + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.DeviceMessagingEndpoint(_Model): + address: str + endpoint_type: Optional[str] + + @overload + def __init__( + self, + *, + address: str, + endpoint_type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.DeviceRef(_Model): + device_name: str + endpoint_name: str + + @overload + def __init__( + self, + *, + device_name: str, + endpoint_name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.DeviceStatus(_Model): + config: Optional[StatusConfig] + endpoints: Optional[DeviceStatusEndpoints] + + + class azure.mgmt.deviceregistry.models.DeviceStatusEndpoint(_Model): + error: Optional[StatusError] + health_state: Optional[HealthState] + + + class azure.mgmt.deviceregistry.models.DeviceStatusEndpoints(_Model): + inbound: Optional[dict[str, DeviceStatusEndpoint]] + + + class azure.mgmt.deviceregistry.models.DiscoveredInboundEndpoints(_Model): + additional_configuration: Optional[str] + address: str + endpoint_type: str + last_updated_on: Optional[datetime] + supported_authentication_methods: Optional[list[Union[str, AuthenticationMethod]]] + version: Optional[str] + + @overload + def __init__( + self, + *, + additional_configuration: Optional[str] = ..., + address: str, + endpoint_type: str, + last_updated_on: Optional[datetime] = ..., + supported_authentication_methods: Optional[list[Union[str, AuthenticationMethod]]] = ..., + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.DiscoveredMessagingEndpoints(_Model): + inbound: Optional[dict[str, DiscoveredInboundEndpoints]] + outbound: Optional[DiscoveredOutboundEndpoints] + + @overload + def __init__( + self, + *, + inbound: Optional[dict[str, DiscoveredInboundEndpoints]] = ..., + outbound: Optional[DiscoveredOutboundEndpoints] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.DiscoveredOutboundEndpoints(_Model): + assigned: dict[str, DeviceMessagingEndpoint] + + @overload + def __init__( + self, + *, + assigned: dict[str, DeviceMessagingEndpoint] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.deviceregistry.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.deviceregistry.models.ErrorDetails(_Model): + code: Optional[str] + correlation_id: Optional[str] + info: Optional[str] + message: Optional[str] + + + class azure.mgmt.deviceregistry.models.ErrorResponse(_Model): + error: Optional[ErrorDetail] + + @overload + def __init__( + self, + *, + error: Optional[ErrorDetail] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.Event(EventBase): + event_configuration: str + event_notifier: str + name: str + observability_mode: Optional[Union[str, EventObservabilityMode]] + topic: Topic + + @overload + def __init__( + self, + *, + event_configuration: Optional[str] = ..., + event_notifier: str, + name: str, + observability_mode: Optional[Union[str, EventObservabilityMode]] = ..., + topic: Optional[Topic] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.EventBase(_Model): + event_configuration: Optional[str] + event_notifier: str + name: str + topic: Optional[Topic] + + @overload + def __init__( + self, + *, + event_configuration: Optional[str] = ..., + event_notifier: str, + name: str, + topic: Optional[Topic] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.EventDestination(_Model): + target: str + + @overload + def __init__( + self, + *, + target: str = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.EventDestinationTarget(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MQTT = "Mqtt" + STORAGE = "Storage" + + + class azure.mgmt.deviceregistry.models.EventMqttDestination(EventDestination, discriminator='Mqtt'): + configuration: MqttDestinationConfiguration + target: Literal[EventDestinationTarget.MQTT] + + @overload + def __init__( + self, + *, + configuration: MqttDestinationConfiguration + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.EventObservabilityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): + LOG = "Log" + NONE = "None" + + + class azure.mgmt.deviceregistry.models.EventStorageDestination(EventDestination, discriminator='Storage'): + configuration: StorageDestinationConfiguration + target: Literal[EventDestinationTarget.STORAGE] + + @overload + def __init__( + self, + *, + configuration: StorageDestinationConfiguration + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.ExtendedLocation(_Model): + name: str + type: str + + @overload + def __init__( + self, + *, + name: str, + type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.ExternalCertificateAuthorityIssuer(CertificateAuthorityIssuer, discriminator='External'): + certificate_signing_request: Optional[str] + issuer_type: Literal[CertificateAuthorityIssuerType.EXTERNAL] + status: Optional[Union[str, CertificateAuthorityStatus]] + thumbprint: Optional[str] + + @overload + def __init__(self) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.Format(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DELTA1_0 = "Delta/1.0" + JSON_LD1_1 = "JsonLD/1.1" + JSON_SCHEMA_DRAFT7 = "JsonSchema/draft-07" + + + class azure.mgmt.deviceregistry.models.HealthState(_Model): + last_transition_time: Optional[str] + last_update_time: Optional[str] + message: Optional[str] + reason_code: Optional[str] + status: Optional[Union[str, HealthStatus]] + + + class azure.mgmt.deviceregistry.models.HealthStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AVAILABLE = "Available" + DEGRADED = "Degraded" + UNAVAILABLE = "Unavailable" + UNKNOWN = "Unknown" + + + class azure.mgmt.deviceregistry.models.HostAuthentication(_Model): + method: Union[str, AuthenticationMethod] + username_password_credentials: Optional[UsernamePasswordCredentials] + x509_credentials: Optional[X509CertificateCredentials] + + @overload + def __init__( + self, + *, + method: Union[str, AuthenticationMethod], + username_password_credentials: Optional[UsernamePasswordCredentials] = ..., + x509_credentials: Optional[X509CertificateCredentials] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.InboundCallerIdentity(_Model): + type: Union[str, InboundCallerIdentityType] + user_assigned_identity: Optional[str] + + @overload + def __init__( + self, + *, + type: Union[str, InboundCallerIdentityType], + user_assigned_identity: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.InboundCallerIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + + + class azure.mgmt.deviceregistry.models.InboundEndpoints(_Model): + additional_configuration: Optional[str] + address: str + authentication: Optional[HostAuthentication] + endpoint_type: str + trust_settings: Optional[TrustSettings] + version: Optional[str] + + @overload + def __init__( + self, + *, + additional_configuration: Optional[str] = ..., + address: str, + authentication: Optional[HostAuthentication] = ..., + endpoint_type: str, + trust_settings: Optional[TrustSettings] = ..., + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.IntermediateCertificateAuthorityProperties(CertificateAuthorityProperties, discriminator='ICA'): + certificate_authority_type: Literal[CertificateAuthorityType.ICA] + issuer: CertificateAuthorityIssuer + key_type: Union[str, CertificateAuthorityKeyType] + provisioning_state: Union[str, ProvisioningState] + subject: str + uuid: str + validity_not_after: datetime + validity_not_before: datetime + + @overload + def __init__( + self, + *, + issuer: CertificateAuthorityIssuer, + key_type: Union[str, CertificateAuthorityKeyType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.ManagedServiceIdentity(_Model): + principal_id: Optional[str] + tenant_id: Optional[str] + type: Union[str, ManagedServiceIdentityType] + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] + + @overload + def __init__( + self, + *, + type: Union[str, ManagedServiceIdentityType], + user_assigned_identities: Optional[dict[str, UserAssignedIdentity]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + USER_ASSIGNED = "UserAssigned" + + + class azure.mgmt.deviceregistry.models.Management(_Model): + endpoints: Optional[dict[str, ManagementEndpoint]] + + @overload + def __init__( + self, + *, + endpoints: Optional[dict[str, ManagementEndpoint]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.ManagementAction(_Model): + action_configuration: Optional[str] + action_type: Optional[Union[str, ManagementActionType]] + name: str + target_uri: str + timeout_in_seconds: Optional[int] + topic: Optional[str] + type_ref: Optional[str] + + @overload + def __init__( + self, + *, + action_configuration: Optional[str] = ..., + action_type: Optional[Union[str, ManagementActionType]] = ..., + name: str, + target_uri: str, + timeout_in_seconds: Optional[int] = ..., + topic: Optional[str] = ..., + type_ref: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.ManagementActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CALL = "Call" + READ = "Read" + WRITE = "Write" + + + class azure.mgmt.deviceregistry.models.ManagementEndpoint(_Model): + address: str + endpoint_type: str + resource_id: str + scope_id: str + + @overload + def __init__( + self, + *, + address: str, + endpoint_type: str, + resource_id: str, + scope_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.ManagementGroup(_Model): + actions: Optional[list[ManagementAction]] + data_source: Optional[str] + default_timeout_in_seconds: Optional[int] + default_topic: Optional[str] + management_group_configuration: Optional[str] + name: str + type_ref: Optional[str] + + @overload + def __init__( + self, + *, + actions: Optional[list[ManagementAction]] = ..., + data_source: Optional[str] = ..., + default_timeout_in_seconds: Optional[int] = ..., + default_topic: Optional[str] = ..., + management_group_configuration: Optional[str] = ..., + name: str, + type_ref: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.MessageSchemaReference(_Model): + schema_name: str + schema_registry_namespace: str + schema_version: str + + + class azure.mgmt.deviceregistry.models.Messaging(_Model): + endpoints: Optional[dict[str, MessagingEndpoint]] + + @overload + def __init__( + self, + *, + endpoints: Optional[dict[str, MessagingEndpoint]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.MessagingEndpoint(_Model): + address: Optional[str] + device_address: Optional[str] + endpoint_type: Optional[str] + inbound_caller_identity: Optional[InboundCallerIdentity] + linking_error: Optional[NamespaceLinkingError] + linking_state: Optional[Union[str, NamespaceLinkingStateValue]] + provisioning: Optional[MessagingEndpointProvisioning] + resource_id: Optional[str] + + @overload + def __init__( + self, + *, + address: Optional[str] = ..., + endpoint_type: Optional[str] = ..., + inbound_caller_identity: Optional[InboundCallerIdentity] = ..., + provisioning: Optional[MessagingEndpointProvisioning] = ..., + resource_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.MessagingEndpointAvailability(str, Enum, metaclass=CaseInsensitiveEnumMeta): + AVAILABLE = "Available" + DISABLED = "Disabled" + + + class azure.mgmt.deviceregistry.models.MessagingEndpointProvisioning(_Model): + allocation_weight: Optional[int] + availability: Optional[Union[str, MessagingEndpointAvailability]] + + @overload + def __init__( + self, + *, + allocation_weight: Optional[int] = ..., + availability: Optional[Union[str, MessagingEndpointAvailability]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.MessagingEndpoints(_Model): + inbound: Optional[dict[str, InboundEndpoints]] + outbound: Optional[OutboundEndpoints] + + @overload + def __init__( + self, + *, + inbound: Optional[dict[str, InboundEndpoints]] = ..., + outbound: Optional[OutboundEndpoints] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.MicrosoftCertificateAuthorityIssuer(CertificateAuthorityIssuer, discriminator='Microsoft'): + certificate_authority_resource_id: str + issuer_type: Literal[CertificateAuthorityIssuerType.MICROSOFT] + + @overload + def __init__( + self, + *, + certificate_authority_resource_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.MqttDestinationConfiguration(_Model): + qos: Optional[Union[str, MqttDestinationQos]] + retain: Optional[Union[str, TopicRetainType]] + topic: str + ttl: Optional[int] + + @overload + def __init__( + self, + *, + qos: Optional[Union[str, MqttDestinationQos]] = ..., + retain: Optional[Union[str, TopicRetainType]] = ..., + topic: str, + ttl: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.MqttDestinationQos(str, Enum, metaclass=CaseInsensitiveEnumMeta): + QOS0 = "Qos0" + QOS1 = "Qos1" + + + class azure.mgmt.deviceregistry.models.Namespace(TrackedResource): + id: str + identity: Optional[ManagedServiceIdentity] + location: str + name: str + properties: Optional[NamespaceProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + location: str, + properties: Optional[NamespaceProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceAsset(TrackedResource): + extended_location: ExtendedLocation + id: str + location: str + name: str + properties: Optional[NamespaceAssetProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + extended_location: ExtendedLocation, + location: str, + properties: Optional[NamespaceAssetProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceAssetExecuteActionRequest(_Model): + management_action_name: str + management_group_name: str + payload: Optional[dict[str, Any]] + + @overload + def __init__( + self, + *, + management_action_name: str, + management_group_name: str, + payload: Optional[dict[str, Any]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceAssetProperties(_Model): + asset_type_refs: Optional[list[str]] + attributes: Optional[dict[str, Any]] + datasets: Optional[list[NamespaceDataset]] + default_datasets_configuration: Optional[str] + default_datasets_destinations: Optional[list[DatasetDestination]] + default_events_configuration: Optional[str] + default_events_destinations: Optional[list[EventDestination]] + default_management_groups_configuration: Optional[str] + default_streams_configuration: Optional[str] + default_streams_destinations: Optional[list[StreamDestination]] + description: Optional[str] + device_ref: DeviceRef + discovered_asset_refs: Optional[list[str]] + display_name: Optional[str] + documentation_uri: Optional[str] + enabled: Optional[bool] + event_groups: Optional[list[NamespaceEventGroup]] + external_asset_id: Optional[str] + hardware_revision: Optional[str] + last_transition_time: Optional[datetime] + management_groups: Optional[list[ManagementGroup]] + manufacturer: Optional[str] + manufacturer_uri: Optional[str] + model: Optional[str] + product_code: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + serial_number: Optional[str] + software_revision: Optional[str] + status: Optional[NamespaceAssetStatus] + streams: Optional[list[NamespaceStream]] + uuid: Optional[str] + version: Optional[int] + + @overload + def __init__( + self, + *, + asset_type_refs: Optional[list[str]] = ..., + attributes: Optional[dict[str, Any]] = ..., + datasets: Optional[list[NamespaceDataset]] = ..., + default_datasets_configuration: Optional[str] = ..., + default_datasets_destinations: Optional[list[DatasetDestination]] = ..., + default_events_configuration: Optional[str] = ..., + default_events_destinations: Optional[list[EventDestination]] = ..., + default_management_groups_configuration: Optional[str] = ..., + default_streams_configuration: Optional[str] = ..., + default_streams_destinations: Optional[list[StreamDestination]] = ..., + description: Optional[str] = ..., + device_ref: DeviceRef, + discovered_asset_refs: Optional[list[str]] = ..., + display_name: Optional[str] = ..., + documentation_uri: Optional[str] = ..., + enabled: Optional[bool] = ..., + event_groups: Optional[list[NamespaceEventGroup]] = ..., + external_asset_id: Optional[str] = ..., + hardware_revision: Optional[str] = ..., + management_groups: Optional[list[ManagementGroup]] = ..., + manufacturer: Optional[str] = ..., + manufacturer_uri: Optional[str] = ..., + model: Optional[str] = ..., + product_code: Optional[str] = ..., + serial_number: Optional[str] = ..., + software_revision: Optional[str] = ..., + streams: Optional[list[NamespaceStream]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceAssetStatus(_Model): + config: Optional[StatusConfig] + datasets: Optional[list[NamespaceAssetStatusDataset]] + event_groups: Optional[list[NamespaceAssetStatusEventGroup]] + health_state: Optional[HealthState] + management_groups: Optional[list[NamespaceAssetStatusManagementGroup]] + streams: Optional[list[NamespaceAssetStatusStream]] + + + class azure.mgmt.deviceregistry.models.NamespaceAssetStatusDataset(_Model): + error: Optional[StatusError] + message_schema_reference: Optional[NamespaceMessageSchemaReference] + name: str + + + class azure.mgmt.deviceregistry.models.NamespaceAssetStatusEvent(_Model): + error: Optional[StatusError] + message_schema_reference: Optional[NamespaceMessageSchemaReference] + name: str + + + class azure.mgmt.deviceregistry.models.NamespaceAssetStatusEventGroup(_Model): + events: Optional[list[NamespaceAssetStatusEvent]] + name: str + + + class azure.mgmt.deviceregistry.models.NamespaceAssetStatusManagementAction(_Model): + error: Optional[StatusError] + name: str + request_message_schema_reference: Optional[NamespaceMessageSchemaReference] + response_message_schema_reference: Optional[NamespaceMessageSchemaReference] + + + class azure.mgmt.deviceregistry.models.NamespaceAssetStatusManagementGroup(_Model): + actions: Optional[list[NamespaceAssetStatusManagementAction]] + name: str + + + class azure.mgmt.deviceregistry.models.NamespaceAssetStatusStream(_Model): + error: Optional[StatusError] + message_schema_reference: Optional[NamespaceMessageSchemaReference] + name: str + + + class azure.mgmt.deviceregistry.models.NamespaceAssetUpdate(_Model): + properties: Optional[NamespaceAssetUpdateProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[NamespaceAssetUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceAssetUpdateProperties(_Model): + asset_type_refs: Optional[list[str]] + attributes: Optional[dict[str, Any]] + datasets: Optional[list[NamespaceDataset]] + default_datasets_configuration: Optional[str] + default_datasets_destinations: Optional[list[DatasetDestination]] + default_events_configuration: Optional[str] + default_events_destinations: Optional[list[EventDestination]] + default_management_groups_configuration: Optional[str] + default_streams_configuration: Optional[str] + default_streams_destinations: Optional[list[StreamDestination]] + description: Optional[str] + display_name: Optional[str] + documentation_uri: Optional[str] + enabled: Optional[bool] + event_groups: Optional[list[NamespaceEventGroup]] + hardware_revision: Optional[str] + management_groups: Optional[list[ManagementGroup]] + manufacturer: Optional[str] + manufacturer_uri: Optional[str] + model: Optional[str] + product_code: Optional[str] + serial_number: Optional[str] + software_revision: Optional[str] + streams: Optional[list[NamespaceStream]] + + @overload + def __init__( + self, + *, + asset_type_refs: Optional[list[str]] = ..., + attributes: Optional[dict[str, Any]] = ..., + datasets: Optional[list[NamespaceDataset]] = ..., + default_datasets_configuration: Optional[str] = ..., + default_datasets_destinations: Optional[list[DatasetDestination]] = ..., + default_events_configuration: Optional[str] = ..., + default_events_destinations: Optional[list[EventDestination]] = ..., + default_management_groups_configuration: Optional[str] = ..., + default_streams_configuration: Optional[str] = ..., + default_streams_destinations: Optional[list[StreamDestination]] = ..., + description: Optional[str] = ..., + display_name: Optional[str] = ..., + documentation_uri: Optional[str] = ..., + enabled: Optional[bool] = ..., + event_groups: Optional[list[NamespaceEventGroup]] = ..., + hardware_revision: Optional[str] = ..., + management_groups: Optional[list[ManagementGroup]] = ..., + manufacturer: Optional[str] = ..., + manufacturer_uri: Optional[str] = ..., + model: Optional[str] = ..., + product_code: Optional[str] = ..., + serial_number: Optional[str] = ..., + software_revision: Optional[str] = ..., + streams: Optional[list[NamespaceStream]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDataset(_Model): + data_points: Optional[list[NamespaceDatasetDataPoint]] + data_source: Optional[str] + dataset_configuration: Optional[str] + destinations: Optional[list[DatasetDestination]] + name: str + type_ref: Optional[str] + + @overload + def __init__( + self, + *, + data_points: Optional[list[NamespaceDatasetDataPoint]] = ..., + data_source: Optional[str] = ..., + dataset_configuration: Optional[str] = ..., + destinations: Optional[list[DatasetDestination]] = ..., + name: str, + type_ref: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDatasetDataPoint(_Model): + data_point_configuration: Optional[str] + data_source: str + name: str + type_ref: Optional[str] + + @overload + def __init__( + self, + *, + data_point_configuration: Optional[str] = ..., + data_source: str, + name: str, + type_ref: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDevice(TrackedResource): + etag: Optional[str] + extended_location: Optional[ExtendedLocation] + id: str + location: str + name: str + properties: Optional[NamespaceDeviceProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + extended_location: Optional[ExtendedLocation] = ..., + location: str, + properties: Optional[NamespaceDeviceProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDeviceProperties(_Model): + attributes: Optional[dict[str, Any]] + discovered_device_ref: Optional[str] + enabled: Optional[bool] + endpoints: Optional[MessagingEndpoints] + external_device_id: Optional[str] + last_transition_time: Optional[datetime] + manufacturer: Optional[str] + model: Optional[str] + operating_system: Optional[str] + operating_system_version: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + status: Optional[DeviceStatus] + uuid: Optional[str] + version: Optional[int] + + @overload + def __init__( + self, + *, + attributes: Optional[dict[str, Any]] = ..., + discovered_device_ref: Optional[str] = ..., + enabled: Optional[bool] = ..., + endpoints: Optional[MessagingEndpoints] = ..., + external_device_id: Optional[str] = ..., + manufacturer: Optional[str] = ..., + model: Optional[str] = ..., + operating_system: Optional[str] = ..., + operating_system_version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDeviceUpdate(_Model): + properties: Optional[NamespaceDeviceUpdateProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[NamespaceDeviceUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDeviceUpdateProperties(_Model): + attributes: Optional[dict[str, Any]] + enabled: Optional[bool] + endpoints: Optional[MessagingEndpoints] + operating_system_version: Optional[str] + + @overload + def __init__( + self, + *, + attributes: Optional[dict[str, Any]] = ..., + enabled: Optional[bool] = ..., + endpoints: Optional[MessagingEndpoints] = ..., + operating_system_version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset(TrackedResource): + extended_location: ExtendedLocation + id: str + location: str + name: str + properties: Optional[NamespaceDiscoveredAssetProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + extended_location: ExtendedLocation, + location: str, + properties: Optional[NamespaceDiscoveredAssetProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredAssetProperties(_Model): + asset_type_refs: Optional[list[str]] + attributes: Optional[dict[str, Any]] + datasets: Optional[list[NamespaceDiscoveredDataset]] + default_datasets_configuration: Optional[str] + default_datasets_destinations: Optional[list[DatasetDestination]] + default_events_configuration: Optional[str] + default_events_destinations: Optional[list[EventDestination]] + default_management_groups_configuration: Optional[str] + default_streams_configuration: Optional[str] + default_streams_destinations: Optional[list[StreamDestination]] + description: Optional[str] + device_ref: DeviceRef + discovery_id: str + display_name: Optional[str] + documentation_uri: Optional[str] + event_groups: Optional[list[NamespaceDiscoveredEventGroup]] + external_asset_id: Optional[str] + hardware_revision: Optional[str] + management_groups: Optional[list[NamespaceDiscoveredManagementGroup]] + manufacturer: Optional[str] + manufacturer_uri: Optional[str] + model: Optional[str] + product_code: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + serial_number: Optional[str] + software_revision: Optional[str] + streams: Optional[list[NamespaceDiscoveredStream]] + version: int + + @overload + def __init__( + self, + *, + asset_type_refs: Optional[list[str]] = ..., + attributes: Optional[dict[str, Any]] = ..., + datasets: Optional[list[NamespaceDiscoveredDataset]] = ..., + default_datasets_configuration: Optional[str] = ..., + default_datasets_destinations: Optional[list[DatasetDestination]] = ..., + default_events_configuration: Optional[str] = ..., + default_events_destinations: Optional[list[EventDestination]] = ..., + default_management_groups_configuration: Optional[str] = ..., + default_streams_configuration: Optional[str] = ..., + default_streams_destinations: Optional[list[StreamDestination]] = ..., + description: Optional[str] = ..., + device_ref: DeviceRef, + discovery_id: str, + display_name: Optional[str] = ..., + documentation_uri: Optional[str] = ..., + event_groups: Optional[list[NamespaceDiscoveredEventGroup]] = ..., + external_asset_id: Optional[str] = ..., + hardware_revision: Optional[str] = ..., + management_groups: Optional[list[NamespaceDiscoveredManagementGroup]] = ..., + manufacturer: Optional[str] = ..., + manufacturer_uri: Optional[str] = ..., + model: Optional[str] = ..., + product_code: Optional[str] = ..., + serial_number: Optional[str] = ..., + software_revision: Optional[str] = ..., + streams: Optional[list[NamespaceDiscoveredStream]] = ..., + version: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredAssetUpdate(_Model): + properties: Optional[NamespaceDiscoveredAssetUpdateProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[NamespaceDiscoveredAssetUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredAssetUpdateProperties(_Model): + asset_type_refs: Optional[list[str]] + attributes: Optional[dict[str, Any]] + datasets: Optional[list[NamespaceDiscoveredDataset]] + default_datasets_configuration: Optional[str] + default_datasets_destinations: Optional[list[DatasetDestination]] + default_events_configuration: Optional[str] + default_events_destinations: Optional[list[EventDestination]] + default_management_groups_configuration: Optional[str] + default_streams_configuration: Optional[str] + default_streams_destinations: Optional[list[StreamDestination]] + description: Optional[str] + device_ref: Optional[DeviceRef] + discovery_id: Optional[str] + display_name: Optional[str] + documentation_uri: Optional[str] + event_groups: Optional[list[NamespaceDiscoveredEventGroup]] + hardware_revision: Optional[str] + management_groups: Optional[list[NamespaceDiscoveredManagementGroup]] + manufacturer: Optional[str] + manufacturer_uri: Optional[str] + model: Optional[str] + product_code: Optional[str] + serial_number: Optional[str] + software_revision: Optional[str] + streams: Optional[list[NamespaceDiscoveredStream]] + version: Optional[int] + + @overload + def __init__( + self, + *, + asset_type_refs: Optional[list[str]] = ..., + attributes: Optional[dict[str, Any]] = ..., + datasets: Optional[list[NamespaceDiscoveredDataset]] = ..., + default_datasets_configuration: Optional[str] = ..., + default_datasets_destinations: Optional[list[DatasetDestination]] = ..., + default_events_configuration: Optional[str] = ..., + default_events_destinations: Optional[list[EventDestination]] = ..., + default_management_groups_configuration: Optional[str] = ..., + default_streams_configuration: Optional[str] = ..., + default_streams_destinations: Optional[list[StreamDestination]] = ..., + description: Optional[str] = ..., + device_ref: Optional[DeviceRef] = ..., + discovery_id: Optional[str] = ..., + display_name: Optional[str] = ..., + documentation_uri: Optional[str] = ..., + event_groups: Optional[list[NamespaceDiscoveredEventGroup]] = ..., + hardware_revision: Optional[str] = ..., + management_groups: Optional[list[NamespaceDiscoveredManagementGroup]] = ..., + manufacturer: Optional[str] = ..., + manufacturer_uri: Optional[str] = ..., + model: Optional[str] = ..., + product_code: Optional[str] = ..., + serial_number: Optional[str] = ..., + software_revision: Optional[str] = ..., + streams: Optional[list[NamespaceDiscoveredStream]] = ..., + version: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredDataset(_Model): + data_points: Optional[list[NamespaceDiscoveredDatasetDataPoint]] + data_source: Optional[str] + dataset_configuration: Optional[str] + destinations: Optional[list[DatasetDestination]] + last_updated_on: Optional[datetime] + name: str + type_ref: Optional[str] + + @overload + def __init__( + self, + *, + data_points: Optional[list[NamespaceDiscoveredDatasetDataPoint]] = ..., + data_source: Optional[str] = ..., + dataset_configuration: Optional[str] = ..., + destinations: Optional[list[DatasetDestination]] = ..., + last_updated_on: Optional[datetime] = ..., + name: str, + type_ref: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredDatasetDataPoint(_Model): + data_point_configuration: Optional[str] + data_source: str + last_updated_on: Optional[datetime] + name: str + type_ref: Optional[str] + + @overload + def __init__( + self, + *, + data_point_configuration: Optional[str] = ..., + data_source: str, + last_updated_on: Optional[datetime] = ..., + name: str, + type_ref: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice(TrackedResource): + extended_location: ExtendedLocation + id: str + location: str + name: str + properties: Optional[NamespaceDiscoveredDeviceProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + extended_location: ExtendedLocation, + location: str, + properties: Optional[NamespaceDiscoveredDeviceProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredDeviceProperties(_Model): + attributes: Optional[dict[str, Any]] + discovery_id: str + endpoints: Optional[DiscoveredMessagingEndpoints] + external_device_id: Optional[str] + manufacturer: Optional[str] + model: Optional[str] + operating_system: Optional[str] + operating_system_version: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + version: int + + @overload + def __init__( + self, + *, + attributes: Optional[dict[str, Any]] = ..., + discovery_id: str, + endpoints: Optional[DiscoveredMessagingEndpoints] = ..., + external_device_id: Optional[str] = ..., + manufacturer: Optional[str] = ..., + model: Optional[str] = ..., + operating_system: Optional[str] = ..., + operating_system_version: Optional[str] = ..., + version: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredDeviceUpdate(_Model): + properties: Optional[NamespaceDiscoveredDeviceUpdateProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[NamespaceDiscoveredDeviceUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredDeviceUpdateProperties(_Model): + attributes: Optional[dict[str, Any]] + discovery_id: Optional[str] + endpoints: Optional[DiscoveredMessagingEndpoints] + external_device_id: Optional[str] + operating_system_version: Optional[str] + version: Optional[int] + + @overload + def __init__( + self, + *, + attributes: Optional[dict[str, Any]] = ..., + discovery_id: Optional[str] = ..., + endpoints: Optional[DiscoveredMessagingEndpoints] = ..., + external_device_id: Optional[str] = ..., + operating_system_version: Optional[str] = ..., + version: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredEvent(_Model): + data_source: Optional[str] + destinations: Optional[list[EventDestination]] + event_configuration: Optional[str] + last_updated_on: Optional[datetime] + name: str + type_ref: Optional[str] + + @overload + def __init__( + self, + *, + data_source: Optional[str] = ..., + destinations: Optional[list[EventDestination]] = ..., + event_configuration: Optional[str] = ..., + last_updated_on: Optional[datetime] = ..., + name: str, + type_ref: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredEventGroup(_Model): + data_source: Optional[str] + default_destinations: Optional[list[EventDestination]] + event_group_configuration: Optional[str] + events: Optional[list[NamespaceDiscoveredEvent]] + name: str + type_ref: Optional[str] + + @overload + def __init__( + self, + *, + data_source: Optional[str] = ..., + default_destinations: Optional[list[EventDestination]] = ..., + event_group_configuration: Optional[str] = ..., + events: Optional[list[NamespaceDiscoveredEvent]] = ..., + name: str, + type_ref: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredManagementAction(_Model): + action_configuration: Optional[str] + action_type: Optional[Union[str, NamespaceDiscoveredManagementActionType]] + last_updated_on: Optional[datetime] + name: str + target_uri: str + timeout_in_seconds: Optional[int] + topic: Optional[str] + type_ref: Optional[str] + + @overload + def __init__( + self, + *, + action_configuration: Optional[str] = ..., + action_type: Optional[Union[str, NamespaceDiscoveredManagementActionType]] = ..., + last_updated_on: Optional[datetime] = ..., + name: str, + target_uri: str, + timeout_in_seconds: Optional[int] = ..., + topic: Optional[str] = ..., + type_ref: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredManagementActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CALL = "Call" + READ = "Read" + WRITE = "Write" + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredManagementGroup(_Model): + actions: Optional[list[NamespaceDiscoveredManagementAction]] + data_source: Optional[str] + default_timeout_in_seconds: Optional[int] + default_topic: Optional[str] + last_updated_on: Optional[datetime] + management_group_configuration: Optional[str] + name: str + type_ref: Optional[str] + + @overload + def __init__( + self, + *, + actions: Optional[list[NamespaceDiscoveredManagementAction]] = ..., + data_source: Optional[str] = ..., + default_timeout_in_seconds: Optional[int] = ..., + default_topic: Optional[str] = ..., + last_updated_on: Optional[datetime] = ..., + management_group_configuration: Optional[str] = ..., + name: str, + type_ref: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceDiscoveredStream(_Model): + destinations: Optional[list[StreamDestination]] + last_updated_on: Optional[datetime] + name: str + stream_configuration: Optional[str] + type_ref: Optional[str] + + @overload + def __init__( + self, + *, + destinations: Optional[list[StreamDestination]] = ..., + last_updated_on: Optional[datetime] = ..., + name: str, + stream_configuration: Optional[str] = ..., + type_ref: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceEvent(_Model): + data_source: Optional[str] + destinations: Optional[list[EventDestination]] + event_configuration: Optional[str] + name: str + type_ref: Optional[str] + + @overload + def __init__( + self, + *, + data_source: Optional[str] = ..., + destinations: Optional[list[EventDestination]] = ..., + event_configuration: Optional[str] = ..., + name: str, + type_ref: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceEventGroup(_Model): + data_source: Optional[str] + default_destinations: Optional[list[EventDestination]] + event_group_configuration: Optional[str] + events: Optional[list[NamespaceEvent]] + name: str + type_ref: Optional[str] + + @overload + def __init__( + self, + *, + data_source: Optional[str] = ..., + default_destinations: Optional[list[EventDestination]] = ..., + event_group_configuration: Optional[str] = ..., + events: Optional[list[NamespaceEvent]] = ..., + name: str, + type_ref: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceLinkingError(_Model): + code: Optional[str] + message: Optional[str] + + + class azure.mgmt.deviceregistry.models.NamespaceLinkingStateValue(str, Enum, metaclass=CaseInsensitiveEnumMeta): + FAILED = "Failed" + IN_PROGRESS = "InProgress" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.deviceregistry.models.NamespaceMessageSchemaReference(_Model): + schema_name: str + schema_registry_namespace: str + schema_version: str + + + class azure.mgmt.deviceregistry.models.NamespaceMigrateRequest(_Model): + resource_ids: Optional[list[str]] + scope: Optional[Union[str, Scope]] + + @overload + def __init__( + self, + *, + resource_ids: Optional[list[str]] = ..., + scope: Optional[Union[str, Scope]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceProperties(_Model): + management: Optional[Management] + messaging: Optional[Messaging] + outbound_identity: Optional[OutboundIdentity] + provisioning: Optional[NamespaceProvisioning] + provisioning_state: Optional[Union[str, ProvisioningState]] + uuid: Optional[str] + + @overload + def __init__( + self, + *, + management: Optional[Management] = ..., + messaging: Optional[Messaging] = ..., + outbound_identity: Optional[OutboundIdentity] = ..., + provisioning: Optional[NamespaceProvisioning] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceProvisioning(_Model): + endpoints: Optional[dict[str, ProvisioningEndpoint]] + + @overload + def __init__( + self, + *, + endpoints: Optional[dict[str, ProvisioningEndpoint]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceStream(_Model): + destinations: Optional[list[StreamDestination]] + name: str + stream_configuration: Optional[str] + type_ref: Optional[str] + + @overload + def __init__( + self, + *, + destinations: Optional[list[StreamDestination]] = ..., + name: str, + stream_configuration: Optional[str] = ..., + type_ref: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceUpdate(_Model): + identity: Optional[ManagedServiceIdentity] + properties: Optional[NamespaceUpdateProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + properties: Optional[NamespaceUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.NamespaceUpdateProperties(_Model): + management: Optional[Management] + messaging: Optional[Messaging] + outbound_identity: Optional[OutboundIdentity] + provisioning: Optional[NamespaceProvisioning] + + @overload + def __init__( + self, + *, + management: Optional[Management] = ..., + messaging: Optional[Messaging] = ..., + outbound_identity: Optional[OutboundIdentity] = ..., + provisioning: Optional[NamespaceProvisioning] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.Operation(_Model): + action_type: Optional[Union[str, ActionType]] + display: Optional[OperationDisplay] + is_data_action: Optional[bool] + name: Optional[str] + origin: Optional[Union[str, Origin]] + + @overload + def __init__( + self, + *, + display: Optional[OperationDisplay] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + + class azure.mgmt.deviceregistry.models.OperationStatusResult(_Model): + end_time: Optional[datetime] + error: Optional[ErrorDetail] + id: Optional[str] + name: Optional[str] + operations: Optional[list[OperationStatusResult]] + percent_complete: Optional[float] + resource_id: Optional[str] + start_time: Optional[datetime] + status: str + + @overload + def __init__( + self, + *, + end_time: Optional[datetime] = ..., + error: Optional[ErrorDetail] = ..., + id: Optional[str] = ..., + name: Optional[str] = ..., + operations: Optional[list[OperationStatusResult]] = ..., + percent_complete: Optional[float] = ..., + start_time: Optional[datetime] = ..., + status: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.OptionalPropertiesCertificatePolicyConfiguration(_Model): + validity_period_in_days: Optional[int] + + @overload + def __init__( + self, + *, + validity_period_in_days: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + USER_SYSTEM = "user,system" + + + class azure.mgmt.deviceregistry.models.OutboundEndpoints(_Model): + assigned: dict[str, DeviceMessagingEndpoint] + unassigned: Optional[dict[str, DeviceMessagingEndpoint]] + + @overload + def __init__( + self, + *, + assigned: dict[str, DeviceMessagingEndpoint], + unassigned: Optional[dict[str, DeviceMessagingEndpoint]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.OutboundIdentity(_Model): + type: Union[str, OutboundIdentityType] + user_assigned_identity: Optional[str] + + @overload + def __init__( + self, + *, + type: Union[str, OutboundIdentityType], + user_assigned_identity: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.OutboundIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + + + class azure.mgmt.deviceregistry.models.ProvisioningEndpoint(_Model): + endpoint_type: Union[str, ProvisioningEndpointType] + inbound_caller_identity: InboundCallerIdentity + linking_error: Optional[NamespaceLinkingError] + linking_state: Optional[Union[str, NamespaceLinkingStateValue]] + resource_id: str + + @overload + def __init__( + self, + *, + endpoint_type: Union[str, ProvisioningEndpointType], + inbound_caller_identity: InboundCallerIdentity, + resource_id: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.ProvisioningEndpointType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DPS = "Microsoft.Devices/provisioningServices" + + + class azure.mgmt.deviceregistry.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ACCEPTED = "Accepted" + CANCELED = "Canceled" + DELETING = "Deleting" + FAILED = "Failed" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.deviceregistry.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.deviceregistry.models.RegistryDevice(TrackedResource): + etag: Optional[str] + id: str + location: str + name: str + properties: Optional[RegistryDeviceProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + location: str, + properties: Optional[RegistryDeviceProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.RegistryDeviceEnablementState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + DISABLED = "Disabled" + ENABLED = "Enabled" + + + class azure.mgmt.deviceregistry.models.RegistryDeviceProperties(_Model): + enablement_state: Union[str, RegistryDeviceEnablementState] + external_device_id: Optional[str] + hardware_revision: Optional[str] + manufacturer: Optional[str] + model: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + software_revision: Optional[str] + uuid: Optional[str] + + @overload + def __init__( + self, + *, + enablement_state: Union[str, RegistryDeviceEnablementState], + external_device_id: Optional[str] = ..., + hardware_revision: Optional[str] = ..., + manufacturer: Optional[str] = ..., + model: Optional[str] = ..., + software_revision: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.RegistryDeviceUpdate(_Model): + properties: Optional[RegistryDeviceUpdateProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + properties: Optional[RegistryDeviceUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.RegistryDeviceUpdateProperties(_Model): + enablement_state: Optional[Union[str, RegistryDeviceEnablementState]] + hardware_revision: Optional[str] + manufacturer: Optional[str] + model: Optional[str] + software_revision: Optional[str] + + @overload + def __init__( + self, + *, + enablement_state: Optional[Union[str, RegistryDeviceEnablementState]] = ..., + hardware_revision: Optional[str] = ..., + manufacturer: Optional[str] = ..., + model: Optional[str] = ..., + software_revision: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.deviceregistry.models.RootCertificateAuthorityProperties(CertificateAuthorityProperties, discriminator='Root'): + certificate_authority_type: Literal[CertificateAuthorityType.ROOT] + key_type: Union[str, CertificateAuthorityKeyType] + provisioning_state: Union[str, ProvisioningState] + subject: str + uuid: str + validity_not_after: datetime + validity_not_before: datetime + + @overload + def __init__( + self, + *, + key_type: Union[str, CertificateAuthorityKeyType] + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.Schema(ProxyResource): + id: str + name: str + properties: Optional[SchemaProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[SchemaProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.SchemaProperties(_Model): + description: Optional[str] + display_name: Optional[str] + format: Union[str, Format] + provisioning_state: Optional[Union[str, ProvisioningState]] + schema_type: Union[str, SchemaType] + tags: Optional[dict[str, str]] + uuid: Optional[str] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + display_name: Optional[str] = ..., + format: Union[str, Format], + schema_type: Union[str, SchemaType], + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.SchemaRegistry(TrackedResource): + id: str + identity: Optional[ManagedServiceIdentity] + location: str + name: str + properties: Optional[SchemaRegistryProperties] + system_data: SystemData + tags: dict[str, str] + type: str + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + location: str, + properties: Optional[SchemaRegistryProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.SchemaRegistryProperties(_Model): + description: Optional[str] + display_name: Optional[str] + namespace: str + outbound_identity: Optional[OutboundIdentity] + provisioning_state: Optional[Union[str, ProvisioningState]] + storage_account_container_url: str + uuid: Optional[str] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + display_name: Optional[str] = ..., + namespace: str, + outbound_identity: Optional[OutboundIdentity] = ..., + storage_account_container_url: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.SchemaRegistryUpdate(_Model): + identity: Optional[ManagedServiceIdentity] + properties: Optional[SchemaRegistryUpdateProperties] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + identity: Optional[ManagedServiceIdentity] = ..., + properties: Optional[SchemaRegistryUpdateProperties] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.SchemaRegistryUpdateProperties(_Model): + description: Optional[str] + display_name: Optional[str] + outbound_identity: Optional[OutboundIdentity] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + display_name: Optional[str] = ..., + outbound_identity: Optional[OutboundIdentity] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.SchemaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MESSAGE_SCHEMA = "MessageSchema" + THING_DESCRIPTION = "ThingDescription" + THING_MODEL = "ThingModel" + + + class azure.mgmt.deviceregistry.models.SchemaVersion(ProxyResource): + id: str + name: str + properties: Optional[SchemaVersionProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[SchemaVersionProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.SchemaVersionProperties(_Model): + description: Optional[str] + hash: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + schema_content: str + uuid: Optional[str] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + schema_content: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.Scope(str, Enum, metaclass=CaseInsensitiveEnumMeta): + RESOURCES = "Resources" + + + class azure.mgmt.deviceregistry.models.StatusConfig(_Model): + error: Optional[StatusError] + last_transition_time: Optional[datetime] + version: Optional[int] + + + class azure.mgmt.deviceregistry.models.StatusError(_Model): + code: Optional[str] + details: Optional[list[ErrorDetails]] + message: Optional[str] + + + class azure.mgmt.deviceregistry.models.StorageDestinationConfiguration(_Model): + path: str + + @overload + def __init__( + self, + *, + path: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.StreamDestination(_Model): + target: str + + @overload + def __init__( + self, + *, + target: str = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.StreamDestinationTarget(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MQTT = "Mqtt" + STORAGE = "Storage" + + + class azure.mgmt.deviceregistry.models.StreamMqttDestination(StreamDestination, discriminator='Mqtt'): + configuration: MqttDestinationConfiguration + target: Literal[StreamDestinationTarget.MQTT] + + @overload + def __init__( + self, + *, + configuration: MqttDestinationConfiguration + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.StreamStorageDestination(StreamDestination, discriminator='Storage'): + configuration: StorageDestinationConfiguration + target: Literal[StreamDestinationTarget.STORAGE] + + @overload + def __init__( + self, + *, + configuration: StorageDestinationConfiguration + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.SystemData(_Model): + created_at: Optional[datetime] + created_by: Optional[str] + created_by_type: Optional[Union[str, CreatedByType]] + last_modified_at: Optional[datetime] + last_modified_by: Optional[str] + last_modified_by_type: Optional[Union[str, CreatedByType]] + + @overload + def __init__( + self, + *, + created_at: Optional[datetime] = ..., + created_by: Optional[str] = ..., + created_by_type: Optional[Union[str, CreatedByType]] = ..., + last_modified_at: Optional[datetime] = ..., + last_modified_by: Optional[str] = ..., + last_modified_by_type: Optional[Union[str, CreatedByType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.Topic(_Model): + path: str + retain: Optional[Union[str, TopicRetainType]] + + @overload + def __init__( + self, + *, + path: str, + retain: Optional[Union[str, TopicRetainType]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.TopicRetainType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + KEEP = "Keep" + NEVER = "Never" + + + class azure.mgmt.deviceregistry.models.TrackedResource(Resource): + id: str + location: str + name: str + system_data: SystemData + tags: Optional[dict[str, str]] + type: str + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.TrustSettings(_Model): + trust_list: Optional[str] + + @overload + def __init__( + self, + *, + trust_list: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.UserAssignedIdentity(_Model): + client_id: Optional[str] + principal_id: Optional[str] + + + class azure.mgmt.deviceregistry.models.UsernamePasswordCredentials(_Model): + password_secret_name: str + username_secret_name: str + + @overload + def __init__( + self, + *, + password_secret_name: str, + username_secret_name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.X509CertificateCredentials(_Model): + certificate_secret_name: str + intermediate_certificates_secret_name: Optional[str] + key_secret_name: Optional[str] + + @overload + def __init__( + self, + *, + certificate_secret_name: str, + intermediate_certificates_secret_name: Optional[str] = ..., + key_secret_name: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.deviceregistry.models.X509Credentials(_Model): + certificate_secret_name: str + + @overload + def __init__( + self, + *, + certificate_secret_name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + +namespace azure.mgmt.deviceregistry.operations + + class azure.mgmt.deviceregistry.operations.AssetEndpointProfilesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + resource: AssetEndpointProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[AssetEndpointProfile]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + resource: AssetEndpointProfile, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[AssetEndpointProfile]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[AssetEndpointProfile]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + properties: AssetEndpointProfileUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[AssetEndpointProfile]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + properties: AssetEndpointProfileUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[AssetEndpointProfile]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[AssetEndpointProfile]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + asset_endpoint_profile_name: str, + **kwargs: Any + ) -> AssetEndpointProfile: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[AssetEndpointProfile]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[AssetEndpointProfile]: ... + + + class azure.mgmt.deviceregistry.operations.AssetsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + asset_name: str, + resource: Asset, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Asset]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + asset_name: str, + resource: Asset, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Asset]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + asset_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Asset]: ... + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + asset_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + asset_name: str, + properties: AssetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Asset]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + asset_name: str, + properties: AssetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Asset]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + asset_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Asset]: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + asset_name: str, + **kwargs: Any + ) -> Asset: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[Asset]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[Asset]: ... + + + class azure.mgmt.deviceregistry.operations.AsyncOperationStatusOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'location', 'operation_id', 'accept']}, api_versions_list=['2026-11-01']) + def get( + self, + location: str, + operation_id: str, + **kwargs: Any + ) -> OperationStatusResult: ... + + + class azure.mgmt.deviceregistry.operations.BillingContainersOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'billing_container_name', 'accept']}, api_versions_list=['2024-09-01-preview', '2024-11-01', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def get( + self, + billing_container_name: str, + **kwargs: Any + ) -> BillingContainer: ... + + @distributed_trace + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'accept']}, api_versions_list=['2024-09-01-preview', '2024-11-01', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[BillingContainer]: ... + + + class azure.mgmt.deviceregistry.operations.CertificateAuthoritiesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_activate( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + body: ActivateCertificateAuthorityRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_activate( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + body: ActivateCertificateAuthorityRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_activate( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + resource: CertificateAuthority, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CertificateAuthority]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + resource: CertificateAuthority, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CertificateAuthority]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CertificateAuthority]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'certificate_authority_name']}, api_versions_list=['2026-11-01']) + def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'certificate_authority_name']}, api_versions_list=['2026-11-01']) + def begin_revoke_and_rotate( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: CertificateAuthorityUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CertificateAuthority]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: CertificateAuthorityUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CertificateAuthority]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CertificateAuthority]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'certificate_authority_name', 'accept']}, api_versions_list=['2026-11-01']) + def get( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + **kwargs: Any + ) -> CertificateAuthority: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'accept']}, api_versions_list=['2026-11-01']) + def list_by_namespace( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> ItemPaged[CertificateAuthority]: ... + + + class azure.mgmt.deviceregistry.operations.CertificatePoliciesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: CertificatePolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CertificatePolicy]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: CertificatePolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CertificatePolicy]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CertificatePolicy]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'certificate_authority_name', 'certificate_policy_name']}, api_versions_list=['2026-11-01']) + def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: CertificatePolicyUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CertificatePolicy]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: CertificatePolicyUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CertificatePolicy]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[CertificatePolicy]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'certificate_authority_name', 'certificate_policy_name', 'accept']}, api_versions_list=['2026-11-01']) + def get( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + **kwargs: Any + ) -> CertificatePolicy: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'certificate_authority_name', 'accept']}, api_versions_list=['2026-11-01']) + def list_by_certificate_authority( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + **kwargs: Any + ) -> ItemPaged[CertificatePolicy]: ... + + + class azure.mgmt.deviceregistry.operations.NamespaceAssetsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + resource: NamespaceAsset, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceAsset]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + resource: NamespaceAsset, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceAsset]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceAsset]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'asset_name']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_execute_action( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + body: NamespaceAssetExecuteActionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_execute_action( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + body: NamespaceAssetExecuteActionRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_execute_action( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + properties: NamespaceAssetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceAsset]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + properties: NamespaceAssetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceAsset]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceAsset]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'asset_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def get( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + **kwargs: Any + ) -> NamespaceAsset: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_namespace( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> ItemPaged[NamespaceAsset]: ... + + + class azure.mgmt.deviceregistry.operations.NamespaceDevicesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + resource: NamespaceDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDevice]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + resource: NamespaceDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDevice]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDevice]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'device_name']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + properties: NamespaceDeviceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDevice]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + properties: NamespaceDeviceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDevice]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDevice]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'device_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def get( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + **kwargs: Any + ) -> NamespaceDevice: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_namespace( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> ItemPaged[NamespaceDevice]: ... + + + class azure.mgmt.deviceregistry.operations.NamespaceDiscoveredAssetsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + resource: NamespaceDiscoveredAsset, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDiscoveredAsset]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + resource: NamespaceDiscoveredAsset, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDiscoveredAsset]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDiscoveredAsset]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'discovered_asset_name']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + properties: NamespaceDiscoveredAssetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDiscoveredAsset]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + properties: NamespaceDiscoveredAssetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDiscoveredAsset]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDiscoveredAsset]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'discovered_asset_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def get( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + **kwargs: Any + ) -> NamespaceDiscoveredAsset: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_namespace( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> ItemPaged[NamespaceDiscoveredAsset]: ... + + + class azure.mgmt.deviceregistry.operations.NamespaceDiscoveredDevicesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + resource: NamespaceDiscoveredDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDiscoveredDevice]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + resource: NamespaceDiscoveredDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDiscoveredDevice]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDiscoveredDevice]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'discovered_device_name']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + properties: NamespaceDiscoveredDeviceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDiscoveredDevice]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + properties: NamespaceDiscoveredDeviceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDiscoveredDevice]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[NamespaceDiscoveredDevice]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'discovered_device_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def get( + self, + resource_group_name: str, + namespace_name: str, + discovered_device_name: str, + **kwargs: Any + ) -> NamespaceDiscoveredDevice: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_namespace( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> ItemPaged[NamespaceDiscoveredDevice]: ... + + + class azure.mgmt.deviceregistry.operations.NamespacesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + resource: Namespace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Namespace]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + resource: Namespace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Namespace]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Namespace]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_migrate( + self, + resource_group_name: str, + namespace_name: str, + body: NamespaceMigrateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_migrate( + self, + resource_group_name: str, + namespace_name: str, + body: NamespaceMigrateRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_migrate( + self, + resource_group_name: str, + namespace_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + properties: NamespaceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Namespace]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + properties: NamespaceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Namespace]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[Namespace]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def get( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> Namespace: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[Namespace]: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-07-01-preview', params_added_on={'2025-07-01-preview': ['api_version', 'subscription_id', 'accept']}, api_versions_list=['2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[Namespace]: ... + + + class azure.mgmt.deviceregistry.operations.OperationStatusOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + location: str, + operation_id: str, + **kwargs: Any + ) -> OperationStatusResult: ... + + + class azure.mgmt.deviceregistry.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + + class azure.mgmt.deviceregistry.operations.RegistryDevicesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: RegistryDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RegistryDevice]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: RegistryDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RegistryDevice]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RegistryDevice]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'registry_device_name']}, api_versions_list=['2026-11-01']) + def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + properties: RegistryDeviceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RegistryDevice]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + properties: RegistryDeviceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RegistryDevice]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[RegistryDevice]: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'registry_device_name', 'accept']}, api_versions_list=['2026-11-01']) + def get( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + **kwargs: Any + ) -> RegistryDevice: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-11-01', params_added_on={'2026-11-01': ['api_version', 'subscription_id', 'resource_group_name', 'namespace_name', 'accept']}, api_versions_list=['2026-11-01']) + def list_by_namespace( + self, + resource_group_name: str, + namespace_name: str, + **kwargs: Any + ) -> ItemPaged[RegistryDevice]: ... + + + class azure.mgmt.deviceregistry.operations.SchemaRegistriesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + resource: SchemaRegistry, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SchemaRegistry]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + resource: SchemaRegistry, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SchemaRegistry]: ... + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SchemaRegistry]: ... + + @distributed_trace + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def begin_delete( + self, + resource_group_name: str, + schema_registry_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + schema_registry_name: str, + properties: SchemaRegistryUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SchemaRegistry]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + schema_registry_name: str, + properties: SchemaRegistryUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SchemaRegistry]: ... + + @overload + def begin_update( + self, + resource_group_name: str, + schema_registry_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[SchemaRegistry]: ... + + @distributed_trace + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name', 'accept']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def get( + self, + resource_group_name: str, + schema_registry_name: str, + **kwargs: Any + ) -> SchemaRegistry: ... + + @distributed_trace + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'accept']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[SchemaRegistry]: ... + + @distributed_trace + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'accept']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[SchemaRegistry]: ... + + + class azure.mgmt.deviceregistry.operations.SchemaVersionsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-10-01', params_added_on={'2025-10-01': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name', 'schema_name', 'schema_version_name']}, api_versions_list=['2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def begin_delete( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + resource: SchemaVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemaVersion: ... + + @overload + def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + resource: SchemaVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemaVersion: ... + + @overload + def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> SchemaVersion: ... + + @distributed_trace + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name', 'schema_name', 'schema_version_name', 'accept']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def get( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + **kwargs: Any + ) -> SchemaVersion: ... + + @distributed_trace + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name', 'schema_name', 'accept']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_schema( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + **kwargs: Any + ) -> ItemPaged[SchemaVersion]: ... + + + class azure.mgmt.deviceregistry.operations.SchemasOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-10-01', params_added_on={'2025-10-01': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name', 'schema_name']}, api_versions_list=['2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def begin_delete( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + resource: Schema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Schema: ... + + @overload + def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + resource: Schema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Schema: ... + + @overload + def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Schema: ... + + @distributed_trace + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name', 'schema_name', 'accept']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def get( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + **kwargs: Any + ) -> Schema: ... + + @distributed_trace + @api_version_validation(method_added_on='2024-09-01-preview', params_added_on={'2024-09-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'schema_registry_name', 'accept']}, api_versions_list=['2024-09-01-preview', '2025-07-01-preview', '2025-10-01', '2025-11-01-preview', '2026-03-01-preview', '2026-04-01', '2026-11-01']) + def list_by_schema_registry( + self, + resource_group_name: str, + schema_registry_name: str, + **kwargs: Any + ) -> ItemPaged[Schema]: ... + + +namespace azure.mgmt.deviceregistry.types + + class azure.mgmt.deviceregistry.types.ActivateCertificateAuthorityRequest(TypedDict, total=False): + key "certificateChain": Required[str] + certificateChain: str + + + class azure.mgmt.deviceregistry.types.Asset(TrackedResource): + key "extendedLocation": Required[ExtendedLocation] + key "id": str + key "location": Required[str] + key "name": str + key "properties": ForwardRef('AssetProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + extendedLocation: ExtendedLocation + id: str + location: str + name: str + properties: AssetProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.deviceregistry.types.AssetEndpointProfile(TrackedResource): + key "extendedLocation": Required[ExtendedLocation] + key "id": str + key "location": Required[str] + key "name": str + key "properties": ForwardRef('AssetEndpointProfileProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + extendedLocation: ExtendedLocation + id: str + location: str + name: str + properties: AssetEndpointProfileProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.deviceregistry.types.AssetEndpointProfileProperties(TypedDict, total=False): + key "additionalConfiguration": str + key "authentication": ForwardRef('Authentication', module='types') + key "discoveredAssetEndpointProfileRef": str + key "endpointProfileType": Required[str] + key "provisioningState": Union[str, ProvisioningState] + key "status": ForwardRef('AssetEndpointProfileStatus', module='types') + key "targetAddress": Required[str] + key "uuid": str + additionalConfiguration: str + authentication: Authentication + discoveredAssetEndpointProfileRef: str + endpointProfileType: str + provisioningState: Union[str, ProvisioningState] + status: AssetEndpointProfileStatus + targetAddress: str + uuid: str + + + class azure.mgmt.deviceregistry.types.AssetEndpointProfileStatus(TypedDict, total=False): + errors: list[AssetEndpointProfileStatusError] + + + class azure.mgmt.deviceregistry.types.AssetEndpointProfileStatusError(TypedDict, total=False): + key "code": int + key "message": str + code: int + message: str + + + class azure.mgmt.deviceregistry.types.AssetEndpointProfileUpdate(TypedDict, total=False): + key "properties": ForwardRef('AssetEndpointProfileUpdateProperties', module='types') + properties: AssetEndpointProfileUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.deviceregistry.types.AssetEndpointProfileUpdateProperties(TypedDict, total=False): + key "additionalConfiguration": str + key "authentication": ForwardRef('Authentication', module='types') + key "endpointProfileType": str + key "targetAddress": str + additionalConfiguration: str + authentication: Authentication + endpointProfileType: str + targetAddress: str + + + class azure.mgmt.deviceregistry.types.AssetProperties(TypedDict, total=False): + key "assetEndpointProfileRef": Required[str] + key "defaultDatasetsConfiguration": str + key "defaultEventsConfiguration": str + key "defaultTopic": ForwardRef('Topic', module='types') + key "description": str + key "displayName": str + key "documentationUri": str + key "enabled": bool + key "externalAssetId": str + key "hardwareRevision": str + key "manufacturer": str + key "manufacturerUri": str + key "model": str + key "productCode": str + key "provisioningState": Union[str, ProvisioningState] + key "serialNumber": str + key "softwareRevision": str + key "status": ForwardRef('AssetStatus', module='types') + key "uuid": str + key "version": int + assetEndpointProfileRef: str + attributes: dict[str, Any] + datasets: list[Dataset] + defaultDatasetsConfiguration: str + defaultEventsConfiguration: str + defaultTopic: Topic + description: str + discoveredAssetRefs: list[str] + displayName: str + documentationUri: str + enabled: bool + events: list[Event] + externalAssetId: str + hardwareRevision: str + manufacturer: str + manufacturerUri: str + model: str + productCode: str + provisioningState: Union[str, ProvisioningState] + serialNumber: str + softwareRevision: str + status: AssetStatus + uuid: str + version: int + + + class azure.mgmt.deviceregistry.types.AssetStatus(TypedDict, total=False): + key "version": int + datasets: list[AssetStatusDataset] + errors: list[AssetStatusError] + events: list[AssetStatusEvent] + version: int + + + class azure.mgmt.deviceregistry.types.AssetStatusDataset(TypedDict, total=False): + key "messageSchemaReference": ForwardRef('MessageSchemaReference', module='types') + key "name": Required[str] + messageSchemaReference: MessageSchemaReference + name: str + + + class azure.mgmt.deviceregistry.types.AssetStatusError(TypedDict, total=False): + key "code": int + key "message": str + code: int + message: str + + + class azure.mgmt.deviceregistry.types.AssetStatusEvent(TypedDict, total=False): + key "messageSchemaReference": ForwardRef('MessageSchemaReference', module='types') + key "name": Required[str] + messageSchemaReference: MessageSchemaReference + name: str + + + class azure.mgmt.deviceregistry.types.AssetUpdate(TypedDict, total=False): + key "properties": ForwardRef('AssetUpdateProperties', module='types') + properties: AssetUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.deviceregistry.types.AssetUpdateProperties(TypedDict, total=False): + key "defaultDatasetsConfiguration": str + key "defaultEventsConfiguration": str + key "defaultTopic": ForwardRef('Topic', module='types') + key "description": str + key "displayName": str + key "documentationUri": str + key "enabled": bool + key "hardwareRevision": str + key "manufacturer": str + key "manufacturerUri": str + key "model": str + key "productCode": str + key "serialNumber": str + key "softwareRevision": str + attributes: dict[str, Any] + datasets: list[Dataset] + defaultDatasetsConfiguration: str + defaultEventsConfiguration: str + defaultTopic: Topic + description: str + displayName: str + documentationUri: str + enabled: bool + events: list[Event] + hardwareRevision: str + manufacturer: str + manufacturerUri: str + model: str + productCode: str + serialNumber: str + softwareRevision: str + + + class azure.mgmt.deviceregistry.types.Authentication(TypedDict, total=False): + key "method": Required[Union[str, AuthenticationMethod]] + key "usernamePasswordCredentials": ForwardRef('UsernamePasswordCredentials', module='types') + key "x509Credentials": ForwardRef('X509Credentials', module='types') + method: Union[str, AuthenticationMethod] + usernamePasswordCredentials: UsernamePasswordCredentials + x509Credentials: X509Credentials + + + class azure.mgmt.deviceregistry.types.BrokerStateStoreDestinationConfiguration(TypedDict, total=False): + key "key": Required[str] + key: str + + + class azure.mgmt.deviceregistry.types.CertificateAuthority(TrackedResource): + key "id": str + key "location": Required[str] + key "name": str + key "properties": ForwardRef('CertificateAuthorityProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: CertificateAuthorityProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.deviceregistry.types.CertificateAuthorityIssuerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + EXTERNAL = "External" + MICROSOFT = "Microsoft" + + + class azure.mgmt.deviceregistry.types.CertificateAuthorityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ICA = "ICA" + ROOT = "Root" + + + class azure.mgmt.deviceregistry.types.CertificateAuthorityUpdate(TypedDict, total=False): + tags: dict[str, str] + + + class azure.mgmt.deviceregistry.types.CertificatePolicy(TrackedResource): + key "id": str + key "location": Required[str] + key "name": str + key "properties": ForwardRef('CertificatePolicyProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: CertificatePolicyProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.deviceregistry.types.CertificatePolicyConfiguration(TypedDict, total=False): + key "validityPeriodInDays": Required[int] + validityPeriodInDays: int + + + class azure.mgmt.deviceregistry.types.CertificatePolicyProperties(TypedDict, total=False): + key "certificate": ForwardRef('CertificatePolicyConfiguration', module='types') + key "provisioningState": Union[str, ProvisioningState] + key "uuid": str + certificate: CertificatePolicyConfiguration + provisioningState: Union[str, ProvisioningState] + uuid: str + + + class azure.mgmt.deviceregistry.types.CertificatePolicyUpdate(TypedDict, total=False): + key "properties": ForwardRef('CertificatePolicyUpdateProperties', module='types') + properties: CertificatePolicyUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.deviceregistry.types.CertificatePolicyUpdateProperties(TypedDict, total=False): + key "certificate": ForwardRef('OptionalPropertiesCertificatePolicyConfiguration', module='types') + certificate: OptionalPropertiesCertificatePolicyConfiguration + + + class azure.mgmt.deviceregistry.types.DataPoint(DataPointBase): + key "dataPointConfiguration": str + key "dataSource": Required[str] + key "name": Required[str] + key "observabilityMode": Union[str, DataPointObservabilityMode] + dataPointConfiguration: str + dataSource: str + name: str + observabilityMode: Union[str, DataPointObservabilityMode] + + + class azure.mgmt.deviceregistry.types.DataPointBase(TypedDict, total=False): + key "dataPointConfiguration": str + key "dataSource": Required[str] + key "name": Required[str] + dataPointConfiguration: str + dataSource: str + name: str + + + class azure.mgmt.deviceregistry.types.Dataset(TypedDict, total=False): + key "datasetConfiguration": str + key "name": Required[str] + key "topic": ForwardRef('Topic', module='types') + dataPoints: list[DataPoint] + datasetConfiguration: str + name: str + topic: Topic + + + class azure.mgmt.deviceregistry.types.DatasetBrokerStateStoreDestination(TypedDict, total=False): + key "configuration": Required[BrokerStateStoreDestinationConfiguration] + key "target": Required[Literal[DatasetDestinationTarget.BROKER_STATE_STORE]] + configuration: BrokerStateStoreDestinationConfiguration + target: Literal[DatasetDestinationTarget.BROKER_STATE_STORE] + + + class azure.mgmt.deviceregistry.types.DatasetDestinationTarget(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BROKER_STATE_STORE = "BrokerStateStore" + MQTT = "Mqtt" + STORAGE = "Storage" + + + class azure.mgmt.deviceregistry.types.DatasetMqttDestination(TypedDict, total=False): + key "configuration": Required[MqttDestinationConfiguration] + key "target": Required[Literal[DatasetDestinationTarget.MQTT]] + configuration: MqttDestinationConfiguration + target: Literal[DatasetDestinationTarget.MQTT] + + + class azure.mgmt.deviceregistry.types.DatasetStorageDestination(TypedDict, total=False): + key "configuration": Required[StorageDestinationConfiguration] + key "target": Required[Literal[DatasetDestinationTarget.STORAGE]] + configuration: StorageDestinationConfiguration + target: Literal[DatasetDestinationTarget.STORAGE] + + + class azure.mgmt.deviceregistry.types.DeviceMessagingEndpoint(TypedDict, total=False): + key "address": Required[str] + key "endpointType": str + address: str + endpointType: str + + + class azure.mgmt.deviceregistry.types.DeviceRef(TypedDict, total=False): + key "deviceName": Required[str] + key "endpointName": Required[str] + deviceName: str + endpointName: str + + + class azure.mgmt.deviceregistry.types.DeviceStatus(TypedDict, total=False): + key "config": ForwardRef('StatusConfig', module='types') + key "endpoints": ForwardRef('DeviceStatusEndpoints', module='types') + config: StatusConfig + endpoints: DeviceStatusEndpoints + + + class azure.mgmt.deviceregistry.types.DeviceStatusEndpoint(TypedDict, total=False): + key "error": ForwardRef('StatusError', module='types') + key "healthState": ForwardRef('HealthState', module='types') + error: StatusError + healthState: HealthState + + + class azure.mgmt.deviceregistry.types.DeviceStatusEndpoints(TypedDict, total=False): + inbound: dict[str, DeviceStatusEndpoint] + + + class azure.mgmt.deviceregistry.types.DiscoveredInboundEndpoints(TypedDict, total=False): + key "additionalConfiguration": str + key "address": Required[str] + key "endpointType": Required[str] + key "lastUpdatedOn": str + key "version": str + additionalConfiguration: str + address: str + endpointType: str + lastUpdatedOn: str + supportedAuthenticationMethods: list[Union[str, AuthenticationMethod]] + version: str + + + class azure.mgmt.deviceregistry.types.DiscoveredMessagingEndpoints(TypedDict, total=False): + key "outbound": ForwardRef('DiscoveredOutboundEndpoints', module='types') + inbound: dict[str, DiscoveredInboundEndpoints] + outbound: DiscoveredOutboundEndpoints + + + class azure.mgmt.deviceregistry.types.DiscoveredOutboundEndpoints(TypedDict, total=False): + key "assigned": Required[dict[str, DeviceMessagingEndpoint]] + assigned: dict[str, DeviceMessagingEndpoint] + + + class azure.mgmt.deviceregistry.types.ErrorDetails(TypedDict, total=False): + key "code": str + key "correlationId": str + key "info": str + key "message": str + code: str + correlationId: str + info: str + message: str + + + class azure.mgmt.deviceregistry.types.Event(EventBase): + key "eventConfiguration": str + key "eventNotifier": Required[str] + key "name": Required[str] + key "observabilityMode": Union[str, EventObservabilityMode] + key "topic": ForwardRef('Topic', module='types') + eventConfiguration: str + eventNotifier: str + name: str + observabilityMode: Union[str, EventObservabilityMode] + topic: Topic + + + class azure.mgmt.deviceregistry.types.EventBase(TypedDict, total=False): + key "eventConfiguration": str + key "eventNotifier": Required[str] + key "name": Required[str] + key "topic": ForwardRef('Topic', module='types') + eventConfiguration: str + eventNotifier: str + name: str + topic: Topic + + + class azure.mgmt.deviceregistry.types.EventDestinationTarget(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MQTT = "Mqtt" + STORAGE = "Storage" + + + class azure.mgmt.deviceregistry.types.EventMqttDestination(TypedDict, total=False): + key "configuration": Required[MqttDestinationConfiguration] + key "target": Required[Literal[EventDestinationTarget.MQTT]] + configuration: MqttDestinationConfiguration + target: Literal[EventDestinationTarget.MQTT] + + + class azure.mgmt.deviceregistry.types.EventStorageDestination(TypedDict, total=False): + key "configuration": Required[StorageDestinationConfiguration] + key "target": Required[Literal[EventDestinationTarget.STORAGE]] + configuration: StorageDestinationConfiguration + target: Literal[EventDestinationTarget.STORAGE] + + + class azure.mgmt.deviceregistry.types.ExtendedLocation(TypedDict, total=False): + key "name": Required[str] + key "type": Required[str] + name: str + type: str + + + class azure.mgmt.deviceregistry.types.ExternalCertificateAuthorityIssuer(TypedDict, total=False): + key "certificateSigningRequest": str + key "issuerType": Required[Literal[CertificateAuthorityIssuerType.EXTERNAL]] + key "status": Union[str, CertificateAuthorityStatus] + key "thumbprint": str + certificateSigningRequest: str + issuerType: Literal[CertificateAuthorityIssuerType.EXTERNAL] + status: Union[str, CertificateAuthorityStatus] + thumbprint: str + + + class azure.mgmt.deviceregistry.types.HealthState(TypedDict, total=False): + key "lastTransitionTime": str + key "lastUpdateTime": str + key "message": str + key "reasonCode": str + key "status": Union[str, HealthStatus] + lastTransitionTime: str + lastUpdateTime: str + message: str + reasonCode: str + status: Union[str, HealthStatus] + + + class azure.mgmt.deviceregistry.types.HostAuthentication(TypedDict, total=False): + key "method": Required[Union[str, AuthenticationMethod]] + key "usernamePasswordCredentials": ForwardRef('UsernamePasswordCredentials', module='types') + key "x509Credentials": ForwardRef('X509CertificateCredentials', module='types') + method: Union[str, AuthenticationMethod] + usernamePasswordCredentials: UsernamePasswordCredentials + x509Credentials: X509CertificateCredentials + + + class azure.mgmt.deviceregistry.types.InboundCallerIdentity(TypedDict, total=False): + key "type": Required[Union[str, InboundCallerIdentityType]] + key "userAssignedIdentity": str + type: Union[str, InboundCallerIdentityType] + userAssignedIdentity: str + + + class azure.mgmt.deviceregistry.types.InboundEndpoints(TypedDict, total=False): + key "additionalConfiguration": str + key "address": Required[str] + key "authentication": ForwardRef('HostAuthentication', module='types') + key "endpointType": Required[str] + key "trustSettings": ForwardRef('TrustSettings', module='types') + key "version": str + additionalConfiguration: str + address: str + authentication: HostAuthentication + endpointType: str + trustSettings: TrustSettings + version: str + + + class azure.mgmt.deviceregistry.types.IntermediateCertificateAuthorityProperties(TypedDict, total=False): + key "certificateAuthorityType": Required[Literal[CertificateAuthorityType.ICA]] + key "issuer": Required[CertificateAuthorityIssuer] + key "keyType": Required[Union[str, CertificateAuthorityKeyType]] + key "provisioningState": Union[str, ProvisioningState] + key "subject": str + key "uuid": str + key "validityNotAfter": str + key "validityNotBefore": str + certificateAuthorityType: Literal[CertificateAuthorityType.ICA] + issuer: CertificateAuthorityIssuer + keyType: Union[str, CertificateAuthorityKeyType] + provisioningState: Union[str, ProvisioningState] + subject: str + uuid: str + validityNotAfter: str + validityNotBefore: str + + + class azure.mgmt.deviceregistry.types.ManagedServiceIdentity(TypedDict, total=False): + key "principalId": str + key "tenantId": str + key "type": Required[Union[str, ManagedServiceIdentityType]] + principalId: str + tenantId: str + type: Union[str, ManagedServiceIdentityType] + userAssignedIdentities: dict[str, UserAssignedIdentity] + + + class azure.mgmt.deviceregistry.types.Management(TypedDict, total=False): + endpoints: dict[str, ManagementEndpoint] + + + class azure.mgmt.deviceregistry.types.ManagementAction(TypedDict, total=False): + key "actionConfiguration": str + key "actionType": Union[str, ManagementActionType] + key "name": Required[str] + key "targetUri": Required[str] + key "timeoutInSeconds": int + key "topic": str + key "typeRef": str + actionConfiguration: str + actionType: Union[str, ManagementActionType] + name: str + targetUri: str + timeoutInSeconds: int + topic: str + typeRef: str + + + class azure.mgmt.deviceregistry.types.ManagementEndpoint(TypedDict, total=False): + key "address": Required[str] + key "endpointType": Required[str] + key "resourceId": Required[str] + key "scopeId": Required[str] + address: str + endpointType: str + resourceId: str + scopeId: str + + + class azure.mgmt.deviceregistry.types.ManagementGroup(TypedDict, total=False): + key "dataSource": str + key "defaultTimeoutInSeconds": int + key "defaultTopic": str + key "managementGroupConfiguration": str + key "name": Required[str] + key "typeRef": str + actions: list[ManagementAction] + dataSource: str + defaultTimeoutInSeconds: int + defaultTopic: str + managementGroupConfiguration: str + name: str + typeRef: str + + + class azure.mgmt.deviceregistry.types.MessageSchemaReference(TypedDict, total=False): + key "schemaName": Required[str] + key "schemaRegistryNamespace": Required[str] + key "schemaVersion": Required[str] + schemaName: str + schemaRegistryNamespace: str + schemaVersion: str + + + class azure.mgmt.deviceregistry.types.Messaging(TypedDict, total=False): + endpoints: dict[str, MessagingEndpoint] + + + class azure.mgmt.deviceregistry.types.MessagingEndpoint(TypedDict, total=False): + key "address": str + key "deviceAddress": str + key "endpointType": str + key "inboundCallerIdentity": ForwardRef('InboundCallerIdentity', module='types') + key "linkingError": ForwardRef('NamespaceLinkingError', module='types') + key "linkingState": Union[str, NamespaceLinkingStateValue] + key "provisioning": ForwardRef('MessagingEndpointProvisioning', module='types') + key "resourceId": str + address: str + deviceAddress: str + endpointType: str + inboundCallerIdentity: InboundCallerIdentity + linkingError: NamespaceLinkingError + linkingState: Union[str, NamespaceLinkingStateValue] + provisioning: MessagingEndpointProvisioning + resourceId: str + + + class azure.mgmt.deviceregistry.types.MessagingEndpointProvisioning(TypedDict, total=False): + key "allocationWeight": int + key "availability": Union[str, MessagingEndpointAvailability] + allocationWeight: int + availability: Union[str, MessagingEndpointAvailability] + + + class azure.mgmt.deviceregistry.types.MessagingEndpoints(TypedDict, total=False): + key "outbound": ForwardRef('OutboundEndpoints', module='types') + inbound: dict[str, InboundEndpoints] + outbound: OutboundEndpoints + + + class azure.mgmt.deviceregistry.types.MicrosoftCertificateAuthorityIssuer(TypedDict, total=False): + key "certificateAuthorityResourceId": Required[str] + key "issuerType": Required[Literal[CertificateAuthorityIssuerType.MICROSOFT]] + certificateAuthorityResourceId: str + issuerType: Literal[CertificateAuthorityIssuerType.MICROSOFT] + + + class azure.mgmt.deviceregistry.types.MqttDestinationConfiguration(TypedDict, total=False): + key "qos": Union[str, MqttDestinationQos] + key "retain": Union[str, TopicRetainType] + key "topic": Required[str] + key "ttl": int + qos: Union[str, MqttDestinationQos] + retain: Union[str, TopicRetainType] + topic: str + ttl: int + + + class azure.mgmt.deviceregistry.types.Namespace(TrackedResource): + key "id": str + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "location": Required[str] + key "name": str + key "properties": ForwardRef('NamespaceProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + identity: ManagedServiceIdentity + location: str + name: str + properties: NamespaceProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.deviceregistry.types.NamespaceAsset(TrackedResource): + key "extendedLocation": Required[ExtendedLocation] + key "id": str + key "location": Required[str] + key "name": str + key "properties": ForwardRef('NamespaceAssetProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + extendedLocation: ExtendedLocation + id: str + location: str + name: str + properties: NamespaceAssetProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.deviceregistry.types.NamespaceAssetExecuteActionRequest(TypedDict, total=False): + key "managementActionName": Required[str] + key "managementGroupName": Required[str] + managementActionName: str + managementGroupName: str + payload: dict[str, Any] + + + class azure.mgmt.deviceregistry.types.NamespaceAssetProperties(TypedDict, total=False): + key "defaultDatasetsConfiguration": str + key "defaultEventsConfiguration": str + key "defaultManagementGroupsConfiguration": str + key "defaultStreamsConfiguration": str + key "description": str + key "deviceRef": Required[DeviceRef] + key "displayName": str + key "documentationUri": str + key "enabled": bool + key "externalAssetId": str + key "hardwareRevision": str + key "lastTransitionTime": str + key "manufacturer": str + key "manufacturerUri": str + key "model": str + key "productCode": str + key "provisioningState": Union[str, ProvisioningState] + key "serialNumber": str + key "softwareRevision": str + key "status": ForwardRef('NamespaceAssetStatus', module='types') + key "uuid": str + key "version": int + assetTypeRefs: list[str] + attributes: dict[str, Any] + datasets: list[NamespaceDataset] + defaultDatasetsConfiguration: str + defaultDatasetsDestinations: list[DatasetDestination] + defaultEventsConfiguration: str + defaultEventsDestinations: list[EventDestination] + defaultManagementGroupsConfiguration: str + defaultStreamsConfiguration: str + defaultStreamsDestinations: list[StreamDestination] + description: str + deviceRef: DeviceRef + discoveredAssetRefs: list[str] + displayName: str + documentationUri: str + enabled: bool + eventGroups: list[NamespaceEventGroup] + externalAssetId: str + hardwareRevision: str + lastTransitionTime: str + managementGroups: list[ManagementGroup] + manufacturer: str + manufacturerUri: str + model: str + productCode: str + provisioningState: Union[str, ProvisioningState] + serialNumber: str + softwareRevision: str + status: NamespaceAssetStatus + streams: list[NamespaceStream] + uuid: str + version: int + + + class azure.mgmt.deviceregistry.types.NamespaceAssetStatus(TypedDict, total=False): + key "config": ForwardRef('StatusConfig', module='types') + key "healthState": ForwardRef('HealthState', module='types') + config: StatusConfig + datasets: list[NamespaceAssetStatusDataset] + eventGroups: list[NamespaceAssetStatusEventGroup] + healthState: HealthState + managementGroups: list[NamespaceAssetStatusManagementGroup] + streams: list[NamespaceAssetStatusStream] + + + class azure.mgmt.deviceregistry.types.NamespaceAssetStatusDataset(TypedDict, total=False): + key "error": ForwardRef('StatusError', module='types') + key "messageSchemaReference": ForwardRef('NamespaceMessageSchemaReference', module='types') + key "name": Required[str] + error: StatusError + messageSchemaReference: NamespaceMessageSchemaReference + name: str + + + class azure.mgmt.deviceregistry.types.NamespaceAssetStatusEvent(TypedDict, total=False): + key "error": ForwardRef('StatusError', module='types') + key "messageSchemaReference": ForwardRef('NamespaceMessageSchemaReference', module='types') + key "name": Required[str] + error: StatusError + messageSchemaReference: NamespaceMessageSchemaReference + name: str + + + class azure.mgmt.deviceregistry.types.NamespaceAssetStatusEventGroup(TypedDict, total=False): + key "name": Required[str] + events: list[NamespaceAssetStatusEvent] + name: str + + + class azure.mgmt.deviceregistry.types.NamespaceAssetStatusManagementAction(TypedDict, total=False): + key "error": ForwardRef('StatusError', module='types') + key "name": Required[str] + key "requestMessageSchemaReference": ForwardRef('NamespaceMessageSchemaReference', module='types') + key "responseMessageSchemaReference": ForwardRef('NamespaceMessageSchemaReference', module='types') + error: StatusError + name: str + requestMessageSchemaReference: NamespaceMessageSchemaReference + responseMessageSchemaReference: NamespaceMessageSchemaReference + + + class azure.mgmt.deviceregistry.types.NamespaceAssetStatusManagementGroup(TypedDict, total=False): + key "name": Required[str] + actions: list[NamespaceAssetStatusManagementAction] + name: str + + + class azure.mgmt.deviceregistry.types.NamespaceAssetStatusStream(TypedDict, total=False): + key "error": ForwardRef('StatusError', module='types') + key "messageSchemaReference": ForwardRef('NamespaceMessageSchemaReference', module='types') + key "name": Required[str] + error: StatusError + messageSchemaReference: NamespaceMessageSchemaReference + name: str + + + class azure.mgmt.deviceregistry.types.NamespaceAssetUpdate(TypedDict, total=False): + key "properties": ForwardRef('NamespaceAssetUpdateProperties', module='types') + properties: NamespaceAssetUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.deviceregistry.types.NamespaceAssetUpdateProperties(TypedDict, total=False): + key "defaultDatasetsConfiguration": str + key "defaultEventsConfiguration": str + key "defaultManagementGroupsConfiguration": str + key "defaultStreamsConfiguration": str + key "description": str + key "displayName": str + key "documentationUri": str + key "enabled": bool + key "hardwareRevision": str + key "manufacturer": str + key "manufacturerUri": str + key "model": str + key "productCode": str + key "serialNumber": str + key "softwareRevision": str + assetTypeRefs: list[str] + attributes: dict[str, Any] + datasets: list[NamespaceDataset] + defaultDatasetsConfiguration: str + defaultDatasetsDestinations: list[DatasetDestination] + defaultEventsConfiguration: str + defaultEventsDestinations: list[EventDestination] + defaultManagementGroupsConfiguration: str + defaultStreamsConfiguration: str + defaultStreamsDestinations: list[StreamDestination] + description: str + displayName: str + documentationUri: str + enabled: bool + eventGroups: list[NamespaceEventGroup] + hardwareRevision: str + managementGroups: list[ManagementGroup] + manufacturer: str + manufacturerUri: str + model: str + productCode: str + serialNumber: str + softwareRevision: str + streams: list[NamespaceStream] + + + class azure.mgmt.deviceregistry.types.NamespaceDataset(TypedDict, total=False): + key "dataSource": str + key "datasetConfiguration": str + key "name": Required[str] + key "typeRef": str + dataPoints: list[NamespaceDatasetDataPoint] + dataSource: str + datasetConfiguration: str + destinations: list[DatasetDestination] + name: str + typeRef: str + + + class azure.mgmt.deviceregistry.types.NamespaceDatasetDataPoint(TypedDict, total=False): + key "dataPointConfiguration": str + key "dataSource": Required[str] + key "name": Required[str] + key "typeRef": str + dataPointConfiguration: str + dataSource: str + name: str + typeRef: str + + + class azure.mgmt.deviceregistry.types.NamespaceDevice(TrackedResource): + key "etag": str + key "extendedLocation": ForwardRef('ExtendedLocation', module='types') + key "id": str + key "location": Required[str] + key "name": str + key "properties": ForwardRef('NamespaceDeviceProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + etag: str + extendedLocation: ExtendedLocation + id: str + location: str + name: str + properties: NamespaceDeviceProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.deviceregistry.types.NamespaceDeviceProperties(TypedDict, total=False): + key "discoveredDeviceRef": str + key "enabled": bool + key "endpoints": ForwardRef('MessagingEndpoints', module='types') + key "externalDeviceId": str + key "lastTransitionTime": str + key "manufacturer": str + key "model": str + key "operatingSystem": str + key "operatingSystemVersion": str + key "provisioningState": Union[str, ProvisioningState] + key "status": ForwardRef('DeviceStatus', module='types') + key "uuid": str + key "version": int + attributes: dict[str, Any] + discoveredDeviceRef: str + enabled: bool + endpoints: MessagingEndpoints + externalDeviceId: str + lastTransitionTime: str + manufacturer: str + model: str + operatingSystem: str + operatingSystemVersion: str + provisioningState: Union[str, ProvisioningState] + status: DeviceStatus + uuid: str + version: int + + + class azure.mgmt.deviceregistry.types.NamespaceDeviceUpdate(TypedDict, total=False): + key "properties": ForwardRef('NamespaceDeviceUpdateProperties', module='types') + properties: NamespaceDeviceUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.deviceregistry.types.NamespaceDeviceUpdateProperties(TypedDict, total=False): + key "enabled": bool + key "endpoints": ForwardRef('MessagingEndpoints', module='types') + key "operatingSystemVersion": str + attributes: dict[str, Any] + enabled: bool + endpoints: MessagingEndpoints + operatingSystemVersion: str + + + class azure.mgmt.deviceregistry.types.NamespaceDiscoveredAsset(TrackedResource): + key "extendedLocation": Required[ExtendedLocation] + key "id": str + key "location": Required[str] + key "name": str + key "properties": ForwardRef('NamespaceDiscoveredAssetProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + extendedLocation: ExtendedLocation + id: str + location: str + name: str + properties: NamespaceDiscoveredAssetProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.deviceregistry.types.NamespaceDiscoveredAssetProperties(TypedDict, total=False): + key "defaultDatasetsConfiguration": str + key "defaultEventsConfiguration": str + key "defaultManagementGroupsConfiguration": str + key "defaultStreamsConfiguration": str + key "description": str + key "deviceRef": Required[DeviceRef] + key "discoveryId": Required[str] + key "displayName": str + key "documentationUri": str + key "externalAssetId": str + key "hardwareRevision": str + key "manufacturer": str + key "manufacturerUri": str + key "model": str + key "productCode": str + key "provisioningState": Union[str, ProvisioningState] + key "serialNumber": str + key "softwareRevision": str + key "version": Required[int] + assetTypeRefs: list[str] + attributes: dict[str, Any] + datasets: list[NamespaceDiscoveredDataset] + defaultDatasetsConfiguration: str + defaultDatasetsDestinations: list[DatasetDestination] + defaultEventsConfiguration: str + defaultEventsDestinations: list[EventDestination] + defaultManagementGroupsConfiguration: str + defaultStreamsConfiguration: str + defaultStreamsDestinations: list[StreamDestination] + description: str + deviceRef: DeviceRef + discoveryId: str + displayName: str + documentationUri: str + eventGroups: list[NamespaceDiscoveredEventGroup] + externalAssetId: str + hardwareRevision: str + managementGroups: list[NamespaceDiscoveredManagementGroup] + manufacturer: str + manufacturerUri: str + model: str + productCode: str + provisioningState: Union[str, ProvisioningState] + serialNumber: str + softwareRevision: str + streams: list[NamespaceDiscoveredStream] + version: int + + + class azure.mgmt.deviceregistry.types.NamespaceDiscoveredAssetUpdate(TypedDict, total=False): + key "properties": ForwardRef('NamespaceDiscoveredAssetUpdateProperties', module='types') + properties: NamespaceDiscoveredAssetUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.deviceregistry.types.NamespaceDiscoveredAssetUpdateProperties(TypedDict, total=False): + key "defaultDatasetsConfiguration": str + key "defaultEventsConfiguration": str + key "defaultManagementGroupsConfiguration": str + key "defaultStreamsConfiguration": str + key "description": str + key "deviceRef": ForwardRef('DeviceRef', module='types') + key "discoveryId": str + key "displayName": str + key "documentationUri": str + key "hardwareRevision": str + key "manufacturer": str + key "manufacturerUri": str + key "model": str + key "productCode": str + key "serialNumber": str + key "softwareRevision": str + key "version": int + assetTypeRefs: list[str] + attributes: dict[str, Any] + datasets: list[NamespaceDiscoveredDataset] + defaultDatasetsConfiguration: str + defaultDatasetsDestinations: list[DatasetDestination] + defaultEventsConfiguration: str + defaultEventsDestinations: list[EventDestination] + defaultManagementGroupsConfiguration: str + defaultStreamsConfiguration: str + defaultStreamsDestinations: list[StreamDestination] + description: str + deviceRef: DeviceRef + discoveryId: str + displayName: str + documentationUri: str + eventGroups: list[NamespaceDiscoveredEventGroup] + hardwareRevision: str + managementGroups: list[NamespaceDiscoveredManagementGroup] + manufacturer: str + manufacturerUri: str + model: str + productCode: str + serialNumber: str + softwareRevision: str + streams: list[NamespaceDiscoveredStream] + version: int + + + class azure.mgmt.deviceregistry.types.NamespaceDiscoveredDataset(TypedDict, total=False): + key "dataSource": str + key "datasetConfiguration": str + key "lastUpdatedOn": str + key "name": Required[str] + key "typeRef": str + dataPoints: list[NamespaceDiscoveredDatasetDataPoint] + dataSource: str + datasetConfiguration: str + destinations: list[DatasetDestination] + lastUpdatedOn: str + name: str + typeRef: str + + + class azure.mgmt.deviceregistry.types.NamespaceDiscoveredDatasetDataPoint(TypedDict, total=False): + key "dataPointConfiguration": str + key "dataSource": Required[str] + key "lastUpdatedOn": str + key "name": Required[str] + key "typeRef": str + dataPointConfiguration: str + dataSource: str + lastUpdatedOn: str + name: str + typeRef: str + + + class azure.mgmt.deviceregistry.types.NamespaceDiscoveredDevice(TrackedResource): + key "extendedLocation": Required[ExtendedLocation] + key "id": str + key "location": Required[str] + key "name": str + key "properties": ForwardRef('NamespaceDiscoveredDeviceProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + extendedLocation: ExtendedLocation + id: str + location: str + name: str + properties: NamespaceDiscoveredDeviceProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.deviceregistry.types.NamespaceDiscoveredDeviceProperties(TypedDict, total=False): + key "discoveryId": Required[str] + key "endpoints": ForwardRef('DiscoveredMessagingEndpoints', module='types') + key "externalDeviceId": str + key "manufacturer": str + key "model": str + key "operatingSystem": str + key "operatingSystemVersion": str + key "provisioningState": Union[str, ProvisioningState] + key "version": Required[int] + attributes: dict[str, Any] + discoveryId: str + endpoints: DiscoveredMessagingEndpoints + externalDeviceId: str + manufacturer: str + model: str + operatingSystem: str + operatingSystemVersion: str + provisioningState: Union[str, ProvisioningState] + version: int + + + class azure.mgmt.deviceregistry.types.NamespaceDiscoveredDeviceUpdate(TypedDict, total=False): + key "properties": ForwardRef('NamespaceDiscoveredDeviceUpdateProperties', module='types') + properties: NamespaceDiscoveredDeviceUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.deviceregistry.types.NamespaceDiscoveredDeviceUpdateProperties(TypedDict, total=False): + key "discoveryId": str + key "endpoints": ForwardRef('DiscoveredMessagingEndpoints', module='types') + key "externalDeviceId": str + key "operatingSystemVersion": str + key "version": int + attributes: dict[str, Any] + discoveryId: str + endpoints: DiscoveredMessagingEndpoints + externalDeviceId: str + operatingSystemVersion: str + version: int + + + class azure.mgmt.deviceregistry.types.NamespaceDiscoveredEvent(TypedDict, total=False): + key "dataSource": str + key "eventConfiguration": str + key "lastUpdatedOn": str + key "name": Required[str] + key "typeRef": str + dataSource: str + destinations: list[EventDestination] + eventConfiguration: str + lastUpdatedOn: str + name: str + typeRef: str + + + class azure.mgmt.deviceregistry.types.NamespaceDiscoveredEventGroup(TypedDict, total=False): + key "dataSource": str + key "eventGroupConfiguration": str + key "name": Required[str] + key "typeRef": str + dataSource: str + defaultDestinations: list[EventDestination] + eventGroupConfiguration: str + events: list[NamespaceDiscoveredEvent] + name: str + typeRef: str + + + class azure.mgmt.deviceregistry.types.NamespaceDiscoveredManagementAction(TypedDict, total=False): + key "actionConfiguration": str + key "actionType": Union[str, NamespaceDiscoveredManagementActionType] + key "lastUpdatedOn": str + key "name": Required[str] + key "targetUri": Required[str] + key "timeoutInSeconds": int + key "topic": str + key "typeRef": str + actionConfiguration: str + actionType: Union[str, NamespaceDiscoveredManagementActionType] + lastUpdatedOn: str + name: str + targetUri: str + timeoutInSeconds: int + topic: str + typeRef: str + + + class azure.mgmt.deviceregistry.types.NamespaceDiscoveredManagementGroup(TypedDict, total=False): + key "dataSource": str + key "defaultTimeoutInSeconds": int + key "defaultTopic": str + key "lastUpdatedOn": str + key "managementGroupConfiguration": str + key "name": Required[str] + key "typeRef": str + actions: list[NamespaceDiscoveredManagementAction] + dataSource: str + defaultTimeoutInSeconds: int + defaultTopic: str + lastUpdatedOn: str + managementGroupConfiguration: str + name: str + typeRef: str + + + class azure.mgmt.deviceregistry.types.NamespaceDiscoveredStream(TypedDict, total=False): + key "lastUpdatedOn": str + key "name": Required[str] + key "streamConfiguration": str + key "typeRef": str + destinations: list[StreamDestination] + lastUpdatedOn: str + name: str + streamConfiguration: str + typeRef: str + + + class azure.mgmt.deviceregistry.types.NamespaceEvent(TypedDict, total=False): + key "dataSource": str + key "eventConfiguration": str + key "name": Required[str] + key "typeRef": str + dataSource: str + destinations: list[EventDestination] + eventConfiguration: str + name: str + typeRef: str + + + class azure.mgmt.deviceregistry.types.NamespaceEventGroup(TypedDict, total=False): + key "dataSource": str + key "eventGroupConfiguration": str + key "name": Required[str] + key "typeRef": str + dataSource: str + defaultDestinations: list[EventDestination] + eventGroupConfiguration: str + events: list[NamespaceEvent] + name: str + typeRef: str + + + class azure.mgmt.deviceregistry.types.NamespaceLinkingError(TypedDict, total=False): + key "code": str + key "message": str + code: str + message: str + + + class azure.mgmt.deviceregistry.types.NamespaceMessageSchemaReference(TypedDict, total=False): + key "schemaName": Required[str] + key "schemaRegistryNamespace": Required[str] + key "schemaVersion": Required[str] + schemaName: str + schemaRegistryNamespace: str + schemaVersion: str + + + class azure.mgmt.deviceregistry.types.NamespaceMigrateRequest(TypedDict, total=False): + key "scope": Union[str, Scope] + resourceIds: list[str] + scope: Union[str, Scope] + + + class azure.mgmt.deviceregistry.types.NamespaceProperties(TypedDict, total=False): + key "management": ForwardRef('Management', module='types') + key "messaging": ForwardRef('Messaging', module='types') + key "outboundIdentity": ForwardRef('OutboundIdentity', module='types') + key "provisioning": ForwardRef('NamespaceProvisioning', module='types') + key "provisioningState": Union[str, ProvisioningState] + key "uuid": str + management: Management + messaging: Messaging + outboundIdentity: OutboundIdentity + provisioning: NamespaceProvisioning + provisioningState: Union[str, ProvisioningState] + uuid: str + + + class azure.mgmt.deviceregistry.types.NamespaceProvisioning(TypedDict, total=False): + endpoints: dict[str, ProvisioningEndpoint] + + + class azure.mgmt.deviceregistry.types.NamespaceStream(TypedDict, total=False): + key "name": Required[str] + key "streamConfiguration": str + key "typeRef": str + destinations: list[StreamDestination] + name: str + streamConfiguration: str + typeRef: str + + + class azure.mgmt.deviceregistry.types.NamespaceUpdate(TypedDict, total=False): + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "properties": ForwardRef('NamespaceUpdateProperties', module='types') + identity: ManagedServiceIdentity + properties: NamespaceUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.deviceregistry.types.NamespaceUpdateProperties(TypedDict, total=False): + key "management": ForwardRef('Management', module='types') + key "messaging": ForwardRef('Messaging', module='types') + key "outboundIdentity": ForwardRef('OutboundIdentity', module='types') + key "provisioning": ForwardRef('NamespaceProvisioning', module='types') + management: Management + messaging: Messaging + outboundIdentity: OutboundIdentity + provisioning: NamespaceProvisioning + + + class azure.mgmt.deviceregistry.types.OptionalPropertiesCertificatePolicyConfiguration(TypedDict, total=False): + key "validityPeriodInDays": int + validityPeriodInDays: int + + + class azure.mgmt.deviceregistry.types.OutboundEndpoints(TypedDict, total=False): + key "assigned": Required[dict[str, DeviceMessagingEndpoint]] + assigned: dict[str, DeviceMessagingEndpoint] + unassigned: dict[str, DeviceMessagingEndpoint] + + + class azure.mgmt.deviceregistry.types.OutboundIdentity(TypedDict, total=False): + key "type": Required[Union[str, OutboundIdentityType]] + key "userAssignedIdentity": str + type: Union[str, OutboundIdentityType] + userAssignedIdentity: str + + + class azure.mgmt.deviceregistry.types.ProvisioningEndpoint(TypedDict, total=False): + key "endpointType": Required[Union[str, ProvisioningEndpointType]] + key "inboundCallerIdentity": Required[InboundCallerIdentity] + key "linkingError": ForwardRef('NamespaceLinkingError', module='types') + key "linkingState": Union[str, NamespaceLinkingStateValue] + key "resourceId": Required[str] + endpointType: Union[str, ProvisioningEndpointType] + inboundCallerIdentity: InboundCallerIdentity + linkingError: NamespaceLinkingError + linkingState: Union[str, NamespaceLinkingStateValue] + resourceId: str + + + class azure.mgmt.deviceregistry.types.ProxyResource(Resource): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.deviceregistry.types.RegistryDevice(TrackedResource): + key "etag": str + key "id": str + key "location": Required[str] + key "name": str + key "properties": ForwardRef('RegistryDeviceProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + etag: str + id: str + location: str + name: str + properties: RegistryDeviceProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.deviceregistry.types.RegistryDeviceProperties(TypedDict, total=False): + key "enablementState": Required[Union[str, RegistryDeviceEnablementState]] + key "externalDeviceId": str + key "hardwareRevision": str + key "manufacturer": str + key "model": str + key "provisioningState": Union[str, ProvisioningState] + key "softwareRevision": str + key "uuid": str + enablementState: Union[str, RegistryDeviceEnablementState] + externalDeviceId: str + hardwareRevision: str + manufacturer: str + model: str + provisioningState: Union[str, ProvisioningState] + softwareRevision: str + uuid: str + + + class azure.mgmt.deviceregistry.types.RegistryDeviceUpdate(TypedDict, total=False): + key "properties": ForwardRef('RegistryDeviceUpdateProperties', module='types') + properties: RegistryDeviceUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.deviceregistry.types.RegistryDeviceUpdateProperties(TypedDict, total=False): + key "enablementState": Union[str, RegistryDeviceEnablementState] + key "hardwareRevision": str + key "manufacturer": str + key "model": str + key "softwareRevision": str + enablementState: Union[str, RegistryDeviceEnablementState] + hardwareRevision: str + manufacturer: str + model: str + softwareRevision: str + + + class azure.mgmt.deviceregistry.types.Resource(TypedDict, total=False): + key "id": str + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + systemData: SystemData + type: str + + + class azure.mgmt.deviceregistry.types.RootCertificateAuthorityProperties(TypedDict, total=False): + key "certificateAuthorityType": Required[Literal[CertificateAuthorityType.ROOT]] + key "keyType": Required[Union[str, CertificateAuthorityKeyType]] + key "provisioningState": Union[str, ProvisioningState] + key "subject": str + key "uuid": str + key "validityNotAfter": str + key "validityNotBefore": str + certificateAuthorityType: Literal[CertificateAuthorityType.ROOT] + keyType: Union[str, CertificateAuthorityKeyType] + provisioningState: Union[str, ProvisioningState] + subject: str + uuid: str + validityNotAfter: str + validityNotBefore: str + + + class azure.mgmt.deviceregistry.types.Schema(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('SchemaProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: SchemaProperties + systemData: SystemData + type: str + + + class azure.mgmt.deviceregistry.types.SchemaProperties(TypedDict, total=False): + key "description": str + key "displayName": str + key "format": Required[Union[str, Format]] + key "provisioningState": Union[str, ProvisioningState] + key "schemaType": Required[Union[str, SchemaType]] + key "uuid": str + description: str + displayName: str + format: Union[str, Format] + provisioningState: Union[str, ProvisioningState] + schemaType: Union[str, SchemaType] + tags: dict[str, str] + uuid: str + + + class azure.mgmt.deviceregistry.types.SchemaRegistry(TrackedResource): + key "id": str + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "location": Required[str] + key "name": str + key "properties": ForwardRef('SchemaRegistryProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + identity: ManagedServiceIdentity + location: str + name: str + properties: SchemaRegistryProperties + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.deviceregistry.types.SchemaRegistryProperties(TypedDict, total=False): + key "description": str + key "displayName": str + key "namespace": Required[str] + key "outboundIdentity": ForwardRef('OutboundIdentity', module='types') + key "provisioningState": Union[str, ProvisioningState] + key "storageAccountContainerUrl": Required[str] + key "uuid": str + description: str + displayName: str + namespace: str + outboundIdentity: OutboundIdentity + provisioningState: Union[str, ProvisioningState] + storageAccountContainerUrl: str + uuid: str + + + class azure.mgmt.deviceregistry.types.SchemaRegistryUpdate(TypedDict, total=False): + key "identity": ForwardRef('ManagedServiceIdentity', module='types') + key "properties": ForwardRef('SchemaRegistryUpdateProperties', module='types') + identity: ManagedServiceIdentity + properties: SchemaRegistryUpdateProperties + tags: dict[str, str] + + + class azure.mgmt.deviceregistry.types.SchemaRegistryUpdateProperties(TypedDict, total=False): + key "description": str + key "displayName": str + key "outboundIdentity": ForwardRef('OutboundIdentity', module='types') + description: str + displayName: str + outboundIdentity: OutboundIdentity + + + class azure.mgmt.deviceregistry.types.SchemaVersion(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('SchemaVersionProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: SchemaVersionProperties + systemData: SystemData + type: str + + + class azure.mgmt.deviceregistry.types.SchemaVersionProperties(TypedDict, total=False): + key "description": str + key "hash": str + key "provisioningState": Union[str, ProvisioningState] + key "schemaContent": Required[str] + key "uuid": str + description: str + hash: str + provisioningState: Union[str, ProvisioningState] + schemaContent: str + uuid: str + + + class azure.mgmt.deviceregistry.types.StatusConfig(TypedDict, total=False): + key "error": ForwardRef('StatusError', module='types') + key "lastTransitionTime": str + key "version": int + error: StatusError + lastTransitionTime: str + version: int + + + class azure.mgmt.deviceregistry.types.StatusError(TypedDict, total=False): + key "code": str + key "message": str + code: str + details: list[ErrorDetails] + message: str + + + class azure.mgmt.deviceregistry.types.StorageDestinationConfiguration(TypedDict, total=False): + key "path": Required[str] + path: str + + + class azure.mgmt.deviceregistry.types.StreamDestinationTarget(str, Enum, metaclass=CaseInsensitiveEnumMeta): + MQTT = "Mqtt" + STORAGE = "Storage" + + + class azure.mgmt.deviceregistry.types.StreamMqttDestination(TypedDict, total=False): + key "configuration": Required[MqttDestinationConfiguration] + key "target": Required[Literal[StreamDestinationTarget.MQTT]] + configuration: MqttDestinationConfiguration + target: Literal[StreamDestinationTarget.MQTT] + + + class azure.mgmt.deviceregistry.types.StreamStorageDestination(TypedDict, total=False): + key "configuration": Required[StorageDestinationConfiguration] + key "target": Required[Literal[StreamDestinationTarget.STORAGE]] + configuration: StorageDestinationConfiguration + target: Literal[StreamDestinationTarget.STORAGE] + + + class azure.mgmt.deviceregistry.types.SystemData(TypedDict, total=False): + key "createdAt": str + key "createdBy": str + key "createdByType": Union[str, CreatedByType] + key "lastModifiedAt": str + key "lastModifiedBy": str + key "lastModifiedByType": Union[str, CreatedByType] + createdAt: str + createdBy: str + createdByType: Union[str, CreatedByType] + lastModifiedAt: str + lastModifiedBy: str + lastModifiedByType: Union[str, CreatedByType] + + + class azure.mgmt.deviceregistry.types.Topic(TypedDict, total=False): + key "path": Required[str] + key "retain": Union[str, TopicRetainType] + path: str + retain: Union[str, TopicRetainType] + + + class azure.mgmt.deviceregistry.types.TrackedResource(Resource): + key "id": str + key "location": Required[str] + key "name": str + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.deviceregistry.types.TrustSettings(TypedDict, total=False): + key "trustList": str + trustList: str + + + class azure.mgmt.deviceregistry.types.UserAssignedIdentity(TypedDict, total=False): + key "clientId": str + key "principalId": str + clientId: str + principalId: str + + + class azure.mgmt.deviceregistry.types.UsernamePasswordCredentials(TypedDict, total=False): + key "passwordSecretName": Required[str] + key "usernameSecretName": Required[str] + passwordSecretName: str + usernameSecretName: str + + + class azure.mgmt.deviceregistry.types.X509CertificateCredentials(TypedDict, total=False): + key "certificateSecretName": Required[str] + key "intermediateCertificatesSecretName": str + key "keySecretName": str + certificateSecretName: str + intermediateCertificatesSecretName: str + keySecretName: str + + + class azure.mgmt.deviceregistry.types.X509Credentials(TypedDict, total=False): + key "certificateSecretName": Required[str] + certificateSecretName: str + + +``` \ No newline at end of file diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/api.metadata.yml b/sdk/deviceregistry/azure-mgmt-deviceregistry/api.metadata.yml new file mode 100644 index 000000000000..a0fc59faf7fe --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/api.metadata.yml @@ -0,0 +1,4 @@ +apiMdSha256: 718aab5542016601eeeaedc9e0590fc53834702db3a434c4ca0d0a0bda949710 +packageVersion: 2.0.0 +parserVersion: 0.3.31 +pythonVersion: 3.13.15 diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/apiview-properties.json b/sdk/deviceregistry/azure-mgmt-deviceregistry/apiview-properties.json index cbaad59b3ec7..a54f3f4f56cf 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/apiview-properties.json +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/apiview-properties.json @@ -1,7 +1,7 @@ { "CrossLanguagePackageId": "Microsoft.DeviceRegistry", "CrossLanguageDefinitionId": { - "azure.mgmt.deviceregistry.models.ActivateBringYourOwnRootRequest": "Microsoft.DeviceRegistry.ActivateBringYourOwnRootRequest", + "azure.mgmt.deviceregistry.models.ActivateCertificateAuthorityRequest": "Microsoft.DeviceRegistry.ActivateCertificateAuthorityRequest", "azure.mgmt.deviceregistry.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", "azure.mgmt.deviceregistry.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", "azure.mgmt.deviceregistry.models.Asset": "Microsoft.DeviceRegistry.Asset", @@ -22,13 +22,16 @@ "azure.mgmt.deviceregistry.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", "azure.mgmt.deviceregistry.models.BillingContainer": "Microsoft.DeviceRegistry.BillingContainer", "azure.mgmt.deviceregistry.models.BillingContainerProperties": "Microsoft.DeviceRegistry.BillingContainerProperties", - "azure.mgmt.deviceregistry.models.BringYourOwnRoot": "Microsoft.DeviceRegistry.BringYourOwnRoot", "azure.mgmt.deviceregistry.models.BrokerStateStoreDestinationConfiguration": "Microsoft.DeviceRegistry.BrokerStateStoreDestinationConfiguration", - "azure.mgmt.deviceregistry.models.CertificateAuthorityConfiguration": "Microsoft.DeviceRegistry.CertificateAuthorityConfiguration", - "azure.mgmt.deviceregistry.models.CertificateConfiguration": "Microsoft.DeviceRegistry.CertificateConfiguration", - "azure.mgmt.deviceregistry.models.Credential": "Microsoft.DeviceRegistry.Credential", - "azure.mgmt.deviceregistry.models.CredentialProperties": "Microsoft.DeviceRegistry.CredentialProperties", - "azure.mgmt.deviceregistry.models.CredentialUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.deviceregistry.models.CertificateAuthority": "Microsoft.DeviceRegistry.CertificateAuthority", + "azure.mgmt.deviceregistry.models.CertificateAuthorityIssuer": "Microsoft.DeviceRegistry.CertificateAuthorityIssuer", + "azure.mgmt.deviceregistry.models.CertificateAuthorityProperties": "Microsoft.DeviceRegistry.CertificateAuthorityProperties", + "azure.mgmt.deviceregistry.models.CertificateAuthorityUpdate": "Microsoft.DeviceRegistry.CertificateAuthorityUpdate", + "azure.mgmt.deviceregistry.models.CertificatePolicy": "Microsoft.DeviceRegistry.CertificatePolicy", + "azure.mgmt.deviceregistry.models.CertificatePolicyConfiguration": "Microsoft.DeviceRegistry.CertificatePolicyConfiguration", + "azure.mgmt.deviceregistry.models.CertificatePolicyProperties": "Microsoft.DeviceRegistry.CertificatePolicyProperties", + "azure.mgmt.deviceregistry.models.CertificatePolicyUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.deviceregistry.models.CertificatePolicyUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", "azure.mgmt.deviceregistry.models.DataPointBase": "Microsoft.DeviceRegistry.DataPointBase", "azure.mgmt.deviceregistry.models.DataPoint": "Microsoft.DeviceRegistry.DataPoint", "azure.mgmt.deviceregistry.models.Dataset": "Microsoft.DeviceRegistry.Dataset", @@ -36,8 +39,6 @@ "azure.mgmt.deviceregistry.models.DatasetBrokerStateStoreDestination": "Microsoft.DeviceRegistry.DatasetBrokerStateStoreDestination", "azure.mgmt.deviceregistry.models.DatasetMqttDestination": "Microsoft.DeviceRegistry.DatasetMqttDestination", "azure.mgmt.deviceregistry.models.DatasetStorageDestination": "Microsoft.DeviceRegistry.DatasetStorageDestination", - "azure.mgmt.deviceregistry.models.DeviceCredentialPolicy": "Microsoft.DeviceRegistry.DeviceCredentialPolicy", - "azure.mgmt.deviceregistry.models.DeviceCredentialsRevokeRequest": "Microsoft.DeviceRegistry.DeviceCredentialsRevokeRequest", "azure.mgmt.deviceregistry.models.DeviceMessagingEndpoint": "Microsoft.DeviceRegistry.DeviceMessagingEndpoint", "azure.mgmt.deviceregistry.models.DeviceRef": "Microsoft.DeviceRegistry.DeviceRef", "azure.mgmt.deviceregistry.models.DeviceStatus": "Microsoft.DeviceRegistry.DeviceStatus", @@ -56,18 +57,27 @@ "azure.mgmt.deviceregistry.models.EventMqttDestination": "Microsoft.DeviceRegistry.EventMqttDestination", "azure.mgmt.deviceregistry.models.EventStorageDestination": "Microsoft.DeviceRegistry.EventStorageDestination", "azure.mgmt.deviceregistry.models.ExtendedLocation": "Microsoft.DeviceRegistry.ExtendedLocation", + "azure.mgmt.deviceregistry.models.ExternalCertificateAuthorityIssuer": "Microsoft.DeviceRegistry.ExternalCertificateAuthorityIssuer", + "azure.mgmt.deviceregistry.models.HealthState": "Microsoft.DeviceRegistry.HealthState", "azure.mgmt.deviceregistry.models.HostAuthentication": "Microsoft.DeviceRegistry.HostAuthentication", + "azure.mgmt.deviceregistry.models.InboundCallerIdentity": "Microsoft.DeviceRegistry.InboundCallerIdentity", "azure.mgmt.deviceregistry.models.InboundEndpoints": "Microsoft.DeviceRegistry.InboundEndpoints", - "azure.mgmt.deviceregistry.models.LeafCertificateConfiguration": "Microsoft.DeviceRegistry.LeafCertificateConfiguration", + "azure.mgmt.deviceregistry.models.IntermediateCertificateAuthorityProperties": "Microsoft.DeviceRegistry.IntermediateCertificateAuthorityProperties", + "azure.mgmt.deviceregistry.models.ManagedServiceIdentity": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "azure.mgmt.deviceregistry.models.Management": "Microsoft.DeviceRegistry.Management", "azure.mgmt.deviceregistry.models.ManagementAction": "Microsoft.DeviceRegistry.ManagementAction", + "azure.mgmt.deviceregistry.models.ManagementEndpoint": "Microsoft.DeviceRegistry.ManagementEndpoint", "azure.mgmt.deviceregistry.models.ManagementGroup": "Microsoft.DeviceRegistry.ManagementGroup", "azure.mgmt.deviceregistry.models.MessageSchemaReference": "Microsoft.DeviceRegistry.MessageSchemaReference", "azure.mgmt.deviceregistry.models.Messaging": "Microsoft.DeviceRegistry.Messaging", "azure.mgmt.deviceregistry.models.MessagingEndpoint": "Microsoft.DeviceRegistry.MessagingEndpoint", + "azure.mgmt.deviceregistry.models.MessagingEndpointProvisioning": "Microsoft.DeviceRegistry.MessagingEndpointProvisioning", "azure.mgmt.deviceregistry.models.MessagingEndpoints": "Microsoft.DeviceRegistry.MessagingEndpoints", + "azure.mgmt.deviceregistry.models.MicrosoftCertificateAuthorityIssuer": "Microsoft.DeviceRegistry.MicrosoftCertificateAuthorityIssuer", "azure.mgmt.deviceregistry.models.MqttDestinationConfiguration": "Microsoft.DeviceRegistry.MqttDestinationConfiguration", "azure.mgmt.deviceregistry.models.Namespace": "Microsoft.DeviceRegistry.Namespace", "azure.mgmt.deviceregistry.models.NamespaceAsset": "Microsoft.DeviceRegistry.NamespaceAsset", + "azure.mgmt.deviceregistry.models.NamespaceAssetExecuteActionRequest": "Microsoft.DeviceRegistry.NamespaceAssetExecuteActionRequest", "azure.mgmt.deviceregistry.models.NamespaceAssetProperties": "Microsoft.DeviceRegistry.NamespaceAssetProperties", "azure.mgmt.deviceregistry.models.NamespaceAssetStatus": "Microsoft.DeviceRegistry.NamespaceAssetStatus", "azure.mgmt.deviceregistry.models.NamespaceAssetStatusDataset": "Microsoft.DeviceRegistry.NamespaceAssetStatusDataset", @@ -101,20 +111,26 @@ "azure.mgmt.deviceregistry.models.NamespaceDiscoveredStream": "Microsoft.DeviceRegistry.NamespaceDiscoveredStream", "azure.mgmt.deviceregistry.models.NamespaceEvent": "Microsoft.DeviceRegistry.NamespaceEvent", "azure.mgmt.deviceregistry.models.NamespaceEventGroup": "Microsoft.DeviceRegistry.NamespaceEventGroup", + "azure.mgmt.deviceregistry.models.NamespaceLinkingError": "Microsoft.DeviceRegistry.NamespaceLinkingError", "azure.mgmt.deviceregistry.models.NamespaceMessageSchemaReference": "Microsoft.DeviceRegistry.NamespaceMessageSchemaReference", "azure.mgmt.deviceregistry.models.NamespaceMigrateRequest": "Microsoft.DeviceRegistry.NamespaceMigrateRequest", "azure.mgmt.deviceregistry.models.NamespaceProperties": "Microsoft.DeviceRegistry.NamespaceProperties", + "azure.mgmt.deviceregistry.models.NamespaceProvisioning": "Microsoft.DeviceRegistry.NamespaceProvisioning", "azure.mgmt.deviceregistry.models.NamespaceStream": "Microsoft.DeviceRegistry.NamespaceStream", "azure.mgmt.deviceregistry.models.NamespaceUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", "azure.mgmt.deviceregistry.models.NamespaceUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", "azure.mgmt.deviceregistry.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", "azure.mgmt.deviceregistry.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", "azure.mgmt.deviceregistry.models.OperationStatusResult": "Azure.ResourceManager.CommonTypes.OperationStatusResult", + "azure.mgmt.deviceregistry.models.OptionalPropertiesCertificatePolicyConfiguration": "TypeSpec.OptionalProperties", "azure.mgmt.deviceregistry.models.OutboundEndpoints": "Microsoft.DeviceRegistry.OutboundEndpoints", - "azure.mgmt.deviceregistry.models.Policy": "Microsoft.DeviceRegistry.Policy", - "azure.mgmt.deviceregistry.models.PolicyProperties": "Microsoft.DeviceRegistry.PolicyProperties", - "azure.mgmt.deviceregistry.models.PolicyUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", - "azure.mgmt.deviceregistry.models.PolicyUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.deviceregistry.models.OutboundIdentity": "Microsoft.DeviceRegistry.OutboundIdentity", + "azure.mgmt.deviceregistry.models.ProvisioningEndpoint": "Microsoft.DeviceRegistry.ProvisioningEndpoint", + "azure.mgmt.deviceregistry.models.RegistryDevice": "Microsoft.DeviceRegistry.RegistryDevice", + "azure.mgmt.deviceregistry.models.RegistryDeviceProperties": "Microsoft.DeviceRegistry.RegistryDeviceProperties", + "azure.mgmt.deviceregistry.models.RegistryDeviceUpdate": "Azure.ResourceManager.Foundations.ResourceUpdateModel", + "azure.mgmt.deviceregistry.models.RegistryDeviceUpdateProperties": "Azure.ResourceManager.Foundations.ResourceUpdateModelProperties", + "azure.mgmt.deviceregistry.models.RootCertificateAuthorityProperties": "Microsoft.DeviceRegistry.RootCertificateAuthorityProperties", "azure.mgmt.deviceregistry.models.Schema": "Microsoft.DeviceRegistry.Schema", "azure.mgmt.deviceregistry.models.SchemaProperties": "Microsoft.DeviceRegistry.SchemaProperties", "azure.mgmt.deviceregistry.models.SchemaRegistry": "Microsoft.DeviceRegistry.SchemaRegistry", @@ -129,10 +145,10 @@ "azure.mgmt.deviceregistry.models.StreamDestination": "Microsoft.DeviceRegistry.StreamDestination", "azure.mgmt.deviceregistry.models.StreamMqttDestination": "Microsoft.DeviceRegistry.StreamMqttDestination", "azure.mgmt.deviceregistry.models.StreamStorageDestination": "Microsoft.DeviceRegistry.StreamStorageDestination", - "azure.mgmt.deviceregistry.models.SystemAssignedServiceIdentity": "Azure.ResourceManager.CommonTypes.SystemAssignedServiceIdentity", "azure.mgmt.deviceregistry.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", "azure.mgmt.deviceregistry.models.Topic": "Microsoft.DeviceRegistry.Topic", "azure.mgmt.deviceregistry.models.TrustSettings": "Microsoft.DeviceRegistry.TrustSettings", + "azure.mgmt.deviceregistry.models.UserAssignedIdentity": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", "azure.mgmt.deviceregistry.models.UsernamePasswordCredentials": "Microsoft.DeviceRegistry.UsernamePasswordCredentials", "azure.mgmt.deviceregistry.models.X509CertificateCredentials": "Microsoft.DeviceRegistry.X509CertificateCredentials", "azure.mgmt.deviceregistry.models.X509Credentials": "Microsoft.DeviceRegistry.X509Credentials", @@ -144,22 +160,33 @@ "azure.mgmt.deviceregistry.models.EventObservabilityMode": "Microsoft.DeviceRegistry.EventObservabilityMode", "azure.mgmt.deviceregistry.models.ProvisioningState": "Microsoft.DeviceRegistry.ProvisioningState", "azure.mgmt.deviceregistry.models.AuthenticationMethod": "Microsoft.DeviceRegistry.AuthenticationMethod", - "azure.mgmt.deviceregistry.models.SystemAssignedServiceIdentityType": "Azure.ResourceManager.CommonTypes.SystemAssignedServiceIdentityType", + "azure.mgmt.deviceregistry.models.InboundCallerIdentityType": "Microsoft.DeviceRegistry.InboundCallerIdentityType", + "azure.mgmt.deviceregistry.models.NamespaceLinkingStateValue": "Microsoft.DeviceRegistry.NamespaceLinkingStateValue", + "azure.mgmt.deviceregistry.models.MessagingEndpointAvailability": "Microsoft.DeviceRegistry.MessagingEndpointAvailability", + "azure.mgmt.deviceregistry.models.ProvisioningEndpointType": "Microsoft.DeviceRegistry.ProvisioningEndpointType", + "azure.mgmt.deviceregistry.models.OutboundIdentityType": "Microsoft.DeviceRegistry.OutboundIdentityType", + "azure.mgmt.deviceregistry.models.ManagedServiceIdentityType": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", "azure.mgmt.deviceregistry.models.Scope": "Microsoft.DeviceRegistry.Scope", - "azure.mgmt.deviceregistry.models.SupportedKeyType": "Microsoft.DeviceRegistry.SupportedKeyType", - "azure.mgmt.deviceregistry.models.BringYourOwnRootStatus": "Microsoft.DeviceRegistry.BringYourOwnRootStatus", "azure.mgmt.deviceregistry.models.DatasetDestinationTarget": "Microsoft.DeviceRegistry.DatasetDestinationTarget", "azure.mgmt.deviceregistry.models.MqttDestinationQos": "Microsoft.DeviceRegistry.MqttDestinationQos", "azure.mgmt.deviceregistry.models.EventDestinationTarget": "Microsoft.DeviceRegistry.EventDestinationTarget", "azure.mgmt.deviceregistry.models.StreamDestinationTarget": "Microsoft.DeviceRegistry.StreamDestinationTarget", "azure.mgmt.deviceregistry.models.ManagementActionType": "Microsoft.DeviceRegistry.ManagementActionType", + "azure.mgmt.deviceregistry.models.HealthStatus": "Microsoft.DeviceRegistry.HealthStatus", "azure.mgmt.deviceregistry.models.NamespaceDiscoveredManagementActionType": "Microsoft.DeviceRegistry.NamespaceDiscoveredManagementActionType", "azure.mgmt.deviceregistry.models.Format": "Microsoft.DeviceRegistry.Format", "azure.mgmt.deviceregistry.models.SchemaType": "Microsoft.DeviceRegistry.SchemaType", + "azure.mgmt.deviceregistry.models.CertificateAuthorityType": "Microsoft.DeviceRegistry.CertificateAuthorityType", + "azure.mgmt.deviceregistry.models.CertificateAuthorityKeyType": "Microsoft.DeviceRegistry.CertificateAuthorityKeyType", + "azure.mgmt.deviceregistry.models.CertificateAuthorityIssuerType": "Microsoft.DeviceRegistry.CertificateAuthorityIssuerType", + "azure.mgmt.deviceregistry.models.CertificateAuthorityStatus": "Microsoft.DeviceRegistry.CertificateAuthorityStatus", + "azure.mgmt.deviceregistry.models.RegistryDeviceEnablementState": "Microsoft.DeviceRegistry.RegistryDeviceEnablementState", "azure.mgmt.deviceregistry.operations.Operations.list": "Azure.ResourceManager.Operations.list", "azure.mgmt.deviceregistry.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", "azure.mgmt.deviceregistry.operations.OperationStatusOperations.get": "Microsoft.DeviceRegistry.OperationStatus.get", "azure.mgmt.deviceregistry.aio.operations.OperationStatusOperations.get": "Microsoft.DeviceRegistry.OperationStatus.get", + "azure.mgmt.deviceregistry.operations.AsyncOperationStatusOperations.get": "Microsoft.DeviceRegistry.AsyncOperationStatus.get", + "azure.mgmt.deviceregistry.aio.operations.AsyncOperationStatusOperations.get": "Microsoft.DeviceRegistry.AsyncOperationStatus.get", "azure.mgmt.deviceregistry.operations.AssetsOperations.get": "Microsoft.DeviceRegistry.Assets.get", "azure.mgmt.deviceregistry.aio.operations.AssetsOperations.get": "Microsoft.DeviceRegistry.Assets.get", "azure.mgmt.deviceregistry.operations.AssetsOperations.begin_create_or_replace": "Microsoft.DeviceRegistry.Assets.createOrReplace", @@ -202,32 +229,6 @@ "azure.mgmt.deviceregistry.aio.operations.NamespacesOperations.list_by_subscription": "Microsoft.DeviceRegistry.Namespaces.listBySubscription", "azure.mgmt.deviceregistry.operations.NamespacesOperations.begin_migrate": "Microsoft.DeviceRegistry.Namespaces.migrate", "azure.mgmt.deviceregistry.aio.operations.NamespacesOperations.begin_migrate": "Microsoft.DeviceRegistry.Namespaces.migrate", - "azure.mgmt.deviceregistry.operations.CredentialsOperations.get": "Microsoft.DeviceRegistry.Credentials.get", - "azure.mgmt.deviceregistry.aio.operations.CredentialsOperations.get": "Microsoft.DeviceRegistry.Credentials.get", - "azure.mgmt.deviceregistry.operations.CredentialsOperations.begin_create_or_update": "Microsoft.DeviceRegistry.Credentials.createOrUpdate", - "azure.mgmt.deviceregistry.aio.operations.CredentialsOperations.begin_create_or_update": "Microsoft.DeviceRegistry.Credentials.createOrUpdate", - "azure.mgmt.deviceregistry.operations.CredentialsOperations.begin_delete": "Microsoft.DeviceRegistry.Credentials.delete", - "azure.mgmt.deviceregistry.aio.operations.CredentialsOperations.begin_delete": "Microsoft.DeviceRegistry.Credentials.delete", - "azure.mgmt.deviceregistry.operations.CredentialsOperations.begin_update": "Microsoft.DeviceRegistry.Credentials.update", - "azure.mgmt.deviceregistry.aio.operations.CredentialsOperations.begin_update": "Microsoft.DeviceRegistry.Credentials.update", - "azure.mgmt.deviceregistry.operations.CredentialsOperations.list_by_resource_group": "Microsoft.DeviceRegistry.Credentials.listByResourceGroup", - "azure.mgmt.deviceregistry.aio.operations.CredentialsOperations.list_by_resource_group": "Microsoft.DeviceRegistry.Credentials.listByResourceGroup", - "azure.mgmt.deviceregistry.operations.CredentialsOperations.begin_synchronize": "Microsoft.DeviceRegistry.Credentials.synchronize", - "azure.mgmt.deviceregistry.aio.operations.CredentialsOperations.begin_synchronize": "Microsoft.DeviceRegistry.Credentials.synchronize", - "azure.mgmt.deviceregistry.operations.PoliciesOperations.get": "Microsoft.DeviceRegistry.Policies.get", - "azure.mgmt.deviceregistry.aio.operations.PoliciesOperations.get": "Microsoft.DeviceRegistry.Policies.get", - "azure.mgmt.deviceregistry.operations.PoliciesOperations.begin_create_or_update": "Microsoft.DeviceRegistry.Policies.createOrUpdate", - "azure.mgmt.deviceregistry.aio.operations.PoliciesOperations.begin_create_or_update": "Microsoft.DeviceRegistry.Policies.createOrUpdate", - "azure.mgmt.deviceregistry.operations.PoliciesOperations.begin_delete": "Microsoft.DeviceRegistry.Policies.delete", - "azure.mgmt.deviceregistry.aio.operations.PoliciesOperations.begin_delete": "Microsoft.DeviceRegistry.Policies.delete", - "azure.mgmt.deviceregistry.operations.PoliciesOperations.begin_update": "Microsoft.DeviceRegistry.Policies.update", - "azure.mgmt.deviceregistry.aio.operations.PoliciesOperations.begin_update": "Microsoft.DeviceRegistry.Policies.update", - "azure.mgmt.deviceregistry.operations.PoliciesOperations.list_by_resource_group": "Microsoft.DeviceRegistry.Policies.listByResourceGroup", - "azure.mgmt.deviceregistry.aio.operations.PoliciesOperations.list_by_resource_group": "Microsoft.DeviceRegistry.Policies.listByResourceGroup", - "azure.mgmt.deviceregistry.operations.PoliciesOperations.begin_revoke_issuer": "Microsoft.DeviceRegistry.Policies.revokeIssuer", - "azure.mgmt.deviceregistry.aio.operations.PoliciesOperations.begin_revoke_issuer": "Microsoft.DeviceRegistry.Policies.revokeIssuer", - "azure.mgmt.deviceregistry.operations.PoliciesOperations.begin_activate_bring_your_own_root": "Microsoft.DeviceRegistry.Policies.activateBringYourOwnRoot", - "azure.mgmt.deviceregistry.aio.operations.PoliciesOperations.begin_activate_bring_your_own_root": "Microsoft.DeviceRegistry.Policies.activateBringYourOwnRoot", "azure.mgmt.deviceregistry.operations.NamespaceAssetsOperations.get": "Microsoft.DeviceRegistry.NamespaceAssets.get", "azure.mgmt.deviceregistry.aio.operations.NamespaceAssetsOperations.get": "Microsoft.DeviceRegistry.NamespaceAssets.get", "azure.mgmt.deviceregistry.operations.NamespaceAssetsOperations.begin_create_or_replace": "Microsoft.DeviceRegistry.NamespaceAssets.createOrReplace", @@ -236,8 +237,10 @@ "azure.mgmt.deviceregistry.aio.operations.NamespaceAssetsOperations.begin_update": "Microsoft.DeviceRegistry.NamespaceAssets.update", "azure.mgmt.deviceregistry.operations.NamespaceAssetsOperations.begin_delete": "Microsoft.DeviceRegistry.NamespaceAssets.delete", "azure.mgmt.deviceregistry.aio.operations.NamespaceAssetsOperations.begin_delete": "Microsoft.DeviceRegistry.NamespaceAssets.delete", - "azure.mgmt.deviceregistry.operations.NamespaceAssetsOperations.list_by_resource_group": "Microsoft.DeviceRegistry.NamespaceAssets.listByResourceGroup", - "azure.mgmt.deviceregistry.aio.operations.NamespaceAssetsOperations.list_by_resource_group": "Microsoft.DeviceRegistry.NamespaceAssets.listByResourceGroup", + "azure.mgmt.deviceregistry.operations.NamespaceAssetsOperations.list_by_namespace": "Microsoft.DeviceRegistry.NamespaceAssets.listByNamespace", + "azure.mgmt.deviceregistry.aio.operations.NamespaceAssetsOperations.list_by_namespace": "Microsoft.DeviceRegistry.NamespaceAssets.listByNamespace", + "azure.mgmt.deviceregistry.operations.NamespaceAssetsOperations.begin_execute_action": "Microsoft.DeviceRegistry.NamespaceAssets.executeAction", + "azure.mgmt.deviceregistry.aio.operations.NamespaceAssetsOperations.begin_execute_action": "Microsoft.DeviceRegistry.NamespaceAssets.executeAction", "azure.mgmt.deviceregistry.operations.NamespaceDevicesOperations.get": "Microsoft.DeviceRegistry.NamespaceDevices.get", "azure.mgmt.deviceregistry.aio.operations.NamespaceDevicesOperations.get": "Microsoft.DeviceRegistry.NamespaceDevices.get", "azure.mgmt.deviceregistry.operations.NamespaceDevicesOperations.begin_create_or_replace": "Microsoft.DeviceRegistry.NamespaceDevices.createOrReplace", @@ -246,10 +249,8 @@ "azure.mgmt.deviceregistry.aio.operations.NamespaceDevicesOperations.begin_update": "Microsoft.DeviceRegistry.NamespaceDevices.update", "azure.mgmt.deviceregistry.operations.NamespaceDevicesOperations.begin_delete": "Microsoft.DeviceRegistry.NamespaceDevices.delete", "azure.mgmt.deviceregistry.aio.operations.NamespaceDevicesOperations.begin_delete": "Microsoft.DeviceRegistry.NamespaceDevices.delete", - "azure.mgmt.deviceregistry.operations.NamespaceDevicesOperations.list_by_resource_group": "Microsoft.DeviceRegistry.NamespaceDevices.listByResourceGroup", - "azure.mgmt.deviceregistry.aio.operations.NamespaceDevicesOperations.list_by_resource_group": "Microsoft.DeviceRegistry.NamespaceDevices.listByResourceGroup", - "azure.mgmt.deviceregistry.operations.NamespaceDevicesOperations.begin_revoke": "Microsoft.DeviceRegistry.NamespaceDevices.revoke", - "azure.mgmt.deviceregistry.aio.operations.NamespaceDevicesOperations.begin_revoke": "Microsoft.DeviceRegistry.NamespaceDevices.revoke", + "azure.mgmt.deviceregistry.operations.NamespaceDevicesOperations.list_by_namespace": "Microsoft.DeviceRegistry.NamespaceDevices.listByNamespace", + "azure.mgmt.deviceregistry.aio.operations.NamespaceDevicesOperations.list_by_namespace": "Microsoft.DeviceRegistry.NamespaceDevices.listByNamespace", "azure.mgmt.deviceregistry.operations.NamespaceDiscoveredAssetsOperations.get": "Microsoft.DeviceRegistry.NamespaceDiscoveredAssets.get", "azure.mgmt.deviceregistry.aio.operations.NamespaceDiscoveredAssetsOperations.get": "Microsoft.DeviceRegistry.NamespaceDiscoveredAssets.get", "azure.mgmt.deviceregistry.operations.NamespaceDiscoveredAssetsOperations.begin_create_or_replace": "Microsoft.DeviceRegistry.NamespaceDiscoveredAssets.createOrReplace", @@ -258,8 +259,8 @@ "azure.mgmt.deviceregistry.aio.operations.NamespaceDiscoveredAssetsOperations.begin_update": "Microsoft.DeviceRegistry.NamespaceDiscoveredAssets.update", "azure.mgmt.deviceregistry.operations.NamespaceDiscoveredAssetsOperations.begin_delete": "Microsoft.DeviceRegistry.NamespaceDiscoveredAssets.delete", "azure.mgmt.deviceregistry.aio.operations.NamespaceDiscoveredAssetsOperations.begin_delete": "Microsoft.DeviceRegistry.NamespaceDiscoveredAssets.delete", - "azure.mgmt.deviceregistry.operations.NamespaceDiscoveredAssetsOperations.list_by_resource_group": "Microsoft.DeviceRegistry.NamespaceDiscoveredAssets.listByResourceGroup", - "azure.mgmt.deviceregistry.aio.operations.NamespaceDiscoveredAssetsOperations.list_by_resource_group": "Microsoft.DeviceRegistry.NamespaceDiscoveredAssets.listByResourceGroup", + "azure.mgmt.deviceregistry.operations.NamespaceDiscoveredAssetsOperations.list_by_namespace": "Microsoft.DeviceRegistry.NamespaceDiscoveredAssets.listByNamespace", + "azure.mgmt.deviceregistry.aio.operations.NamespaceDiscoveredAssetsOperations.list_by_namespace": "Microsoft.DeviceRegistry.NamespaceDiscoveredAssets.listByNamespace", "azure.mgmt.deviceregistry.operations.NamespaceDiscoveredDevicesOperations.get": "Microsoft.DeviceRegistry.NamespaceDiscoveredDevices.get", "azure.mgmt.deviceregistry.aio.operations.NamespaceDiscoveredDevicesOperations.get": "Microsoft.DeviceRegistry.NamespaceDiscoveredDevices.get", "azure.mgmt.deviceregistry.operations.NamespaceDiscoveredDevicesOperations.begin_create_or_replace": "Microsoft.DeviceRegistry.NamespaceDiscoveredDevices.createOrReplace", @@ -268,8 +269,8 @@ "azure.mgmt.deviceregistry.aio.operations.NamespaceDiscoveredDevicesOperations.begin_update": "Microsoft.DeviceRegistry.NamespaceDiscoveredDevices.update", "azure.mgmt.deviceregistry.operations.NamespaceDiscoveredDevicesOperations.begin_delete": "Microsoft.DeviceRegistry.NamespaceDiscoveredDevices.delete", "azure.mgmt.deviceregistry.aio.operations.NamespaceDiscoveredDevicesOperations.begin_delete": "Microsoft.DeviceRegistry.NamespaceDiscoveredDevices.delete", - "azure.mgmt.deviceregistry.operations.NamespaceDiscoveredDevicesOperations.list_by_resource_group": "Microsoft.DeviceRegistry.NamespaceDiscoveredDevices.listByResourceGroup", - "azure.mgmt.deviceregistry.aio.operations.NamespaceDiscoveredDevicesOperations.list_by_resource_group": "Microsoft.DeviceRegistry.NamespaceDiscoveredDevices.listByResourceGroup", + "azure.mgmt.deviceregistry.operations.NamespaceDiscoveredDevicesOperations.list_by_namespace": "Microsoft.DeviceRegistry.NamespaceDiscoveredDevices.listByNamespace", + "azure.mgmt.deviceregistry.aio.operations.NamespaceDiscoveredDevicesOperations.list_by_namespace": "Microsoft.DeviceRegistry.NamespaceDiscoveredDevices.listByNamespace", "azure.mgmt.deviceregistry.operations.SchemaRegistriesOperations.get": "Microsoft.DeviceRegistry.SchemaRegistries.get", "azure.mgmt.deviceregistry.aio.operations.SchemaRegistriesOperations.get": "Microsoft.DeviceRegistry.SchemaRegistries.get", "azure.mgmt.deviceregistry.operations.SchemaRegistriesOperations.begin_create_or_replace": "Microsoft.DeviceRegistry.SchemaRegistries.createOrReplace", @@ -297,6 +298,41 @@ "azure.mgmt.deviceregistry.operations.SchemaVersionsOperations.begin_delete": "Microsoft.DeviceRegistry.SchemaVersions.delete", "azure.mgmt.deviceregistry.aio.operations.SchemaVersionsOperations.begin_delete": "Microsoft.DeviceRegistry.SchemaVersions.delete", "azure.mgmt.deviceregistry.operations.SchemaVersionsOperations.list_by_schema": "Microsoft.DeviceRegistry.SchemaVersions.listBySchema", - "azure.mgmt.deviceregistry.aio.operations.SchemaVersionsOperations.list_by_schema": "Microsoft.DeviceRegistry.SchemaVersions.listBySchema" - } + "azure.mgmt.deviceregistry.aio.operations.SchemaVersionsOperations.list_by_schema": "Microsoft.DeviceRegistry.SchemaVersions.listBySchema", + "azure.mgmt.deviceregistry.operations.CertificateAuthoritiesOperations.get": "Microsoft.DeviceRegistry.CertificateAuthorities.get", + "azure.mgmt.deviceregistry.aio.operations.CertificateAuthoritiesOperations.get": "Microsoft.DeviceRegistry.CertificateAuthorities.get", + "azure.mgmt.deviceregistry.operations.CertificateAuthoritiesOperations.begin_create_or_replace": "Microsoft.DeviceRegistry.CertificateAuthorities.createOrReplace", + "azure.mgmt.deviceregistry.aio.operations.CertificateAuthoritiesOperations.begin_create_or_replace": "Microsoft.DeviceRegistry.CertificateAuthorities.createOrReplace", + "azure.mgmt.deviceregistry.operations.CertificateAuthoritiesOperations.begin_delete": "Microsoft.DeviceRegistry.CertificateAuthorities.delete", + "azure.mgmt.deviceregistry.aio.operations.CertificateAuthoritiesOperations.begin_delete": "Microsoft.DeviceRegistry.CertificateAuthorities.delete", + "azure.mgmt.deviceregistry.operations.CertificateAuthoritiesOperations.begin_update": "Microsoft.DeviceRegistry.CertificateAuthorities.update", + "azure.mgmt.deviceregistry.aio.operations.CertificateAuthoritiesOperations.begin_update": "Microsoft.DeviceRegistry.CertificateAuthorities.update", + "azure.mgmt.deviceregistry.operations.CertificateAuthoritiesOperations.list_by_namespace": "Microsoft.DeviceRegistry.CertificateAuthorities.listByNamespace", + "azure.mgmt.deviceregistry.aio.operations.CertificateAuthoritiesOperations.list_by_namespace": "Microsoft.DeviceRegistry.CertificateAuthorities.listByNamespace", + "azure.mgmt.deviceregistry.operations.CertificateAuthoritiesOperations.begin_activate": "Microsoft.DeviceRegistry.CertificateAuthorities.activate", + "azure.mgmt.deviceregistry.aio.operations.CertificateAuthoritiesOperations.begin_activate": "Microsoft.DeviceRegistry.CertificateAuthorities.activate", + "azure.mgmt.deviceregistry.operations.CertificateAuthoritiesOperations.begin_revoke_and_rotate": "Microsoft.DeviceRegistry.CertificateAuthorities.revokeAndRotate", + "azure.mgmt.deviceregistry.aio.operations.CertificateAuthoritiesOperations.begin_revoke_and_rotate": "Microsoft.DeviceRegistry.CertificateAuthorities.revokeAndRotate", + "azure.mgmt.deviceregistry.operations.CertificatePoliciesOperations.get": "Microsoft.DeviceRegistry.CertificatePolicies.get", + "azure.mgmt.deviceregistry.aio.operations.CertificatePoliciesOperations.get": "Microsoft.DeviceRegistry.CertificatePolicies.get", + "azure.mgmt.deviceregistry.operations.CertificatePoliciesOperations.begin_create_or_replace": "Microsoft.DeviceRegistry.CertificatePolicies.createOrReplace", + "azure.mgmt.deviceregistry.aio.operations.CertificatePoliciesOperations.begin_create_or_replace": "Microsoft.DeviceRegistry.CertificatePolicies.createOrReplace", + "azure.mgmt.deviceregistry.operations.CertificatePoliciesOperations.begin_delete": "Microsoft.DeviceRegistry.CertificatePolicies.delete", + "azure.mgmt.deviceregistry.aio.operations.CertificatePoliciesOperations.begin_delete": "Microsoft.DeviceRegistry.CertificatePolicies.delete", + "azure.mgmt.deviceregistry.operations.CertificatePoliciesOperations.begin_update": "Microsoft.DeviceRegistry.CertificatePolicies.update", + "azure.mgmt.deviceregistry.aio.operations.CertificatePoliciesOperations.begin_update": "Microsoft.DeviceRegistry.CertificatePolicies.update", + "azure.mgmt.deviceregistry.operations.CertificatePoliciesOperations.list_by_certificate_authority": "Microsoft.DeviceRegistry.CertificatePolicies.listByCertificateAuthority", + "azure.mgmt.deviceregistry.aio.operations.CertificatePoliciesOperations.list_by_certificate_authority": "Microsoft.DeviceRegistry.CertificatePolicies.listByCertificateAuthority", + "azure.mgmt.deviceregistry.operations.RegistryDevicesOperations.get": "Microsoft.DeviceRegistry.RegistryDevices.get", + "azure.mgmt.deviceregistry.aio.operations.RegistryDevicesOperations.get": "Microsoft.DeviceRegistry.RegistryDevices.get", + "azure.mgmt.deviceregistry.operations.RegistryDevicesOperations.begin_create_or_replace": "Microsoft.DeviceRegistry.RegistryDevices.createOrReplace", + "azure.mgmt.deviceregistry.aio.operations.RegistryDevicesOperations.begin_create_or_replace": "Microsoft.DeviceRegistry.RegistryDevices.createOrReplace", + "azure.mgmt.deviceregistry.operations.RegistryDevicesOperations.begin_update": "Microsoft.DeviceRegistry.RegistryDevices.update", + "azure.mgmt.deviceregistry.aio.operations.RegistryDevicesOperations.begin_update": "Microsoft.DeviceRegistry.RegistryDevices.update", + "azure.mgmt.deviceregistry.operations.RegistryDevicesOperations.begin_delete": "Microsoft.DeviceRegistry.RegistryDevices.delete", + "azure.mgmt.deviceregistry.aio.operations.RegistryDevicesOperations.begin_delete": "Microsoft.DeviceRegistry.RegistryDevices.delete", + "azure.mgmt.deviceregistry.operations.RegistryDevicesOperations.list_by_namespace": "Microsoft.DeviceRegistry.RegistryDevices.listByNamespace", + "azure.mgmt.deviceregistry.aio.operations.RegistryDevicesOperations.list_by_namespace": "Microsoft.DeviceRegistry.RegistryDevices.listByNamespace" + }, + "CrossLanguageVersion": "7e63eccddb32" } \ No newline at end of file diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_client.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_client.py index 8bc8a5d02435..c62c06a60248 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_client.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_client.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,8 +8,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import HttpRequest, HttpResponse @@ -22,8 +23,10 @@ from .operations import ( AssetEndpointProfilesOperations, AssetsOperations, + AsyncOperationStatusOperations, BillingContainersOperations, - CredentialsOperations, + CertificateAuthoritiesOperations, + CertificatePoliciesOperations, NamespaceAssetsOperations, NamespaceDevicesOperations, NamespaceDiscoveredAssetsOperations, @@ -31,24 +34,32 @@ NamespacesOperations, OperationStatusOperations, Operations, - PoliciesOperations, + RegistryDevicesOperations, SchemaRegistriesOperations, SchemaVersionsOperations, SchemasOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class DeviceRegistryMgmtClient: # pylint: disable=too-many-instance-attributes +class DeviceRegistryMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Microsoft.DeviceRegistry Resource Provider management API. :ivar operations: Operations operations :vartype operations: azure.mgmt.deviceregistry.operations.Operations :ivar operation_status: OperationStatusOperations operations :vartype operation_status: azure.mgmt.deviceregistry.operations.OperationStatusOperations + :ivar async_operation_status: AsyncOperationStatusOperations operations + :vartype async_operation_status: + azure.mgmt.deviceregistry.operations.AsyncOperationStatusOperations :ivar assets: AssetsOperations operations :vartype assets: azure.mgmt.deviceregistry.operations.AssetsOperations :ivar asset_endpoint_profiles: AssetEndpointProfilesOperations operations @@ -58,10 +69,6 @@ class DeviceRegistryMgmtClient: # pylint: disable=too-many-instance-attributes :vartype billing_containers: azure.mgmt.deviceregistry.operations.BillingContainersOperations :ivar namespaces: NamespacesOperations operations :vartype namespaces: azure.mgmt.deviceregistry.operations.NamespacesOperations - :ivar credentials: CredentialsOperations operations - :vartype credentials: azure.mgmt.deviceregistry.operations.CredentialsOperations - :ivar policies: PoliciesOperations operations - :vartype policies: azure.mgmt.deviceregistry.operations.PoliciesOperations :ivar namespace_assets: NamespaceAssetsOperations operations :vartype namespace_assets: azure.mgmt.deviceregistry.operations.NamespaceAssetsOperations :ivar namespace_devices: NamespaceDevicesOperations operations @@ -78,6 +85,14 @@ class DeviceRegistryMgmtClient: # pylint: disable=too-many-instance-attributes :vartype schemas: azure.mgmt.deviceregistry.operations.SchemasOperations :ivar schema_versions: SchemaVersionsOperations operations :vartype schema_versions: azure.mgmt.deviceregistry.operations.SchemaVersionsOperations + :ivar certificate_authorities: CertificateAuthoritiesOperations operations + :vartype certificate_authorities: + azure.mgmt.deviceregistry.operations.CertificateAuthoritiesOperations + :ivar certificate_policies: CertificatePoliciesOperations operations + :vartype certificate_policies: + azure.mgmt.deviceregistry.operations.CertificatePoliciesOperations + :ivar registry_devices: RegistryDevicesOperations operations + :vartype registry_devices: azure.mgmt.deviceregistry.operations.RegistryDevicesOperations :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. @@ -87,9 +102,9 @@ class DeviceRegistryMgmtClient: # pylint: disable=too-many-instance-attributes :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-03-01-preview". Default value is "2026-03-01-preview". Note that overriding this default - value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -146,6 +161,9 @@ def __init__( self.operation_status = OperationStatusOperations( self._client, self._config, self._serialize, self._deserialize ) + self.async_operation_status = AsyncOperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.assets = AssetsOperations(self._client, self._config, self._serialize, self._deserialize) self.asset_endpoint_profiles = AssetEndpointProfilesOperations( self._client, self._config, self._serialize, self._deserialize @@ -154,8 +172,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.credentials = CredentialsOperations(self._client, self._config, self._serialize, self._deserialize) - self.policies = PoliciesOperations(self._client, self._config, self._serialize, self._deserialize) self.namespace_assets = NamespaceAssetsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -173,6 +189,15 @@ def __init__( ) self.schemas = SchemasOperations(self._client, self._config, self._serialize, self._deserialize) self.schema_versions = SchemaVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.certificate_authorities = CertificateAuthoritiesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.certificate_policies = CertificatePoliciesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_devices = RegistryDevicesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_configuration.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_configuration.py index b2fb2550d1d0..3e35979029e0 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_configuration.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ from azure.core.credentials import TokenCredential -class DeviceRegistryMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes +class DeviceRegistryMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for DeviceRegistryMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -33,9 +34,9 @@ class DeviceRegistryMgmtClientConfiguration: # pylint: disable=too-many-instanc :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-03-01-preview". Default value is "2026-03-01-preview". Note that overriding this default - value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -47,7 +48,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-03-01-preview") + api_version: str = kwargs.pop("api_version", "2026-11-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_patch.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_patch.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_utils/model_base.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_utils/model_base.py index 7b7f8ba67b53..35d5fc024978 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_utils/model_base.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_utils/model_base.py @@ -23,14 +23,19 @@ from json import JSONEncoder import xml.etree.ElementTree as ET from collections.abc import MutableMapping -from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError from azure.core import CaseInsensitiveEnumMeta from azure.core.pipeline import PipelineResponse from azure.core.serialization import _Null + from azure.core.rest import HttpResponse +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _LOGGER = logging.getLogger(__name__) __all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] @@ -104,6 +109,29 @@ def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: return encoded +def _serialize_duration(td: timedelta, format: typing.Optional[str] = None): + """Serialize a timedelta to its wire representation. + + For the ``seconds``/``milliseconds`` encodings the value is converted to a + numeric value, otherwise it falls back to an ISO 8601 duration string. + + :param timedelta td: The timedelta to serialize. + :param str format: The duration encoding format. + :rtype: int or float or str + :return: serialized duration + """ + seconds = td.total_seconds() + if format == "duration-seconds-int": + return int(seconds) + if format == "duration-seconds-float": + return seconds + if format == "duration-milliseconds-int": + return int(seconds * 1000) + if format == "duration-milliseconds-float": + return seconds * 1000 + return _timedelta_as_isostr(td) + + def _serialize_datetime(o, format: typing.Optional[str] = None): if hasattr(o, "year") and hasattr(o, "hour"): if format == "rfc7231": @@ -130,7 +158,15 @@ def _is_readonly(p): class SdkJSONEncoder(JSONEncoder): - """A JSON encoder that's capable of serializing datetime objects and bytes.""" + """A JSON encoder that's capable of serializing datetime objects and bytes. + + :param args: Additional positional arguments passed to the base ``JSONEncoder``. + :type args: typing.Any + :keyword exclude_readonly: Whether to exclude readonly properties. Defaults to False. + :paramtype exclude_readonly: bool + :keyword format: The format to use for serialization. Defaults to None. + :paramtype format: typing.Optional[str] + """ def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): super().__init__(*args, **kwargs) @@ -296,6 +332,12 @@ def _deserialize_duration(attr): return isodate.parse_duration(attr) +def _deserialize_duration_numeric(attr, unit): + if isinstance(attr, timedelta): + return attr + return timedelta(**{unit: float(attr)}) + + def _deserialize_decimal(attr): if isinstance(attr, decimal.Decimal): return attr @@ -308,6 +350,12 @@ def _deserialize_int_as_str(attr): return int(attr) +def _deserialize_bool_as_str(attr): + if isinstance(attr, bool): + return attr + return attr.lower() == "true" + + _DESERIALIZE_MAPPING = { datetime: _deserialize_datetime, date: _deserialize_date, @@ -325,12 +373,18 @@ def _deserialize_int_as_str(attr): "unix-timestamp": _deserialize_datetime_unix_timestamp, "base64": _deserialize_bytes, "base64url": _deserialize_bytes_base64, + "duration-seconds-int": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-seconds-float": functools.partial(_deserialize_duration_numeric, unit="seconds"), + "duration-milliseconds-int": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), + "duration-milliseconds-float": functools.partial(_deserialize_duration_numeric, unit="milliseconds"), } def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is bool and rf and rf._format == "str": + return _deserialize_bool_as_str if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: @@ -420,21 +474,21 @@ def __ne__(self, other: typing.Any) -> bool: def keys(self) -> typing.KeysView[str]: """ - :returns: a set-like object providing a view on D's keys + :returns: a set-like object providing a view on the mapping's keys :rtype: ~typing.KeysView """ return self._data.keys() def values(self) -> typing.ValuesView[typing.Any]: """ - :returns: an object providing a view on D's values + :returns: an object providing a view on the mapping's values :rtype: ~typing.ValuesView """ return self._data.values() def items(self) -> typing.ItemsView[str, typing.Any]: """ - :returns: set-like object providing a view on D's items + :returns: a set-like object providing a view on the mapping's items :rtype: ~typing.ItemsView """ return self._data.items() @@ -444,7 +498,7 @@ def get(self, key: str, default: typing.Any = None) -> typing.Any: Get the value for key if key is in the dictionary, else default. :param str key: The key to look up. :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ try: @@ -479,19 +533,19 @@ def popitem(self) -> tuple[str, typing.Any]: Removes and returns some (key, value) pair :returns: The (key, value) pair. :rtype: tuple - :raises KeyError: if D is empty. + :raises KeyError: if the dictionary is empty. """ return self._data.popitem() def clear(self) -> None: """ - Remove all items from D. + Remove all items from the dictionary. """ self._data.clear() def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ """ - Updates D from mapping/iterable E and F. + Update the dictionary from a mapping or an iterable of key-value pairs. :param any args: Either a mapping object or an iterable of key-value pairs. """ self._data.update(*args, **kwargs) @@ -504,10 +558,11 @@ def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: """ - Same as calling D.get(k, d), and setting D[k]=d if k not found + Return the value for key if key is in the dictionary; otherwise set the key to + default and return default. :param str key: The key to look up. :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. + :returns: The value for key if key is in the dictionary, else default. :rtype: any """ if default is _UNSET: @@ -559,7 +614,7 @@ def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-m pass # Last, try datetime.timedelta try: - return _timedelta_as_isostr(o) + return _serialize_duration(o, format) except AttributeError: # This will be raised when it hits value.total_seconds in the method above pass @@ -585,6 +640,239 @@ def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typin return _serialize(value, rf._format) +# ============================================================================ +# Fast-path scalar deserializer functions for rest_field(deserializer=...) +# These are referenced from rest_field declarations to bypass the generic +# _deserialize -> _deserialize_with_callable chain. +# Only simple/primitive types — no models or container types. +# ============================================================================ + + +def _xml_deser_str(value): + if isinstance(value, ET.Element): + return value.text or "" + return str(value) if value is not None else None + + +def _xml_deser_int(value): + if isinstance(value, ET.Element): + return int(value.text) if value.text else None + return int(value) if value is not None else None + + +def _xml_deser_float(value): + if isinstance(value, ET.Element): + return float(value.text) if value.text else None + return float(value) if value is not None else None + + +def _xml_deser_bool(value): + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + if text in (True, False): + return text + return text.lower() == "true" + + +# pylint: disable=docstring-missing-param +def _xml_deser_bytes(value): + """Deserialize bytes from XML (base64).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes(text) + + +def _xml_deser_bytes_base64url(value): + """Deserialize bytes from XML (base64url).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_bytes_base64(text) + + +def _xml_deser_datetime(value): + """Deserialize a datetime from XML (ISO 8601 / rfc3339).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime(text) + + +def _xml_deser_datetime_rfc7231(value): + """Deserialize a datetime from XML (RFC7231 format).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_rfc7231(text) + + +def _xml_deser_datetime_unix_timestamp(value): + """Deserialize a datetime from XML (Unix timestamp).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_datetime_unix_timestamp(float(text)) + + +def _xml_deser_date(value): + """Deserialize a date from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_date(text) + + +def _xml_deser_time(value): + """Deserialize a time from XML (ISO 8601).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_time(text) + + +def _xml_deser_duration(value): + """Deserialize a timedelta from XML (ISO 8601 duration).""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_duration(text) + + +def _xml_deser_decimal(value): + """Deserialize a Decimal from XML.""" + if isinstance(value, ET.Element): + text = value.text + else: + text = value + if text is None: + return None + return _deserialize_decimal(text) + + +def _xml_deser_enum_or_str(enum_cls, value): + """Deserialize a Union[EnumType, str] from XML.""" + text = value.text if isinstance(value, ET.Element) else value + if text is None: + return None + try: + return enum_cls(text) + except ValueError: + return text + + +def _extract_xml_model_type(rf_type): + """Extract the concrete Model class from a resolved rf._type partial chain. + + Unwraps ``Optional[Model]`` and ``_deserialize_model(Model, ...)`` + wrappers. Only handles Model and Optional[Model] — other composite + types (List, Dict, Union, etc.) return None and fall through to the + generic ``_deserialize`` path at runtime. + """ + if rf_type is None: + return None + if isinstance(rf_type, type) and _is_model(rf_type): + return rf_type + if not isinstance(rf_type, functools.partial): + return None + func = rf_type.func + args = rf_type.args + if func is _deserialize_with_optional and args: + return _extract_xml_model_type(args[0]) + if func is _deserialize_model and args: + cls = args[0] + return cls if isinstance(cls, type) and _is_model(cls) else None + return None + + +def _build_xml_field_plan( # pylint: disable=docstring-missing-return, docstring-missing-rtype, unused-variable + cls, attr_to_rest_field: dict +) -> list: + """Build a precomputed XML field plan for fast _init_from_xml iteration. + + Called once per model class in __new__. Returns a list of tuples: + (rest_name, xml_name, kind, deser, rf_type, is_optional, items_name) + + kind: 0=wrapped, 1=attribute, 2=unwrapped, 3=text + + For Model and Optional[Model] fields that lack a scalar + ``_deserializer``, this function precomputes the Model class as the + deserializer so ``_init_from_xml`` can call ``ModelClass(element)`` + directly instead of going through the expensive + ``_get_deserialize_callable_from_annotation`` chain at runtime. + """ + model_meta = getattr(cls, "_xml", {}) + model_ns = model_meta.get("ns") or model_meta.get("namespace") + plan = [] + + for rf in attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + deser = rf._deserializer + + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + is_optional = rf._is_optional + + # For Model / Optional[Model] fields without a scalar deserializer, + # precompute the Model class as the deserializer. + if deser is None and rf._type is not None: + model_cls = _extract_xml_model_type(rf._type) + if model_cls is not None: + deser = model_cls + + if prop_meta.get("attribute", False): + plan.append((rf._rest_name, xml_name, 1, deser, rf._type, is_optional, None)) + elif prop_meta.get("unwrapped", False): + items_name = prop_meta.get("itemsName") + if items_name: + items_ns = prop_meta.get("itemsNs") + if items_ns is not None: + xml_ns = items_ns + if xml_ns: + items_name = "{" + xml_ns + "}" + items_name + else: + items_name = xml_name + plan.append((rf._rest_name, xml_name, 2, deser, rf._type, is_optional, items_name)) + elif prop_meta.get("text", False): + plan.append((rf._rest_name, xml_name, 3, deser, rf._type, is_optional, None)) + else: + plan.append((rf._rest_name, xml_name, 0, deser, rf._type, is_optional, None)) + + return plan + + +# pylint: enable=docstring-missing-param class Model(_MyMutableMapping): _is_model = True # label whether current class's _attr_to_rest_field has been calculated @@ -595,62 +883,10 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: class_name = self.__class__.__name__ if len(args) > 1: raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") - dict_to_pass = { - rest_field._rest_name: rest_field._default - for rest_field in self._attr_to_rest_field.values() - if rest_field._default is not _UNSET - } - if args: # pylint: disable=too-many-nested-blocks + dict_to_pass: dict[str, typing.Any] = {} + if args: if isinstance(args[0], ET.Element): - existed_attr_keys = [] - model_meta = getattr(self, "_xml", {}) - - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - if prop_meta.get("itemsName"): - xml_name = prop_meta.get("itemsName") - xml_ns = prop_meta.get("itemNs") - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = args[0].findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) - elif not rf._is_optional: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = [] - continue - - # text element is primitive type - if prop_meta.get("text", False): - if args[0].text is not None: - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = args[0].find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in args[0]: - if e.tag not in existed_attr_keys: - dict_to_pass[e.tag] = _convert_element(e) + dict_to_pass.update(self._init_from_xml(args[0])) else: dict_to_pass.update( {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} @@ -667,8 +903,117 @@ def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: if v is not None } ) + # Apply client default values for fields the caller didn't set so that + # defaults are part of `_data` and therefore included during serialization. + for rf in self._attr_to_rest_field.values(): + if rf._default is _UNSET: + continue + if rf._rest_name in dict_to_pass: + continue + dict_to_pass[rf._rest_name] = _create_value(rf, rf._default) super().__init__(dict_to_pass) + def _init_from_xml( # pylint: disable=too-many-branches, too-many-statements + self, element: ET.Element + ) -> dict[str, typing.Any]: + """Deserialize an XML element into a dict mapping rest field names to values. + + :param ET.Element element: The XML element to deserialize from. + :returns: A dictionary of rest_name to deserialized value pairs. + :rtype: dict + """ + result: dict[str, typing.Any] = {} + existed_attr_keys: list[str] = [] + + field_plan = getattr(self, "_xml_field_plan", None) + if field_plan: + for rest_name, xml_name, kind, deser, rf_type, is_optional, items_name in field_plan: + if kind == 0: # wrapped element (most common) + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(item) + else: + result[rest_name] = _deserialize(rf_type, item) + elif kind == 1: # attribute + attr_val = element.get(xml_name) + if attr_val is not None: + existed_attr_keys.append(xml_name) + if deser: + result[rest_name] = deser(attr_val) + else: + result[rest_name] = attr_val + elif kind == 2: # unwrapped array + items = element.findall(items_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(items_name) + if deser: + result[rest_name] = deser(items) + else: + result[rest_name] = _deserialize(rf_type, items) + elif not is_optional: + existed_attr_keys.append(items_name) + result[rest_name] = [] + elif kind == 3: # text + if element.text is not None: + if deser: + result[rest_name] = deser(element.text) + else: + result[rest_name] = element.text + else: + model_meta = getattr(self, "_xml", {}) + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and element.get(xml_name) is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, element.get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + _items_name = prop_meta.get("itemsName") + if _items_name: + xml_name = _items_name + _items_ns = prop_meta.get("itemsNs") + if _items_ns is not None: + xml_ns = _items_ns + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = element.findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if element.text is not None: + result[rf._rest_name] = _deserialize(rf._type, element.text) + continue + + # wrapped element could be normal property or array + item = element.find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + result[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in element: + if e.tag not in existed_attr_keys: + result[e.tag] = _convert_element(e) + + return result + def copy(self) -> "Model": return Model(self.__dict__) @@ -693,6 +1038,9 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if not rf._rest_name_input: rf._rest_name_input = attr cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + # Build XML field plan for fast _init_from_xml (only for XML models) + if getattr(cls, "_xml", None): + cls._xml_field_plan = _build_xml_field_plan(cls, attr_to_rest_field) cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") return super().__new__(cls) @@ -721,7 +1069,7 @@ def _deserialize(cls, data, exist_discriminators): model_meta = getattr(cls, "_xml", {}) prop_meta = getattr(discriminator, "_xml", {}) xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + xml_ns = _resolve_xml_ns(prop_meta, model_meta) if xml_ns: xml_name = "{" + xml_ns + "}" + xml_name @@ -1067,6 +1415,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ): self._type = type self._rest_name_input = name @@ -1079,6 +1428,7 @@ def __init__( self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._deserializer = deserializer @property def _class_type(self) -> typing.Any: @@ -1098,7 +1448,10 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class # Use _data.get() directly to avoid triggering __getitem__ which clears the cache - item = obj._data.get(self._rest_name) + item = obj._data.get(self._rest_name, _UNSET) + if item is _UNSET: + # Field not set by user; return the client default if one exists, otherwise None + return self._default if self._default is not _UNSET else None if item is None: return item if self._is_model: @@ -1111,7 +1464,11 @@ def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # Return the value from _data directly (it's been deserialized in place) return obj._data.get(self._rest_name) - deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + # Fast path: use _deserializer directly (avoids _serialize/_deserialize chain) + if self._deserializer: + deserialized = self._deserializer(item) + else: + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) # For mutable types, store the deserialized value back in _data # so mutations directly affect _data @@ -1157,6 +1514,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ) -> typing.Any: return _RestField( name=name, @@ -1166,6 +1524,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1190,6 +1549,56 @@ def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore +def _get_xml_ns(meta: dict[str, typing.Any]) -> typing.Optional[str]: + """Return the XML namespace from a metadata dict, checking both 'ns' (old-style) and 'namespace' (DPG) keys. + + :param dict meta: The metadata dictionary to extract namespace from. + :returns: The namespace string if 'ns' or 'namespace' key is present, None otherwise. + :rtype: str or None + """ + ns = meta.get("ns") + if ns is None: + ns = meta.get("namespace") + return ns + + +def _resolve_xml_ns( + prop_meta: dict[str, typing.Any], model_meta: typing.Optional[dict[str, typing.Any]] = None +) -> typing.Optional[str]: + """Resolve XML namespace for a property, falling back to model namespace when appropriate. + + Checks the property metadata first; if no namespace is found and the model does not declare + an explicit prefix, falls back to the model-level namespace. + + :param dict prop_meta: The property metadata dictionary. + :param dict model_meta: The model metadata dictionary, used as fallback. + :returns: The resolved namespace string, or None. + :rtype: str or None + """ + ns = _get_xml_ns(prop_meta) + if ns is None and model_meta is not None and not model_meta.get("prefix"): + ns = _get_xml_ns(model_meta) + return ns + + +def _set_xml_attribute(element: ET.Element, name: str, value: typing.Any, prop_meta: dict[str, typing.Any]) -> None: + """Set an XML attribute on an element, handling namespace prefix registration. + + :param ET.Element element: The element to set the attribute on. + :param str name: The default attribute name (wire name). + :param any value: The attribute value. + :param dict prop_meta: The property metadata dictionary. + """ + xml_name = prop_meta.get("name", name) + _attr_ns = _get_xml_ns(prop_meta) + if _attr_ns: + _attr_prefix = prop_meta.get("prefix") + if _attr_prefix: + _safe_register_namespace(_attr_prefix, _attr_ns) + xml_name = "{" + _attr_ns + "}" + xml_name + element.set(xml_name, _get_primitive_type_value(value)) + + def _get_element( o: typing.Any, exclude_readonly: bool = False, @@ -1201,10 +1610,16 @@ def _get_element( # if prop is a model, then use the prop element directly, else generate a wrapper of model if wrapped_element is None: + # When serializing as an array item (parent_meta is set), check if the parent has an + # explicit itemsName. This ensures correct element names for unwrapped arrays (where + # the element tag is the property/items name, not the model type name). + _items_name = parent_meta.get("itemsName") if parent_meta is not None else None + element_name = _items_name if _items_name else (model_meta.get("name") or o.__class__.__name__) + _model_ns = _get_xml_ns(model_meta) wrapped_element = _create_xml_element( - model_meta.get("name", o.__class__.__name__), + element_name, model_meta.get("prefix"), - model_meta.get("ns"), + _model_ns, ) readonly_props = [] @@ -1226,7 +1641,9 @@ def _get_element( # additional properties will not have rest field, use the wire name as xml name prop_meta = {"name": k} - # if no ns for prop, use model's + # Propagate model namespace to properties only for old-style "ns"-keyed models. + # DPG-generated models use the "namespace" key and explicitly declare namespace on + # each property that needs it, so propagation is intentionally skipped for them. if prop_meta.get("ns") is None and model_meta.get("ns"): prop_meta["ns"] = model_meta.get("ns") prop_meta["prefix"] = model_meta.get("prefix") @@ -1238,12 +1655,7 @@ def _get_element( # text could only set on primitive type wrapped_element.text = _get_primitive_type_value(v) elif prop_meta.get("attribute", False): - xml_name = prop_meta.get("name", k) - if prop_meta.get("ns"): - ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore - xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore - # attribute should be primitive type - wrapped_element.set(xml_name, _get_primitive_type_value(v)) + _set_xml_attribute(wrapped_element, k, v, prop_meta) else: # other wrapped prop element wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) @@ -1252,6 +1664,7 @@ def _get_element( return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore if isinstance(o, dict): result = [] + _dict_ns = _get_xml_ns(parent_meta) if parent_meta else None for k, v in o.items(): result.append( _get_wrapped_element( @@ -1259,7 +1672,7 @@ def _get_element( exclude_readonly, { "name": k, - "ns": parent_meta.get("ns") if parent_meta else None, + "ns": _dict_ns, "prefix": parent_meta.get("prefix") if parent_meta else None, }, ) @@ -1268,13 +1681,16 @@ def _get_element( # primitive case need to create element based on parent_meta if parent_meta: + _items_ns = parent_meta.get("itemsNs") + if _items_ns is None: + _items_ns = _get_xml_ns(parent_meta) return _get_wrapped_element( o, exclude_readonly, { "name": parent_meta.get("itemsName", parent_meta.get("name")), "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + "ns": _items_ns, }, ) @@ -1286,8 +1702,9 @@ def _get_wrapped_element( exclude_readonly: bool, meta: typing.Optional[dict[str, typing.Any]], ) -> ET.Element: + _meta_ns = _get_xml_ns(meta) if meta else None wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + meta.get("name") if meta else None, meta.get("prefix") if meta else None, _meta_ns ) if isinstance(v, (dict, list)): wrapped_element.extend(_get_element(v, exclude_readonly, meta)) @@ -1308,11 +1725,29 @@ def _get_primitive_type_value(v) -> str: return str(v) +def _safe_register_namespace(prefix: str, ns: str) -> None: + """Register an XML namespace prefix, handling reserved prefix patterns. + + Some prefixes (e.g. 'ns2') match Python's reserved 'ns\\d+' pattern used for + auto-generated prefixes, causing register_namespace to raise ValueError. + Falls back to directly registering in the internal namespace map. + + :param str prefix: The namespace prefix to register. + :param str ns: The namespace URI. + """ + try: + ET.register_namespace(prefix, ns) + except ValueError: + _ns_map = getattr(ET, "_namespace_map", None) + if _ns_map is not None: + _ns_map[ns] = prefix + + def _create_xml_element( tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None ) -> ET.Element: if prefix and ns: - ET.register_namespace(prefix, ns) + _safe_register_namespace(prefix, ns) if ns: return ET.Element("{" + ns + "}" + tag) return ET.Element(tag) @@ -1323,6 +1758,8 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_utils/serialization.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_utils/serialization.py index 47a16628dc5d..ae08f9d89f74 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_utils/serialization.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_utils/serialization.py @@ -39,11 +39,15 @@ import xml.etree.ElementTree as ET import isodate # type: ignore -from typing_extensions import Self from azure.core.exceptions import DeserializationError, SerializationError from azure.core.serialization import NULL as CoreNull +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + _BOM = codecs.BOM_UTF8.decode(encoding="utf-8") JSON = MutableMapping[str, Any] @@ -476,7 +480,11 @@ def _decode_attribute_map_key(key): class Serializer: # pylint: disable=too-many-public-methods - """Request object model serializer.""" + """Request object model serializer. + + :param classes: Mapping of model names to model types, used to resolve models during serialization. + :type classes: typing.Optional[typing.Mapping[str, type]] + """ basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -516,6 +524,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Serializer.serialize_rfc, "unix-time": Serializer.serialize_unix, "duration": Serializer.serialize_duration, + "duration-seconds-int": Serializer.serialize_duration_seconds_int, + "duration-seconds-float": Serializer.serialize_duration_seconds_float, + "duration-milliseconds-int": Serializer.serialize_duration_milliseconds_int, + "duration-milliseconds-float": Serializer.serialize_duration_milliseconds_float, "date": Serializer.serialize_date, "time": Serializer.serialize_time, "decimal": Serializer.serialize_decimal, @@ -1105,6 +1117,61 @@ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) + @staticmethod + def _serialize_duration_numeric(attr, scale, as_int): + """Serialize a TimeDelta into a numeric value scaled to the wire unit. + + :param TimeDelta attr: Object to be serialized. + :param int scale: Multiplier applied to total seconds (1 for seconds, 1000 for milliseconds). + :param bool as_int: Whether to truncate the result to an int. + :rtype: int or float + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + value = attr.total_seconds() * scale if isinstance(attr, datetime.timedelta) else attr + return int(value) if as_int else float(value) + + @staticmethod + def serialize_duration_seconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, True) + + @staticmethod + def serialize_duration_seconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of seconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1, False) + + @staticmethod + def serialize_duration_milliseconds_int(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into an integer number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: int + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, True) + + @staticmethod + def serialize_duration_milliseconds_float(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into a floating point number of milliseconds. + + :param TimeDelta attr: Object to be serialized. + :rtype: float + :return: serialized duration + """ + return Serializer._serialize_duration_numeric(attr, 1000, False) + @staticmethod def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. @@ -1377,6 +1444,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "rfc-1123": Deserializer.deserialize_rfc, "unix-time": Deserializer.deserialize_unix, "duration": Deserializer.deserialize_duration, + "duration-seconds-int": Deserializer.deserialize_duration_seconds, + "duration-seconds-float": Deserializer.deserialize_duration_seconds, + "duration-milliseconds-int": Deserializer.deserialize_duration_milliseconds, + "duration-milliseconds-float": Deserializer.deserialize_duration_milliseconds, "date": Deserializer.deserialize_date, "time": Deserializer.deserialize_time, "decimal": Deserializer.deserialize_decimal, @@ -1389,6 +1460,10 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: } self.deserialize_expected_types = { "duration": (isodate.Duration, datetime.timedelta), + "duration-seconds-int": (isodate.Duration, datetime.timedelta), + "duration-seconds-float": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-int": (isodate.Duration, datetime.timedelta), + "duration-milliseconds-float": (isodate.Duration, datetime.timedelta), "iso-8601": (datetime.datetime), } self.dependencies: dict[str, type] = dict(classes) if classes else {} @@ -1401,7 +1476,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: # Otherwise, result are unexpected self.additional_properties_detection = True - def __call__(self, target_obj, response_data, content_type=None): + def __call__(self, target_obj, response_data, content_type=None): # pylint: disable=too-many-return-statements """Call the deserializer to process a REST response. :param str target_obj: Target data type to deserialize to. @@ -1411,6 +1486,27 @@ def __call__(self, target_obj, response_data, content_type=None): :return: Deserialized object. :rtype: object """ + # Fast path for header deserialization: response_data is a plain str or None + # and target_obj is a simple scalar type. This avoids the expensive + # _unpack_content → _deserialize → _classify_target → deserialize_data chain. + if response_data is None: + return None + if target_obj == "str" and isinstance(response_data, str): + return response_data + if isinstance(response_data, str): + if target_obj == "int": + return int(response_data) + if target_obj == "bool": + if response_data in ("true", "1", "True"): + return True + if response_data in ("false", "0", "False"): + return False + return bool(response_data) + if target_obj == "rfc-1123": + return Deserializer.deserialize_rfc(response_data) + if target_obj == "bytearray": + return Deserializer.deserialize_bytearray(response_data) + data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) @@ -1779,9 +1875,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return return None if data_type == "bool": - if isinstance(attr, bool): - return attr - if attr in [1, 0]: + if attr in [True, False, 1, 0]: return bool(attr) if isinstance(attr, str): if attr.lower() in ["true", "1"]: @@ -1931,6 +2025,48 @@ def deserialize_duration(attr): raise DeserializationError(msg) from err return duration + @staticmethod + def _deserialize_duration_numeric(attr, unit): + """Deserialize a numeric duration value into a TimeDelta object. + + :param float attr: response value to be deserialized. + :param str unit: The wire unit, used as the ``timedelta`` keyword + (``"seconds"`` or ``"milliseconds"``). + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = datetime.timedelta(**{unit: float(attr)}) # type: ignore + except (ValueError, OverflowError, TypeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_duration_seconds(attr): + """Deserialize a numeric number of seconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "seconds") + + @staticmethod + def deserialize_duration_milliseconds(attr): + """Deserialize a numeric number of milliseconds into a TimeDelta object. + + :param float attr: response value to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises DeserializationError: if value is invalid. + """ + return Deserializer._deserialize_duration_numeric(attr, "milliseconds") + @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_version.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_version.py index 5bf479b145f7..8f2350dd3b0c 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_version.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.2.0b1" +VERSION = "2.0.0" diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/_client.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/_client.py index 3dc0fc288521..ddbd2af960e4 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/_client.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/_client.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,8 +8,8 @@ # -------------------------------------------------------------------------- from copy import deepcopy +import sys from typing import Any, Awaitable, Optional, TYPE_CHECKING, cast -from typing_extensions import Self from azure.core.pipeline import policies from azure.core.rest import AsyncHttpResponse, HttpRequest @@ -22,8 +23,10 @@ from .operations import ( AssetEndpointProfilesOperations, AssetsOperations, + AsyncOperationStatusOperations, BillingContainersOperations, - CredentialsOperations, + CertificateAuthoritiesOperations, + CertificatePoliciesOperations, NamespaceAssetsOperations, NamespaceDevicesOperations, NamespaceDiscoveredAssetsOperations, @@ -31,24 +34,32 @@ NamespacesOperations, OperationStatusOperations, Operations, - PoliciesOperations, + RegistryDevicesOperations, SchemaRegistriesOperations, SchemaVersionsOperations, SchemasOperations, ) +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self # type: ignore + if TYPE_CHECKING: from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class DeviceRegistryMgmtClient: # pylint: disable=too-many-instance-attributes +class DeviceRegistryMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Microsoft.DeviceRegistry Resource Provider management API. :ivar operations: Operations operations :vartype operations: azure.mgmt.deviceregistry.aio.operations.Operations :ivar operation_status: OperationStatusOperations operations :vartype operation_status: azure.mgmt.deviceregistry.aio.operations.OperationStatusOperations + :ivar async_operation_status: AsyncOperationStatusOperations operations + :vartype async_operation_status: + azure.mgmt.deviceregistry.aio.operations.AsyncOperationStatusOperations :ivar assets: AssetsOperations operations :vartype assets: azure.mgmt.deviceregistry.aio.operations.AssetsOperations :ivar asset_endpoint_profiles: AssetEndpointProfilesOperations operations @@ -59,10 +70,6 @@ class DeviceRegistryMgmtClient: # pylint: disable=too-many-instance-attributes azure.mgmt.deviceregistry.aio.operations.BillingContainersOperations :ivar namespaces: NamespacesOperations operations :vartype namespaces: azure.mgmt.deviceregistry.aio.operations.NamespacesOperations - :ivar credentials: CredentialsOperations operations - :vartype credentials: azure.mgmt.deviceregistry.aio.operations.CredentialsOperations - :ivar policies: PoliciesOperations operations - :vartype policies: azure.mgmt.deviceregistry.aio.operations.PoliciesOperations :ivar namespace_assets: NamespaceAssetsOperations operations :vartype namespace_assets: azure.mgmt.deviceregistry.aio.operations.NamespaceAssetsOperations :ivar namespace_devices: NamespaceDevicesOperations operations @@ -79,6 +86,14 @@ class DeviceRegistryMgmtClient: # pylint: disable=too-many-instance-attributes :vartype schemas: azure.mgmt.deviceregistry.aio.operations.SchemasOperations :ivar schema_versions: SchemaVersionsOperations operations :vartype schema_versions: azure.mgmt.deviceregistry.aio.operations.SchemaVersionsOperations + :ivar certificate_authorities: CertificateAuthoritiesOperations operations + :vartype certificate_authorities: + azure.mgmt.deviceregistry.aio.operations.CertificateAuthoritiesOperations + :ivar certificate_policies: CertificatePoliciesOperations operations + :vartype certificate_policies: + azure.mgmt.deviceregistry.aio.operations.CertificatePoliciesOperations + :ivar registry_devices: RegistryDevicesOperations operations + :vartype registry_devices: azure.mgmt.deviceregistry.aio.operations.RegistryDevicesOperations :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. @@ -88,9 +103,9 @@ class DeviceRegistryMgmtClient: # pylint: disable=too-many-instance-attributes :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-03-01-preview". Default value is "2026-03-01-preview". Note that overriding this default - value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -149,6 +164,9 @@ def __init__( self.operation_status = OperationStatusOperations( self._client, self._config, self._serialize, self._deserialize ) + self.async_operation_status = AsyncOperationStatusOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.assets = AssetsOperations(self._client, self._config, self._serialize, self._deserialize) self.asset_endpoint_profiles = AssetEndpointProfilesOperations( self._client, self._config, self._serialize, self._deserialize @@ -157,8 +175,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize) - self.credentials = CredentialsOperations(self._client, self._config, self._serialize, self._deserialize) - self.policies = PoliciesOperations(self._client, self._config, self._serialize, self._deserialize) self.namespace_assets = NamespaceAssetsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -176,6 +192,15 @@ def __init__( ) self.schemas = SchemasOperations(self._client, self._config, self._serialize, self._deserialize) self.schema_versions = SchemaVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.certificate_authorities = CertificateAuthoritiesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.certificate_policies = CertificatePoliciesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.registry_devices = RegistryDevicesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/_configuration.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/_configuration.py index 6f428fc65c0c..4575b611c0d4 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/_configuration.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,7 +19,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class DeviceRegistryMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes +class DeviceRegistryMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Configuration for DeviceRegistryMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -33,9 +34,9 @@ class DeviceRegistryMgmtClientConfiguration: # pylint: disable=too-many-instanc :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: The API version to use for this operation. Known values are - "2026-03-01-preview". Default value is "2026-03-01-preview". Note that overriding this default - value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are "2026-11-01" + and None. Default value is None. If not set, the operation's default API version will be used. + Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -47,7 +48,7 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2026-03-01-preview") + api_version: str = kwargs.pop("api_version", "2026-11-01") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/_patch.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/_patch.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/operations/__init__.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/operations/__init__.py index 0e32b3a3ba1b..48c273c7d044 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/operations/__init__.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/operations/__init__.py @@ -14,12 +14,11 @@ from ._operations import Operations # type: ignore from ._operations import OperationStatusOperations # type: ignore +from ._operations import AsyncOperationStatusOperations # type: ignore from ._operations import AssetsOperations # type: ignore from ._operations import AssetEndpointProfilesOperations # type: ignore from ._operations import BillingContainersOperations # type: ignore from ._operations import NamespacesOperations # type: ignore -from ._operations import CredentialsOperations # type: ignore -from ._operations import PoliciesOperations # type: ignore from ._operations import NamespaceAssetsOperations # type: ignore from ._operations import NamespaceDevicesOperations # type: ignore from ._operations import NamespaceDiscoveredAssetsOperations # type: ignore @@ -27,6 +26,9 @@ from ._operations import SchemaRegistriesOperations # type: ignore from ._operations import SchemasOperations # type: ignore from ._operations import SchemaVersionsOperations # type: ignore +from ._operations import CertificateAuthoritiesOperations # type: ignore +from ._operations import CertificatePoliciesOperations # type: ignore +from ._operations import RegistryDevicesOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -35,12 +37,11 @@ __all__ = [ "Operations", "OperationStatusOperations", + "AsyncOperationStatusOperations", "AssetsOperations", "AssetEndpointProfilesOperations", "BillingContainersOperations", "NamespacesOperations", - "CredentialsOperations", - "PoliciesOperations", "NamespaceAssetsOperations", "NamespaceDevicesOperations", "NamespaceDiscoveredAssetsOperations", @@ -48,6 +49,9 @@ "SchemaRegistriesOperations", "SchemasOperations", "SchemaVersionsOperations", + "CertificateAuthoritiesOperations", + "CertificatePoliciesOperations", + "RegistryDevicesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/operations/_operations.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/operations/_operations.py index 2da1c806af68..4c3970f5c4da 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/operations/_operations.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/operations/_operations.py @@ -33,7 +33,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models as _models +from ... import models as _models, types as _types from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer from ..._validation import api_version_validation @@ -50,34 +50,41 @@ build_assets_list_by_resource_group_request, build_assets_list_by_subscription_request, build_assets_update_request, + build_async_operation_status_get_request, build_billing_containers_get_request, build_billing_containers_list_by_subscription_request, - build_credentials_create_or_update_request, - build_credentials_delete_request, - build_credentials_get_request, - build_credentials_list_by_resource_group_request, - build_credentials_synchronize_request, - build_credentials_update_request, + build_certificate_authorities_activate_request, + build_certificate_authorities_create_or_replace_request, + build_certificate_authorities_delete_request, + build_certificate_authorities_get_request, + build_certificate_authorities_list_by_namespace_request, + build_certificate_authorities_revoke_and_rotate_request, + build_certificate_authorities_update_request, + build_certificate_policies_create_or_replace_request, + build_certificate_policies_delete_request, + build_certificate_policies_get_request, + build_certificate_policies_list_by_certificate_authority_request, + build_certificate_policies_update_request, build_namespace_assets_create_or_replace_request, build_namespace_assets_delete_request, + build_namespace_assets_execute_action_request, build_namespace_assets_get_request, - build_namespace_assets_list_by_resource_group_request, + build_namespace_assets_list_by_namespace_request, build_namespace_assets_update_request, build_namespace_devices_create_or_replace_request, build_namespace_devices_delete_request, build_namespace_devices_get_request, - build_namespace_devices_list_by_resource_group_request, - build_namespace_devices_revoke_request, + build_namespace_devices_list_by_namespace_request, build_namespace_devices_update_request, build_namespace_discovered_assets_create_or_replace_request, build_namespace_discovered_assets_delete_request, build_namespace_discovered_assets_get_request, - build_namespace_discovered_assets_list_by_resource_group_request, + build_namespace_discovered_assets_list_by_namespace_request, build_namespace_discovered_assets_update_request, build_namespace_discovered_devices_create_or_replace_request, build_namespace_discovered_devices_delete_request, build_namespace_discovered_devices_get_request, - build_namespace_discovered_devices_list_by_resource_group_request, + build_namespace_discovered_devices_list_by_namespace_request, build_namespace_discovered_devices_update_request, build_namespaces_create_or_replace_request, build_namespaces_delete_request, @@ -88,13 +95,11 @@ build_namespaces_update_request, build_operation_status_get_request, build_operations_list_request, - build_policies_activate_bring_your_own_root_request, - build_policies_create_or_update_request, - build_policies_delete_request, - build_policies_get_request, - build_policies_list_by_resource_group_request, - build_policies_revoke_issuer_request, - build_policies_update_request, + build_registry_devices_create_or_replace_request, + build_registry_devices_delete_request, + build_registry_devices_get_request, + build_registry_devices_list_by_namespace_request, + build_registry_devices_update_request, build_schema_registries_create_or_replace_request, build_schema_registries_delete_request, build_schema_registries_get_request, @@ -114,11 +119,10 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list -class Operations: +class Operations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -182,7 +186,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -225,7 +232,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class OperationStatusOperations: +class OperationStatusOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -312,7 +319,99 @@ async def get(self, location: str, operation_id: str, **kwargs: Any) -> _models. return deserialized # type: ignore -class AssetsOperations: +class AsyncOperationStatusOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s + :attr:`async_operation_status` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-11-01", + params_added_on={"2026-11-01": ["api_version", "subscription_id", "location", "operation_id", "accept"]}, + api_versions_list=["2026-11-01"], + ) + async def get(self, location: str, operation_id: str, **kwargs: Any) -> _models.OperationStatusResult: + """Returns the current status of an async operation. + + :param location: The location name. Required. + :type location: str + :param operation_id: The ID of an ongoing async operation. Required. + :type operation_id: str + :return: OperationStatusResult. The OperationStatusResult is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_async_operation_status_get_request( + location=location, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class AssetsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -400,7 +499,11 @@ async def get(self, resource_group_name: str, asset_name: str, **kwargs: Any) -> return deserialized # type: ignore async def _create_or_replace_initial( - self, resource_group_name: str, asset_name: str, resource: Union[_models.Asset, JSON, IO[bytes]], **kwargs: Any + self, + resource_group_name: str, + asset_name: str, + resource: Union[_models.Asset, _types.Asset, IO[bytes]], + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -505,7 +608,7 @@ async def begin_create_or_replace( self, resource_group_name: str, asset_name: str, - resource: JSON, + resource: _types.Asset, *, content_type: str = "application/json", **kwargs: Any @@ -518,7 +621,7 @@ async def begin_create_or_replace( :param asset_name: Asset name parameter. Required. :type asset_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.deviceregistry.types.Asset :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -558,7 +661,11 @@ async def begin_create_or_replace( @distributed_trace_async async def begin_create_or_replace( - self, resource_group_name: str, asset_name: str, resource: Union[_models.Asset, JSON, IO[bytes]], **kwargs: Any + self, + resource_group_name: str, + asset_name: str, + resource: Union[_models.Asset, _types.Asset, IO[bytes]], + **kwargs: Any ) -> AsyncLROPoller[_models.Asset]: """Create a Asset. @@ -567,9 +674,10 @@ async def begin_create_or_replace( :type resource_group_name: str :param asset_name: Asset name parameter. Required. :type asset_name: str - :param resource: Resource create parameters. Is one of the following types: Asset, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.Asset or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a Asset type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.deviceregistry.models.Asset or + ~azure.mgmt.deviceregistry.types.Asset or IO[bytes] :return: An instance of AsyncLROPoller that returns Asset. The Asset is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Asset] @@ -631,7 +739,7 @@ async def _update_initial( self, resource_group_name: str, asset_name: str, - properties: Union[_models.AssetUpdate, JSON, IO[bytes]], + properties: Union[_models.AssetUpdate, _types.AssetUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -735,7 +843,7 @@ async def begin_update( self, resource_group_name: str, asset_name: str, - properties: JSON, + properties: _types.AssetUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -748,7 +856,7 @@ async def begin_update( :param asset_name: Asset name parameter. Required. :type asset_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.deviceregistry.types.AssetUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -791,7 +899,7 @@ async def begin_update( self, resource_group_name: str, asset_name: str, - properties: Union[_models.AssetUpdate, JSON, IO[bytes]], + properties: Union[_models.AssetUpdate, _types.AssetUpdate, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.Asset]: """Update a Asset. @@ -801,9 +909,10 @@ async def begin_update( :type resource_group_name: str :param asset_name: Asset name parameter. Required. :type asset_name: str - :param properties: The resource properties to be updated. Is one of the following types: - AssetUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.AssetUpdate or JSON or IO[bytes] + :param properties: The resource properties to be updated. Is either a AssetUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.AssetUpdate or + ~azure.mgmt.deviceregistry.types.AssetUpdate or IO[bytes] :return: An instance of AsyncLROPoller that returns Asset. The Asset is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Asset] @@ -1029,7 +1138,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1119,7 +1231,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1162,7 +1277,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class AssetEndpointProfilesOperations: +class AssetEndpointProfilesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1255,7 +1370,7 @@ async def _create_or_replace_initial( self, resource_group_name: str, asset_endpoint_profile_name: str, - resource: Union[_models.AssetEndpointProfile, JSON, IO[bytes]], + resource: Union[_models.AssetEndpointProfile, _types.AssetEndpointProfile, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -1362,7 +1477,7 @@ async def begin_create_or_replace( self, resource_group_name: str, asset_endpoint_profile_name: str, - resource: JSON, + resource: _types.AssetEndpointProfile, *, content_type: str = "application/json", **kwargs: Any @@ -1375,7 +1490,7 @@ async def begin_create_or_replace( :param asset_endpoint_profile_name: Asset Endpoint Profile name parameter. Required. :type asset_endpoint_profile_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.deviceregistry.types.AssetEndpointProfile :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1420,7 +1535,7 @@ async def begin_create_or_replace( self, resource_group_name: str, asset_endpoint_profile_name: str, - resource: Union[_models.AssetEndpointProfile, JSON, IO[bytes]], + resource: Union[_models.AssetEndpointProfile, _types.AssetEndpointProfile, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AssetEndpointProfile]: """Create a AssetEndpointProfile. @@ -1430,9 +1545,10 @@ async def begin_create_or_replace( :type resource_group_name: str :param asset_endpoint_profile_name: Asset Endpoint Profile name parameter. Required. :type asset_endpoint_profile_name: str - :param resource: Resource create parameters. Is one of the following types: - AssetEndpointProfile, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.AssetEndpointProfile or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a AssetEndpointProfile type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.AssetEndpointProfile or + ~azure.mgmt.deviceregistry.types.AssetEndpointProfile or IO[bytes] :return: An instance of AsyncLROPoller that returns AssetEndpointProfile. The AssetEndpointProfile is compatible with MutableMapping :rtype: @@ -1495,7 +1611,7 @@ async def _update_initial( self, resource_group_name: str, asset_endpoint_profile_name: str, - properties: Union[_models.AssetEndpointProfileUpdate, JSON, IO[bytes]], + properties: Union[_models.AssetEndpointProfileUpdate, _types.AssetEndpointProfileUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -1600,7 +1716,7 @@ async def begin_update( self, resource_group_name: str, asset_endpoint_profile_name: str, - properties: JSON, + properties: _types.AssetEndpointProfileUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -1613,7 +1729,7 @@ async def begin_update( :param asset_endpoint_profile_name: Asset Endpoint Profile name parameter. Required. :type asset_endpoint_profile_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.deviceregistry.types.AssetEndpointProfileUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1658,7 +1774,7 @@ async def begin_update( self, resource_group_name: str, asset_endpoint_profile_name: str, - properties: Union[_models.AssetEndpointProfileUpdate, JSON, IO[bytes]], + properties: Union[_models.AssetEndpointProfileUpdate, _types.AssetEndpointProfileUpdate, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.AssetEndpointProfile]: """Update a AssetEndpointProfile. @@ -1668,10 +1784,10 @@ async def begin_update( :type resource_group_name: str :param asset_endpoint_profile_name: Asset Endpoint Profile name parameter. Required. :type asset_endpoint_profile_name: str - :param properties: The resource properties to be updated. Is one of the following types: - AssetEndpointProfileUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.AssetEndpointProfileUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + AssetEndpointProfileUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.AssetEndpointProfileUpdate or + ~azure.mgmt.deviceregistry.types.AssetEndpointProfileUpdate or IO[bytes] :return: An instance of AsyncLROPoller that returns AssetEndpointProfile. The AssetEndpointProfile is compatible with MutableMapping :rtype: @@ -1905,7 +2021,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -1996,7 +2115,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2039,7 +2161,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class BillingContainersOperations: +class BillingContainersOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2067,6 +2189,8 @@ def __init__(self, *args, **kwargs) -> None: "2025-10-01", "2025-11-01-preview", "2026-03-01-preview", + "2026-04-01", + "2026-11-01", ], ) async def get(self, billing_container_name: str, **kwargs: Any) -> _models.BillingContainer: @@ -2145,6 +2269,8 @@ async def get(self, billing_container_name: str, **kwargs: Any) -> _models.Billi "2025-10-01", "2025-11-01-preview", "2026-03-01-preview", + "2026-04-01", + "2026-11-01", ], ) def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.BillingContainer"]: @@ -2195,7 +2321,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2238,7 +2367,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class NamespacesOperations: +class NamespacesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2261,7 +2390,14 @@ def __init__(self, *args, **kwargs) -> None: params_added_on={ "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _models.Namespace: """Get a Namespace. @@ -2344,13 +2480,20 @@ async def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def _create_or_replace_initial( self, resource_group_name: str, namespace_name: str, - resource: Union[_models.Namespace, JSON, IO[bytes]], + resource: Union[_models.Namespace, _types.Namespace, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2456,7 +2599,7 @@ async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - resource: JSON, + resource: _types.Namespace, *, content_type: str = "application/json", **kwargs: Any @@ -2469,7 +2612,7 @@ async def begin_create_or_replace( :param namespace_name: The name of the namespace. Required. :type namespace_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.deviceregistry.types.Namespace :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2520,13 +2663,20 @@ async def begin_create_or_replace( "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - resource: Union[_models.Namespace, JSON, IO[bytes]], + resource: Union[_models.Namespace, _types.Namespace, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.Namespace]: """Create a Namespace. @@ -2536,9 +2686,10 @@ async def begin_create_or_replace( :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param resource: Resource create parameters. Is one of the following types: Namespace, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.Namespace or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a Namespace type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.deviceregistry.models.Namespace or + ~azure.mgmt.deviceregistry.types.Namespace or IO[bytes] :return: An instance of AsyncLROPoller that returns Namespace. The Namespace is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Namespace] @@ -2608,13 +2759,20 @@ def get_long_running_output(pipeline_response): "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def _update_initial( self, resource_group_name: str, namespace_name: str, - properties: Union[_models.NamespaceUpdate, JSON, IO[bytes]], + properties: Union[_models.NamespaceUpdate, _types.NamespaceUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -2718,7 +2876,7 @@ async def begin_update( self, resource_group_name: str, namespace_name: str, - properties: JSON, + properties: _types.NamespaceUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -2731,7 +2889,7 @@ async def begin_update( :param namespace_name: The name of the namespace. Required. :type namespace_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.deviceregistry.types.NamespaceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2782,13 +2940,20 @@ async def begin_update( "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def begin_update( self, resource_group_name: str, namespace_name: str, - properties: Union[_models.NamespaceUpdate, JSON, IO[bytes]], + properties: Union[_models.NamespaceUpdate, _types.NamespaceUpdate, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.Namespace]: """Update a Namespace. @@ -2798,9 +2963,10 @@ async def begin_update( :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param properties: The resource properties to be updated. Is one of the following types: - NamespaceUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceUpdate or JSON or IO[bytes] + :param properties: The resource properties to be updated. Is either a NamespaceUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceUpdate or + ~azure.mgmt.deviceregistry.types.NamespaceUpdate or IO[bytes] :return: An instance of AsyncLROPoller that returns Namespace. The Namespace is compatible with MutableMapping :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Namespace] @@ -2863,7 +3029,14 @@ def get_long_running_output(pipeline_response): params_added_on={ "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def _delete_initial( self, resource_group_name: str, namespace_name: str, **kwargs: Any @@ -2932,7 +3105,14 @@ async def _delete_initial( params_added_on={ "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def begin_delete(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> AsyncLROPoller[None]: """Delete a Namespace. @@ -2994,7 +3174,14 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @api_version_validation( method_added_on="2025-07-01-preview", params_added_on={"2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.Namespace"]: """List Namespace resources by resource group. @@ -3047,7 +3234,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3093,7 +3283,14 @@ async def get_next(next_link=None): @api_version_validation( method_added_on="2025-07-01-preview", params_added_on={"2025-07-01-preview": ["api_version", "subscription_id", "accept"]}, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.Namespace"]: """List Namespace resources by subscription ID. @@ -3142,7 +3339,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3196,13 +3396,20 @@ async def get_next(next_link=None): "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def _migrate_initial( self, resource_group_name: str, namespace_name: str, - body: Union[_models.NamespaceMigrateRequest, JSON, IO[bytes]], + body: Union[_models.NamespaceMigrateRequest, _types.NamespaceMigrateRequest, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3308,7 +3515,7 @@ async def begin_migrate( self, resource_group_name: str, namespace_name: str, - body: JSON, + body: _types.NamespaceMigrateRequest, *, content_type: str = "application/json", **kwargs: Any @@ -3321,7 +3528,7 @@ async def begin_migrate( :param namespace_name: The name of the namespace. Required. :type namespace_name: str :param body: The content of the action request. Required. - :type body: JSON + :type body: ~azure.mgmt.deviceregistry.types.NamespaceMigrateRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3370,13 +3577,20 @@ async def begin_migrate( "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def begin_migrate( self, resource_group_name: str, namespace_name: str, - body: Union[_models.NamespaceMigrateRequest, JSON, IO[bytes]], + body: Union[_models.NamespaceMigrateRequest, _types.NamespaceMigrateRequest, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[None]: """Migrate the resources into Namespace. @@ -3386,9 +3600,10 @@ async def begin_migrate( :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param body: The content of the action request. Is one of the following types: - NamespaceMigrateRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.deviceregistry.models.NamespaceMigrateRequest or JSON or IO[bytes] + :param body: The content of the action request. Is either a NamespaceMigrateRequest type or a + IO[bytes] type. Required. + :type body: ~azure.mgmt.deviceregistry.models.NamespaceMigrateRequest or + ~azure.mgmt.deviceregistry.types.NamespaceMigrateRequest or IO[bytes] :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3441,14 +3656,14 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore -class CredentialsOperations: +class NamespaceAssetsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s - :attr:`credentials` attribute. + :attr:`namespace_assets` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -3460,22 +3675,40 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async @api_version_validation( - method_added_on="2025-11-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2025-11-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "asset_name", + "accept", + ] }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _models.Credential: - """Get a Credential. + async def get( + self, resource_group_name: str, namespace_name: str, asset_name: str, **kwargs: Any + ) -> _models.NamespaceAsset: + """Get a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :return: Credential. The Credential is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.Credential + :param asset_name: The name of the asset. Required. + :type asset_name: str + :return: NamespaceAsset. The NamespaceAsset is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.NamespaceAsset :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3489,11 +3722,12 @@ async def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Credential] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceAsset] = kwargs.pop("cls", None) - _request = build_credentials_get_request( + _request = build_namespace_assets_get_request( resource_group_name=resource_group_name, namespace_name=namespace_name, + asset_name=asset_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -3528,7 +3762,7 @@ async def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Credential, response.json()) + deserialized = _deserialize(_models.NamespaceAsset, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3536,24 +3770,33 @@ async def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any return deserialized # type: ignore @api_version_validation( - method_added_on="2025-11-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2025-11-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", + "asset_name", "content_type", "accept", ] }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def _create_or_update_initial( + async def _create_or_replace_initial( self, resource_group_name: str, namespace_name: str, - resource: Union[_models.Credential, JSON, IO[bytes]], + asset_name: str, + resource: Union[_models.NamespaceAsset, _types.NamespaceAsset, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3577,9 +3820,10 @@ async def _create_or_update_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_credentials_create_or_update_request( + _request = build_namespace_assets_create_or_replace_request( resource_group_name=resource_group_name, namespace_name=namespace_name, + asset_name=asset_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -3627,138 +3871,160 @@ async def _create_or_update_initial( return deserialized # type: ignore @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - resource: _models.Credential, + asset_name: str, + resource: _models.NamespaceAsset, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Credential]: - """Create a Credential. + ) -> AsyncLROPoller[_models.NamespaceAsset]: + """Create a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str + :param asset_name: The name of the asset. Required. + :type asset_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.Credential + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceAsset :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Credential. The Credential is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Credential] + :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - resource: JSON, + asset_name: str, + resource: _types.NamespaceAsset, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Credential]: - """Create a Credential. + ) -> AsyncLROPoller[_models.NamespaceAsset]: + """Create a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str + :param asset_name: The name of the asset. Required. + :type asset_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.deviceregistry.types.NamespaceAsset :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Credential. The Credential is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Credential] + :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, + asset_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Credential]: - """Create a Credential. + ) -> AsyncLROPoller[_models.NamespaceAsset]: + """Create a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str + :param asset_name: The name of the asset. Required. + :type asset_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Credential. The Credential is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Credential] + :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2025-11-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2025-11-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", + "asset_name", "content_type", "accept", ] }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def begin_create_or_update( + async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - resource: Union[_models.Credential, JSON, IO[bytes]], + asset_name: str, + resource: Union[_models.NamespaceAsset, _types.NamespaceAsset, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.Credential]: - """Create a Credential. + ) -> AsyncLROPoller[_models.NamespaceAsset]: + """Create a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param resource: Resource create parameters. Is one of the following types: Credential, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.Credential or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns Credential. The Credential is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Credential] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + :param asset_name: The name of the asset. Required. + :type asset_name: str + :param resource: Resource create parameters. Is either a NamespaceAsset type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceAsset or + ~azure.mgmt.deviceregistry.types.NamespaceAsset or IO[bytes] + :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Credential] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceAsset] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( + raw_result = await self._create_or_replace_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, + asset_name=asset_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -3771,7 +4037,7 @@ async def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Credential, response.json()) + deserialized = _deserialize(_models.NamespaceAsset, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3789,167 +4055,44 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.Credential].from_continuation_token( + return AsyncLROPoller[_models.NamespaceAsset].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.Credential]( + return AsyncLROPoller[_models.NamespaceAsset]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2025-11-01-preview", - params_added_on={ - "2025-11-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name"] - }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], - ) - async def _delete_initial( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_credentials_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-11-01-preview", - params_added_on={ - "2025-11-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name"] - }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], - ) - async def begin_delete(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Delete a Credential. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @api_version_validation( - method_added_on="2025-11-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2025-11-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", + "asset_name", "content_type", "accept", ] }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def _update_initial( self, resource_group_name: str, namespace_name: str, - properties: Union[_models.CredentialUpdate, JSON, IO[bytes]], + asset_name: str, + properties: Union[_models.NamespaceAssetUpdate, _types.NamespaceAssetUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -3973,9 +4116,10 @@ async def _update_initial( else: _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_credentials_update_request( + _request = build_namespace_assets_update_request( resource_group_name=resource_group_name, namespace_name=namespace_name, + asset_name=asset_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -4025,26 +4169,29 @@ async def begin_update( self, resource_group_name: str, namespace_name: str, - properties: _models.CredentialUpdate, + asset_name: str, + properties: _models.NamespaceAssetUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Credential]: - """Update a Credential. + ) -> AsyncLROPoller[_models.NamespaceAsset]: + """Update a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str + :param asset_name: The name of the asset. Required. + :type asset_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.deviceregistry.models.CredentialUpdate + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceAssetUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Credential. The Credential is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Credential] + :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4053,26 +4200,29 @@ async def begin_update( self, resource_group_name: str, namespace_name: str, - properties: JSON, + asset_name: str, + properties: _types.NamespaceAssetUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Credential]: - """Update a Credential. + ) -> AsyncLROPoller[_models.NamespaceAsset]: + """Update a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str + :param asset_name: The name of the asset. Required. + :type asset_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.deviceregistry.types.NamespaceAssetUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Credential. The Credential is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Credential] + :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4081,71 +4231,86 @@ async def begin_update( self, resource_group_name: str, namespace_name: str, + asset_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Credential]: - """Update a Credential. + ) -> AsyncLROPoller[_models.NamespaceAsset]: + """Update a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str + :param asset_name: The name of the asset. Required. + :type asset_name: str :param properties: The resource properties to be updated. Required. :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Credential. The Credential is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Credential] + :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2025-11-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2025-11-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", + "asset_name", "content_type", "accept", ] }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def begin_update( self, resource_group_name: str, namespace_name: str, - properties: Union[_models.CredentialUpdate, JSON, IO[bytes]], + asset_name: str, + properties: Union[_models.NamespaceAssetUpdate, _types.NamespaceAssetUpdate, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.Credential]: - """Update a Credential. + ) -> AsyncLROPoller[_models.NamespaceAsset]: + """Update a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param properties: The resource properties to be updated. Is one of the following types: - CredentialUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.CredentialUpdate or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns Credential. The Credential is compatible - with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Credential] + :param asset_name: The name of the asset. Required. + :type asset_name: str + :param properties: The resource properties to be updated. Is either a NamespaceAssetUpdate type + or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceAssetUpdate or + ~azure.mgmt.deviceregistry.types.NamespaceAssetUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Credential] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceAsset] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -4153,6 +4318,7 @@ async def begin_update( raw_result = await self._update_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, + asset_name=asset_name, properties=properties, content_type=content_type, cls=lambda x, y, z: x, @@ -4165,7 +4331,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Credential, response.json()) + deserialized = _deserialize(_models.NamespaceAsset, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -4183,43 +4349,39 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.Credential].from_continuation_token( + return AsyncLROPoller[_models.NamespaceAsset].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.Credential]( + return AsyncLROPoller[_models.NamespaceAsset]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @distributed_trace @api_version_validation( - method_added_on="2025-11-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2025-11-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "asset_name", + ] }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def list_by_resource_group( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.Credential"]: - """List Credential resources by Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :return: An iterator like instance of Credential - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.Credential] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Credential]] = kwargs.pop("cls", None) - + async def _delete_initial( + self, resource_group_name: str, namespace_name: str, asset_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4228,103 +4390,15 @@ def list_by_resource_group( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - _request = build_credentials_list_by_resource_group_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Credential], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @api_version_validation( - method_added_on="2025-11-01-preview", - params_added_on={ - "2025-11-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name"] - }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], - ) - async def _synchronize_initial( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_credentials_synchronize_request( + _request = build_namespace_assets_delete_request( resource_group_name=resource_group_name, namespace_name=namespace_name, + asset_name=asset_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -4343,7 +4417,7 @@ async def _synchronize_initial( response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -4356,8 +4430,9 @@ async def _synchronize_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -4368,22 +4443,37 @@ async def _synchronize_initial( @distributed_trace_async @api_version_validation( - method_added_on="2025-11-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2025-11-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name"] + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "asset_name", + ] }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def begin_synchronize( - self, resource_group_name: str, namespace_name: str, **kwargs: Any + async def begin_delete( + self, resource_group_name: str, namespace_name: str, asset_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """A long-running resource action. + """Delete a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str + :param asset_name: The name of the asset. Required. + :type asset_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -4396,9 +4486,10 @@ async def begin_synchronize( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._synchronize_initial( + raw_result = await self._delete_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, + asset_name=asset_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -4432,55 +4523,41 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - -class PoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s - :attr:`policies` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async + @distributed_trace @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2026-03-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "policy_name", - "accept", - ] + "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def get( - self, resource_group_name: str, namespace_name: str, policy_name: str, **kwargs: Any - ) -> _models.Policy: - """Get a Policy. + def list_by_namespace( + self, resource_group_name: str, namespace_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.NamespaceAsset"]: + """List NamespaceAsset resources by Namespace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :return: Policy. The Policy is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.Policy + :return: An iterator like instance of NamespaceAsset + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NamespaceAsset]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4489,77 +4566,101 @@ async def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + def prepare_request(next_link=None): + if not next_link: - cls: ClsType[_models.Policy] = kwargs.pop("cls", None) + _request = build_namespace_assets_list_by_namespace_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _request = build_policies_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + return _request - response = pipeline_response.http_response + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NamespaceAsset], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response = pipeline_response.http_response - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Policy, response.json()) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return AsyncItemPaged(get_next, extract_data) @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2026-04-01", params_added_on={ - "2026-03-01-preview": [ + "2026-04-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", + "asset_name", "content_type", "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=["2026-04-01", "2026-11-01"], ) - async def _create_or_update_initial( + async def _execute_action_initial( self, resource_group_name: str, namespace_name: str, - policy_name: str, - resource: Union[_models.Policy, JSON, IO[bytes]], + asset_name: str, + body: Union[_models.NamespaceAssetExecuteActionRequest, _types.NamespaceAssetExecuteActionRequest, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -4578,15 +4679,15 @@ async def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(body, (IOBase, bytes)): + _content = body else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_policies_create_or_update_request( + _request = build_namespace_assets_execute_action_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, + asset_name=asset_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -4607,7 +4708,7 @@ async def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -4620,10 +4721,11 @@ async def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: + if response.status_code == 202: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -4634,153 +4736,150 @@ async def _create_or_update_initial( return deserialized # type: ignore @overload - async def begin_create_or_update( + async def begin_execute_action( self, resource_group_name: str, namespace_name: str, - policy_name: str, - resource: _models.Policy, + asset_name: str, + body: _models.NamespaceAssetExecuteActionRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Policy]: - """Create a Policy. + ) -> AsyncLROPoller[None]: + """A long-running resource action. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.Policy + :param asset_name: The name of the asset. Required. + :type asset_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.deviceregistry.models.NamespaceAssetExecuteActionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Policy] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_execute_action( self, resource_group_name: str, namespace_name: str, - policy_name: str, - resource: JSON, + asset_name: str, + body: _types.NamespaceAssetExecuteActionRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Policy]: - """Create a Policy. + ) -> AsyncLROPoller[None]: + """A long-running resource action. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON + :param asset_name: The name of the asset. Required. + :type asset_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.deviceregistry.types.NamespaceAssetExecuteActionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Policy] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_update( + async def begin_execute_action( self, resource_group_name: str, namespace_name: str, - policy_name: str, - resource: IO[bytes], + asset_name: str, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Policy]: - """Create a Policy. + ) -> AsyncLROPoller[None]: + """A long-running resource action. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] + :param asset_name: The name of the asset. Required. + :type asset_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Policy] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2026-04-01", params_added_on={ - "2026-03-01-preview": [ + "2026-04-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", + "asset_name", "content_type", "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=["2026-04-01", "2026-11-01"], ) - async def begin_create_or_update( + async def begin_execute_action( self, resource_group_name: str, namespace_name: str, - policy_name: str, - resource: Union[_models.Policy, JSON, IO[bytes]], + asset_name: str, + body: Union[_models.NamespaceAssetExecuteActionRequest, _types.NamespaceAssetExecuteActionRequest, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.Policy]: - """Create a Policy. + ) -> AsyncLROPoller[None]: + """A long-running resource action. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param resource: Resource create parameters. Is one of the following types: Policy, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.Policy or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Policy] + :param asset_name: The name of the asset. Required. + :type asset_name: str + :param body: The content of the action request. Is either a NamespaceAssetExecuteActionRequest + type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.deviceregistry.models.NamespaceAssetExecuteActionRequest or + ~azure.mgmt.deviceregistry.types.NamespaceAssetExecuteActionRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Policy] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_update_initial( + raw_result = await self._execute_action_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, - resource=resource, + asset_name=asset_name, + body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -4790,12 +4889,9 @@ async def begin_create_or_update( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Policy, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -4810,32 +4906,70 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.Policy].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.Policy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class NamespaceDevicesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s + :attr:`namespace_devices` attribute. + """ + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", + "device_name", + "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def _delete_initial( - self, resource_group_name: str, namespace_name: str, policy_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: + async def get( + self, resource_group_name: str, namespace_name: str, device_name: str, **kwargs: Any + ) -> _models.NamespaceDevice: + """Get a NamespaceDevice. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param device_name: The name of the device. Required. + :type device_name: str + :return: NamespaceDevice. The NamespaceDevice is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.NamespaceDevice + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4847,12 +4981,12 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceDevice] = kwargs.pop("cls", None) - _request = build_policies_delete_request( + _request = build_namespace_devices_get_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, + device_name=device_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -4864,18 +4998,19 @@ async def _delete_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -4883,114 +5018,44 @@ async def _delete_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NamespaceDevice, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace_async - @api_version_validation( - method_added_on="2026-03-01-preview", - params_added_on={ - "2026-03-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "policy_name", - ] - }, - api_versions_list=["2026-03-01-preview"], - ) - async def begin_delete( - self, resource_group_name: str, namespace_name: str, policy_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - policy_name=policy_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", + "device_name", "content_type", "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def _update_initial( + async def _create_or_replace_initial( self, resource_group_name: str, namespace_name: str, - policy_name: str, - properties: Union[_models.PolicyUpdate, JSON, IO[bytes]], + device_name: str, + resource: Union[_models.NamespaceDevice, _types.NamespaceDevice, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -5009,15 +5074,15 @@ async def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties + if isinstance(resource, (IOBase, bytes)): + _content = resource else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_policies_update_request( + _request = build_namespace_devices_create_or_replace_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, + device_name=device_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -5038,7 +5103,7 @@ async def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -5051,8 +5116,10 @@ async def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -5063,153 +5130,161 @@ async def _update_initial( return deserialized # type: ignore @overload - async def begin_update( + async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - policy_name: str, - properties: _models.PolicyUpdate, + device_name: str, + resource: _models.NamespaceDevice, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Policy]: - """Update a Policy. + ) -> AsyncLROPoller[_models.NamespaceDevice]: + """Create a NamespaceDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.deviceregistry.models.PolicyUpdate + :param device_name: The name of the device. Required. + :type device_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDevice :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Policy] + :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update( + async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - policy_name: str, - properties: JSON, + device_name: str, + resource: _types.NamespaceDevice, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Policy]: - """Update a Policy. + ) -> AsyncLROPoller[_models.NamespaceDevice]: + """Create a NamespaceDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON + :param device_name: The name of the device. Required. + :type device_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.types.NamespaceDevice :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Policy] + :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update( + async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - policy_name: str, - properties: IO[bytes], + device_name: str, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.Policy]: - """Update a Policy. + ) -> AsyncLROPoller[_models.NamespaceDevice]: + """Create a NamespaceDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] + :param device_name: The name of the device. Required. + :type device_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Policy] + :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", + "device_name", "content_type", "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def begin_update( + async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - policy_name: str, - properties: Union[_models.PolicyUpdate, JSON, IO[bytes]], + device_name: str, + resource: Union[_models.NamespaceDevice, _types.NamespaceDevice, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.Policy]: - """Update a Policy. + ) -> AsyncLROPoller[_models.NamespaceDevice]: + """Create a NamespaceDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param properties: The resource properties to be updated. Is one of the following types: - PolicyUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.PolicyUpdate or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.Policy] + :param device_name: The name of the device. Required. + :type device_name: str + :param resource: Resource create parameters. Is either a NamespaceDevice type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDevice or + ~azure.mgmt.deviceregistry.types.NamespaceDevice or IO[bytes] + :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Policy] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceDevice] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( + raw_result = await self._create_or_replace_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, - properties=properties, + device_name=device_name, + resource=resource, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -5221,7 +5296,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Policy, response.json()) + deserialized = _deserialize(_models.NamespaceDevice, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -5239,137 +5314,45 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.Policy].from_continuation_token( + return AsyncLROPoller[_models.NamespaceDevice].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.Policy]( + return AsyncLROPoller[_models.NamespaceDevice]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @distributed_trace - @api_version_validation( - method_added_on="2026-03-01-preview", - params_added_on={ - "2026-03-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] - }, - api_versions_list=["2026-03-01-preview"], - ) - def list_by_resource_group( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.Policy"]: - """List Policy resources by Credential. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :return: An iterator like instance of Policy - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.Policy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Policy]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_policies_list_by_resource_group_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Policy], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", + "device_name", + "content_type", + "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def _revoke_issuer_initial( - self, resource_group_name: str, namespace_name: str, policy_name: str, **kwargs: Any + async def _update_initial( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + properties: Union[_models.NamespaceDeviceUpdate, _types.NamespaceDeviceUpdate, IO[bytes]], + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -5379,17 +5362,27 @@ async def _revoke_issuer_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_policies_revoke_issuer_request( + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_namespace_devices_update_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, + device_name=device_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -5406,7 +5399,7 @@ async def _revoke_issuer_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -5430,320 +5423,162 @@ async def _revoke_issuer_initial( return deserialized # type: ignore - @distributed_trace_async - @api_version_validation( - method_added_on="2026-03-01-preview", - params_added_on={ - "2026-03-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "policy_name", - ] - }, - api_versions_list=["2026-03-01-preview"], - ) - async def begin_revoke_issuer( - self, resource_group_name: str, namespace_name: str, policy_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """A long-running resource action. + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + properties: _models.NamespaceDeviceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NamespaceDevice]: + """Update a NamespaceDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param device_name: The name of the device. Required. + :type device_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDeviceUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._revoke_issuer_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - policy_name=policy_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @api_version_validation( - method_added_on="2026-03-01-preview", - params_added_on={ - "2026-03-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "policy_name", - "content_type", - ] - }, - api_versions_list=["2026-03-01-preview"], - ) - async def _activate_bring_your_own_root_initial( + @overload + async def begin_update( self, resource_group_name: str, namespace_name: str, - policy_name: str, - body: Union[_models.ActivateBringYourOwnRootRequest, JSON, IO[bytes]], + device_name: str, + properties: _types.NamespaceDeviceUpdate, + *, + content_type: str = "application/json", **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_policies_activate_bring_your_own_root_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_activate_bring_your_own_root( - self, - resource_group_name: str, - namespace_name: str, - policy_name: str, - body: _models.ActivateBringYourOwnRootRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Activates or renews a Bring Your Own Root policy by accepting a customer-provided signed - certificate. This is a long-running operation that returns no content upon completion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.deviceregistry.models.ActivateBringYourOwnRootRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_activate_bring_your_own_root( - self, - resource_group_name: str, - namespace_name: str, - policy_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Activates or renews a Bring Your Own Root policy by accepting a customer-provided signed - certificate. This is a long-running operation that returns no content upon completion. + ) -> AsyncLROPoller[_models.NamespaceDevice]: + """Update a NamespaceDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param body: The content of the action request. Required. - :type body: JSON + :param device_name: The name of the device. Required. + :type device_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.types.NamespaceDeviceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_activate_bring_your_own_root( + async def begin_update( self, resource_group_name: str, namespace_name: str, - policy_name: str, - body: IO[bytes], + device_name: str, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """Activates or renews a Bring Your Own Root policy by accepting a customer-provided signed - certificate. This is a long-running operation that returns no content upon completion. + ) -> AsyncLROPoller[_models.NamespaceDevice]: + """Update a NamespaceDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param body: The content of the action request. Required. - :type body: IO[bytes] + :param device_name: The name of the device. Required. + :type device_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", + "device_name", "content_type", + "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def begin_activate_bring_your_own_root( + async def begin_update( self, resource_group_name: str, namespace_name: str, - policy_name: str, - body: Union[_models.ActivateBringYourOwnRootRequest, JSON, IO[bytes]], + device_name: str, + properties: Union[_models.NamespaceDeviceUpdate, _types.NamespaceDeviceUpdate, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[None]: - """Activates or renews a Bring Your Own Root policy by accepting a customer-provided signed - certificate. This is a long-running operation that returns no content upon completion. + ) -> AsyncLROPoller[_models.NamespaceDevice]: + """Update a NamespaceDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param body: The content of the action request. Is one of the following types: - ActivateBringYourOwnRootRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.deviceregistry.models.ActivateBringYourOwnRootRequest or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param device_name: The name of the device. Required. + :type device_name: str + :param properties: The resource properties to be updated. Is either a NamespaceDeviceUpdate + type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDeviceUpdate or + ~azure.mgmt.deviceregistry.types.NamespaceDeviceUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceDevice] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._activate_bring_your_own_root_initial( + raw_result = await self._update_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, - body=body, + device_name=device_name, + properties=properties, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -5753,9 +5588,12 @@ async def begin_activate_bring_your_own_root( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NamespaceDevice, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -5770,33 +5608,16 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.NamespaceDevice].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class NamespaceAssetsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s - :attr:`namespace_assets` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return AsyncLROPoller[_models.NamespaceDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @distributed_trace_async @api_version_validation( method_added_on="2025-07-01-preview", params_added_on={ @@ -5805,28 +5626,21 @@ def __init__(self, *args, **kwargs) -> None: "subscription_id", "resource_group_name", "namespace_name", - "asset_name", - "accept", + "device_name", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def get( - self, resource_group_name: str, namespace_name: str, asset_name: str, **kwargs: Any - ) -> _models.NamespaceAsset: - """Get a NamespaceAsset. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str - :return: NamespaceAsset. The NamespaceAsset is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.NamespaceAsset - :raises ~azure.core.exceptions.HttpResponseError: - """ + async def _delete_initial( + self, resource_group_name: str, namespace_name: str, device_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5838,12 +5652,12 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.NamespaceAsset] = kwargs.pop("cls", None) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_namespace_assets_get_request( + _request = build_namespace_devices_delete_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - asset_name=asset_name, + device_name=device_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -5855,19 +5669,18 @@ async def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -5875,16 +5688,19 @@ async def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.NamespaceAsset, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore + @distributed_trace_async @api_version_validation( method_added_on="2025-07-01-preview", params_added_on={ @@ -5893,19 +5709,1333 @@ async def get( "subscription_id", "resource_group_name", "namespace_name", - "asset_name", - "content_type", - "accept", + "device_name", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def _create_or_replace_initial( + async def begin_delete( + self, resource_group_name: str, namespace_name: str, device_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a NamespaceDevice. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param device_name: The name of the device. Required. + :type device_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + device_name=device_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-01-preview", + params_added_on={ + "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] + }, + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + def list_by_namespace( + self, resource_group_name: str, namespace_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.NamespaceDevice"]: + """List NamespaceDevice resources by Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :return: An iterator like instance of NamespaceDevice + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NamespaceDevice]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_namespace_devices_list_by_namespace_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NamespaceDevice], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NamespaceDiscoveredAssetsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s + :attr:`namespace_discovered_assets` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-01-preview", + params_added_on={ + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "discovered_asset_name", + "accept", + ] + }, + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + async def get( + self, resource_group_name: str, namespace_name: str, discovered_asset_name: str, **kwargs: Any + ) -> _models.NamespaceDiscoveredAsset: + """Get a NamespaceDiscoveredAsset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str + :return: NamespaceDiscoveredAsset. The NamespaceDiscoveredAsset is compatible with + MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NamespaceDiscoveredAsset] = kwargs.pop("cls", None) + + _request = build_namespace_discovered_assets_get_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + discovered_asset_name=discovered_asset_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NamespaceDiscoveredAsset, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-07-01-preview", + params_added_on={ + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "discovered_asset_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + async def _create_or_replace_initial( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + resource: Union[_models.NamespaceDiscoveredAsset, _types.NamespaceDiscoveredAsset, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_namespace_discovered_assets_create_or_replace_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + discovered_asset_name=discovered_asset_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + resource: _models.NamespaceDiscoveredAsset, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: + """Create a NamespaceDiscoveredAsset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + resource: _types.NamespaceDiscoveredAsset, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: + """Create a NamespaceDiscoveredAsset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredAsset + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: + """Create a NamespaceDiscoveredAsset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-01-preview", + params_added_on={ + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "discovered_asset_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + resource: Union[_models.NamespaceDiscoveredAsset, _types.NamespaceDiscoveredAsset, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: + """Create a NamespaceDiscoveredAsset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str + :param resource: Resource create parameters. Is either a NamespaceDiscoveredAsset type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset or + ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredAsset or IO[bytes] + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NamespaceDiscoveredAsset] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_replace_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + discovered_asset_name=discovered_asset_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NamespaceDiscoveredAsset, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NamespaceDiscoveredAsset].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NamespaceDiscoveredAsset]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-01-preview", + params_added_on={ + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "discovered_asset_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + async def _update_initial( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + properties: Union[_models.NamespaceDiscoveredAssetUpdate, _types.NamespaceDiscoveredAssetUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_namespace_discovered_assets_update_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + discovered_asset_name=discovered_asset_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + properties: _models.NamespaceDiscoveredAssetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: + """Update a NamespaceDiscoveredAsset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAssetUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + properties: _types.NamespaceDiscoveredAssetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: + """Update a NamespaceDiscoveredAsset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredAssetUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: + """Update a NamespaceDiscoveredAsset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-01-preview", + params_added_on={ + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "discovered_asset_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + discovered_asset_name: str, + properties: Union[_models.NamespaceDiscoveredAssetUpdate, _types.NamespaceDiscoveredAssetUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: + """Update a NamespaceDiscoveredAsset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str + :param properties: The resource properties to be updated. Is either a + NamespaceDiscoveredAssetUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAssetUpdate or + ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredAssetUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NamespaceDiscoveredAsset] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + discovered_asset_name=discovered_asset_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NamespaceDiscoveredAsset, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NamespaceDiscoveredAsset].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NamespaceDiscoveredAsset]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @api_version_validation( + method_added_on="2025-07-01-preview", + params_added_on={ + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "discovered_asset_name", + ] + }, + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + async def _delete_initial( + self, resource_group_name: str, namespace_name: str, discovered_asset_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_namespace_discovered_assets_delete_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + discovered_asset_name=discovered_asset_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-01-preview", + params_added_on={ + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "discovered_asset_name", + ] + }, + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + async def begin_delete( + self, resource_group_name: str, namespace_name: str, discovered_asset_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a NamespaceDiscoveredAsset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + discovered_asset_name=discovered_asset_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-01-preview", + params_added_on={ + "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] + }, + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + def list_by_namespace( + self, resource_group_name: str, namespace_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.NamespaceDiscoveredAsset"]: + """List NamespaceDiscoveredAsset resources by Namespace. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :return: An iterator like instance of NamespaceDiscoveredAsset + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NamespaceDiscoveredAsset]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_namespace_discovered_assets_list_by_namespace_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NamespaceDiscoveredAsset], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NamespaceDiscoveredDevicesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s + :attr:`namespace_discovered_devices` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2025-07-01-preview", + params_added_on={ + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "discovered_device_name", + "accept", + ] + }, + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + async def get( + self, resource_group_name: str, namespace_name: str, discovered_device_name: str, **kwargs: Any + ) -> _models.NamespaceDiscoveredDevice: + """Get a NamespaceDiscoveredDevice. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str + :return: NamespaceDiscoveredDevice. The NamespaceDiscoveredDevice is compatible with + MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NamespaceDiscoveredDevice] = kwargs.pop("cls", None) + + _request = build_namespace_discovered_devices_get_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + discovered_device_name=discovered_device_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NamespaceDiscoveredDevice, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-07-01-preview", + params_added_on={ + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "discovered_device_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + async def _create_or_replace_initial( self, resource_group_name: str, namespace_name: str, - asset_name: str, - resource: Union[_models.NamespaceAsset, JSON, IO[bytes]], + discovered_device_name: str, + resource: Union[_models.NamespaceDiscoveredDevice, _types.NamespaceDiscoveredDevice, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -5929,10 +7059,10 @@ async def _create_or_replace_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_namespace_assets_create_or_replace_request( + _request = build_namespace_discovered_devices_create_or_replace_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - asset_name=asset_name, + discovered_device_name=discovered_device_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -5984,29 +7114,30 @@ async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - asset_name: str, - resource: _models.NamespaceAsset, + discovered_device_name: str, + resource: _models.NamespaceDiscoveredDevice, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceAsset]: - """Create a NamespaceAsset. + ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: + """Create a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceAsset + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -6015,29 +7146,30 @@ async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - asset_name: str, - resource: JSON, + discovered_device_name: str, + resource: _types.NamespaceDiscoveredDevice, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceAsset]: - """Create a NamespaceAsset. + ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: + """Create a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredDevice :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -6046,29 +7178,30 @@ async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - asset_name: str, + discovered_device_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceAsset]: - """Create a NamespaceAsset. + ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: + """Create a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -6081,43 +7214,52 @@ async def begin_create_or_replace( "subscription_id", "resource_group_name", "namespace_name", - "asset_name", + "discovered_device_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - asset_name: str, - resource: Union[_models.NamespaceAsset, JSON, IO[bytes]], + discovered_device_name: str, + resource: Union[_models.NamespaceDiscoveredDevice, _types.NamespaceDiscoveredDevice, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceAsset]: - """Create a NamespaceAsset. + ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: + """Create a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str - :param resource: Resource create parameters. Is one of the following types: NamespaceAsset, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceAsset or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str + :param resource: Resource create parameters. Is either a NamespaceDiscoveredDevice type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice or + ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredDevice or IO[bytes] + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceAsset] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceDiscoveredDevice] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -6125,7 +7267,7 @@ async def begin_create_or_replace( raw_result = await self._create_or_replace_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - asset_name=asset_name, + discovered_device_name=discovered_device_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -6138,7 +7280,7 @@ async def begin_create_or_replace( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceAsset, response.json()) + deserialized = _deserialize(_models.NamespaceDiscoveredDevice, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -6156,13 +7298,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.NamespaceAsset].from_continuation_token( + return AsyncLROPoller[_models.NamespaceDiscoveredDevice].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.NamespaceAsset]( + return AsyncLROPoller[_models.NamespaceDiscoveredDevice]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -6174,19 +7316,26 @@ def get_long_running_output(pipeline_response): "subscription_id", "resource_group_name", "namespace_name", - "asset_name", + "discovered_device_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def _update_initial( self, resource_group_name: str, namespace_name: str, - asset_name: str, - properties: Union[_models.NamespaceAssetUpdate, JSON, IO[bytes]], + discovered_device_name: str, + properties: Union[_models.NamespaceDiscoveredDeviceUpdate, _types.NamespaceDiscoveredDeviceUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -6210,10 +7359,10 @@ async def _update_initial( else: _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_namespace_assets_update_request( + _request = build_namespace_discovered_devices_update_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - asset_name=asset_name, + discovered_device_name=discovered_device_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -6263,29 +7412,30 @@ async def begin_update( self, resource_group_name: str, namespace_name: str, - asset_name: str, - properties: _models.NamespaceAssetUpdate, + discovered_device_name: str, + properties: _models.NamespaceDiscoveredDeviceUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceAsset]: - """Update a NamespaceAsset. + ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: + """Update a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceAssetUpdate + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDeviceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -6294,29 +7444,30 @@ async def begin_update( self, resource_group_name: str, namespace_name: str, - asset_name: str, - properties: JSON, + discovered_device_name: str, + properties: _types.NamespaceDiscoveredDeviceUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceAsset]: - """Update a NamespaceAsset. + ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: + """Update a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredDeviceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -6325,29 +7476,30 @@ async def begin_update( self, resource_group_name: str, namespace_name: str, - asset_name: str, + discovered_device_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceAsset]: - """Update a NamespaceAsset. + ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: + """Update a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str :param properties: The resource properties to be updated. Required. :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -6360,43 +7512,52 @@ async def begin_update( "subscription_id", "resource_group_name", "namespace_name", - "asset_name", + "discovered_device_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def begin_update( self, resource_group_name: str, namespace_name: str, - asset_name: str, - properties: Union[_models.NamespaceAssetUpdate, JSON, IO[bytes]], + discovered_device_name: str, + properties: Union[_models.NamespaceDiscoveredDeviceUpdate, _types.NamespaceDiscoveredDeviceUpdate, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceAsset]: - """Update a NamespaceAsset. + ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: + """Update a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str - :param properties: The resource properties to be updated. Is one of the following types: - NamespaceAssetUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceAssetUpdate or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns NamespaceAsset. The NamespaceAsset is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str + :param properties: The resource properties to be updated. Is either a + NamespaceDiscoveredDeviceUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDeviceUpdate or + ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredDeviceUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceAsset] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceDiscoveredDevice] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -6404,7 +7565,7 @@ async def begin_update( raw_result = await self._update_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - asset_name=asset_name, + discovered_device_name=discovered_device_name, properties=properties, content_type=content_type, cls=lambda x, y, z: x, @@ -6417,7 +7578,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceAsset, response.json()) + deserialized = _deserialize(_models.NamespaceDiscoveredDevice, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -6435,13 +7596,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.NamespaceAsset].from_continuation_token( + return AsyncLROPoller[_models.NamespaceDiscoveredDevice].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.NamespaceAsset]( + return AsyncLROPoller[_models.NamespaceDiscoveredDevice]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -6453,13 +7614,20 @@ def get_long_running_output(pipeline_response): "subscription_id", "resource_group_name", "namespace_name", - "asset_name", + "discovered_device_name", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def _delete_initial( - self, resource_group_name: str, namespace_name: str, asset_name: str, **kwargs: Any + self, resource_group_name: str, namespace_name: str, discovered_device_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6474,10 +7642,10 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_namespace_assets_delete_request( + _request = build_namespace_discovered_devices_delete_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - asset_name=asset_name, + discovered_device_name=discovered_device_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -6529,23 +7697,30 @@ async def _delete_initial( "subscription_id", "resource_group_name", "namespace_name", - "asset_name", + "discovered_device_name", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def begin_delete( - self, resource_group_name: str, namespace_name: str, asset_name: str, **kwargs: Any + self, resource_group_name: str, namespace_name: str, discovered_device_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a NamespaceAsset. + """Delete a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -6561,7 +7736,7 @@ async def begin_delete( raw_result = await self._delete_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - asset_name=asset_name, + discovered_device_name=discovered_device_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -6601,27 +7776,34 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={ "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def list_by_resource_group( + def list_by_namespace( self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.NamespaceAsset"]: - """List NamespaceAsset resources by Namespace. + ) -> AsyncItemPaged["_models.NamespaceDiscoveredDevice"]: + """List NamespaceDiscoveredDevice resources by Namespace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :return: An iterator like instance of NamespaceAsset + :return: An iterator like instance of NamespaceDiscoveredDevice :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.NamespaceAsset] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.NamespaceAsset]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.NamespaceDiscoveredDevice]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -6634,7 +7816,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_namespace_assets_list_by_resource_group_request( + _request = build_namespace_discovered_devices_list_by_namespace_request( resource_group_name=resource_group_name, namespace_name=namespace_name, subscription_id=self._config.subscription_id, @@ -6660,7 +7842,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -6674,7 +7859,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.NamespaceAsset], + List[_models.NamespaceDiscoveredDevice], deserialized.get("value", []), ) if cls: @@ -6703,14 +7888,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class NamespaceDevicesOperations: +class SchemaRegistriesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s - :attr:`namespace_devices` attribute. + :attr:`schema_registries` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -6722,33 +7907,36 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2025-07-01-preview": [ + "2024-09-01-preview": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "device_name", + "schema_registry_name", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def get( - self, resource_group_name: str, namespace_name: str, device_name: str, **kwargs: Any - ) -> _models.NamespaceDevice: - """Get a NamespaceDevice. + async def get(self, resource_group_name: str, schema_registry_name: str, **kwargs: Any) -> _models.SchemaRegistry: + """Get a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str - :return: NamespaceDevice. The NamespaceDevice is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.NamespaceDevice + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :return: SchemaRegistry. The SchemaRegistry is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.SchemaRegistry :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -6762,12 +7950,11 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.NamespaceDevice] = kwargs.pop("cls", None) + cls: ClsType[_models.SchemaRegistry] = kwargs.pop("cls", None) - _request = build_namespace_devices_get_request( + _request = build_schema_registries_get_request( resource_group_name=resource_group_name, - namespace_name=namespace_name, - device_name=device_name, + schema_registry_name=schema_registry_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -6802,7 +7989,7 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.NamespaceDevice, response.json()) + deserialized = _deserialize(_models.SchemaRegistry, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -6810,26 +7997,32 @@ async def get( return deserialized # type: ignore @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2025-07-01-preview": [ + "2024-09-01-preview": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "device_name", + "schema_registry_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def _create_or_replace_initial( self, resource_group_name: str, - namespace_name: str, - device_name: str, - resource: Union[_models.NamespaceDevice, JSON, IO[bytes]], + schema_registry_name: str, + resource: Union[_models.SchemaRegistry, _types.SchemaRegistry, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -6853,10 +8046,9 @@ async def _create_or_replace_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_namespace_devices_create_or_replace_request( + _request = build_schema_registries_create_or_replace_request( resource_group_name=resource_group_name, - namespace_name=namespace_name, - device_name=device_name, + schema_registry_name=schema_registry_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -6907,30 +8099,27 @@ async def _create_or_replace_initial( async def begin_create_or_replace( self, resource_group_name: str, - namespace_name: str, - device_name: str, - resource: _models.NamespaceDevice, + schema_registry_name: str, + resource: _models.SchemaRegistry, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDevice]: - """Create a NamespaceDevice. + ) -> AsyncLROPoller[_models.SchemaRegistry]: + """Create a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDevice + :type resource: ~azure.mgmt.deviceregistry.models.SchemaRegistry :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -6938,30 +8127,27 @@ async def begin_create_or_replace( async def begin_create_or_replace( self, resource_group_name: str, - namespace_name: str, - device_name: str, - resource: JSON, + schema_registry_name: str, + resource: _types.SchemaRegistry, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDevice]: - """Create a NamespaceDevice. + ) -> AsyncLROPoller[_models.SchemaRegistry]: + """Create a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.deviceregistry.types.SchemaRegistry :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -6969,87 +8155,88 @@ async def begin_create_or_replace( async def begin_create_or_replace( self, resource_group_name: str, - namespace_name: str, - device_name: str, + schema_registry_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDevice]: - """Create a NamespaceDevice. + ) -> AsyncLROPoller[_models.SchemaRegistry]: + """Create a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2025-07-01-preview": [ + "2024-09-01-preview": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "device_name", + "schema_registry_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def begin_create_or_replace( self, resource_group_name: str, - namespace_name: str, - device_name: str, - resource: Union[_models.NamespaceDevice, JSON, IO[bytes]], + schema_registry_name: str, + resource: Union[_models.SchemaRegistry, _types.SchemaRegistry, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDevice]: - """Create a NamespaceDevice. + ) -> AsyncLROPoller[_models.SchemaRegistry]: + """Create a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str - :param resource: Resource create parameters. Is one of the following types: NamespaceDevice, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDevice or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param resource: Resource create parameters. Is either a SchemaRegistry type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.SchemaRegistry or + ~azure.mgmt.deviceregistry.types.SchemaRegistry or IO[bytes] + :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceDevice] = kwargs.pop("cls", None) + cls: ClsType[_models.SchemaRegistry] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._create_or_replace_initial( resource_group_name=resource_group_name, - namespace_name=namespace_name, - device_name=device_name, + schema_registry_name=schema_registry_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -7062,7 +8249,7 @@ async def begin_create_or_replace( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceDevice, response.json()) + deserialized = _deserialize(_models.SchemaRegistry, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -7080,37 +8267,43 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.NamespaceDevice].from_continuation_token( + return AsyncLROPoller[_models.SchemaRegistry].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.NamespaceDevice]( + return AsyncLROPoller[_models.SchemaRegistry]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2025-07-01-preview": [ + "2024-09-01-preview": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "device_name", + "schema_registry_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def _update_initial( self, resource_group_name: str, - namespace_name: str, - device_name: str, - properties: Union[_models.NamespaceDeviceUpdate, JSON, IO[bytes]], + schema_registry_name: str, + properties: Union[_models.SchemaRegistryUpdate, _types.SchemaRegistryUpdate, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -7134,10 +8327,9 @@ async def _update_initial( else: _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_namespace_devices_update_request( + _request = build_schema_registries_update_request( resource_group_name=resource_group_name, - namespace_name=namespace_name, - device_name=device_name, + schema_registry_name=schema_registry_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -7186,30 +8378,27 @@ async def _update_initial( async def begin_update( self, resource_group_name: str, - namespace_name: str, - device_name: str, - properties: _models.NamespaceDeviceUpdate, + schema_registry_name: str, + properties: _models.SchemaRegistryUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDevice]: - """Update a NamespaceDevice. + ) -> AsyncLROPoller[_models.SchemaRegistry]: + """Update a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDeviceUpdate + :type properties: ~azure.mgmt.deviceregistry.models.SchemaRegistryUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -7217,30 +8406,27 @@ async def begin_update( async def begin_update( self, resource_group_name: str, - namespace_name: str, - device_name: str, - properties: JSON, + schema_registry_name: str, + properties: _types.SchemaRegistryUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDevice]: - """Update a NamespaceDevice. + ) -> AsyncLROPoller[_models.SchemaRegistry]: + """Update a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.deviceregistry.types.SchemaRegistryUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -7248,87 +8434,88 @@ async def begin_update( async def begin_update( self, resource_group_name: str, - namespace_name: str, - device_name: str, + schema_registry_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDevice]: - """Update a NamespaceDevice. + ) -> AsyncLROPoller[_models.SchemaRegistry]: + """Update a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str :param properties: The resource properties to be updated. Required. :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2025-07-01-preview": [ + "2024-09-01-preview": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "device_name", + "schema_registry_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def begin_update( self, resource_group_name: str, - namespace_name: str, - device_name: str, - properties: Union[_models.NamespaceDeviceUpdate, JSON, IO[bytes]], + schema_registry_name: str, + properties: Union[_models.SchemaRegistryUpdate, _types.SchemaRegistryUpdate, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDevice]: - """Update a NamespaceDevice. + ) -> AsyncLROPoller[_models.SchemaRegistry]: + """Update a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str - :param properties: The resource properties to be updated. Is one of the following types: - NamespaceDeviceUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDeviceUpdate or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns NamespaceDevice. The NamespaceDevice is + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param properties: The resource properties to be updated. Is either a SchemaRegistryUpdate type + or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.SchemaRegistryUpdate or + ~azure.mgmt.deviceregistry.types.SchemaRegistryUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceDevice] = kwargs.pop("cls", None) + cls: ClsType[_models.SchemaRegistry] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: raw_result = await self._update_initial( resource_group_name=resource_group_name, - namespace_name=namespace_name, - device_name=device_name, + schema_registry_name=schema_registry_name, properties=properties, content_type=content_type, cls=lambda x, y, z: x, @@ -7341,7 +8528,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceDevice, response.json()) + deserialized = _deserialize(_models.SchemaRegistry, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -7359,31 +8546,33 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.NamespaceDevice].from_continuation_token( + return AsyncLROPoller[_models.SchemaRegistry].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.NamespaceDevice]( + return AsyncLROPoller[_models.SchemaRegistry]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2025-07-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "device_name", - ] + "2024-09-01-preview": ["api_version", "subscription_id", "resource_group_name", "schema_registry_name"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def _delete_initial( - self, resource_group_name: str, namespace_name: str, device_name: str, **kwargs: Any + self, resource_group_name: str, schema_registry_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7398,10 +8587,9 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_namespace_devices_delete_request( + _request = build_schema_registries_delete_request( resource_group_name=resource_group_name, - namespace_name=namespace_name, - device_name=device_name, + schema_registry_name=schema_registry_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -7446,30 +8634,30 @@ async def _delete_initial( @distributed_trace_async @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2025-07-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "device_name", - ] + "2024-09-01-preview": ["api_version", "subscription_id", "resource_group_name", "schema_registry_name"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) async def begin_delete( - self, resource_group_name: str, namespace_name: str, device_name: str, **kwargs: Any + self, resource_group_name: str, schema_registry_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a NamespaceDevice. + """Delete a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -7484,8 +8672,7 @@ async def begin_delete( if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, - namespace_name=namespace_name, - device_name=device_name, + schema_registry_name=schema_registry_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -7521,31 +8708,35 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace @api_version_validation( - method_added_on="2025-07-01-preview", - params_added_on={ - "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] - }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + method_added_on="2024-09-01-preview", + params_added_on={"2024-09-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def list_by_resource_group( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.NamespaceDevice"]: - """List NamespaceDevice resources by Namespace. + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SchemaRegistry"]: + """List SchemaRegistry resources by resource group. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :return: An iterator like instance of NamespaceDevice + :return: An iterator like instance of SchemaRegistry :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.NamespaceDevice] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.NamespaceDevice]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.SchemaRegistry]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7558,9 +8749,8 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_namespace_devices_list_by_resource_group_request( + _request = build_schema_registries_list_by_resource_group_request( resource_group_name=resource_group_name, - namespace_name=namespace_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -7584,7 +8774,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -7598,7 +8791,114 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.NamespaceDevice], + List[_models.SchemaRegistry], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + @api_version_validation( + method_added_on="2024-09-01-preview", + params_added_on={"2024-09-01-preview": ["api_version", "subscription_id", "accept"]}, + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.SchemaRegistry"]: + """List SchemaRegistry resources by subscription ID. + + :return: An iterator like instance of SchemaRegistry + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SchemaRegistry]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_schema_registries_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SchemaRegistry], deserialized.get("value", []), ) if cls: @@ -7626,29 +8926,63 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) + +class SchemasOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s + :attr:`schemas` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2024-09-01-preview": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "device_name", - "content_type", + "schema_registry_name", + "schema_name", "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def _revoke_initial( - self, - resource_group_name: str, - namespace_name: str, - device_name: str, - body: Union[_models.DeviceCredentialsRevokeRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: + async def get( + self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any + ) -> _models.Schema: + """Get a Schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :return: Schema. The Schema is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.Schema + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7657,27 +8991,17 @@ async def _revoke_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.Schema] = kwargs.pop("cls", None) - _request = build_namespace_devices_revoke_request( + _request = build_schemas_get_request( resource_group_name=resource_group_name, - namespace_name=namespace_name, - device_name=device_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -7687,18 +9011,19 @@ async def _revoke_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -7706,248 +9031,153 @@ async def _revoke_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Schema, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload - async def begin_revoke( + async def create_or_replace( self, - resource_group_name: str, - namespace_name: str, - device_name: str, - body: _models.DeviceCredentialsRevokeRequest, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + resource: _models.Schema, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """A long-running resource action. + ) -> _models.Schema: + """Create a Schema. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.deviceregistry.models.DeviceCredentialsRevokeRequest + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.models.Schema :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :return: Schema. The Schema is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.Schema :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_revoke( + async def create_or_replace( self, resource_group_name: str, - namespace_name: str, - device_name: str, - body: JSON, + schema_registry_name: str, + schema_name: str, + resource: _types.Schema, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """A long-running resource action. + ) -> _models.Schema: + """Create a Schema. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str - :param body: The content of the action request. Required. - :type body: JSON + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.types.Schema :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :return: Schema. The Schema is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.Schema :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_revoke( + async def create_or_replace( self, resource_group_name: str, - namespace_name: str, - device_name: str, - body: IO[bytes], + schema_registry_name: str, + schema_name: str, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[None]: - """A long-running resource action. + ) -> _models.Schema: + """Create a Schema. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str - :param body: The content of the action request. Required. - :type body: IO[bytes] + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :return: Schema. The Schema is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.Schema :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2024-09-01-preview": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "device_name", + "schema_registry_name", + "schema_name", "content_type", "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def begin_revoke( + async def create_or_replace( self, resource_group_name: str, - namespace_name: str, - device_name: str, - body: Union[_models.DeviceCredentialsRevokeRequest, JSON, IO[bytes]], + schema_registry_name: str, + schema_name: str, + resource: Union[_models.Schema, _types.Schema, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[None]: - """A long-running resource action. + ) -> _models.Schema: + """Create a Schema. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str - :param body: The content of the action request. Is one of the following types: - DeviceCredentialsRevokeRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.deviceregistry.models.DeviceCredentialsRevokeRequest or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._revoke_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - device_name=device_name, - body=body, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class NamespaceDiscoveredAssetsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s - :attr:`namespace_discovered_assets` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2025-07-01-preview", - params_added_on={ - "2025-07-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "discovered_asset_name", - "accept", - ] - }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], - ) - async def get( - self, resource_group_name: str, namespace_name: str, discovered_asset_name: str, **kwargs: Any - ) -> _models.NamespaceDiscoveredAsset: - """Get a NamespaceDiscoveredAsset. - - :param resource_group_name: The name of the resource group. The name is case insensitive. + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param resource: Resource create parameters. Is either a Schema type or a IO[bytes] type. Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :return: NamespaceDiscoveredAsset. The NamespaceDiscoveredAsset is compatible with - MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset + :type resource: ~azure.mgmt.deviceregistry.models.Schema or + ~azure.mgmt.deviceregistry.types.Schema or IO[bytes] + :return: Schema. The Schema is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.Schema :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -7958,17 +9188,27 @@ async def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.NamespaceDiscoveredAsset] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Schema] = kwargs.pop("cls", None) - _request = build_namespace_discovered_assets_get_request( + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_schemas_create_or_replace_request( resource_group_name=resource_group_name, - namespace_name=namespace_name, - discovered_asset_name=discovered_asset_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -7985,7 +9225,7 @@ async def get( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -8001,7 +9241,7 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.NamespaceDiscoveredAsset, response.json()) + deserialized = _deserialize(_models.Schema, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -8009,27 +9249,20 @@ async def get( return deserialized # type: ignore @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2025-10-01", params_added_on={ - "2025-07-01-preview": [ + "2025-10-01": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "discovered_asset_name", - "content_type", - "accept", + "schema_registry_name", + "schema_name", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview", "2026-04-01", "2026-11-01"], ) - async def _create_or_replace_initial( - self, - resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - resource: Union[_models.NamespaceDiscoveredAsset, JSON, IO[bytes]], - **kwargs: Any + async def _delete_initial( + self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8039,27 +9272,17 @@ async def _create_or_replace_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_namespace_discovered_assets_create_or_replace_request( + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_schemas_delete_request( resource_group_name=resource_group_name, - namespace_name=namespace_name, - discovered_asset_name=discovered_asset_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -8076,7 +9299,7 @@ async def _create_or_replace_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -8089,10 +9312,8 @@ async def _create_or_replace_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -8102,220 +9323,269 @@ async def _create_or_replace_initial( return deserialized # type: ignore - @overload - async def begin_create_or_replace( - self, - resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - resource: _models.NamespaceDiscoveredAsset, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: - """Create a NamespaceDiscoveredAsset. + @distributed_trace_async + @api_version_validation( + method_added_on="2025-10-01", + params_added_on={ + "2025-10-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "schema_registry_name", + "schema_name", + ] + }, + api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview", "2026-04-01", "2026-11-01"], + ) + async def begin_delete( + self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a Schema. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - async def begin_create_or_replace( - self, - resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - resource: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: - """Create a NamespaceDiscoveredAsset. + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-09-01-preview", + params_added_on={ + "2024-09-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "schema_registry_name", + "accept", + ] + }, + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + def list_by_schema_registry( + self, resource_group_name: str, schema_registry_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.Schema"]: + """List Schema resources by SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :return: An iterator like instance of Schema + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.Schema] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - @overload - async def begin_create_or_replace( - self, - resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: - """Create a NamespaceDiscoveredAsset. + cls: ClsType[List[_models.Schema]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_schemas_list_by_schema_registry_request( + resource_group_name=resource_group_name, + schema_registry_name=schema_registry_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Schema], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] - :raises ~azure.core.exceptions.HttpResponseError: - """ + return AsyncItemPaged(get_next, extract_data) + + +class SchemaVersionsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s + :attr:`schema_versions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2025-07-01-preview": [ + "2024-09-01-preview": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "discovered_asset_name", - "content_type", + "schema_registry_name", + "schema_name", + "schema_version_name", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def begin_create_or_replace( + async def get( self, resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - resource: Union[_models.NamespaceDiscoveredAsset, JSON, IO[bytes]], + schema_registry_name: str, + schema_name: str, + schema_version_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: - """Create a NamespaceDiscoveredAsset. + ) -> _models.SchemaVersion: + """Get a SchemaVersion. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param resource: Resource create parameters. Is one of the following types: - NamespaceDiscoveredAsset, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param schema_version_name: Schema version name parameter. Required. + :type schema_version_name: str + :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceDiscoveredAsset] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_replace_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - discovered_asset_name=discovered_asset_name, - resource=resource, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceDiscoveredAsset, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.NamespaceDiscoveredAsset].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.NamespaceDiscoveredAsset]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @api_version_validation( - method_added_on="2025-07-01-preview", - params_added_on={ - "2025-07-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "discovered_asset_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], - ) - async def _update_initial( - self, - resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - properties: Union[_models.NamespaceDiscoveredAssetUpdate, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -8324,27 +9594,18 @@ async def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.SchemaVersion] = kwargs.pop("cls", None) - _request = build_namespace_discovered_assets_update_request( + _request = build_schema_versions_get_request( resource_group_name=resource_group_name, - namespace_name=namespace_name, - discovered_asset_name=discovered_asset_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, + schema_version_name=schema_version_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -8354,18 +9615,19 @@ async def _update_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -8373,225 +9635,258 @@ async def _update_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SchemaVersion, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @overload - async def begin_update( + async def create_or_replace( self, resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - properties: _models.NamespaceDiscoveredAssetUpdate, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + resource: _models.SchemaVersion, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: - """Update a NamespaceDiscoveredAsset. + ) -> _models.SchemaVersion: + """Create a SchemaVersion. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAssetUpdate + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param schema_version_name: Schema version name parameter. Required. + :type schema_version_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.models.SchemaVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update( + async def create_or_replace( self, resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - properties: JSON, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + resource: _types.SchemaVersion, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: - """Update a NamespaceDiscoveredAsset. + ) -> _models.SchemaVersion: + """Create a SchemaVersion. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param schema_version_name: Schema version name parameter. Required. + :type schema_version_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.types.SchemaVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update( + async def create_or_replace( self, resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - properties: IO[bytes], + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: - """Update a NamespaceDiscoveredAsset. + ) -> _models.SchemaVersion: + """Create a SchemaVersion. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param schema_version_name: Schema version name parameter. Required. + :type schema_version_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2025-07-01-preview": [ + "2024-09-01-preview": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "discovered_asset_name", + "schema_registry_name", + "schema_name", + "schema_version_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - async def begin_update( + async def create_or_replace( self, resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - properties: Union[_models.NamespaceDiscoveredAssetUpdate, JSON, IO[bytes]], + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + resource: Union[_models.SchemaVersion, _types.SchemaVersion, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredAsset]: - """Update a NamespaceDiscoveredAsset. + ) -> _models.SchemaVersion: + """Create a SchemaVersion. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param properties: The resource properties to be updated. Is one of the following types: - NamespaceDiscoveredAssetUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAssetUpdate or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param schema_version_name: Schema version name parameter. Required. + :type schema_version_name: str + :param resource: Resource create parameters. Is either a SchemaVersion type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.SchemaVersion or + ~azure.mgmt.deviceregistry.types.SchemaVersion or IO[bytes] + :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceDiscoveredAsset] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - discovered_asset_name=discovered_asset_name, - properties=properties, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + cls: ClsType[_models.SchemaVersion] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceDiscoveredAsset, response.json()) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _request = build_schema_versions_create_or_replace_request( + resource_group_name=resource_group_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, + schema_version_name=schema_version_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.NamespaceDiscoveredAsset].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.NamespaceDiscoveredAsset]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialized = _deserialize(_models.SchemaVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2025-10-01", params_added_on={ - "2025-07-01-preview": [ + "2025-10-01": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "discovered_asset_name", + "schema_registry_name", + "schema_name", + "schema_version_name", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview", "2026-04-01", "2026-11-01"], ) async def _delete_initial( - self, resource_group_name: str, namespace_name: str, discovered_asset_name: str, **kwargs: Any + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8606,10 +9901,11 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_namespace_discovered_assets_delete_request( + _request = build_schema_versions_delete_request( resource_group_name=resource_group_name, - namespace_name=namespace_name, - discovered_asset_name=discovered_asset_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, + schema_version_name=schema_version_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -8654,30 +9950,38 @@ async def _delete_initial( @distributed_trace_async @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2025-10-01", params_added_on={ - "2025-07-01-preview": [ + "2025-10-01": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "discovered_asset_name", + "schema_registry_name", + "schema_name", + "schema_version_name", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview", "2026-04-01", "2026-11-01"], ) async def begin_delete( - self, resource_group_name: str, namespace_name: str, discovered_asset_name: str, **kwargs: Any + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a NamespaceDiscoveredAsset. + """Delete a SchemaVersion. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param schema_version_name: Schema version name parameter. Required. + :type schema_version_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -8692,8 +9996,9 @@ async def begin_delete( if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, - namespace_name=namespace_name, - discovered_asset_name=discovered_asset_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, + schema_version_name=schema_version_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -8729,31 +10034,48 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] + "2024-09-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "schema_registry_name", + "schema_name", + "accept", + ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], - ) - def list_by_resource_group( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.NamespaceDiscoveredAsset"]: - """List NamespaceDiscoveredAsset resources by Namespace. + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + def list_by_schema( + self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SchemaVersion"]: + """List SchemaVersion resources by Schema. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :return: An iterator like instance of NamespaceDiscoveredAsset + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :return: An iterator like instance of SchemaVersion :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.SchemaVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.NamespaceDiscoveredAsset]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.SchemaVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8766,9 +10088,10 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_namespace_discovered_assets_list_by_resource_group_request( + _request = build_schema_versions_list_by_schema_request( resource_group_name=resource_group_name, - namespace_name=namespace_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -8792,7 +10115,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -8806,7 +10132,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.NamespaceDiscoveredAsset], + List[_models.SchemaVersion], deserialized.get("value", []), ) if cls: @@ -8835,14 +10161,14 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class NamespaceDiscoveredDevicesOperations: +class CertificateAuthoritiesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s - :attr:`namespace_discovered_devices` attribute. + :attr:`certificate_authorities` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -8854,34 +10180,33 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2025-07-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "discovered_device_name", + "certificate_authority_name", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) async def get( - self, resource_group_name: str, namespace_name: str, discovered_device_name: str, **kwargs: Any - ) -> _models.NamespaceDiscoveredDevice: - """Get a NamespaceDiscoveredDevice. + self, resource_group_name: str, namespace_name: str, certificate_authority_name: str, **kwargs: Any + ) -> _models.CertificateAuthority: + """Get a CertificateAuthority. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str - :return: NamespaceDiscoveredDevice. The NamespaceDiscoveredDevice is compatible with - MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :return: CertificateAuthority. The CertificateAuthority is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.CertificateAuthority :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8895,12 +10220,12 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.NamespaceDiscoveredDevice] = kwargs.pop("cls", None) + cls: ClsType[_models.CertificateAuthority] = kwargs.pop("cls", None) - _request = build_namespace_discovered_devices_get_request( + _request = build_certificate_authorities_get_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - discovered_device_name=discovered_device_name, + certificate_authority_name=certificate_authority_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -8935,7 +10260,7 @@ async def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.NamespaceDiscoveredDevice, response.json()) + deserialized = _deserialize(_models.CertificateAuthority, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -8943,26 +10268,26 @@ async def get( return deserialized # type: ignore @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2025-07-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "discovered_device_name", + "certificate_authority_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) async def _create_or_replace_initial( self, resource_group_name: str, namespace_name: str, - discovered_device_name: str, - resource: Union[_models.NamespaceDiscoveredDevice, JSON, IO[bytes]], + certificate_authority_name: str, + resource: Union[_models.CertificateAuthority, _types.CertificateAuthority, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -8986,10 +10311,10 @@ async def _create_or_replace_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_namespace_discovered_devices_create_or_replace_request( + _request = build_certificate_authorities_create_or_replace_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - discovered_device_name=discovered_device_name, + certificate_authority_name=certificate_authority_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -9041,30 +10366,30 @@ async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - discovered_device_name: str, - resource: _models.NamespaceDiscoveredDevice, + certificate_authority_name: str, + resource: _models.CertificateAuthority, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: - """Create a NamespaceDiscoveredDevice. + ) -> AsyncLROPoller[_models.CertificateAuthority]: + """Create a CertificateAuthority. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice + :type resource: ~azure.mgmt.deviceregistry.models.CertificateAuthority :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping + :return: An instance of AsyncLROPoller that returns CertificateAuthority. The + CertificateAuthority is compatible with MutableMapping :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9073,30 +10398,30 @@ async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - discovered_device_name: str, - resource: JSON, + certificate_authority_name: str, + resource: _types.CertificateAuthority, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: - """Create a NamespaceDiscoveredDevice. + ) -> AsyncLROPoller[_models.CertificateAuthority]: + """Create a CertificateAuthority. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.deviceregistry.types.CertificateAuthority :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping + :return: An instance of AsyncLROPoller that returns CertificateAuthority. The + CertificateAuthority is compatible with MutableMapping :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9105,81 +10430,81 @@ async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - discovered_device_name: str, + certificate_authority_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: - """Create a NamespaceDiscoveredDevice. + ) -> AsyncLROPoller[_models.CertificateAuthority]: + """Create a CertificateAuthority. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping + :return: An instance of AsyncLROPoller that returns CertificateAuthority. The + CertificateAuthority is compatible with MutableMapping :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2025-07-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "discovered_device_name", + "certificate_authority_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) async def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - discovered_device_name: str, - resource: Union[_models.NamespaceDiscoveredDevice, JSON, IO[bytes]], + certificate_authority_name: str, + resource: Union[_models.CertificateAuthority, _types.CertificateAuthority, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: - """Create a NamespaceDiscoveredDevice. + ) -> AsyncLROPoller[_models.CertificateAuthority]: + """Create a CertificateAuthority. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str - :param resource: Resource create parameters. Is one of the following types: - NamespaceDiscoveredDevice, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param resource: Resource create parameters. Is either a CertificateAuthority type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.CertificateAuthority or + ~azure.mgmt.deviceregistry.types.CertificateAuthority or IO[bytes] + :return: An instance of AsyncLROPoller that returns CertificateAuthority. The + CertificateAuthority is compatible with MutableMapping :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceDiscoveredDevice] = kwargs.pop("cls", None) + cls: ClsType[_models.CertificateAuthority] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -9187,7 +10512,7 @@ async def begin_create_or_replace( raw_result = await self._create_or_replace_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - discovered_device_name=discovered_device_name, + certificate_authority_name=certificate_authority_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -9200,7 +10525,7 @@ async def begin_create_or_replace( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceDiscoveredDevice, response.json()) + deserialized = _deserialize(_models.CertificateAuthority, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -9218,38 +10543,31 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.NamespaceDiscoveredDevice].from_continuation_token( + return AsyncLROPoller[_models.CertificateAuthority].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.NamespaceDiscoveredDevice]( + return AsyncLROPoller[_models.CertificateAuthority]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2025-07-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "discovered_device_name", - "content_type", - "accept", + "certificate_authority_name", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) - async def _update_initial( - self, - resource_group_name: str, - namespace_name: str, - discovered_device_name: str, - properties: Union[_models.NamespaceDiscoveredDeviceUpdate, JSON, IO[bytes]], - **kwargs: Any + async def _delete_initial( + self, resource_group_name: str, namespace_name: str, certificate_authority_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9259,27 +10577,17 @@ async def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_namespace_discovered_devices_update_request( + _request = build_certificate_authorities_delete_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - discovered_device_name=discovered_device_name, + certificate_authority_name=certificate_authority_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -9296,7 +10604,7 @@ async def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -9320,160 +10628,48 @@ async def _update_initial( return deserialized # type: ignore - @overload - async def begin_update( - self, - resource_group_name: str, - namespace_name: str, - discovered_device_name: str, - properties: _models.NamespaceDiscoveredDeviceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: - """Update a NamespaceDiscoveredDevice. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDeviceUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - namespace_name: str, - discovered_device_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: - """Update a NamespaceDiscoveredDevice. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - namespace_name: str, - discovered_device_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: - """Update a NamespaceDiscoveredDevice. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2025-07-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "discovered_device_name", - "content_type", - "accept", + "certificate_authority_name", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) - async def begin_update( - self, - resource_group_name: str, - namespace_name: str, - discovered_device_name: str, - properties: Union[_models.NamespaceDiscoveredDeviceUpdate, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.NamespaceDiscoveredDevice]: - """Update a NamespaceDiscoveredDevice. + async def begin_delete( + self, resource_group_name: str, namespace_name: str, certificate_authority_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete a CertificateAuthority. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str - :param properties: The resource properties to be updated. Is one of the following types: - NamespaceDiscoveredDeviceUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDeviceUpdate or JSON or - IO[bytes] - :return: An instance of AsyncLROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceDiscoveredDevice] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( + raw_result = await self._delete_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - discovered_device_name=discovered_device_name, - properties=properties, - content_type=content_type, + certificate_authority_name=certificate_authority_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -9482,12 +10678,9 @@ async def begin_update( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceDiscoveredDevice, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -9502,31 +10695,36 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.NamespaceDiscoveredDevice].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.NamespaceDiscoveredDevice]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2025-07-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "discovered_device_name", + "certificate_authority_name", + "content_type", + "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) - async def _delete_initial( - self, resource_group_name: str, namespace_name: str, discovered_device_name: str, **kwargs: Any + async def _update_initial( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: Union[_models.CertificateAuthorityUpdate, _types.CertificateAuthorityUpdate, IO[bytes]], + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9536,17 +10734,27 @@ async def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_namespace_discovered_devices_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_certificate_authorities_update_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - discovered_device_name=discovered_device_name, + certificate_authority_name=certificate_authority_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -9563,7 +10771,7 @@ async def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -9587,48 +10795,160 @@ async def _delete_initial( return deserialized # type: ignore + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: _models.CertificateAuthorityUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CertificateAuthority]: + """Update a CertificateAuthority. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.models.CertificateAuthorityUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns CertificateAuthority. The + CertificateAuthority is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: _types.CertificateAuthorityUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CertificateAuthority]: + """Update a CertificateAuthority. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.types.CertificateAuthorityUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns CertificateAuthority. The + CertificateAuthority is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CertificateAuthority]: + """Update a CertificateAuthority. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns CertificateAuthority. The + CertificateAuthority is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2025-07-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "discovered_device_name", + "certificate_authority_name", + "content_type", + "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) - async def begin_delete( - self, resource_group_name: str, namespace_name: str, discovered_device_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a NamespaceDiscoveredDevice. + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: Union[_models.CertificateAuthorityUpdate, _types.CertificateAuthorityUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CertificateAuthority]: + """Update a CertificateAuthority. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param properties: The resource properties to be updated. Is either a + CertificateAuthorityUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.CertificateAuthorityUpdate or + ~azure.mgmt.deviceregistry.types.CertificateAuthorityUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns CertificateAuthority. The + CertificateAuthority is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CertificateAuthority] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_initial( + raw_result = await self._update_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - discovered_device_name=discovered_device_name, + certificate_authority_name=certificate_authority_name, + properties=properties, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -9637,9 +10957,12 @@ async def begin_delete( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CertificateAuthority, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -9654,41 +10977,43 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.CertificateAuthority].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return AsyncLROPoller[_models.CertificateAuthority]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] + "2026-11-01": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) - def list_by_resource_group( + def list_by_namespace( self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.NamespaceDiscoveredDevice"]: - """List NamespaceDiscoveredDevice resources by Namespace. + ) -> AsyncItemPaged["_models.CertificateAuthority"]: + """List CertificateAuthority resources by Namespace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :return: An iterator like instance of NamespaceDiscoveredDevice + :return: An iterator like instance of CertificateAuthority :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.CertificateAuthority] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.NamespaceDiscoveredDevice]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CertificateAuthority]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9701,7 +11026,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_namespace_discovered_devices_list_by_resource_group_request( + _request = build_certificate_authorities_list_by_namespace_request( resource_group_name=resource_group_name, namespace_name=namespace_name, subscription_id=self._config.subscription_id, @@ -9727,7 +11052,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -9741,7 +11069,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.NamespaceDiscoveredDevice], + List[_models.CertificateAuthority], deserialized.get("value", []), ) if cls: @@ -9751,156 +11079,44 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): _request = prepare_request(next_link) - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class SchemaRegistriesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s - :attr:`schema_registries` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2024-09-01-preview", - params_added_on={ - "2024-09-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "schema_registry_name", - "accept", - ] - }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], - ) - async def get(self, resource_group_name: str, schema_registry_name: str, **kwargs: Any) -> _models.SchemaRegistry: - """Get a SchemaRegistry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :return: SchemaRegistry. The SchemaRegistry is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.SchemaRegistry - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.SchemaRegistry] = kwargs.pop("cls", None) - - _request = build_schema_registries_get_request( - resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response = pipeline_response.http_response - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.SchemaRegistry, response.json()) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return AsyncItemPaged(get_next, extract_data) @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", + "namespace_name", + "certificate_authority_name", "content_type", - "accept", ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - async def _create_or_replace_initial( + async def _activate_initial( self, resource_group_name: str, - schema_registry_name: str, - resource: Union[_models.SchemaRegistry, JSON, IO[bytes]], + namespace_name: str, + certificate_authority_name: str, + body: Union[_models.ActivateCertificateAuthorityRequest, _types.ActivateCertificateAuthorityRequest, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -9919,14 +11135,15 @@ async def _create_or_replace_initial( content_type = content_type or "application/json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(body, (IOBase, bytes)): + _content = body else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_schema_registries_create_or_replace_request( + _request = build_certificate_authorities_activate_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -9947,7 +11164,7 @@ async def _create_or_replace_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -9960,10 +11177,8 @@ async def _create_or_replace_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -9974,146 +11189,305 @@ async def _create_or_replace_initial( return deserialized # type: ignore @overload - async def begin_create_or_replace( + async def begin_activate( self, resource_group_name: str, - schema_registry_name: str, - resource: _models.SchemaRegistry, + namespace_name: str, + certificate_authority_name: str, + body: _models.ActivateCertificateAuthorityRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.SchemaRegistry]: - """Create a SchemaRegistry. + ) -> AsyncLROPoller[None]: + """Activates a Certificate Authority of type ``ICA`` and issuer type ``External``. If the + Certificate Authority is an invalid type, the API responds with HTTP 400. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.SchemaRegistry + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.deviceregistry.models.ActivateCertificateAuthorityRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_replace( + async def begin_activate( self, resource_group_name: str, - schema_registry_name: str, - resource: JSON, + namespace_name: str, + certificate_authority_name: str, + body: _types.ActivateCertificateAuthorityRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.SchemaRegistry]: - """Create a SchemaRegistry. + ) -> AsyncLROPoller[None]: + """Activates a Certificate Authority of type ``ICA`` and issuer type ``External``. If the + Certificate Authority is an invalid type, the API responds with HTTP 400. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.deviceregistry.types.ActivateCertificateAuthorityRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_or_replace( + async def begin_activate( self, resource_group_name: str, - schema_registry_name: str, - resource: IO[bytes], + namespace_name: str, + certificate_authority_name: str, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.SchemaRegistry]: - """Create a SchemaRegistry. + ) -> AsyncLROPoller[None]: + """Activates a Certificate Authority of type ``ICA`` and issuer type ``External``. If the + Certificate Authority is an invalid type, the API responds with HTTP 400. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", + "namespace_name", + "certificate_authority_name", "content_type", - "accept", ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], + ) + async def begin_activate( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + body: Union[_models.ActivateCertificateAuthorityRequest, _types.ActivateCertificateAuthorityRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Activates a Certificate Authority of type ``ICA`` and issuer type ``External``. If the + Certificate Authority is an invalid type, the API responds with HTTP 400. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param body: The content of the action request. Is either a ActivateCertificateAuthorityRequest + type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.deviceregistry.models.ActivateCertificateAuthorityRequest or + ~azure.mgmt.deviceregistry.types.ActivateCertificateAuthorityRequest or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._activate_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @api_version_validation( + method_added_on="2026-11-01", + params_added_on={ + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + ] + }, + api_versions_list=["2026-11-01"], + ) + async def _revoke_and_rotate_initial( + self, resource_group_name: str, namespace_name: str, certificate_authority_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_certificate_authorities_revoke_and_rotate_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-11-01", + params_added_on={ + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + ] + }, + api_versions_list=["2026-11-01"], ) - async def begin_create_or_replace( - self, - resource_group_name: str, - schema_registry_name: str, - resource: Union[_models.SchemaRegistry, JSON, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.SchemaRegistry]: - """Create a SchemaRegistry. + async def begin_revoke_and_rotate( + self, resource_group_name: str, namespace_name: str, certificate_authority_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Revokes a Certificate Authority of type ``ICA`` and issuer type ``Microsoft``. If the + Certificate Authority is an invalid type, the API responds with HTTP 400. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param resource: Resource create parameters. Is one of the following types: SchemaRegistry, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.SchemaRegistry or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is - compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SchemaRegistry] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_or_replace_initial( + raw_result = await self._revoke_and_rotate_initial( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - resource=resource, - content_type=content_type, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -10122,12 +11496,9 @@ async def begin_create_or_replace( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.SchemaRegistry, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -10142,41 +11513,153 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.SchemaRegistry].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.SchemaRegistry]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class CertificatePoliciesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s + :attr:`certificate_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-11-01", + params_added_on={ + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + "certificate_policy_name", + "accept", + ] + }, + api_versions_list=["2026-11-01"], + ) + async def get( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + **kwargs: Any + ) -> _models.CertificatePolicy: + """Get a CertificatePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :return: CertificatePolicy. The CertificatePolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.CertificatePolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CertificatePolicy] = kwargs.pop("cls", None) + + _request = build_certificate_policies_get_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + certificate_policy_name=certificate_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CertificatePolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", + "namespace_name", + "certificate_authority_name", + "certificate_policy_name", "content_type", "accept", ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - async def _update_initial( + async def _create_or_replace_initial( self, resource_group_name: str, - schema_registry_name: str, - properties: Union[_models.SchemaRegistryUpdate, JSON, IO[bytes]], + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: Union[_models.CertificatePolicy, _types.CertificatePolicy, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { @@ -10195,14 +11678,16 @@ async def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties + if isinstance(resource, (IOBase, bytes)): + _content = resource else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_schema_registries_update_request( + _request = build_certificate_policies_create_or_replace_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + certificate_policy_name=certificate_policy_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -10223,7 +11708,7 @@ async def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -10236,8 +11721,10 @@ async def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -10248,145 +11735,168 @@ async def _update_initial( return deserialized # type: ignore @overload - async def begin_update( + async def begin_create_or_replace( self, resource_group_name: str, - schema_registry_name: str, - properties: _models.SchemaRegistryUpdate, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: _models.CertificatePolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.SchemaRegistry]: - """Update a SchemaRegistry. + ) -> AsyncLROPoller[_models.CertificatePolicy]: + """Create a CertificatePolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.deviceregistry.models.SchemaRegistryUpdate + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.models.CertificatePolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is + :return: An instance of AsyncLROPoller that returns CertificatePolicy. The CertificatePolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update( + async def begin_create_or_replace( self, resource_group_name: str, - schema_registry_name: str, - properties: JSON, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: _types.CertificatePolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.SchemaRegistry]: - """Update a SchemaRegistry. + ) -> AsyncLROPoller[_models.CertificatePolicy]: + """Create a CertificatePolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.types.CertificatePolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is + :return: An instance of AsyncLROPoller that returns CertificatePolicy. The CertificatePolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_update( + async def begin_create_or_replace( self, resource_group_name: str, - schema_registry_name: str, - properties: IO[bytes], + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.SchemaRegistry]: - """Update a SchemaRegistry. + ) -> AsyncLROPoller[_models.CertificatePolicy]: + """Create a CertificatePolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is + :return: An instance of AsyncLROPoller that returns CertificatePolicy. The CertificatePolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", + "namespace_name", + "certificate_authority_name", + "certificate_policy_name", "content_type", "accept", ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - async def begin_update( + async def begin_create_or_replace( self, resource_group_name: str, - schema_registry_name: str, - properties: Union[_models.SchemaRegistryUpdate, JSON, IO[bytes]], + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: Union[_models.CertificatePolicy, _types.CertificatePolicy, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.SchemaRegistry]: - """Update a SchemaRegistry. + ) -> AsyncLROPoller[_models.CertificatePolicy]: + """Create a CertificatePolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param properties: The resource properties to be updated. Is one of the following types: - SchemaRegistryUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.SchemaRegistryUpdate or JSON or IO[bytes] - :return: An instance of AsyncLROPoller that returns SchemaRegistry. The SchemaRegistry is + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param resource: Resource create parameters. Is either a CertificatePolicy type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.CertificatePolicy or + ~azure.mgmt.deviceregistry.types.CertificatePolicy or IO[bytes] + :return: An instance of AsyncLROPoller that returns CertificatePolicy. The CertificatePolicy is compatible with MutableMapping - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SchemaRegistry] = kwargs.pop("cls", None) + cls: ClsType[_models.CertificatePolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._update_initial( + raw_result = await self._create_or_replace_initial( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - properties=properties, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + certificate_policy_name=certificate_policy_name, + resource=resource, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -10398,7 +11908,7 @@ async def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.SchemaRegistry, response.json()) + deserialized = _deserialize(_models.CertificatePolicy, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -10416,31 +11926,37 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.SchemaRegistry].from_continuation_token( + return AsyncLROPoller[_models.CertificatePolicy].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.SchemaRegistry]( + return AsyncLROPoller[_models.CertificatePolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": ["api_version", "subscription_id", "resource_group_name", "schema_registry_name"] + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + "certificate_policy_name", + ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) async def _delete_initial( - self, resource_group_name: str, schema_registry_name: str, **kwargs: Any + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10455,9 +11971,11 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_schema_registries_delete_request( + _request = build_certificate_policies_delete_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + certificate_policy_name=certificate_policy_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -10502,28 +12020,38 @@ async def _delete_initial( @distributed_trace_async @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": ["api_version", "subscription_id", "resource_group_name", "schema_registry_name"] + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + "certificate_policy_name", + ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) async def begin_delete( - self, resource_group_name: str, schema_registry_name: str, **kwargs: Any + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a SchemaRegistry. + """Delete a CertificatePolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -10538,7 +12066,9 @@ async def begin_delete( if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + certificate_policy_name=certificate_policy_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -10572,36 +12102,31 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @distributed_trace @api_version_validation( - method_added_on="2024-09-01-preview", - params_added_on={"2024-09-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + method_added_on="2026-11-01", + params_added_on={ + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + "certificate_policy_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-11-01"], ) - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SchemaRegistry"]: - """List SchemaRegistry resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of SchemaRegistry - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.SchemaRegistry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.SchemaRegistry]] = kwargs.pop("cls", None) - + async def _update_initial( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: Union[_models.CertificatePolicyUpdate, _types.CertificatePolicyUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -10610,100 +12135,306 @@ def list_by_resource_group( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _request = build_schema_registries_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - return _request + _request = build_certificate_policies_update_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + certificate_policy_name=certificate_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.SchemaRegistry], - deserialized.get("value", []), + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: _models.CertificatePolicyUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CertificatePolicy]: + """Update a CertificatePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.models.CertificatePolicyUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns CertificatePolicy. The CertificatePolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: _types.CertificatePolicyUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CertificatePolicy]: + """Update a CertificatePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.types.CertificatePolicyUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns CertificatePolicy. The CertificatePolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.CertificatePolicy]: + """Update a CertificatePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns CertificatePolicy. The CertificatePolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + @api_version_validation( + method_added_on="2026-11-01", + params_added_on={ + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + "certificate_policy_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-11-01"], + ) + async def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: Union[_models.CertificatePolicyUpdate, _types.CertificatePolicyUpdate, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.CertificatePolicy]: + """Update a CertificatePolicy. - async def get_next(next_link=None): - _request = prepare_request(next_link) + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param properties: The resource properties to be updated. Is either a CertificatePolicyUpdate + type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.CertificatePolicyUpdate or + ~azure.mgmt.deviceregistry.types.CertificatePolicyUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns CertificatePolicy. The CertificatePolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CertificatePolicy] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + certificate_policy_name=certificate_policy_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) - response = pipeline_response.http_response + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CertificatePolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - return pipeline_response + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return AsyncItemPaged(get_next, extract_data) + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.CertificatePolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.CertificatePolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace @api_version_validation( - method_added_on="2024-09-01-preview", - params_added_on={"2024-09-01-preview": ["api_version", "subscription_id", "accept"]}, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + method_added_on="2026-11-01", + params_added_on={ + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + "accept", + ] + }, + api_versions_list=["2026-11-01"], ) - def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.SchemaRegistry"]: - """List SchemaRegistry resources by subscription ID. + def list_by_certificate_authority( + self, resource_group_name: str, namespace_name: str, certificate_authority_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.CertificatePolicy"]: + """List CertificatePolicy resources by CertificateAuthority. - :return: An iterator like instance of SchemaRegistry + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :return: An iterator like instance of CertificatePolicy :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.SchemaRegistry] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.CertificatePolicy] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SchemaRegistry]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CertificatePolicy]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10716,7 +12447,10 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged["_models.SchemaR def prepare_request(next_link=None): if not next_link: - _request = build_schema_registries_list_by_subscription_request( + _request = build_certificate_policies_list_by_certificate_authority_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -10740,7 +12474,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -10754,7 +12491,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.SchemaRegistry], + List[_models.CertificatePolicy], deserialized.get("value", []), ) if cls: @@ -10773,262 +12510,62 @@ async def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class SchemasOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s - :attr:`schemas` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - @api_version_validation( - method_added_on="2024-09-01-preview", - params_added_on={ - "2024-09-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "schema_registry_name", - "schema_name", - "accept", - ] - }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], - ) - async def get( - self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any - ) -> _models.Schema: - """Get a Schema. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :return: Schema. The Schema is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.Schema - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Schema] = kwargs.pop("cls", None) - - _request = build_schemas_get_request( - resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Schema, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_replace( - self, - resource_group_name: str, - schema_registry_name: str, - schema_name: str, - resource: _models.Schema, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Schema: - """Create a Schema. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.Schema - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Schema. The Schema is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.Schema - :raises ~azure.core.exceptions.HttpResponseError: - """ + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - @overload - async def create_or_replace( - self, - resource_group_name: str, - schema_registry_name: str, - schema_name: str, - resource: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Schema: - """Create a Schema. + return pipeline_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Schema. The Schema is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.Schema - :raises ~azure.core.exceptions.HttpResponseError: - """ + return AsyncItemPaged(get_next, extract_data) - @overload - async def create_or_replace( - self, - resource_group_name: str, - schema_registry_name: str, - schema_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Schema: - """Create a Schema. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Schema. The Schema is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.Schema - :raises ~azure.core.exceptions.HttpResponseError: - """ +class RegistryDevicesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s + :attr:`registry_devices` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", - "schema_name", - "content_type", + "namespace_name", + "registry_device_name", "accept", ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - async def create_or_replace( - self, - resource_group_name: str, - schema_registry_name: str, - schema_name: str, - resource: Union[_models.Schema, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.Schema: - """Create a Schema. + async def get( + self, resource_group_name: str, namespace_name: str, registry_device_name: str, **kwargs: Any + ) -> _models.RegistryDevice: + """Get a RegistryDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param resource: Resource create parameters. Is one of the following types: Schema, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.Schema or JSON or IO[bytes] - :return: Schema. The Schema is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.Schema + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :return: RegistryDevice. The RegistryDevice is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.RegistryDevice :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -11039,27 +12576,17 @@ async def create_or_replace( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Schema] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.RegistryDevice] = kwargs.pop("cls", None) - _request = build_schemas_create_or_replace_request( + _request = build_registry_devices_get_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, + namespace_name=namespace_name, + registry_device_name=registry_device_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -11076,7 +12603,7 @@ async def create_or_replace( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: if _stream: try: await response.read() # Load the body in memory and close the socket @@ -11092,7 +12619,7 @@ async def create_or_replace( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Schema, response.json()) + deserialized = _deserialize(_models.RegistryDevice, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -11100,20 +12627,27 @@ async def create_or_replace( return deserialized # type: ignore @api_version_validation( - method_added_on="2025-10-01", + method_added_on="2026-11-01", params_added_on={ - "2025-10-01": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", - "schema_name", + "namespace_name", + "registry_device_name", + "content_type", + "accept", ] }, - api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) - async def _delete_initial( - self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any + async def _create_or_replace_initial( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: Union[_models.RegistryDevice, _types.RegistryDevice, IO[bytes]], + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11123,17 +12657,27 @@ async def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_schemas_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_registry_devices_create_or_replace_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, + namespace_name=namespace_name, + registry_device_name=registry_device_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -11150,7 +12694,7 @@ async def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 201]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -11163,8 +12707,10 @@ async def _delete_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -11174,48 +12720,156 @@ async def _delete_initial( return deserialized # type: ignore + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: _models.RegistryDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RegistryDevice]: + """Create a RegistryDevice. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.models.RegistryDevice + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns RegistryDevice. The RegistryDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: _types.RegistryDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RegistryDevice]: + """Create a RegistryDevice. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.types.RegistryDevice + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns RegistryDevice. The RegistryDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RegistryDevice]: + """Create a RegistryDevice. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns RegistryDevice. The RegistryDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace_async @api_version_validation( - method_added_on="2025-10-01", + method_added_on="2026-11-01", params_added_on={ - "2025-10-01": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", - "schema_name", + "namespace_name", + "registry_device_name", + "content_type", + "accept", ] }, - api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) - async def begin_delete( - self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Delete a Schema. + async def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: Union[_models.RegistryDevice, _types.RegistryDevice, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RegistryDevice]: + """Create a RegistryDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :return: An instance of AsyncLROPoller that returns None - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param resource: Resource create parameters. Is either a RegistryDevice type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.RegistryDevice or + ~azure.mgmt.deviceregistry.types.RegistryDevice or IO[bytes] + :return: An instance of AsyncLROPoller that returns RegistryDevice. The RegistryDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RegistryDevice] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_initial( + raw_result = await self._create_or_replace_initial( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, + namespace_name=namespace_name, + registry_device_name=registry_device_name, + resource=resource, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -11224,9 +12878,12 @@ async def begin_delete( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.RegistryDevice, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -11241,195 +12898,39 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.RegistryDevice].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2024-09-01-preview", - params_added_on={ - "2024-09-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "schema_registry_name", - "accept", - ] - }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], - ) - def list_by_schema_registry( - self, resource_group_name: str, schema_registry_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.Schema"]: - """List Schema resources by SchemaRegistry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :return: An iterator like instance of Schema - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.Schema] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Schema]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_schemas_list_by_schema_registry_request( - resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - async def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Schema], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - -class SchemaVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.deviceregistry.aio.DeviceRegistryMgmtClient`'s - :attr:`schema_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return AsyncLROPoller[_models.RegistryDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @distributed_trace_async @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", - "schema_name", - "schema_version_name", + "namespace_name", + "registry_device_name", + "content_type", "accept", ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - async def get( + async def _update_initial( self, resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, + namespace_name: str, + registry_device_name: str, + properties: Union[_models.RegistryDeviceUpdate, _types.RegistryDeviceUpdate, IO[bytes]], **kwargs: Any - ) -> _models.SchemaVersion: - """Get a SchemaVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param schema_version_name: Schema version name parameter. Required. - :type schema_version_name: str - :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -11438,18 +12939,27 @@ async def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.SchemaVersion] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_schema_versions_get_request( + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_registry_devices_update_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, - schema_version_name=schema_version_name, + namespace_name=namespace_name, + registry_device_name=registry_device_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -11459,19 +12969,18 @@ async def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -11479,255 +12988,221 @@ async def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.SchemaVersion, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload - async def create_or_replace( + async def begin_update( self, resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, - resource: _models.SchemaVersion, + namespace_name: str, + registry_device_name: str, + properties: _models.RegistryDeviceUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.SchemaVersion: - """Create a SchemaVersion. + ) -> AsyncLROPoller[_models.RegistryDevice]: + """Update a RegistryDevice. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param schema_version_name: Schema version name parameter. Required. - :type schema_version_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.SchemaVersion + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.models.RegistryDeviceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion + :return: An instance of AsyncLROPoller that returns RegistryDevice. The RegistryDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_or_replace( + async def begin_update( self, resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, - resource: JSON, + namespace_name: str, + registry_device_name: str, + properties: _types.RegistryDeviceUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.SchemaVersion: - """Create a SchemaVersion. + ) -> AsyncLROPoller[_models.RegistryDevice]: + """Update a RegistryDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param schema_version_name: Schema version name parameter. Required. - :type schema_version_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.types.RegistryDeviceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion + :return: An instance of AsyncLROPoller that returns RegistryDevice. The RegistryDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_or_replace( + async def begin_update( self, resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, - resource: IO[bytes], + namespace_name: str, + registry_device_name: str, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.SchemaVersion: - """Create a SchemaVersion. + ) -> AsyncLROPoller[_models.RegistryDevice]: + """Update a RegistryDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param schema_version_name: Schema version name parameter. Required. - :type schema_version_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion + :return: An instance of AsyncLROPoller that returns RegistryDevice. The RegistryDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", - "schema_name", - "schema_version_name", + "namespace_name", + "registry_device_name", "content_type", "accept", ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - async def create_or_replace( + async def begin_update( self, resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, - resource: Union[_models.SchemaVersion, JSON, IO[bytes]], + namespace_name: str, + registry_device_name: str, + properties: Union[_models.RegistryDeviceUpdate, _types.RegistryDeviceUpdate, IO[bytes]], **kwargs: Any - ) -> _models.SchemaVersion: - """Create a SchemaVersion. + ) -> AsyncLROPoller[_models.RegistryDevice]: + """Update a RegistryDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param schema_version_name: Schema version name parameter. Required. - :type schema_version_name: str - :param resource: Resource create parameters. Is one of the following types: SchemaVersion, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.SchemaVersion or JSON or IO[bytes] - :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param properties: The resource properties to be updated. Is either a RegistryDeviceUpdate type + or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.RegistryDeviceUpdate or + ~azure.mgmt.deviceregistry.types.RegistryDeviceUpdate or IO[bytes] + :return: An instance of AsyncLROPoller that returns RegistryDevice. The RegistryDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SchemaVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.RegistryDevice] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + registry_device_name=registry_device_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.RegistryDevice, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_schema_versions_create_or_replace_request( - resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, - schema_version_name=schema_version_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - if response.status_code not in [200, 201]: - if _stream: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: - deserialized = _deserialize(_models.SchemaVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RegistryDevice].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RegistryDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @api_version_validation( - method_added_on="2025-10-01", + method_added_on="2026-11-01", params_added_on={ - "2025-10-01": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", - "schema_name", - "schema_version_name", + "namespace_name", + "registry_device_name", ] }, - api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) async def _delete_initial( - self, - resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, - **kwargs: Any + self, resource_group_name: str, namespace_name: str, registry_device_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11742,11 +13217,10 @@ async def _delete_initial( cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_schema_versions_delete_request( + _request = build_registry_devices_delete_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, - schema_version_name=schema_version_name, + namespace_name=namespace_name, + registry_device_name=registry_device_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -11791,38 +13265,30 @@ async def _delete_initial( @distributed_trace_async @api_version_validation( - method_added_on="2025-10-01", + method_added_on="2026-11-01", params_added_on={ - "2025-10-01": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", - "schema_name", - "schema_version_name", + "namespace_name", + "registry_device_name", ] }, - api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) async def begin_delete( - self, - resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, - **kwargs: Any + self, resource_group_name: str, namespace_name: str, registry_device_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Delete a SchemaVersion. + """Delete a RegistryDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param schema_version_name: Schema version name parameter. Required. - :type schema_version_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str :return: An instance of AsyncLROPoller that returns None :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -11837,9 +13303,8 @@ async def begin_delete( if cont_token is None: raw_result = await self._delete_initial( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, - schema_version_name=schema_version_name, + namespace_name=namespace_name, + registry_device_name=registry_device_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -11875,46 +13340,31 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "schema_registry_name", - "schema_name", - "accept", - ] + "2026-11-01": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - def list_by_schema( - self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SchemaVersion"]: - """List SchemaVersion resources by Schema. + def list_by_namespace( + self, resource_group_name: str, namespace_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.RegistryDevice"]: + """List RegistryDevice resources by Namespace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :return: An iterator like instance of SchemaVersion + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :return: An iterator like instance of RegistryDevice :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.SchemaVersion] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.deviceregistry.models.RegistryDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SchemaVersion]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RegistryDevice]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11927,10 +13377,9 @@ def list_by_schema( def prepare_request(next_link=None): if not next_link: - _request = build_schema_versions_list_by_schema_request( + _request = build_registry_devices_list_by_namespace_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, + namespace_name=namespace_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -11954,7 +13403,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -11968,7 +13420,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.SchemaVersion], + List[_models.RegistryDevice], deserialized.get("value", []), ) if cls: diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/operations/_patch.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/operations/_patch.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/aio/operations/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/__init__.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/__init__.py index 56e28c1ec462..7a08a5964204 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/__init__.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/__init__.py @@ -14,7 +14,7 @@ from ._models import ( # type: ignore - ActivateBringYourOwnRootRequest, + ActivateCertificateAuthorityRequest, Asset, AssetEndpointProfile, AssetEndpointProfileProperties, @@ -32,13 +32,16 @@ Authentication, BillingContainer, BillingContainerProperties, - BringYourOwnRoot, BrokerStateStoreDestinationConfiguration, - CertificateAuthorityConfiguration, - CertificateConfiguration, - Credential, - CredentialProperties, - CredentialUpdate, + CertificateAuthority, + CertificateAuthorityIssuer, + CertificateAuthorityProperties, + CertificateAuthorityUpdate, + CertificatePolicy, + CertificatePolicyConfiguration, + CertificatePolicyProperties, + CertificatePolicyUpdate, + CertificatePolicyUpdateProperties, DataPoint, DataPointBase, Dataset, @@ -46,8 +49,6 @@ DatasetDestination, DatasetMqttDestination, DatasetStorageDestination, - DeviceCredentialPolicy, - DeviceCredentialsRevokeRequest, DeviceMessagingEndpoint, DeviceRef, DeviceStatus, @@ -66,18 +67,27 @@ EventMqttDestination, EventStorageDestination, ExtendedLocation, + ExternalCertificateAuthorityIssuer, + HealthState, HostAuthentication, + InboundCallerIdentity, InboundEndpoints, - LeafCertificateConfiguration, + IntermediateCertificateAuthorityProperties, + ManagedServiceIdentity, + Management, ManagementAction, + ManagementEndpoint, ManagementGroup, MessageSchemaReference, Messaging, MessagingEndpoint, + MessagingEndpointProvisioning, MessagingEndpoints, + MicrosoftCertificateAuthorityIssuer, MqttDestinationConfiguration, Namespace, NamespaceAsset, + NamespaceAssetExecuteActionRequest, NamespaceAssetProperties, NamespaceAssetStatus, NamespaceAssetStatusDataset, @@ -111,22 +121,28 @@ NamespaceDiscoveredStream, NamespaceEvent, NamespaceEventGroup, + NamespaceLinkingError, NamespaceMessageSchemaReference, NamespaceMigrateRequest, NamespaceProperties, + NamespaceProvisioning, NamespaceStream, NamespaceUpdate, NamespaceUpdateProperties, Operation, OperationDisplay, OperationStatusResult, + OptionalPropertiesCertificatePolicyConfiguration, OutboundEndpoints, - Policy, - PolicyProperties, - PolicyUpdate, - PolicyUpdateProperties, + OutboundIdentity, + ProvisioningEndpoint, ProxyResource, + RegistryDevice, + RegistryDeviceProperties, + RegistryDeviceUpdate, + RegistryDeviceUpdateProperties, Resource, + RootCertificateAuthorityProperties, Schema, SchemaProperties, SchemaRegistry, @@ -141,11 +157,11 @@ StreamDestination, StreamMqttDestination, StreamStorageDestination, - SystemAssignedServiceIdentity, SystemData, Topic, TrackedResource, TrustSettings, + UserAssignedIdentity, UsernamePasswordCredentials, X509CertificateCredentials, X509Credentials, @@ -154,23 +170,32 @@ from ._enums import ( # type: ignore ActionType, AuthenticationMethod, - BringYourOwnRootStatus, + CertificateAuthorityIssuerType, + CertificateAuthorityKeyType, + CertificateAuthorityStatus, + CertificateAuthorityType, CreatedByType, DataPointObservabilityMode, DatasetDestinationTarget, EventDestinationTarget, EventObservabilityMode, Format, + HealthStatus, + InboundCallerIdentityType, + ManagedServiceIdentityType, ManagementActionType, + MessagingEndpointAvailability, MqttDestinationQos, NamespaceDiscoveredManagementActionType, + NamespaceLinkingStateValue, Origin, + OutboundIdentityType, + ProvisioningEndpointType, ProvisioningState, + RegistryDeviceEnablementState, SchemaType, Scope, StreamDestinationTarget, - SupportedKeyType, - SystemAssignedServiceIdentityType, TopicRetainType, ) from ._patch import __all__ as _patch_all @@ -178,7 +203,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "ActivateBringYourOwnRootRequest", + "ActivateCertificateAuthorityRequest", "Asset", "AssetEndpointProfile", "AssetEndpointProfileProperties", @@ -196,13 +221,16 @@ "Authentication", "BillingContainer", "BillingContainerProperties", - "BringYourOwnRoot", "BrokerStateStoreDestinationConfiguration", - "CertificateAuthorityConfiguration", - "CertificateConfiguration", - "Credential", - "CredentialProperties", - "CredentialUpdate", + "CertificateAuthority", + "CertificateAuthorityIssuer", + "CertificateAuthorityProperties", + "CertificateAuthorityUpdate", + "CertificatePolicy", + "CertificatePolicyConfiguration", + "CertificatePolicyProperties", + "CertificatePolicyUpdate", + "CertificatePolicyUpdateProperties", "DataPoint", "DataPointBase", "Dataset", @@ -210,8 +238,6 @@ "DatasetDestination", "DatasetMqttDestination", "DatasetStorageDestination", - "DeviceCredentialPolicy", - "DeviceCredentialsRevokeRequest", "DeviceMessagingEndpoint", "DeviceRef", "DeviceStatus", @@ -230,18 +256,27 @@ "EventMqttDestination", "EventStorageDestination", "ExtendedLocation", + "ExternalCertificateAuthorityIssuer", + "HealthState", "HostAuthentication", + "InboundCallerIdentity", "InboundEndpoints", - "LeafCertificateConfiguration", + "IntermediateCertificateAuthorityProperties", + "ManagedServiceIdentity", + "Management", "ManagementAction", + "ManagementEndpoint", "ManagementGroup", "MessageSchemaReference", "Messaging", "MessagingEndpoint", + "MessagingEndpointProvisioning", "MessagingEndpoints", + "MicrosoftCertificateAuthorityIssuer", "MqttDestinationConfiguration", "Namespace", "NamespaceAsset", + "NamespaceAssetExecuteActionRequest", "NamespaceAssetProperties", "NamespaceAssetStatus", "NamespaceAssetStatusDataset", @@ -275,22 +310,28 @@ "NamespaceDiscoveredStream", "NamespaceEvent", "NamespaceEventGroup", + "NamespaceLinkingError", "NamespaceMessageSchemaReference", "NamespaceMigrateRequest", "NamespaceProperties", + "NamespaceProvisioning", "NamespaceStream", "NamespaceUpdate", "NamespaceUpdateProperties", "Operation", "OperationDisplay", "OperationStatusResult", + "OptionalPropertiesCertificatePolicyConfiguration", "OutboundEndpoints", - "Policy", - "PolicyProperties", - "PolicyUpdate", - "PolicyUpdateProperties", + "OutboundIdentity", + "ProvisioningEndpoint", "ProxyResource", + "RegistryDevice", + "RegistryDeviceProperties", + "RegistryDeviceUpdate", + "RegistryDeviceUpdateProperties", "Resource", + "RootCertificateAuthorityProperties", "Schema", "SchemaProperties", "SchemaRegistry", @@ -305,33 +346,42 @@ "StreamDestination", "StreamMqttDestination", "StreamStorageDestination", - "SystemAssignedServiceIdentity", "SystemData", "Topic", "TrackedResource", "TrustSettings", + "UserAssignedIdentity", "UsernamePasswordCredentials", "X509CertificateCredentials", "X509Credentials", "ActionType", "AuthenticationMethod", - "BringYourOwnRootStatus", + "CertificateAuthorityIssuerType", + "CertificateAuthorityKeyType", + "CertificateAuthorityStatus", + "CertificateAuthorityType", "CreatedByType", "DataPointObservabilityMode", "DatasetDestinationTarget", "EventDestinationTarget", "EventObservabilityMode", "Format", + "HealthStatus", + "InboundCallerIdentityType", + "ManagedServiceIdentityType", "ManagementActionType", + "MessagingEndpointAvailability", "MqttDestinationQos", "NamespaceDiscoveredManagementActionType", + "NamespaceLinkingStateValue", "Origin", + "OutboundIdentityType", + "ProvisioningEndpointType", "ProvisioningState", + "RegistryDeviceEnablementState", "SchemaType", "Scope", "StreamDestinationTarget", - "SupportedKeyType", - "SystemAssignedServiceIdentityType", "TopicRetainType", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/_enums.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/_enums.py index f4a63a6af773..949d9b16e31c 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/_enums.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/_enums.py @@ -30,16 +30,40 @@ class AuthenticationMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The user authentication method is a username and password.""" -class BringYourOwnRootStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the Bring Your Own Root configuration.""" +class CertificateAuthorityIssuerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The issuer type for an intermediate Certificate Authority.""" + + MICROSOFT = "Microsoft" + """The intermediate Certificate Authority is issued by Microsoft.""" + EXTERNAL = "External" + """The intermediate Certificate Authority is issued by an external Certificate Authority.""" + + +class CertificateAuthorityKeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Supported Certificate Authority key types.""" + + ECC = "ECC" + """Indicate the ECC key type.""" + + +class CertificateAuthorityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Status of the Certificate Authority certificate lifecycle.""" PENDING_ACTIVATION = "PendingActivation" - """The CSR has been generated and is waiting for the customer to provide the signed certificate.""" + """The CSR has been generated and is waiting for activation.""" ACTIVE = "Active" - """The signed certificate has been successfully uploaded and validated, and the CA is active.""" + """The Certificate Authority is active.""" ACTIVE_BUT_PENDING_RENEWAL = "ActiveButPendingRenewal" - """The certificate is nearing expiration (within renewal window) or has expired. A new CSR has - been generated and is waiting for the customer to provide a new signed certificate.""" + """The Certificate Authority is active but requires renewal.""" + + +class CertificateAuthorityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Supported Certificate Authority types.""" + + ROOT = "Root" + """Self-signed, service-managed root Certificate Authority.""" + ICA = "ICA" + """Intermediate Certificate Authority signed by another Certificate Authority.""" class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -106,6 +130,45 @@ class Format(str, Enum, metaclass=CaseInsensitiveEnumMeta): """JSON Schema version draft 7 format.""" DELTA1_0 = "Delta/1.0" """Delta format.""" + JSON_LD1_1 = "JsonLD/1.1" + """W3C Web of Things JSON-LD format.""" + + +class HealthStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Defines the health state of the resource.""" + + UNKNOWN = "Unknown" + """Resource state is unknown.""" + AVAILABLE = "Available" + """Resource is Available and functioning as expected.""" + DEGRADED = "Degraded" + """Resource health is degraded.""" + UNAVAILABLE = "Unavailable" + """Resource is not functioning as expected.""" + + +class InboundCallerIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity used for inbound calls to the ADR namespace.""" + + SYSTEM_ASSIGNED = "SystemAssigned" + """System-assigned managed identity.""" + USER_ASSIGNED = "UserAssigned" + """User-assigned managed identity.""" + + +class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of managed service identity (where both SystemAssigned and UserAssigned types are + allowed). + """ + + NONE = "None" + """No managed identity.""" + SYSTEM_ASSIGNED = "SystemAssigned" + """System assigned managed identity.""" + USER_ASSIGNED = "UserAssigned" + """User assigned managed identity.""" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + """System and user assigned managed identity.""" class ManagementActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -119,6 +182,15 @@ class ManagementActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Write action type.""" +class MessagingEndpointAvailability(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The availability status of a messaging endpoint.""" + + AVAILABLE = "Available" + """The messaging endpoint is available.""" + DISABLED = "Disabled" + """The messaging endpoint is disabled.""" + + class MqttDestinationQos(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The set of supported QoS types for a MQTT destination.""" @@ -139,6 +211,17 @@ class NamespaceDiscoveredManagementActionType(str, Enum, metaclass=CaseInsensiti """Write action type.""" +class NamespaceLinkingStateValue(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The linking state values for namespace endpoint entries.""" + + IN_PROGRESS = "InProgress" + """Linking is in progress.""" + SUCCEEDED = "Succeeded" + """Linking succeeded.""" + FAILED = "Failed" + """Linking failed.""" + + class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". @@ -152,6 +235,22 @@ class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates the operation is initiated by a user or system.""" +class OutboundIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity used for outbound calls from the ADR namespace.""" + + SYSTEM_ASSIGNED = "SystemAssigned" + """System-assigned managed identity.""" + USER_ASSIGNED = "UserAssigned" + """User-assigned managed identity.""" + + +class ProvisioningEndpointType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of provisioning resource that can be linked to a namespace.""" + + DPS = "Microsoft.Devices/provisioningServices" + """Azure Device Provisioning Service.""" + + class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The provisioning status of the resource.""" @@ -167,11 +266,24 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Resource is deleting.""" +class RegistryDeviceEnablementState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Represents the enablement state of a device.""" + + ENABLED = "Enabled" + """The device is enabled.""" + DISABLED = "Disabled" + """The device is disabled. All PUT/PATCH/POST APIs on the child resources will be blocked.""" + + class SchemaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Defines the schema type.""" MESSAGE_SCHEMA = "MessageSchema" """Message Schema schema type.""" + THING_MODEL = "ThingModel" + """W3C Web of Things Thing Model document.""" + THING_DESCRIPTION = "ThingDescription" + """W3C Web of Things Thing Description document.""" class Scope(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -190,22 +302,6 @@ class StreamDestinationTarget(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Storage target.""" -class SupportedKeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Supported key types.""" - - ECC = "ECC" - """Indicates the ECC key type.""" - - -class SystemAssignedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of managed service identity (either system assigned, or none).""" - - NONE = "None" - """No managed system identity.""" - SYSTEM_ASSIGNED = "SystemAssigned" - """System assigned managed system identity.""" - - class TopicRetainType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Topic retain types.""" diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/_models.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/_models.py index 893147949ca8..9a8c1485fd13 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/_models.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/_models.py @@ -12,30 +12,37 @@ from typing import Any, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload from .._utils.model_base import Model as _Model, rest_discriminator, rest_field -from ._enums import DatasetDestinationTarget, EventDestinationTarget, StreamDestinationTarget +from ._enums import ( + CertificateAuthorityIssuerType, + CertificateAuthorityType, + DatasetDestinationTarget, + EventDestinationTarget, + StreamDestinationTarget, +) if TYPE_CHECKING: from .. import models as _models -class ActivateBringYourOwnRootRequest(_Model): - """Request payload for activating a Bring Your Own Root policy with a customer-provided signed - certificate. +class ActivateCertificateAuthorityRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Request payload for activating a Certificate Authority with a signed certificate. - :ivar certificate_chain: Certificate chain in PEM format, including the signed certificate. The - first certificate must be the signed certificate (matching the CSR generated by the service), - followed by any intermediate CAs, and optionally the root CA. Certificates must be ordered from - leaf to root and concatenated in PEM format. Required. + :ivar certificate_chain: Certificate chain in PEM format for activating an externally issued + intermediate Certificate Authority, including the signed certificate. The first certificate + must be the signed certificate matching the CSR generated by the service, followed by any + intermediate CAs, and optionally the root CA. Certificates must be ordered from leaf to root + and concatenated in PEM format. Required. :vartype certificate_chain: str """ certificate_chain: str = rest_field( name="certificateChain", visibility=["read", "create", "update", "delete", "query"] ) - """Certificate chain in PEM format, including the signed certificate. The first certificate must - be the signed certificate (matching the CSR generated by the service), followed by any - intermediate CAs, and optionally the root CA. Certificates must be ordered from leaf to root - and concatenated in PEM format. Required.""" + """Certificate chain in PEM format for activating an externally issued intermediate Certificate + Authority, including the signed certificate. The first certificate must be the signed + certificate matching the CSR generated by the service, followed by any intermediate CAs, and + optionally the root CA. Certificates must be ordered from leaf to root and concatenated in PEM + format. Required.""" @overload def __init__( @@ -83,7 +90,7 @@ class Resource(_Model): """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" -class TrackedResource(Resource): +class TrackedResource(Resource): # pylint: disable=docstring-keyword-should-match-keyword-only """Tracked Resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -127,7 +134,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Asset(TrackedResource): +class Asset(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Asset definition. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -179,7 +186,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AssetEndpointProfile(TrackedResource): +class AssetEndpointProfile(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Asset Endpoint Profile definition. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -231,7 +238,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AssetEndpointProfileProperties(_Model): +class AssetEndpointProfileProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the Asset Endpoint Profile properties. :ivar uuid: Globally unique, immutable, non-reusable id. @@ -345,7 +352,7 @@ class AssetEndpointProfileStatusError(_Model): “targetAddress 'foo' is not a valid url”).""" -class AssetEndpointProfileUpdate(_Model): +class AssetEndpointProfileUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The type used for update operations of the AssetEndpointProfile. :ivar tags: Resource tags. @@ -380,7 +387,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AssetEndpointProfileUpdateProperties(_Model): +class AssetEndpointProfileUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The updatable properties of the AssetEndpointProfile. :ivar target_address: The local valid URI specifying the network address/DNS name of a @@ -438,7 +445,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AssetProperties(_Model): +class AssetProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the asset properties. :ivar uuid: Globally unique, immutable, non-reusable id. @@ -702,7 +709,7 @@ class AssetStatusEvent(_Model): """The message schema reference object.""" -class AssetUpdate(_Model): +class AssetUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The type used for update operations of the Asset. :ivar tags: Resource tags. @@ -737,7 +744,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class AssetUpdateProperties(_Model): +class AssetUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The updatable properties of the Asset. :ivar enabled: Enabled/Disabled status of the asset. @@ -874,7 +881,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Authentication(_Model): +class Authentication(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Definition of the client authentication mechanism to the server. :ivar method: Defines the method to authenticate the user of the client at the server. @@ -941,7 +948,7 @@ class ProxyResource(Resource): """ -class BillingContainer(ProxyResource): +class BillingContainer(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """billingContainer Model as Azure resource whose sole purpose is to keep track of billables resources under a subscription. @@ -1002,45 +1009,21 @@ class BillingContainerProperties(_Model): \"Accepted\", and \"Deleting\".""" -class BringYourOwnRoot(_Model): - """Configuration for Bring Your Own Root. When enabled, customers provide their own CA-signed - certificates instead of using the service-managed CA. +class BrokerStateStoreDestinationConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The configuration for a MQTT broker state store destination. - :ivar enabled: Indicates whether Bring Your Own Root is enabled. This can only be set at - creation time and cannot be changed afterward. Required. - :vartype enabled: bool - :ivar certificate_signing_request: Certificate Signing Request (CSR) in PEM format, generated - by the service. Sign this CSR with your Certificate Authority and activate via the - activateBringYourOwnRoot action. A new CSR is generated at policy creation and when - certificates near expiration. - :vartype certificate_signing_request: str - :ivar issuing_certificate_thumbprint: Thumbprint of the issuing certificate. - :vartype issuing_certificate_thumbprint: str - :ivar status: The status of the Bring Your Own Root configuration, indicating the current state - of the certificate lifecycle. Known values are: "PendingActivation", "Active", and - "ActiveButPendingRenewal". - :vartype status: str or ~azure.mgmt.deviceregistry.models.BringYourOwnRootStatus + :ivar key: The MQTT broker state store destination key. Required. + :vartype key: str """ - enabled: bool = rest_field(visibility=["read", "create"]) - """Indicates whether Bring Your Own Root is enabled. This can only be set at creation time and - cannot be changed afterward. Required.""" - certificate_signing_request: Optional[str] = rest_field(name="certificateSigningRequest", visibility=["read"]) - """Certificate Signing Request (CSR) in PEM format, generated by the service. Sign this CSR with - your Certificate Authority and activate via the activateBringYourOwnRoot action. A new CSR is - generated at policy creation and when certificates near expiration.""" - issuing_certificate_thumbprint: Optional[str] = rest_field(name="issuingCertificateThumbprint", visibility=["read"]) - """Thumbprint of the issuing certificate.""" - status: Optional[Union[str, "_models.BringYourOwnRootStatus"]] = rest_field(visibility=["read"]) - """The status of the Bring Your Own Root configuration, indicating the current state of the - certificate lifecycle. Known values are: \"PendingActivation\", \"Active\", and - \"ActiveButPendingRenewal\".""" + key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The MQTT broker state store destination key. Required.""" @overload def __init__( self, *, - enabled: bool, + key: str, ) -> None: ... @overload @@ -1054,21 +1037,74 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BrokerStateStoreDestinationConfiguration(_Model): - """The configuration for a MQTT broker state store destination. +class CertificateAuthority(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Certificate Authority resource. - :ivar key: The MQTT broker state store destination key. Required. - :vartype key: str + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.deviceregistry.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.deviceregistry.models.CertificateAuthorityProperties """ - key: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The MQTT broker state store destination key. Required.""" + properties: Optional["_models.CertificateAuthorityProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" @overload def __init__( self, *, - key: str, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.CertificateAuthorityProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CertificateAuthorityIssuer(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The issuer for an intermediate Certificate Authority. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ExternalCertificateAuthorityIssuer, MicrosoftCertificateAuthorityIssuer + + :ivar issuer_type: The Certificate Authority issuer type. Required. Known values are: + "Microsoft" and "External". + :vartype issuer_type: str or ~azure.mgmt.deviceregistry.models.CertificateAuthorityIssuerType + """ + + __mapping__: dict[str, _Model] = {} + issuer_type: str = rest_discriminator(name="issuerType", visibility=["read", "create"]) + """The Certificate Authority issuer type. Required. Known values are: \"Microsoft\" and + \"External\".""" + + @overload + def __init__( + self, + *, + issuer_type: str, ) -> None: ... @overload @@ -1082,47 +1118,65 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CertificateAuthorityConfiguration(_Model): - """The configuration to set up an ICA. +class CertificateAuthorityProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Details of the Certificate Authority resource. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + IntermediateCertificateAuthorityProperties, RootCertificateAuthorityProperties + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.deviceregistry.models.ProvisioningState + :ivar uuid: Globally unique, immutable, non-reusable identifier of the Certificate Authority + resource. + :vartype uuid: str + :ivar certificate_authority_type: The Certificate Authority type. Use Root for a self-signed, + service-managed root CA, and ICA for an intermediate CA. Required. Known values are: "Root" and + "ICA". + :vartype certificate_authority_type: str or + ~azure.mgmt.deviceregistry.models.CertificateAuthorityType :ivar key_type: Crypto type: ECC. Required. "ECC" - :vartype key_type: str or ~azure.mgmt.deviceregistry.models.SupportedKeyType + :vartype key_type: str or ~azure.mgmt.deviceregistry.models.CertificateAuthorityKeyType :ivar subject: Certificate subject. :vartype subject: str - :ivar validity_not_before: Certificate is valid not before this date. Format ISO8601. Generated - based on on validity period. + :ivar validity_not_before: Certificate is valid not before this date. Format ISO8601. :vartype validity_not_before: ~datetime.datetime - :ivar validity_not_after: Certificate is valid not after this date. Format ISO8601. Generated - based on validity period. + :ivar validity_not_after: Certificate is valid not after this date. Format ISO8601. :vartype validity_not_after: ~datetime.datetime - :ivar bring_your_own_root: Configuration for Bring Your Own Root. - :vartype bring_your_own_root: ~azure.mgmt.deviceregistry.models.BringYourOwnRoot """ - key_type: Union[str, "_models.SupportedKeyType"] = rest_field(name="keyType", visibility=["read", "create"]) + __mapping__: dict[str, _Model] = {} + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", and \"Deleting\".""" + uuid: Optional[str] = rest_field(visibility=["read"]) + """Globally unique, immutable, non-reusable identifier of the Certificate Authority resource.""" + certificate_authority_type: str = rest_discriminator(name="certificateAuthorityType", visibility=["read", "create"]) + """The Certificate Authority type. Use Root for a self-signed, service-managed root CA, and ICA + for an intermediate CA. Required. Known values are: \"Root\" and \"ICA\".""" + key_type: Union[str, "_models.CertificateAuthorityKeyType"] = rest_field( + name="keyType", visibility=["read", "create"] + ) """Crypto type: ECC. Required. \"ECC\"""" subject: Optional[str] = rest_field(visibility=["read"]) """Certificate subject.""" validity_not_before: Optional[datetime.datetime] = rest_field( name="validityNotBefore", visibility=["read"], format="rfc3339" ) - """Certificate is valid not before this date. Format ISO8601. Generated based on on validity - period.""" + """Certificate is valid not before this date. Format ISO8601.""" validity_not_after: Optional[datetime.datetime] = rest_field( name="validityNotAfter", visibility=["read"], format="rfc3339" ) - """Certificate is valid not after this date. Format ISO8601. Generated based on validity period.""" - bring_your_own_root: Optional["_models.BringYourOwnRoot"] = rest_field( - name="bringYourOwnRoot", visibility=["read", "create", "update", "delete", "query"] - ) - """Configuration for Bring Your Own Root.""" + """Certificate is valid not after this date. Format ISO8601.""" @overload def __init__( self, *, - key_type: Union[str, "_models.SupportedKeyType"], - bring_your_own_root: Optional["_models.BringYourOwnRoot"] = None, + certificate_authority_type: str, + key_type: Union[str, "_models.CertificateAuthorityKeyType"], ) -> None: ... @overload @@ -1136,32 +1190,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CertificateConfiguration(_Model): - """The certificate configuration. +class CertificateAuthorityUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Update model for Certificate Authority. - :ivar certificate_authority_configuration: The configuration to set up an ICA. Required. - :vartype certificate_authority_configuration: - ~azure.mgmt.deviceregistry.models.CertificateAuthorityConfiguration - :ivar leaf_certificate_configuration: The leaf certificate configuration. Required. - :vartype leaf_certificate_configuration: - ~azure.mgmt.deviceregistry.models.LeafCertificateConfiguration + :ivar tags: Resource tags. + :vartype tags: dict[str, str] """ - certificate_authority_configuration: "_models.CertificateAuthorityConfiguration" = rest_field( - name="certificateAuthorityConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """The configuration to set up an ICA. Required.""" - leaf_certificate_configuration: "_models.LeafCertificateConfiguration" = rest_field( - name="leafCertificateConfiguration", visibility=["read", "create", "update", "delete", "query"] - ) - """The leaf certificate configuration. Required.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" @overload def __init__( self, *, - certificate_authority_configuration: "_models.CertificateAuthorityConfiguration", - leaf_certificate_configuration: "_models.LeafCertificateConfiguration", + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload @@ -1175,8 +1218,8 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Credential(TrackedResource): - """A Credential Resource. +class CertificatePolicy(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Certificate Policy resource. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -1194,10 +1237,10 @@ class Credential(TrackedResource): :ivar location: The geo-location where the resource lives. Required. :vartype location: str :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.deviceregistry.models.CredentialProperties + :vartype properties: ~azure.mgmt.deviceregistry.models.CertificatePolicyProperties """ - properties: Optional["_models.CredentialProperties"] = rest_field( + properties: Optional["_models.CertificatePolicyProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" @@ -1208,7 +1251,37 @@ def __init__( *, location: str, tags: Optional[dict[str, str]] = None, - properties: Optional["_models.CredentialProperties"] = None, + properties: Optional["_models.CertificatePolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CertificatePolicyConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The Certificate Policy certificate configuration. + + :ivar validity_period_in_days: The validity period in days. Required. + :vartype validity_period_in_days: int + """ + + validity_period_in_days: int = rest_field( + name="validityPeriodInDays", visibility=["read", "create", "update", "delete", "query"] + ) + """The validity period in days. Required.""" + + @overload + def __init__( + self, + *, + validity_period_in_days: int, ) -> None: ... @overload @@ -1222,12 +1295,17 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CredentialProperties(_Model): - """Details of the Credential Resource. +class CertificatePolicyProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Details of the Certificate Policy resource. :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", "Failed", "Canceled", "Accepted", and "Deleting". :vartype provisioning_state: str or ~azure.mgmt.deviceregistry.models.ProvisioningState + :ivar uuid: Globally unique, immutable, non-reusable identifier of the Certificate Policy + resource. + :vartype uuid: str + :ivar certificate: The certificate configuration. + :vartype certificate: ~azure.mgmt.deviceregistry.models.CertificatePolicyConfiguration """ provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( @@ -1235,23 +1313,84 @@ class CredentialProperties(_Model): ) """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", \"Accepted\", and \"Deleting\".""" + uuid: Optional[str] = rest_field(visibility=["read"]) + """Globally unique, immutable, non-reusable identifier of the Certificate Policy resource.""" + certificate: Optional["_models.CertificatePolicyConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The certificate configuration.""" + + @overload + def __init__( + self, + *, + certificate: Optional["_models.CertificatePolicyConfiguration"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) -class CredentialUpdate(_Model): - """The type used for update operations of the Credential. + +class CertificatePolicyUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The type used for update operations of the CertificatePolicy. :ivar tags: Resource tags. :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.deviceregistry.models.CertificatePolicyUpdateProperties """ tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" + properties: Optional["_models.CertificatePolicyUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" @overload def __init__( self, *, tags: Optional[dict[str, str]] = None, + properties: Optional["_models.CertificatePolicyUpdateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CertificatePolicyUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The updatable properties of the CertificatePolicy. + + :ivar certificate: The certificate configuration. + :vartype certificate: + ~azure.mgmt.deviceregistry.models.OptionalPropertiesCertificatePolicyConfiguration + """ + + certificate: Optional["_models.OptionalPropertiesCertificatePolicyConfiguration"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The certificate configuration.""" + + @overload + def __init__( + self, + *, + certificate: Optional["_models.OptionalPropertiesCertificatePolicyConfiguration"] = None, ) -> None: ... @overload @@ -1265,7 +1404,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataPointBase(_Model): +class DataPointBase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the data point properties. :ivar name: The name of the data point. Required. @@ -1310,7 +1449,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DataPoint(DataPointBase): +class DataPoint(DataPointBase): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the data point properties. :ivar name: The name of the data point. Required. @@ -1355,7 +1494,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Dataset(_Model): +class Dataset(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the dataset properties. :ivar name: Name of the dataset. Required. @@ -1406,7 +1545,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DatasetDestination(_Model): +class DatasetDestination(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The type of the destination. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -1438,7 +1577,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DatasetBrokerStateStoreDestination(DatasetDestination, discriminator="BrokerStateStore"): +class DatasetBrokerStateStoreDestination( + DatasetDestination, discriminator="BrokerStateStore" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The type for a MQTT broker state store destination. :ivar target: The MQTT broker state store destination target. Required. Broker State Store @@ -1475,7 +1616,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.target = DatasetDestinationTarget.BROKER_STATE_STORE # type: ignore -class DatasetMqttDestination(DatasetDestination, discriminator="Mqtt"): +class DatasetMqttDestination( + DatasetDestination, discriminator="Mqtt" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The type for a MQTT destination. :ivar target: The MQTT destination type. Required. MQTT target. @@ -1510,7 +1653,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.target = DatasetDestinationTarget.MQTT # type: ignore -class DatasetStorageDestination(DatasetDestination, discriminator="Storage"): +class DatasetStorageDestination( + DatasetDestination, discriminator="Storage" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The type for a storage destination. :ivar target: The storage destination type. Required. Storage target. @@ -1545,67 +1690,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.target = DatasetDestinationTarget.STORAGE # type: ignore -class DeviceCredentialPolicy(_Model): - """Defines the Policy used to issue device certificates if any. - - :ivar resource_id: Resource Id of the Policy. - :vartype resource_id: str - """ - - resource_id: Optional[str] = rest_field( - name="resourceId", visibility=["read", "create", "update", "delete", "query"] - ) - """Resource Id of the Policy.""" - - @overload - def __init__( - self, - *, - resource_id: Optional[str] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeviceCredentialsRevokeRequest(_Model): - """Request payload for revoking device credentials. - - :ivar disable: Indicates whether to disable the device(s) after revoking credentials. Prevents - new credentials to be issued. - :vartype disable: bool - """ - - disable: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Indicates whether to disable the device(s) after revoking credentials. Prevents new credentials - to be issued.""" - - @overload - def __init__( - self, - *, - disable: Optional[bool] = None, - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class DeviceMessagingEndpoint(_Model): +class DeviceMessagingEndpoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Device messaging endpoint model. :ivar endpoint_type: Type of connection used for the messaging endpoint. @@ -1640,7 +1725,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DeviceRef(_Model): +class DeviceRef(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines which device and endpoint to use for this asset. :ivar device_name: Name of the device resource. Required. @@ -1693,10 +1778,14 @@ class DeviceStatusEndpoint(_Model): :ivar error: Defines the error related to this endpoint. :vartype error: ~azure.mgmt.deviceregistry.models.StatusError + :ivar health_state: Health state of the endpoint. + :vartype health_state: ~azure.mgmt.deviceregistry.models.HealthState """ error: Optional["_models.StatusError"] = rest_field(visibility=["read"]) """Defines the error related to this endpoint.""" + health_state: Optional["_models.HealthState"] = rest_field(name="healthState", visibility=["read"]) + """Health state of the endpoint.""" class DeviceStatusEndpoints(_Model): @@ -1710,7 +1799,7 @@ class DeviceStatusEndpoints(_Model): """KeyValue pair representing status of inbound endpoints.""" -class DiscoveredInboundEndpoints(_Model): +class DiscoveredInboundEndpoints(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """An endpoint to connect to the device. :ivar endpoint_type: Type of connection endpoint. Required. @@ -1776,7 +1865,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DiscoveredMessagingEndpoints(_Model): +class DiscoveredMessagingEndpoints(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Connection endpoint URL a device can use to connect to a service. :ivar inbound: Set of endpoints to connect to the device. @@ -1813,7 +1902,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class DiscoveredOutboundEndpoints(_Model): +class DiscoveredOutboundEndpoints(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Property bag contains the device's outbound endpoints. :ivar assigned: Endpoints the device can connect to. Required. @@ -1915,7 +2004,7 @@ class ErrorDetails(_Model): """Unique identifier for the transaction to aid in debugging.""" -class ErrorResponse(_Model): +class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Error response. :ivar error: The error object. @@ -1943,7 +2032,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EventBase(_Model): +class EventBase(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the event properties. :ivar name: The name of the event. Required. @@ -1993,7 +2082,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Event(EventBase): +class Event(EventBase): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the event properties. :ivar name: The name of the event. Required. @@ -2040,7 +2129,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EventDestination(_Model): +class EventDestination(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The type of the destination. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -2072,7 +2161,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class EventMqttDestination(EventDestination, discriminator="Mqtt"): +class EventMqttDestination( + EventDestination, discriminator="Mqtt" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The type for a MQTT destination. :ivar target: The MQTT destination type. Required. MQTT target. @@ -2107,7 +2198,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.target = EventDestinationTarget.MQTT # type: ignore -class EventStorageDestination(EventDestination, discriminator="Storage"): +class EventStorageDestination( + EventDestination, discriminator="Storage" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The type for a storage destination. :ivar target: The storage destination type. Required. Storage target. @@ -2142,7 +2235,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.target = EventDestinationTarget.STORAGE # type: ignore -class ExtendedLocation(_Model): +class ExtendedLocation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The extended location. :ivar type: The extended location type. Required. @@ -2175,7 +2268,84 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class HostAuthentication(_Model): +class ExternalCertificateAuthorityIssuer(CertificateAuthorityIssuer, discriminator="External"): + """An external issuer for an intermediate Certificate Authority. + + :ivar issuer_type: The external issuer type. Required. The intermediate Certificate Authority + is issued by an external Certificate Authority. + :vartype issuer_type: str or ~azure.mgmt.deviceregistry.models.EXTERNAL + :ivar certificate_signing_request: Certificate Signing Request (CSR) in PEM format, generated + by the service. + :vartype certificate_signing_request: str + :ivar thumbprint: Thumbprint of the Certificate Authority certificate signed by the external + issuer. + :vartype thumbprint: str + :ivar status: The status of the external issuer certificate lifecycle. Known values are: + "PendingActivation", "Active", and "ActiveButPendingRenewal". + :vartype status: str or ~azure.mgmt.deviceregistry.models.CertificateAuthorityStatus + """ + + issuer_type: Literal[CertificateAuthorityIssuerType.EXTERNAL] = rest_discriminator(name="issuerType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The external issuer type. Required. The intermediate Certificate Authority is issued by an + external Certificate Authority.""" + certificate_signing_request: Optional[str] = rest_field(name="certificateSigningRequest", visibility=["read"]) + """Certificate Signing Request (CSR) in PEM format, generated by the service.""" + thumbprint: Optional[str] = rest_field(visibility=["read"]) + """Thumbprint of the Certificate Authority certificate signed by the external issuer.""" + status: Optional[Union[str, "_models.CertificateAuthorityStatus"]] = rest_field(visibility=["read"]) + """The status of the external issuer certificate lifecycle. Known values are: + \"PendingActivation\", \"Active\", and \"ActiveButPendingRenewal\".""" + + @overload + def __init__( + self, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.issuer_type = CertificateAuthorityIssuerType.EXTERNAL # type: ignore + + +class HealthState(_Model): + """Represents the health state of a resource. + + :ivar status: The high-level health status of the resource. Known values are: "Unknown", + "Available", "Degraded", and "Unavailable". + :vartype status: str or ~azure.mgmt.deviceregistry.models.HealthStatus + :ivar last_transition_time: The timestamp (RFC3339) when the health status last changed. + :vartype last_transition_time: str + :ivar last_update_time: The timestamp (RFC3339) when the health status was last updated, even + if the status did not change. + :vartype last_update_time: str + :ivar message: A human-readable message describing the last transition. + :vartype message: str + :ivar reason_code: Unique, CamelCase reason code describing the cause of the last health state + transition. + :vartype reason_code: str + """ + + status: Optional[Union[str, "_models.HealthStatus"]] = rest_field(visibility=["read"]) + """The high-level health status of the resource. Known values are: \"Unknown\", \"Available\", + \"Degraded\", and \"Unavailable\".""" + last_transition_time: Optional[str] = rest_field(name="lastTransitionTime", visibility=["read"]) + """The timestamp (RFC3339) when the health status last changed.""" + last_update_time: Optional[str] = rest_field(name="lastUpdateTime", visibility=["read"]) + """The timestamp (RFC3339) when the health status was last updated, even if the status did not + change.""" + message: Optional[str] = rest_field(visibility=["read"]) + """A human-readable message describing the last transition.""" + reason_code: Optional[str] = rest_field(name="reasonCode", visibility=["read"]) + """Unique, CamelCase reason code describing the cause of the last health state transition.""" + + +class HostAuthentication(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Definition of the client authentication mechanism to the host. :ivar method: Defines the method to authenticate the user of the client at the server. @@ -2225,27 +2395,65 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class InboundEndpoints(_Model): - """An endpoint to connect to the device. +class InboundCallerIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The identity a linked resource uses for inbound calls to the ADR namespace. - :ivar endpoint_type: Type of connection endpoint. Required. - :vartype endpoint_type: str - :ivar address: The endpoint address & port. This can be either an IP address (e.g., - 192.168.1.1) or a fully qualified domain name (FQDN, e.g., server.example.com). Required. - :vartype address: str - :ivar version: Protocol version associated with the endpoint e.g. 1 or 2 for endpointType - Microsoft.HTTP, and 3.5 or 5.0 for endpointType Microsoft.Mqtt etc. - :vartype version: str - :ivar authentication: Defines the client authentication mechanism to the server. - :vartype authentication: ~azure.mgmt.deviceregistry.models.HostAuthentication - :ivar trust_settings: Defines server trust settings for the endpoint. - :vartype trust_settings: ~azure.mgmt.deviceregistry.models.TrustSettings - :ivar additional_configuration: Stringified JSON that contains configuration to be used by the - connector (e.g., OPC UA, ONVIF). - :vartype additional_configuration: str + :ivar type: The identity type. Required. Known values are: "SystemAssigned" and "UserAssigned". + :vartype type: str or ~azure.mgmt.deviceregistry.models.InboundCallerIdentityType + :ivar user_assigned_identity: The resource ID of the user-assigned managed identity. Required + when type is UserAssigned. + :vartype user_assigned_identity: str """ - endpoint_type: str = rest_field(name="endpointType", visibility=["read", "create", "update", "delete", "query"]) + type: Union[str, "_models.InboundCallerIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The identity type. Required. Known values are: \"SystemAssigned\" and \"UserAssigned\".""" + user_assigned_identity: Optional[str] = rest_field( + name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of the user-assigned managed identity. Required when type is UserAssigned.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.InboundCallerIdentityType"], + user_assigned_identity: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InboundEndpoints(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """An endpoint to connect to the device. + + :ivar endpoint_type: Type of connection endpoint. Required. + :vartype endpoint_type: str + :ivar address: The endpoint address & port. This can be either an IP address (e.g., + 192.168.1.1) or a fully qualified domain name (FQDN, e.g., server.example.com). Required. + :vartype address: str + :ivar version: Protocol version associated with the endpoint e.g. 1 or 2 for endpointType + Microsoft.HTTP, and 3.5 or 5.0 for endpointType Microsoft.Mqtt etc. + :vartype version: str + :ivar authentication: Defines the client authentication mechanism to the server. + :vartype authentication: ~azure.mgmt.deviceregistry.models.HostAuthentication + :ivar trust_settings: Defines server trust settings for the endpoint. + :vartype trust_settings: ~azure.mgmt.deviceregistry.models.TrustSettings + :ivar additional_configuration: Stringified JSON that contains configuration to be used by the + connector (e.g., OPC UA, ONVIF). + :vartype additional_configuration: str + """ + + endpoint_type: str = rest_field(name="endpointType", visibility=["read", "create", "update", "delete", "query"]) """Type of connection endpoint. Required.""" address: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The endpoint address & port. This can be either an IP address (e.g., 192.168.1.1) or a fully @@ -2289,23 +2497,128 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class LeafCertificateConfiguration(_Model): - """The leaf certificate configuration. +class IntermediateCertificateAuthorityProperties( + CertificateAuthorityProperties, discriminator="ICA" +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """Properties for an intermediate Certificate Authority signed by another same-namespace + Certificate Authority. - :ivar validity_period_in_days: The validity period in days. Required. - :vartype validity_period_in_days: int + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.deviceregistry.models.ProvisioningState + :ivar uuid: Globally unique, immutable, non-reusable identifier of the Certificate Authority + resource. + :vartype uuid: str + :ivar key_type: Crypto type: ECC. Required. "ECC" + :vartype key_type: str or ~azure.mgmt.deviceregistry.models.CertificateAuthorityKeyType + :ivar subject: Certificate subject. + :vartype subject: str + :ivar validity_not_before: Certificate is valid not before this date. Format ISO8601. + :vartype validity_not_before: ~datetime.datetime + :ivar validity_not_after: Certificate is valid not after this date. Format ISO8601. + :vartype validity_not_after: ~datetime.datetime + :ivar certificate_authority_type: The intermediate Certificate Authority type. Required. + Intermediate Certificate Authority signed by another Certificate Authority. + :vartype certificate_authority_type: str or ~azure.mgmt.deviceregistry.models.ICA + :ivar issuer: The issuer for the intermediate Certificate Authority. Required. + :vartype issuer: ~azure.mgmt.deviceregistry.models.CertificateAuthorityIssuer """ - validity_period_in_days: int = rest_field( - name="validityPeriodInDays", visibility=["read", "create", "update", "delete", "query"] + certificate_authority_type: Literal[CertificateAuthorityType.ICA] = rest_discriminator(name="certificateAuthorityType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The intermediate Certificate Authority type. Required. Intermediate Certificate Authority + signed by another Certificate Authority.""" + issuer: "_models.CertificateAuthorityIssuer" = rest_field(visibility=["read", "create"]) + """The issuer for the intermediate Certificate Authority. Required.""" + + @overload + def __init__( + self, + *, + key_type: Union[str, "_models.CertificateAuthorityKeyType"], + issuer: "_models.CertificateAuthorityIssuer", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.certificate_authority_type = CertificateAuthorityType.ICA # type: ignore + + +class ManagedServiceIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.deviceregistry.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The identities assigned to this resource by the user. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.deviceregistry.models.UserAssignedIdentity] + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] ) - """The validity period in days. Required.""" + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The identities assigned to this resource by the user.""" @overload def __init__( self, *, - validity_period_in_days: int, + type: Union[str, "_models.ManagedServiceIdentityType"], + user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Management(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The namespace management endpoints model. + + :ivar endpoints: Dictionary of management endpoints. + :vartype endpoints: dict[str, ~azure.mgmt.deviceregistry.models.ManagementEndpoint] + """ + + endpoints: Optional[dict[str, "_models.ManagementEndpoint"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Dictionary of management endpoints.""" + + @overload + def __init__( + self, + *, + endpoints: Optional[dict[str, "_models.ManagementEndpoint"]] = None, ) -> None: ... @overload @@ -2319,7 +2632,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagementAction(_Model): +class ManagementAction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the action properties. :ivar name: Name of the action. Required. @@ -2384,7 +2697,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class ManagementGroup(_Model): +class ManagementEndpoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Namespace management endpoint model used by service to connect to device. + + :ivar endpoint_type: Type of connection used for management endpoint. Required. + :vartype endpoint_type: str + :ivar address: The endpoint address to connect to. Required. + :vartype address: str + :ivar scope_id: The scope ID for the management endpoint. Required. + :vartype scope_id: str + :ivar resource_id: The messaging endpoint Azure resource Id. Required. + :vartype resource_id: str + """ + + endpoint_type: str = rest_field(name="endpointType", visibility=["read", "create", "update", "delete", "query"]) + """Type of connection used for management endpoint. Required.""" + address: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The endpoint address to connect to. Required.""" + scope_id: str = rest_field(name="scopeId", visibility=["read", "create", "update", "delete", "query"]) + """The scope ID for the management endpoint. Required.""" + resource_id: str = rest_field(name="resourceId", visibility=["read", "create", "update", "delete", "query"]) + """The messaging endpoint Azure resource Id. Required.""" + + @overload + def __init__( + self, + *, + endpoint_type: str, + address: str, + scope_id: str, + resource_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagementGroup(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the management group properties. :ivar name: Name of the management group. Required. @@ -2477,7 +2833,7 @@ class MessageSchemaReference(_Model): """The message schema version. Required.""" -class Messaging(_Model): +class Messaging(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The namespace messaging endpoints model. :ivar endpoints: Dictionary of messaging endpoints. @@ -2507,35 +2863,66 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MessagingEndpoint(_Model): +class MessagingEndpoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Namespace messaging endpoint model used by a device to connect to a service. :ivar endpoint_type: Type of connection used for messaging endpoint. :vartype endpoint_type: str - :ivar address: The endpoint address to connect to. Required. + :ivar address: The endpoint address to connect to. :vartype address: str :ivar resource_id: The messaging endpoint Azure resource Id. :vartype resource_id: str + :ivar device_address: The endpoint address used by devices. + :vartype device_address: str + :ivar inbound_caller_identity: The identity the linked resource uses to call the ADR namespace. + :vartype inbound_caller_identity: ~azure.mgmt.deviceregistry.models.InboundCallerIdentity + :ivar linking_state: The linking state of this messaging endpoint. Known values are: + "InProgress", "Succeeded", and "Failed". + :vartype linking_state: str or ~azure.mgmt.deviceregistry.models.NamespaceLinkingStateValue + :ivar linking_error: The error detail surfaced when this messaging endpoint is in the Failed + linking state. + :vartype linking_error: ~azure.mgmt.deviceregistry.models.NamespaceLinkingError + :ivar provisioning: The provisioning configuration for this messaging endpoint. + :vartype provisioning: ~azure.mgmt.deviceregistry.models.MessagingEndpointProvisioning """ endpoint_type: Optional[str] = rest_field( name="endpointType", visibility=["read", "create", "update", "delete", "query"] ) """Type of connection used for messaging endpoint.""" - address: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """The endpoint address to connect to. Required.""" + address: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The endpoint address to connect to.""" resource_id: Optional[str] = rest_field( name="resourceId", visibility=["read", "create", "update", "delete", "query"] ) """The messaging endpoint Azure resource Id.""" + device_address: Optional[str] = rest_field(name="deviceAddress", visibility=["read"]) + """The endpoint address used by devices.""" + inbound_caller_identity: Optional["_models.InboundCallerIdentity"] = rest_field( + name="inboundCallerIdentity", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity the linked resource uses to call the ADR namespace.""" + linking_state: Optional[Union[str, "_models.NamespaceLinkingStateValue"]] = rest_field( + name="linkingState", visibility=["read"] + ) + """The linking state of this messaging endpoint. Known values are: \"InProgress\", \"Succeeded\", + and \"Failed\".""" + linking_error: Optional["_models.NamespaceLinkingError"] = rest_field(name="linkingError", visibility=["read"]) + """The error detail surfaced when this messaging endpoint is in the Failed linking state.""" + provisioning: Optional["_models.MessagingEndpointProvisioning"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The provisioning configuration for this messaging endpoint.""" @overload def __init__( self, *, - address: str, endpoint_type: Optional[str] = None, + address: Optional[str] = None, resource_id: Optional[str] = None, + inbound_caller_identity: Optional["_models.InboundCallerIdentity"] = None, + provisioning: Optional["_models.MessagingEndpointProvisioning"] = None, ) -> None: ... @overload @@ -2549,7 +2936,46 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MessagingEndpoints(_Model): +class MessagingEndpointProvisioning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The provisioning configuration for a messaging endpoint. + + :ivar availability: The availability status of the messaging endpoint. Known values are: + "Available" and "Disabled". + :vartype availability: str or ~azure.mgmt.deviceregistry.models.MessagingEndpointAvailability + :ivar allocation_weight: The allocation weight for this messaging endpoint. + :vartype allocation_weight: int + """ + + availability: Optional[Union[str, "_models.MessagingEndpointAvailability"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The availability status of the messaging endpoint. Known values are: \"Available\" and + \"Disabled\".""" + allocation_weight: Optional[int] = rest_field( + name="allocationWeight", visibility=["read", "create", "update", "delete", "query"] + ) + """The allocation weight for this messaging endpoint.""" + + @overload + def __init__( + self, + *, + availability: Optional[Union[str, "_models.MessagingEndpointAvailability"]] = None, + allocation_weight: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MessagingEndpoints(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Connection endpoint URL a device can use to connect to a service. :ivar inbound: Set of endpoints to connect to the device. @@ -2586,7 +3012,47 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class MqttDestinationConfiguration(_Model): +class MicrosoftCertificateAuthorityIssuer( + CertificateAuthorityIssuer, discriminator="Microsoft" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Microsoft issuer for an intermediate Certificate Authority. + + :ivar issuer_type: The Microsoft issuer type. Required. The intermediate Certificate Authority + is issued by Microsoft. + :vartype issuer_type: str or ~azure.mgmt.deviceregistry.models.MICROSOFT + :ivar certificate_authority_resource_id: The resource ID of the root issuer Certificate + Authority in the same namespace. Required. + :vartype certificate_authority_resource_id: str + """ + + issuer_type: Literal[CertificateAuthorityIssuerType.MICROSOFT] = rest_discriminator(name="issuerType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The Microsoft issuer type. Required. The intermediate Certificate Authority is issued by + Microsoft.""" + certificate_authority_resource_id: str = rest_field( + name="certificateAuthorityResourceId", visibility=["read", "create"] + ) + """The resource ID of the root issuer Certificate Authority in the same namespace. Required.""" + + @overload + def __init__( + self, + *, + certificate_authority_resource_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.issuer_type = CertificateAuthorityIssuerType.MICROSOFT # type: ignore + + +class MqttDestinationConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The configuration for a MQTT destination. :ivar topic: The MQTT topic. Required. @@ -2635,7 +3101,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Namespace(TrackedResource): +class Namespace(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Namespace definition. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -2656,14 +3122,14 @@ class Namespace(TrackedResource): :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.mgmt.deviceregistry.models.NamespaceProperties :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.deviceregistry.models.SystemAssignedServiceIdentity + :vartype identity: ~azure.mgmt.deviceregistry.models.ManagedServiceIdentity """ properties: Optional["_models.NamespaceProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" - identity: Optional["_models.SystemAssignedServiceIdentity"] = rest_field( + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The managed service identities assigned to this resource.""" @@ -2675,7 +3141,7 @@ def __init__( location: str, tags: Optional[dict[str, str]] = None, properties: Optional["_models.NamespaceProperties"] = None, - identity: Optional["_models.SystemAssignedServiceIdentity"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, ) -> None: ... @overload @@ -2689,7 +3155,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceAsset(TrackedResource): +class NamespaceAsset(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Asset definition. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -2741,7 +3207,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceAssetProperties(_Model): +class NamespaceAssetExecuteActionRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The request body for the executeAction operation on NamespaceAsset. + + :ivar management_action_name: Name of the management action to be executed. Required. + :vartype management_action_name: str + :ivar management_group_name: Name of the management group under which the action is to be + executed. Required. + :vartype management_group_name: str + :ivar payload: Payload required for executing the management action. + :vartype payload: dict[str, any] + """ + + management_action_name: str = rest_field( + name="managementActionName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the management action to be executed. Required.""" + management_group_name: str = rest_field( + name="managementGroupName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of the management group under which the action is to be executed. Required.""" + payload: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Payload required for executing the management action.""" + + @overload + def __init__( + self, + *, + management_action_name: str, + management_group_name: str, + payload: Optional[dict[str, Any]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NamespaceAssetProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the asset properties. :ivar uuid: Globally unique, immutable, non-reusable ID. @@ -3007,6 +3516,8 @@ class NamespaceAssetStatus(_Model): management group. :vartype management_groups: list[~azure.mgmt.deviceregistry.models.NamespaceAssetStatusManagementGroup] + :ivar health_state: The details about the runtime health state of the asset. + :vartype health_state: ~azure.mgmt.deviceregistry.models.HealthState """ config: Optional["_models.StatusConfig"] = rest_field(visibility=["read"]) @@ -3023,6 +3534,8 @@ class NamespaceAssetStatus(_Model): name="managementGroups", visibility=["read"] ) """Array of management group statuses that describe the status of each management group.""" + health_state: Optional["_models.HealthState"] = rest_field(name="healthState", visibility=["read"]) + """The details about the runtime health state of the asset.""" class NamespaceAssetStatusDataset(_Model): @@ -3165,7 +3678,7 @@ class NamespaceAssetStatusStream(_Model): """Object to transfer and persist errors that originate from the edge.""" -class NamespaceAssetUpdate(_Model): +class NamespaceAssetUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The type used for update operations of the NamespaceAsset. :ivar tags: Resource tags. @@ -3200,7 +3713,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceAssetUpdateProperties(_Model): +class NamespaceAssetUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The updatable properties of the NamespaceAsset. :ivar enabled: Enabled/disabled status of the asset. @@ -3403,7 +3916,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDataset(_Model): +class NamespaceDataset(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the dataset properties. :ivar name: Name of the dataset. Required. @@ -3468,7 +3981,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDatasetDataPoint(_Model): +class NamespaceDatasetDataPoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the dataset data point properties. :ivar name: The name of the data point. Required. @@ -3518,7 +4031,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDevice(TrackedResource): +class NamespaceDevice(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Device definition. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -3576,7 +4089,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDeviceProperties(_Model): +class NamespaceDeviceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the device properties. :ivar uuid: A unique identifier for the device. @@ -3610,8 +4123,6 @@ class NamespaceDeviceProperties(_Model): :ivar provisioning_state: Provisioning state of the resource. Known values are: "Succeeded", "Failed", "Canceled", "Accepted", and "Deleting". :vartype provisioning_state: str or ~azure.mgmt.deviceregistry.models.ProvisioningState - :ivar policy: Policy used to issue device certificates. - :vartype policy: ~azure.mgmt.deviceregistry.models.DeviceCredentialPolicy """ uuid: Optional[str] = rest_field(visibility=["read"]) @@ -3652,10 +4163,6 @@ class NamespaceDeviceProperties(_Model): ) """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", \"Accepted\", and \"Deleting\".""" - policy: Optional["_models.DeviceCredentialPolicy"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Policy used to issue device certificates.""" @overload def __init__( @@ -3670,7 +4177,6 @@ def __init__( operating_system_version: Optional[str] = None, endpoints: Optional["_models.MessagingEndpoints"] = None, attributes: Optional[dict[str, Any]] = None, - policy: Optional["_models.DeviceCredentialPolicy"] = None, ) -> None: ... @overload @@ -3684,7 +4190,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDeviceUpdate(_Model): +class NamespaceDeviceUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The type used for update operations of the NamespaceDevice. :ivar tags: Resource tags. @@ -3719,7 +4225,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDeviceUpdateProperties(_Model): +class NamespaceDeviceUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The updatable properties of the NamespaceDevice. :ivar operating_system_version: Device operating system version. @@ -3728,8 +4234,6 @@ class NamespaceDeviceUpdateProperties(_Model): :vartype endpoints: ~azure.mgmt.deviceregistry.models.MessagingEndpoints :ivar attributes: A set of key-value pairs that contain custom attributes set by the customer. :vartype attributes: dict[str, any] - :ivar policy: Policy used to issue device certificates. - :vartype policy: ~azure.mgmt.deviceregistry.models.DeviceCredentialPolicy :ivar enabled: Indicates if the resource and identity are enabled or not. A disabled device cannot authenticate with Microsoft Entra ID. :vartype enabled: bool @@ -3745,10 +4249,6 @@ class NamespaceDeviceUpdateProperties(_Model): """Property bag containing the device's unassigned and assigned endpoints.""" attributes: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """A set of key-value pairs that contain custom attributes set by the customer.""" - policy: Optional["_models.DeviceCredentialPolicy"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Policy used to issue device certificates.""" enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Indicates if the resource and identity are enabled or not. A disabled device cannot authenticate with Microsoft Entra ID.""" @@ -3760,7 +4260,6 @@ def __init__( operating_system_version: Optional[str] = None, endpoints: Optional["_models.MessagingEndpoints"] = None, attributes: Optional[dict[str, Any]] = None, - policy: Optional["_models.DeviceCredentialPolicy"] = None, enabled: Optional[bool] = None, ) -> None: ... @@ -3775,7 +4274,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDiscoveredAsset(TrackedResource): +class NamespaceDiscoveredAsset(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Discovered asset definition. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -3827,7 +4326,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDiscoveredAssetProperties(_Model): +class NamespaceDiscoveredAssetProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the discovered asset properties. :ivar device_ref: Reference to the device that provides data for this asset. Must provide @@ -4058,7 +4557,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDiscoveredAssetUpdate(_Model): +class NamespaceDiscoveredAssetUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The type used for update operations of the NamespaceDiscoveredAsset. :ivar tags: Resource tags. @@ -4093,7 +4592,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDiscoveredAssetUpdateProperties(_Model): +class NamespaceDiscoveredAssetUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The updatable properties of the NamespaceDiscoveredAsset. :ivar device_ref: Reference to the device that provides data for this asset. Must provide @@ -4313,7 +4812,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDiscoveredDataset(_Model): +class NamespaceDiscoveredDataset(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the dataset properties. :ivar name: Name of the dataset. Required. @@ -4386,7 +4885,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDiscoveredDatasetDataPoint(_Model): +class NamespaceDiscoveredDatasetDataPoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the discovered dataset data point properties. :ivar name: The name of the data point. Required. @@ -4443,7 +4942,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDiscoveredDevice(TrackedResource): +class NamespaceDiscoveredDevice(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Discovered device definition. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -4495,7 +4994,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDiscoveredDeviceProperties(_Model): +class NamespaceDiscoveredDeviceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the discovered device properties. :ivar external_device_id: A device ID that represents the device in a system external to Azure. @@ -4579,7 +5078,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDiscoveredDeviceUpdate(_Model): +class NamespaceDiscoveredDeviceUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The type used for update operations of the NamespaceDiscoveredDevice. :ivar tags: Resource tags. @@ -4615,7 +5114,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDiscoveredDeviceUpdateProperties(_Model): # pylint: disable=name-too-long +class NamespaceDiscoveredDeviceUpdateProperties( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only """The updatable properties of the NamespaceDiscoveredDevice. :ivar external_device_id: A device ID that represents the device in a system external to Azure. @@ -4678,7 +5179,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDiscoveredEvent(_Model): +class NamespaceDiscoveredEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the event properties. :ivar name: The name of the event. Required. @@ -4742,7 +5243,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDiscoveredEventGroup(_Model): +class NamespaceDiscoveredEventGroup(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the discovered event group properties. :ivar name: The name of the event group. Required. @@ -4810,7 +5311,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDiscoveredManagementAction(_Model): +class NamespaceDiscoveredManagementAction(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the action properties. :ivar name: Name of the action. Required. @@ -4884,7 +5385,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDiscoveredManagementGroup(_Model): +class NamespaceDiscoveredManagementGroup(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the management group properties. :ivar name: Name of the management group. Required. @@ -4966,7 +5467,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceDiscoveredStream(_Model): +class NamespaceDiscoveredStream(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the stream properties. :ivar name: Name of the stream definition. Required. @@ -5021,7 +5522,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceEvent(_Model): +class NamespaceEvent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the event properties. :ivar name: The name of the event. Required. @@ -5078,7 +5579,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceEventGroup(_Model): +class NamespaceEventGroup(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the event group properties. :ivar name: The name of the event group. Required. @@ -5146,6 +5647,22 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class NamespaceLinkingError(_Model): + """Error detail for an endpoint whose linking state is Failed. Present only while the linking + state is Failed and removed when the endpoint recovers. + + :ivar code: Error code that classifies the linking failure. + :vartype code: str + :ivar message: Human-readable message describing the linking failure. + :vartype message: str + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """Error code that classifies the linking failure.""" + message: Optional[str] = rest_field(visibility=["read"]) + """Human-readable message describing the linking failure.""" + + class NamespaceMessageSchemaReference(_Model): """Defines the message schema reference properties. @@ -5165,7 +5682,7 @@ class NamespaceMessageSchemaReference(_Model): """The message schema version. Required.""" -class NamespaceMigrateRequest(_Model): +class NamespaceMigrateRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Request body for the migrate resources operation in to Namespace resource. :ivar scope: Scope of the migrate resources operation. "Resources" @@ -5202,13 +5719,21 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceProperties(_Model): +class NamespaceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The namespace properties model. :ivar uuid: Globally unique, immutable, non-reusable ID. :vartype uuid: str :ivar messaging: Assigned and unassigned messaging endpoints. :vartype messaging: ~azure.mgmt.deviceregistry.models.Messaging + :ivar management: Assigned and unassigned management endpoints. + :vartype management: ~azure.mgmt.deviceregistry.models.Management + :ivar provisioning: The provisioning endpoints associated with this namespace. + :vartype provisioning: ~azure.mgmt.deviceregistry.models.NamespaceProvisioning + :ivar outbound_identity: The identity used for outbound calls from the ADR namespace. If not + specified and the namespace has a system-assigned identity enabled, the system-assigned + identity is used by default. + :vartype outbound_identity: ~azure.mgmt.deviceregistry.models.OutboundIdentity :ivar provisioning_state: Provisioning state of the resource. Known values are: "Succeeded", "Failed", "Canceled", "Accepted", and "Deleting". :vartype provisioning_state: str or ~azure.mgmt.deviceregistry.models.ProvisioningState @@ -5218,6 +5743,17 @@ class NamespaceProperties(_Model): """Globally unique, immutable, non-reusable ID.""" messaging: Optional["_models.Messaging"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Assigned and unassigned messaging endpoints.""" + management: Optional["_models.Management"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Assigned and unassigned management endpoints.""" + provisioning: Optional["_models.NamespaceProvisioning"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The provisioning endpoints associated with this namespace.""" + outbound_identity: Optional["_models.OutboundIdentity"] = rest_field( + name="outboundIdentity", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity used for outbound calls from the ADR namespace. If not specified and the namespace + has a system-assigned identity enabled, the system-assigned identity is used by default.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) @@ -5229,6 +5765,39 @@ def __init__( self, *, messaging: Optional["_models.Messaging"] = None, + management: Optional["_models.Management"] = None, + provisioning: Optional["_models.NamespaceProvisioning"] = None, + outbound_identity: Optional["_models.OutboundIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NamespaceProvisioning(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The provisioning endpoints associated with this namespace. + + :ivar endpoints: Dictionary of provisioning endpoints. + :vartype endpoints: dict[str, ~azure.mgmt.deviceregistry.models.ProvisioningEndpoint] + """ + + endpoints: Optional[dict[str, "_models.ProvisioningEndpoint"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Dictionary of provisioning endpoints.""" + + @overload + def __init__( + self, + *, + endpoints: Optional[dict[str, "_models.ProvisioningEndpoint"]] = None, ) -> None: ... @overload @@ -5242,7 +5811,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceStream(_Model): +class NamespaceStream(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the stream properties. :ivar name: Name of the stream definition. Required. @@ -5290,18 +5859,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceUpdate(_Model): +class NamespaceUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The type used for update operations of the Namespace. :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.deviceregistry.models.SystemAssignedServiceIdentity + :vartype identity: ~azure.mgmt.deviceregistry.models.ManagedServiceIdentity :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.mgmt.deviceregistry.models.NamespaceUpdateProperties """ - identity: Optional["_models.SystemAssignedServiceIdentity"] = rest_field( + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The managed service identities assigned to this resource.""" @@ -5316,7 +5885,7 @@ class NamespaceUpdate(_Model): def __init__( self, *, - identity: Optional["_models.SystemAssignedServiceIdentity"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, tags: Optional[dict[str, str]] = None, properties: Optional["_models.NamespaceUpdateProperties"] = None, ) -> None: ... @@ -5332,21 +5901,43 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class NamespaceUpdateProperties(_Model): +class NamespaceUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The updatable properties of the Namespace. :ivar messaging: Assigned and unassigned messaging endpoints. :vartype messaging: ~azure.mgmt.deviceregistry.models.Messaging + :ivar management: Assigned and unassigned management endpoints. + :vartype management: ~azure.mgmt.deviceregistry.models.Management + :ivar provisioning: The provisioning endpoints associated with this namespace. + :vartype provisioning: ~azure.mgmt.deviceregistry.models.NamespaceProvisioning + :ivar outbound_identity: The identity used for outbound calls from the ADR namespace. If not + specified and the namespace has a system-assigned identity enabled, the system-assigned + identity is used by default. + :vartype outbound_identity: ~azure.mgmt.deviceregistry.models.OutboundIdentity """ messaging: Optional["_models.Messaging"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Assigned and unassigned messaging endpoints.""" + management: Optional["_models.Management"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Assigned and unassigned management endpoints.""" + provisioning: Optional["_models.NamespaceProvisioning"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The provisioning endpoints associated with this namespace.""" + outbound_identity: Optional["_models.OutboundIdentity"] = rest_field( + name="outboundIdentity", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity used for outbound calls from the ADR namespace. If not specified and the namespace + has a system-assigned identity enabled, the system-assigned identity is used by default.""" @overload def __init__( self, *, messaging: Optional["_models.Messaging"] = None, + management: Optional["_models.Management"] = None, + provisioning: Optional["_models.NamespaceProvisioning"] = None, + outbound_identity: Optional["_models.OutboundIdentity"] = None, ) -> None: ... @overload @@ -5360,7 +5951,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Operation(_Model): +class Operation(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """REST API Operation. :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: @@ -5448,7 +6039,7 @@ class OperationDisplay(_Model): views.""" -class OperationStatusResult(_Model): +class OperationStatusResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The current status of an async operation. :ivar id: Fully qualified ID for the async operation. @@ -5524,7 +6115,39 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class OutboundEndpoints(_Model): +class OptionalPropertiesCertificatePolicyConfiguration( + _Model +): # pylint: disable=name-too-long,docstring-keyword-should-match-keyword-only + """The template for adding optional properties. + + :ivar validity_period_in_days: The validity period in days. + :vartype validity_period_in_days: int + """ + + validity_period_in_days: Optional[int] = rest_field( + name="validityPeriodInDays", visibility=["read", "create", "update", "delete", "query"] + ) + """The validity period in days.""" + + @overload + def __init__( + self, + *, + validity_period_in_days: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class OutboundEndpoints(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Property bag contains the device's outbound endpoints. :ivar assigned: Endpoints the device can connect to. Required. @@ -5561,8 +6184,106 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Policy(ProxyResource): - """A Credential Policy. +class OutboundIdentity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The identity the ADR namespace uses for outbound calls. If this property is null and the + namespace has a system-assigned identity enabled, the namespace defaults to using the + system-assigned identity for outbound calls. + + :ivar type: The identity type. Required. Known values are: "SystemAssigned" and "UserAssigned". + :vartype type: str or ~azure.mgmt.deviceregistry.models.OutboundIdentityType + :ivar user_assigned_identity: The resource ID of the user-assigned managed identity. Required + when type is UserAssigned. + :vartype user_assigned_identity: str + """ + + type: Union[str, "_models.OutboundIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The identity type. Required. Known values are: \"SystemAssigned\" and \"UserAssigned\".""" + user_assigned_identity: Optional[str] = rest_field( + name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of the user-assigned managed identity. Required when type is UserAssigned.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.OutboundIdentityType"], + user_assigned_identity: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ProvisioningEndpoint(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """A provisioning service endpoint linked to this namespace. + + :ivar endpoint_type: Type of provisioning resource. Required. + "Microsoft.Devices/provisioningServices" + :vartype endpoint_type: str or ~azure.mgmt.deviceregistry.models.ProvisioningEndpointType + :ivar resource_id: The provisioning endpoint Azure resource Id. Required. + :vartype resource_id: str + :ivar inbound_caller_identity: The identity the linked resource uses to call the ADR namespace. + Required. + :vartype inbound_caller_identity: ~azure.mgmt.deviceregistry.models.InboundCallerIdentity + :ivar linking_state: The linking state of this provisioning endpoint. Known values are: + "InProgress", "Succeeded", and "Failed". + :vartype linking_state: str or ~azure.mgmt.deviceregistry.models.NamespaceLinkingStateValue + :ivar linking_error: The error detail surfaced when this provisioning endpoint is in the Failed + linking state. + :vartype linking_error: ~azure.mgmt.deviceregistry.models.NamespaceLinkingError + """ + + endpoint_type: Union[str, "_models.ProvisioningEndpointType"] = rest_field( + name="endpointType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of provisioning resource. Required. \"Microsoft.Devices/provisioningServices\"""" + resource_id: str = rest_field(name="resourceId", visibility=["read", "create", "update", "delete", "query"]) + """The provisioning endpoint Azure resource Id. Required.""" + inbound_caller_identity: "_models.InboundCallerIdentity" = rest_field( + name="inboundCallerIdentity", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity the linked resource uses to call the ADR namespace. Required.""" + linking_state: Optional[Union[str, "_models.NamespaceLinkingStateValue"]] = rest_field( + name="linkingState", visibility=["read"] + ) + """The linking state of this provisioning endpoint. Known values are: \"InProgress\", + \"Succeeded\", and \"Failed\".""" + linking_error: Optional["_models.NamespaceLinkingError"] = rest_field(name="linkingError", visibility=["read"]) + """The error detail surfaced when this provisioning endpoint is in the Failed linking state.""" + + @overload + def __init__( + self, + *, + endpoint_type: Union[str, "_models.ProvisioningEndpointType"], + resource_id: str, + inbound_caller_identity: "_models.InboundCallerIdentity", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RegistryDevice(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """A Registry Device resource is a tracked resource with a provisioning lifecycle. The different + capabilities of the device are defined through child Device Capability resources. :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. @@ -5575,20 +6296,30 @@ class Policy(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~azure.mgmt.deviceregistry.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.deviceregistry.models.PolicyProperties + :vartype properties: ~azure.mgmt.deviceregistry.models.RegistryDeviceProperties + :ivar etag: Resource etag. + :vartype etag: str """ - properties: Optional["_models.PolicyProperties"] = rest_field( + properties: Optional["_models.RegistryDeviceProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" + etag: Optional[str] = rest_field(visibility=["read"]) + """Resource etag.""" @overload def __init__( self, *, - properties: Optional["_models.PolicyProperties"] = None, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.RegistryDeviceProperties"] = None, ) -> None: ... @overload @@ -5602,31 +6333,68 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PolicyProperties(_Model): - """Details of the Credential Policy. +class RegistryDeviceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The properties of a registry device. - :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + :ivar enablement_state: Whether the device is enabled or disabled. A disabled device cannot + send messages, be updated, or reprovision. Required. Known values are: "Enabled" and + "Disabled". + :vartype enablement_state: str or + ~azure.mgmt.deviceregistry.models.RegistryDeviceEnablementState + :ivar uuid: Globally unique, immutable, non-reusable ID. + :vartype uuid: str + :ivar external_device_id: A Device ID provided by the customer. + :vartype external_device_id: str + :ivar manufacturer: Device manufacturer. + :vartype manufacturer: str + :ivar model: Device model. + :vartype model: str + :ivar hardware_revision: Device hardware revision. + :vartype hardware_revision: str + :ivar software_revision: Device software revision. + :vartype software_revision: str + :ivar provisioning_state: Provisioning state of the resource. Known values are: "Succeeded", "Failed", "Canceled", "Accepted", and "Deleting". :vartype provisioning_state: str or ~azure.mgmt.deviceregistry.models.ProvisioningState - :ivar certificate: The certificate configuration. - :vartype certificate: ~azure.mgmt.deviceregistry.models.CertificateConfiguration """ + enablement_state: Union[str, "_models.RegistryDeviceEnablementState"] = rest_field( + name="enablementState", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the device is enabled or disabled. A disabled device cannot send messages, be updated, + or reprovision. Required. Known values are: \"Enabled\" and \"Disabled\".""" + uuid: Optional[str] = rest_field(visibility=["read"]) + """Globally unique, immutable, non-reusable ID.""" + external_device_id: Optional[str] = rest_field(name="externalDeviceId", visibility=["read", "create"]) + """A Device ID provided by the customer.""" + manufacturer: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Device manufacturer.""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Device model.""" + hardware_revision: Optional[str] = rest_field( + name="hardwareRevision", visibility=["read", "create", "update", "delete", "query"] + ) + """Device hardware revision.""" + software_revision: Optional[str] = rest_field( + name="softwareRevision", visibility=["read", "create", "update", "delete", "query"] + ) + """Device software revision.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) - """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", \"Accepted\", and \"Deleting\".""" - certificate: Optional["_models.CertificateConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The certificate configuration.""" @overload def __init__( self, *, - certificate: Optional["_models.CertificateConfiguration"] = None, + enablement_state: Union[str, "_models.RegistryDeviceEnablementState"], + external_device_id: Optional[str] = None, + manufacturer: Optional[str] = None, + model: Optional[str] = None, + hardware_revision: Optional[str] = None, + software_revision: Optional[str] = None, ) -> None: ... @overload @@ -5640,14 +6408,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PolicyUpdate(_Model): - """The type used for update operations of the Policy. +class RegistryDeviceUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The type used for update operations of the RegistryDevice. + :ivar tags: Resource tags. + :vartype tags: dict[str, str] :ivar properties: The resource-specific properties for this resource. - :vartype properties: ~azure.mgmt.deviceregistry.models.PolicyUpdateProperties + :vartype properties: ~azure.mgmt.deviceregistry.models.RegistryDeviceUpdateProperties """ - properties: Optional["_models.PolicyUpdateProperties"] = rest_field( + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + properties: Optional["_models.RegistryDeviceUpdateProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" @@ -5656,7 +6428,8 @@ class PolicyUpdate(_Model): def __init__( self, *, - properties: Optional["_models.PolicyUpdateProperties"] = None, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.RegistryDeviceUpdateProperties"] = None, ) -> None: ... @overload @@ -5670,23 +6443,50 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PolicyUpdateProperties(_Model): - """The updatable properties of the Policy. +class RegistryDeviceUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """The updatable properties of the RegistryDevice. - :ivar certificate: The certificate configuration. - :vartype certificate: ~azure.mgmt.deviceregistry.models.CertificateConfiguration + :ivar enablement_state: Whether the device is enabled or disabled. A disabled device cannot + send messages, be updated, or reprovision. Known values are: "Enabled" and "Disabled". + :vartype enablement_state: str or + ~azure.mgmt.deviceregistry.models.RegistryDeviceEnablementState + :ivar manufacturer: Device manufacturer. + :vartype manufacturer: str + :ivar model: Device model. + :vartype model: str + :ivar hardware_revision: Device hardware revision. + :vartype hardware_revision: str + :ivar software_revision: Device software revision. + :vartype software_revision: str """ - certificate: Optional["_models.CertificateConfiguration"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] + enablement_state: Optional[Union[str, "_models.RegistryDeviceEnablementState"]] = rest_field( + name="enablementState", visibility=["read", "create", "update", "delete", "query"] ) - """The certificate configuration.""" + """Whether the device is enabled or disabled. A disabled device cannot send messages, be updated, + or reprovision. Known values are: \"Enabled\" and \"Disabled\".""" + manufacturer: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Device manufacturer.""" + model: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Device model.""" + hardware_revision: Optional[str] = rest_field( + name="hardwareRevision", visibility=["read", "create", "update", "delete", "query"] + ) + """Device hardware revision.""" + software_revision: Optional[str] = rest_field( + name="softwareRevision", visibility=["read", "create", "update", "delete", "query"] + ) + """Device software revision.""" @overload def __init__( self, *, - certificate: Optional["_models.CertificateConfiguration"] = None, + enablement_state: Optional[Union[str, "_models.RegistryDeviceEnablementState"]] = None, + manufacturer: Optional[str] = None, + model: Optional[str] = None, + hardware_revision: Optional[str] = None, + software_revision: Optional[str] = None, ) -> None: ... @overload @@ -5700,7 +6500,54 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Schema(ProxyResource): +class RootCertificateAuthorityProperties( + CertificateAuthorityProperties, discriminator="Root" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties for a self-signed, service-managed root Certificate Authority. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioning_state: str or ~azure.mgmt.deviceregistry.models.ProvisioningState + :ivar uuid: Globally unique, immutable, non-reusable identifier of the Certificate Authority + resource. + :vartype uuid: str + :ivar key_type: Crypto type: ECC. Required. "ECC" + :vartype key_type: str or ~azure.mgmt.deviceregistry.models.CertificateAuthorityKeyType + :ivar subject: Certificate subject. + :vartype subject: str + :ivar validity_not_before: Certificate is valid not before this date. Format ISO8601. + :vartype validity_not_before: ~datetime.datetime + :ivar validity_not_after: Certificate is valid not after this date. Format ISO8601. + :vartype validity_not_after: ~datetime.datetime + :ivar certificate_authority_type: The self-signed, service-managed root Certificate Authority + type. Required. Self-signed, service-managed root Certificate Authority. + :vartype certificate_authority_type: str or ~azure.mgmt.deviceregistry.models.ROOT + """ + + certificate_authority_type: Literal[CertificateAuthorityType.ROOT] = rest_discriminator(name="certificateAuthorityType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """The self-signed, service-managed root Certificate Authority type. Required. Self-signed, + service-managed root Certificate Authority.""" + + @overload + def __init__( + self, + *, + key_type: Union[str, "_models.CertificateAuthorityKeyType"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + self.certificate_authority_type = CertificateAuthorityType.ROOT # type: ignore + + +class Schema(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Schema definition. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -5741,7 +6588,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchemaProperties(_Model): +class SchemaProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the schema properties. :ivar uuid: Globally unique, immutable, non-reusable id. @@ -5750,10 +6597,11 @@ class SchemaProperties(_Model): :vartype display_name: str :ivar description: Human-readable description of the schema. :vartype description: str - :ivar format: Format of the schema. Required. Known values are: "JsonSchema/draft-07" and - "Delta/1.0". + :ivar format: Format of the schema. Required. Known values are: "JsonSchema/draft-07", + "Delta/1.0", and "JsonLD/1.1". :vartype format: str or ~azure.mgmt.deviceregistry.models.Format - :ivar schema_type: Type of the schema. Required. "MessageSchema" + :ivar schema_type: Type of the schema. Required. Known values are: "MessageSchema", + "ThingModel", and "ThingDescription". :vartype schema_type: str or ~azure.mgmt.deviceregistry.models.SchemaType :ivar provisioning_state: Provisioning state of the resource. Known values are: "Succeeded", "Failed", "Canceled", "Accepted", and "Deleting". @@ -5771,9 +6619,11 @@ class SchemaProperties(_Model): description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Human-readable description of the schema.""" format: Union[str, "_models.Format"] = rest_field(visibility=["read", "create"]) - """Format of the schema. Required. Known values are: \"JsonSchema/draft-07\" and \"Delta/1.0\".""" + """Format of the schema. Required. Known values are: \"JsonSchema/draft-07\", \"Delta/1.0\", and + \"JsonLD/1.1\".""" schema_type: Union[str, "_models.SchemaType"] = rest_field(name="schemaType", visibility=["read", "create"]) - """Type of the schema. Required. \"MessageSchema\"""" + """Type of the schema. Required. Known values are: \"MessageSchema\", \"ThingModel\", and + \"ThingDescription\".""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) @@ -5804,7 +6654,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchemaRegistry(TrackedResource): +class SchemaRegistry(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Schema registry definition. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -5825,14 +6675,14 @@ class SchemaRegistry(TrackedResource): :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.mgmt.deviceregistry.models.SchemaRegistryProperties :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.deviceregistry.models.SystemAssignedServiceIdentity + :vartype identity: ~azure.mgmt.deviceregistry.models.ManagedServiceIdentity """ properties: Optional["_models.SchemaRegistryProperties"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The resource-specific properties for this resource.""" - identity: Optional["_models.SystemAssignedServiceIdentity"] = rest_field( + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The managed service identities assigned to this resource.""" @@ -5844,7 +6694,7 @@ def __init__( location: str, tags: Optional[dict[str, str]] = None, properties: Optional["_models.SchemaRegistryProperties"] = None, - identity: Optional["_models.SystemAssignedServiceIdentity"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, ) -> None: ... @overload @@ -5858,7 +6708,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchemaRegistryProperties(_Model): +class SchemaRegistryProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the schema registry properties. :ivar uuid: Globally unique, immutable, non-reusable id. @@ -5873,6 +6723,10 @@ class SchemaRegistryProperties(_Model): :ivar storage_account_container_url: The Storage Account's Container URL where schemas will be stored. Required. :vartype storage_account_container_url: str + :ivar outbound_identity: The identity used for outbound calls from the ADR schema registry. If + not specified and the schema registry has a system-assigned identity enabled, the + system-assigned identity is used by default. + :vartype outbound_identity: ~azure.mgmt.deviceregistry.models.OutboundIdentity :ivar provisioning_state: Provisioning state of the resource. Known values are: "Succeeded", "Failed", "Canceled", "Accepted", and "Deleting". :vartype provisioning_state: str or ~azure.mgmt.deviceregistry.models.ProvisioningState @@ -5890,6 +6744,12 @@ class SchemaRegistryProperties(_Model): """Human-readable description of the schema registry.""" storage_account_container_url: str = rest_field(name="storageAccountContainerUrl", visibility=["read", "create"]) """The Storage Account's Container URL where schemas will be stored. Required.""" + outbound_identity: Optional["_models.OutboundIdentity"] = rest_field( + name="outboundIdentity", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity used for outbound calls from the ADR schema registry. If not specified and the + schema registry has a system-assigned identity enabled, the system-assigned identity is used by + default.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) @@ -5904,6 +6764,7 @@ def __init__( storage_account_container_url: str, display_name: Optional[str] = None, description: Optional[str] = None, + outbound_identity: Optional["_models.OutboundIdentity"] = None, ) -> None: ... @overload @@ -5917,18 +6778,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchemaRegistryUpdate(_Model): +class SchemaRegistryUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The type used for update operations of the SchemaRegistry. :ivar identity: The managed service identities assigned to this resource. - :vartype identity: ~azure.mgmt.deviceregistry.models.SystemAssignedServiceIdentity + :vartype identity: ~azure.mgmt.deviceregistry.models.ManagedServiceIdentity :ivar tags: Resource tags. :vartype tags: dict[str, str] :ivar properties: The resource-specific properties for this resource. :vartype properties: ~azure.mgmt.deviceregistry.models.SchemaRegistryUpdateProperties """ - identity: Optional["_models.SystemAssignedServiceIdentity"] = rest_field( + identity: Optional["_models.ManagedServiceIdentity"] = rest_field( visibility=["read", "create", "update", "delete", "query"] ) """The managed service identities assigned to this resource.""" @@ -5943,7 +6804,7 @@ class SchemaRegistryUpdate(_Model): def __init__( self, *, - identity: Optional["_models.SystemAssignedServiceIdentity"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, tags: Optional[dict[str, str]] = None, properties: Optional["_models.SchemaRegistryUpdateProperties"] = None, ) -> None: ... @@ -5959,13 +6820,17 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchemaRegistryUpdateProperties(_Model): +class SchemaRegistryUpdateProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The updatable properties of the SchemaRegistry. :ivar display_name: Human-readable display name. :vartype display_name: str :ivar description: Human-readable description of the schema registry. :vartype description: str + :ivar outbound_identity: The identity used for outbound calls from the ADR schema registry. If + not specified and the schema registry has a system-assigned identity enabled, the + system-assigned identity is used by default. + :vartype outbound_identity: ~azure.mgmt.deviceregistry.models.OutboundIdentity """ display_name: Optional[str] = rest_field( @@ -5974,6 +6839,12 @@ class SchemaRegistryUpdateProperties(_Model): """Human-readable display name.""" description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Human-readable description of the schema registry.""" + outbound_identity: Optional["_models.OutboundIdentity"] = rest_field( + name="outboundIdentity", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity used for outbound calls from the ADR schema registry. If not specified and the + schema registry has a system-assigned identity enabled, the system-assigned identity is used by + default.""" @overload def __init__( @@ -5981,6 +6852,7 @@ def __init__( *, display_name: Optional[str] = None, description: Optional[str] = None, + outbound_identity: Optional["_models.OutboundIdentity"] = None, ) -> None: ... @overload @@ -5994,7 +6866,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchemaVersion(ProxyResource): +class SchemaVersion(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Schema version's definition. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -6035,7 +6907,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SchemaVersionProperties(_Model): +class SchemaVersionProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines the schema version properties. :ivar uuid: Globally unique, immutable, non-reusable id. @@ -6136,7 +7008,7 @@ class StatusError(_Model): """Array of error details that describe the status of each error.""" -class StorageDestinationConfiguration(_Model): +class StorageDestinationConfiguration(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The configuration for a storage destination. :ivar path: The storage destination path. Required. @@ -6164,7 +7036,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StreamDestination(_Model): +class StreamDestination(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The type of the destination. You probably want to use the sub-classes and not this class directly. Known sub-classes are: @@ -6196,7 +7068,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StreamMqttDestination(StreamDestination, discriminator="Mqtt"): +class StreamMqttDestination( + StreamDestination, discriminator="Mqtt" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The type for a MQTT destination. :ivar target: The MQTT destination type. Required. MQTT target. @@ -6231,7 +7105,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.target = StreamDestinationTarget.MQTT # type: ignore -class StreamStorageDestination(StreamDestination, discriminator="Storage"): +class StreamStorageDestination( + StreamDestination, discriminator="Storage" +): # pylint: disable=docstring-keyword-should-match-keyword-only """The type for a storage destination. :ivar target: The storage destination type. Required. Storage target. @@ -6266,51 +7142,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: self.target = StreamDestinationTarget.STORAGE # type: ignore -class SystemAssignedServiceIdentity(_Model): - """Managed service identity (either system assigned, or none). - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: The type of managed identity assigned to this resource. Required. Known values are: - "None" and "SystemAssigned". - :vartype type: str or ~azure.mgmt.deviceregistry.models.SystemAssignedServiceIdentityType - """ - - principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) - """The service principal ID of the system assigned identity. This property will only be provided - for a system assigned identity.""" - tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) - """The tenant ID of the system assigned identity. This property will only be provided for a system - assigned identity.""" - type: Union[str, "_models.SystemAssignedServiceIdentityType"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """The type of managed identity assigned to this resource. Required. Known values are: \"None\" - and \"SystemAssigned\".""" - - @overload - def __init__( - self, - *, - type: Union[str, "_models.SystemAssignedServiceIdentityType"], - ) -> None: ... - - @overload - def __init__(self, mapping: Mapping[str, Any]) -> None: - """ - :param mapping: raw JSON to initialize the model. - :type mapping: Mapping[str, Any] - """ - - def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, **kwargs) - - -class SystemData(_Model): +class SystemData(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. @@ -6377,7 +7209,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Topic(_Model): +class Topic(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Object that describes the topic information. :ivar path: The topic path for messages published to an MQTT broker. Required. @@ -6414,7 +7246,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class TrustSettings(_Model): +class TrustSettings(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Defines server trust settings for an endpoint. :ivar trust_list: Defines a secret reference for certificates to trust. @@ -6442,7 +7274,22 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class UsernamePasswordCredentials(_Model): +class UserAssignedIdentity(_Model): + """User assigned identity properties. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The principal ID of the assigned identity.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The client ID of the assigned identity.""" + + +class UsernamePasswordCredentials(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The credentials for authentication mode UsernamePassword. :ivar username_secret_name: The name of the secret containing the username. Required. @@ -6479,7 +7326,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class X509CertificateCredentials(_Model): +class X509CertificateCredentials(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The x509 certificate for authentication mode Certificate. :ivar certificate_secret_name: The name of the secret containing the certificate and private @@ -6527,7 +7374,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class X509Credentials(_Model): +class X509Credentials(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The x509 certificate for authentication mode Certificate. :ivar certificate_secret_name: The name of the secret containing the certificate and private diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/_patch.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/_patch.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/models/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/operations/__init__.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/operations/__init__.py index 0e32b3a3ba1b..48c273c7d044 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/operations/__init__.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/operations/__init__.py @@ -14,12 +14,11 @@ from ._operations import Operations # type: ignore from ._operations import OperationStatusOperations # type: ignore +from ._operations import AsyncOperationStatusOperations # type: ignore from ._operations import AssetsOperations # type: ignore from ._operations import AssetEndpointProfilesOperations # type: ignore from ._operations import BillingContainersOperations # type: ignore from ._operations import NamespacesOperations # type: ignore -from ._operations import CredentialsOperations # type: ignore -from ._operations import PoliciesOperations # type: ignore from ._operations import NamespaceAssetsOperations # type: ignore from ._operations import NamespaceDevicesOperations # type: ignore from ._operations import NamespaceDiscoveredAssetsOperations # type: ignore @@ -27,6 +26,9 @@ from ._operations import SchemaRegistriesOperations # type: ignore from ._operations import SchemasOperations # type: ignore from ._operations import SchemaVersionsOperations # type: ignore +from ._operations import CertificateAuthoritiesOperations # type: ignore +from ._operations import CertificatePoliciesOperations # type: ignore +from ._operations import RegistryDevicesOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -35,12 +37,11 @@ __all__ = [ "Operations", "OperationStatusOperations", + "AsyncOperationStatusOperations", "AssetsOperations", "AssetEndpointProfilesOperations", "BillingContainersOperations", "NamespacesOperations", - "CredentialsOperations", - "PoliciesOperations", "NamespaceAssetsOperations", "NamespaceDevicesOperations", "NamespaceDiscoveredAssetsOperations", @@ -48,6 +49,9 @@ "SchemaRegistriesOperations", "SchemasOperations", "SchemaVersionsOperations", + "CertificateAuthoritiesOperations", + "CertificatePoliciesOperations", + "RegistryDevicesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/operations/_operations.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/operations/_operations.py index 98b231cf6b79..79ae7c3932ba 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/operations/_operations.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/operations/_operations.py @@ -32,7 +32,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models as _models +from .. import models as _models, types as _types from .._configuration import DeviceRegistryMgmtClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer @@ -40,7 +40,6 @@ T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] List = list _SERIALIZER = Serializer() @@ -51,7 +50,7 @@ def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +71,7 @@ def build_operation_status_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,13 +93,41 @@ def build_operation_status_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_async_operation_status_get_request( + location: str, operation_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/locations/{location}/asyncOperationStatuses/{operationId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + def build_assets_get_request( resource_group_name: str, asset_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -129,7 +156,7 @@ def build_assets_create_or_replace_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -160,7 +187,7 @@ def build_assets_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -189,7 +216,7 @@ def build_assets_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}" path_format_arguments = { @@ -212,7 +239,7 @@ def build_assets_list_by_resource_group_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -241,7 +268,7 @@ def build_assets_list_by_subscription_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -267,7 +294,7 @@ def build_asset_endpoint_profiles_get_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -296,7 +323,7 @@ def build_asset_endpoint_profiles_create_or_replace_request( # pylint: disable= _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -327,7 +354,7 @@ def build_asset_endpoint_profiles_update_request( # pylint: disable=name-too-lo _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -356,7 +383,7 @@ def build_asset_endpoint_profiles_delete_request( # pylint: disable=name-too-lo ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}" path_format_arguments = { @@ -379,7 +406,7 @@ def build_asset_endpoint_profiles_list_by_resource_group_request( # pylint: dis _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -406,7 +433,7 @@ def build_asset_endpoint_profiles_list_by_subscription_request( # pylint: disab _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -432,7 +459,7 @@ def build_billing_containers_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -459,7 +486,7 @@ def build_billing_containers_list_by_subscription_request( # pylint: disable=na _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -485,7 +512,7 @@ def build_namespaces_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -514,7 +541,7 @@ def build_namespaces_create_or_replace_request( # pylint: disable=name-too-long _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -545,7 +572,7 @@ def build_namespaces_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -574,7 +601,7 @@ def build_namespaces_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}" path_format_arguments = { @@ -597,7 +624,7 @@ def build_namespaces_list_by_resource_group_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -624,7 +651,7 @@ def build_namespaces_list_by_subscription_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -651,7 +678,7 @@ def build_namespaces_migrate_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -675,21 +702,22 @@ def build_namespaces_migrate_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_credentials_get_request( - resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +def build_namespace_assets_get_request( + resource_group_name: str, namespace_name: str, asset_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "assetName": _SERIALIZER.url("asset_name", asset_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -703,22 +731,23 @@ def build_credentials_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_credentials_create_or_update_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +def build_namespace_assets_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, asset_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "assetName": _SERIALIZER.url("asset_name", asset_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -734,44 +763,23 @@ def build_credentials_create_or_update_request( # pylint: disable=name-too-long return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_credentials_delete_request( - resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_credentials_update_request( - resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +def build_namespace_assets_update_request( + resource_group_name: str, namespace_name: str, asset_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "assetName": _SERIALIZER.url("asset_name", asset_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -787,21 +795,19 @@ def build_credentials_update_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_credentials_list_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +def build_namespace_assets_delete_request( + resource_group_name: str, namespace_name: str, asset_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "assetName": _SERIALIZER.url("asset_name", asset_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -809,50 +815,24 @@ def build_credentials_list_by_resource_group_request( # pylint: disable=name-to # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_credentials_synchronize_request( +def build_namespace_assets_list_by_namespace_request( # pylint: disable=name-too-long resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/synchronize" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) - - -def build_policies_get_request( - resource_group_name: str, namespace_name: str, policy_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -866,23 +846,23 @@ def build_policies_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_policies_create_or_update_request( - resource_group_name: str, namespace_name: str, policy_name: str, subscription_id: str, **kwargs: Any +def build_namespace_assets_execute_action_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, asset_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}/executeAction" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + "assetName": _SERIALIZER.url("asset_name", asset_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -895,22 +875,25 @@ def build_policies_create_or_update_request( _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_policies_delete_request( - resource_group_name: str, namespace_name: str, policy_name: str, subscription_id: str, **kwargs: Any +def build_namespace_devices_get_request( + resource_group_name: str, namespace_name: str, device_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + "deviceName": _SERIALIZER.url("device_name", device_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -918,26 +901,29 @@ def build_policies_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_policies_update_request( - resource_group_name: str, namespace_name: str, policy_name: str, subscription_id: str, **kwargs: Any +def build_namespace_devices_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, device_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + "deviceName": _SERIALIZER.url("device_name", device_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -950,24 +936,26 @@ def build_policies_update_request( _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_policies_list_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +def build_namespace_devices_update_request( + resource_group_name: str, namespace_name: str, device_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "deviceName": _SERIALIZER.url("device_name", device_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -976,24 +964,26 @@ def build_policies_list_by_resource_group_request( # pylint: disable=name-too-l _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_policies_revoke_issuer_request( - resource_group_name: str, namespace_name: str, policy_name: str, subscription_id: str, **kwargs: Any +def build_namespace_devices_delete_request( + resource_group_name: str, namespace_name: str, device_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}/revokeIssuer" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + "deviceName": _SERIALIZER.url("device_name", device_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1001,24 +991,24 @@ def build_policies_revoke_issuer_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_policies_activate_bring_your_own_root_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, policy_name: str, subscription_id: str, **kwargs: Any +def build_namespace_devices_list_by_namespace_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/credentials/default/policies/{policyName}/activateBringYourOwnRoot" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1027,28 +1017,27 @@ def build_policies_activate_bring_your_own_root_request( # pylint: disable=name _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_assets_get_request( - resource_group_name: str, namespace_name: str, asset_name: str, subscription_id: str, **kwargs: Any +def build_namespace_discovered_assets_get_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, discovered_asset_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "assetName": _SERIALIZER.url("asset_name", asset_name, "str"), + "discoveredAssetName": _SERIALIZER.url("discovered_asset_name", discovered_asset_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1062,23 +1051,23 @@ def build_namespace_assets_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_assets_create_or_replace_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, asset_name: str, subscription_id: str, **kwargs: Any +def build_namespace_discovered_assets_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, discovered_asset_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "assetName": _SERIALIZER.url("asset_name", asset_name, "str"), + "discoveredAssetName": _SERIALIZER.url("discovered_asset_name", discovered_asset_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1094,23 +1083,23 @@ def build_namespace_assets_create_or_replace_request( # pylint: disable=name-to return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_assets_update_request( - resource_group_name: str, namespace_name: str, asset_name: str, subscription_id: str, **kwargs: Any +def build_namespace_discovered_assets_update_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, discovered_asset_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "assetName": _SERIALIZER.url("asset_name", asset_name, "str"), + "discoveredAssetName": _SERIALIZER.url("discovered_asset_name", discovered_asset_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1126,19 +1115,19 @@ def build_namespace_assets_update_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_assets_delete_request( - resource_group_name: str, namespace_name: str, asset_name: str, subscription_id: str, **kwargs: Any +def build_namespace_discovered_assets_delete_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, discovered_asset_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets/{assetName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "assetName": _SERIALIZER.url("asset_name", asset_name, "str"), + "discoveredAssetName": _SERIALIZER.url("discovered_asset_name", discovered_asset_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1149,17 +1138,17 @@ def build_namespace_assets_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_namespace_assets_list_by_resource_group_request( # pylint: disable=name-too-long +def build_namespace_discovered_assets_list_by_namespace_request( # pylint: disable=name-too-long resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/assets" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1177,22 +1166,22 @@ def build_namespace_assets_list_by_resource_group_request( # pylint: disable=na return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_devices_get_request( - resource_group_name: str, namespace_name: str, device_name: str, subscription_id: str, **kwargs: Any +def build_namespace_discovered_devices_get_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, discovered_device_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), + "discoveredDeviceName": _SERIALIZER.url("discovered_device_name", discovered_device_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1206,23 +1195,23 @@ def build_namespace_devices_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_devices_create_or_replace_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, device_name: str, subscription_id: str, **kwargs: Any +def build_namespace_discovered_devices_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, discovered_device_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), + "discoveredDeviceName": _SERIALIZER.url("discovered_device_name", discovered_device_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1238,23 +1227,23 @@ def build_namespace_devices_create_or_replace_request( # pylint: disable=name-t return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_devices_update_request( - resource_group_name: str, namespace_name: str, device_name: str, subscription_id: str, **kwargs: Any +def build_namespace_discovered_devices_update_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, discovered_device_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), + "discoveredDeviceName": _SERIALIZER.url("discovered_device_name", discovered_device_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1270,19 +1259,19 @@ def build_namespace_devices_update_request( return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_devices_delete_request( - resource_group_name: str, namespace_name: str, device_name: str, subscription_id: str, **kwargs: Any +def build_namespace_discovered_devices_delete_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, discovered_device_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), + "discoveredDeviceName": _SERIALIZER.url("discovered_device_name", discovered_device_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1293,17 +1282,17 @@ def build_namespace_devices_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_namespace_devices_list_by_resource_group_request( # pylint: disable=name-too-long +def build_namespace_discovered_devices_list_by_namespace_request( # pylint: disable=name-too-long resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -1321,23 +1310,21 @@ def build_namespace_devices_list_by_resource_group_request( # pylint: disable=n return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_devices_revoke_request( - resource_group_name: str, namespace_name: str, device_name: str, subscription_id: str, **kwargs: Any +def build_schema_registries_get_request( + resource_group_name: str, schema_registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/devices/{deviceName}/revoke" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "deviceName": _SERIALIZER.url("device_name", device_name, "str"), + "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1346,29 +1333,27 @@ def build_namespace_devices_revoke_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_discovered_assets_get_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, discovered_asset_name: str, subscription_id: str, **kwargs: Any +def build_schema_registries_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, schema_registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "discoveredAssetName": _SERIALIZER.url("discovered_asset_name", discovered_asset_name, "str"), + "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1377,28 +1362,29 @@ def build_namespace_discovered_assets_get_request( # pylint: disable=name-too-l _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_discovered_assets_create_or_replace_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, discovered_asset_name: str, subscription_id: str, **kwargs: Any +def build_schema_registries_update_request( + resource_group_name: str, schema_registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "discoveredAssetName": _SERIALIZER.url("discovered_asset_name", discovered_asset_name, "str"), + "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1411,54 +1397,21 @@ def build_namespace_discovered_assets_create_or_replace_request( # pylint: disa _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_discovered_assets_update_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, discovered_asset_name: str, subscription_id: str, **kwargs: Any +def build_schema_registries_delete_request( + resource_group_name: str, schema_registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "discoveredAssetName": _SERIALIZER.url("discovered_asset_name", discovered_asset_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_namespace_discovered_assets_delete_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, discovered_asset_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) - # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets/{discoveredAssetName}" - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "discoveredAssetName": _SERIALIZER.url("discovered_asset_name", discovered_asset_name, "str"), + "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1469,21 +1422,20 @@ def build_namespace_discovered_assets_delete_request( # pylint: disable=name-to return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_namespace_discovered_assets_list_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +def build_schema_registries_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredAssets" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1497,22 +1449,19 @@ def build_namespace_discovered_assets_list_by_resource_group_request( # pylint: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_discovered_devices_get_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, discovered_device_name: str, subscription_id: str, **kwargs: Any +def build_schema_registries_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}" + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/schemaRegistries" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "discoveredDeviceName": _SERIALIZER.url("discovered_device_name", discovered_device_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1526,23 +1475,22 @@ def build_namespace_discovered_devices_get_request( # pylint: disable=name-too- return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_discovered_devices_create_or_replace_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, discovered_device_name: str, subscription_id: str, **kwargs: Any +def build_schemas_get_request( + resource_group_name: str, schema_registry_name: str, schema_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "discoveredDeviceName": _SERIALIZER.url("discovered_device_name", discovered_device_name, "str"), + "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1551,30 +1499,28 @@ def build_namespace_discovered_devices_create_or_replace_request( # pylint: dis _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_discovered_devices_update_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, discovered_device_name: str, subscription_id: str, **kwargs: Any +def build_schemas_create_or_replace_request( + resource_group_name: str, schema_registry_name: str, schema_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "discoveredDeviceName": _SERIALIZER.url("discovered_device_name", discovered_device_name, "str"), + "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1587,22 +1533,22 @@ def build_namespace_discovered_devices_update_request( # pylint: disable=name-t _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_namespace_discovered_devices_delete_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, discovered_device_name: str, subscription_id: str, **kwargs: Any +def build_schemas_delete_request( + resource_group_name: str, schema_registry_name: str, schema_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices/{discoveredDeviceName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), - "discoveredDeviceName": _SERIALIZER.url("discovered_device_name", discovered_device_name, "str"), + "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1613,21 +1559,21 @@ def build_namespace_discovered_devices_delete_request( # pylint: disable=name-t return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_namespace_discovered_devices_list_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +def build_schemas_list_by_schema_registry_request( # pylint: disable=name-too-long + resource_group_name: str, schema_registry_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/discoveredDevices" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1641,21 +1587,28 @@ def build_namespace_discovered_devices_list_by_resource_group_request( # pylint return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_schema_registries_get_request( - resource_group_name: str, schema_registry_name: str, subscription_id: str, **kwargs: Any +def build_schema_versions_get_request( + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "schemaVersionName": _SERIALIZER.url("schema_version_name", schema_version_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1669,22 +1622,29 @@ def build_schema_registries_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_schema_registries_create_or_replace_request( # pylint: disable=name-too-long - resource_group_name: str, schema_registry_name: str, subscription_id: str, **kwargs: Any +def build_schema_versions_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "schemaVersionName": _SERIALIZER.url("schema_version_name", schema_version_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1700,22 +1660,25 @@ def build_schema_registries_create_or_replace_request( # pylint: disable=name-t return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_schema_registries_update_request( - resource_group_name: str, schema_registry_name: str, subscription_id: str, **kwargs: Any +def build_schema_versions_delete_request( + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "schemaVersionName": _SERIALIZER.url("schema_version_name", schema_version_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1723,26 +1686,25 @@ def build_schema_registries_update_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_schema_registries_delete_request( - resource_group_name: str, schema_registry_name: str, subscription_id: str, **kwargs: Any +def build_schema_versions_list_by_schema_request( # pylint: disable=name-too-long + resource_group_name: str, schema_registry_name: str, schema_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1750,23 +1712,28 @@ def build_schema_registries_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_schema_registries_list_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, subscription_id: str, **kwargs: Any + +def build_certificate_authorities_get_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, certificate_authority_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/certificateAuthorities/{certificateAuthorityName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "certificateAuthorityName": _SERIALIZER.url("certificate_authority_name", certificate_authority_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1780,19 +1747,23 @@ def build_schema_registries_list_by_resource_group_request( # pylint: disable=n return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_schema_registries_list_by_subscription_request( # pylint: disable=name-too-long - subscription_id: str, **kwargs: Any +def build_certificate_authorities_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, certificate_authority_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/schemaRegistries" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/certificateAuthorities/{certificateAuthorityName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "certificateAuthorityName": _SERIALIZER.url("certificate_authority_name", certificate_authority_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1801,27 +1772,26 @@ def build_schema_registries_list_by_subscription_request( # pylint: disable=nam _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_schemas_get_request( - resource_group_name: str, schema_registry_name: str, schema_name: str, subscription_id: str, **kwargs: Any +def build_certificate_authorities_delete_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, certificate_authority_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/certificateAuthorities/{certificateAuthorityName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "certificateAuthorityName": _SERIALIZER.url("certificate_authority_name", certificate_authority_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1829,29 +1799,26 @@ def build_schemas_get_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_schemas_create_or_replace_request( - resource_group_name: str, schema_registry_name: str, schema_name: str, subscription_id: str, **kwargs: Any +def build_certificate_authorities_update_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, certificate_authority_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/certificateAuthorities/{certificateAuthorityName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "certificateAuthorityName": _SERIALIZER.url("certificate_authority_name", certificate_authority_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1864,22 +1831,24 @@ def build_schemas_create_or_replace_request( _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_schemas_delete_request( - resource_group_name: str, schema_registry_name: str, schema_name: str, subscription_id: str, **kwargs: Any +def build_certificate_authorities_list_by_namespace_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/certificateAuthorities" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1887,24 +1856,27 @@ def build_schemas_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_schemas_list_by_schema_registry_request( # pylint: disable=name-too-long - resource_group_name: str, schema_registry_name: str, subscription_id: str, **kwargs: Any + +def build_certificate_authorities_activate_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, certificate_authority_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) - accept = _headers.pop("Accept", "application/json") - + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/certificateAuthorities/{certificateAuthorityName}/activate" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "certificateAuthorityName": _SERIALIZER.url("certificate_authority_name", certificate_authority_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1913,33 +1885,57 @@ def build_schemas_list_by_schema_registry_request( # pylint: disable=name-too-l _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_schema_versions_get_request( +def build_certificate_authorities_revoke_and_rotate_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, certificate_authority_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/certificateAuthorities/{certificateAuthorityName}/revokeAndRotate" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "certificateAuthorityName": _SERIALIZER.url("certificate_authority_name", certificate_authority_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_certificate_policies_get_request( resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/certificateAuthorities/{certificateAuthorityName}/certificatePolicies/{certificatePolicyName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "schemaVersionName": _SERIALIZER.url("schema_version_name", schema_version_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "certificateAuthorityName": _SERIALIZER.url("certificate_authority_name", certificate_authority_name, "str"), + "certificatePolicyName": _SERIALIZER.url("certificate_policy_name", certificate_policy_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1953,11 +1949,11 @@ def build_schema_versions_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_schema_versions_create_or_replace_request( # pylint: disable=name-too-long +def build_certificate_policies_create_or_replace_request( # pylint: disable=name-too-long resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: @@ -1965,17 +1961,17 @@ def build_schema_versions_create_or_replace_request( # pylint: disable=name-too _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/certificateAuthorities/{certificateAuthorityName}/certificatePolicies/{certificatePolicyName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "schemaVersionName": _SERIALIZER.url("schema_version_name", schema_version_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "certificateAuthorityName": _SERIALIZER.url("certificate_authority_name", certificate_authority_name, "str"), + "certificatePolicyName": _SERIALIZER.url("certificate_policy_name", certificate_policy_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1991,25 +1987,25 @@ def build_schema_versions_create_or_replace_request( # pylint: disable=name-too return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_schema_versions_delete_request( +def build_certificate_policies_delete_request( # pylint: disable=name-too-long resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/certificateAuthorities/{certificateAuthorityName}/certificatePolicies/{certificatePolicyName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "schemaVersionName": _SERIALIZER.url("schema_version_name", schema_version_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "certificateAuthorityName": _SERIALIZER.url("certificate_authority_name", certificate_authority_name, "str"), + "certificatePolicyName": _SERIALIZER.url("certificate_policy_name", certificate_policy_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2020,22 +2016,204 @@ def build_schema_versions_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_schema_versions_list_by_schema_request( # pylint: disable=name-too-long - resource_group_name: str, schema_registry_name: str, schema_name: str, subscription_id: str, **kwargs: Any +def build_certificate_policies_update_request( # pylint: disable=name-too-long + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-03-01-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions" + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/certificateAuthorities/{certificateAuthorityName}/certificatePolicies/{certificatePolicyName}" path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "schemaRegistryName": _SERIALIZER.url("schema_registry_name", schema_registry_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "certificateAuthorityName": _SERIALIZER.url("certificate_authority_name", certificate_authority_name, "str"), + "certificatePolicyName": _SERIALIZER.url("certificate_policy_name", certificate_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_certificate_policies_list_by_certificate_authority_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, certificate_authority_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/certificateAuthorities/{certificateAuthorityName}/certificatePolicies" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "certificateAuthorityName": _SERIALIZER.url("certificate_authority_name", certificate_authority_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_registry_devices_get_request( + resource_group_name: str, namespace_name: str, registry_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/registryDevices/{registryDeviceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "registryDeviceName": _SERIALIZER.url("registry_device_name", registry_device_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_registry_devices_create_or_replace_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, registry_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/registryDevices/{registryDeviceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "registryDeviceName": _SERIALIZER.url("registry_device_name", registry_device_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_registry_devices_update_request( + resource_group_name: str, namespace_name: str, registry_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/registryDevices/{registryDeviceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "registryDeviceName": _SERIALIZER.url("registry_device_name", registry_device_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_registry_devices_delete_request( + resource_group_name: str, namespace_name: str, registry_device_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/registryDevices/{registryDeviceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), + "registryDeviceName": _SERIALIZER.url("registry_device_name", registry_device_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_registry_devices_list_by_namespace_request( # pylint: disable=name-too-long + resource_group_name: str, namespace_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-11-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/namespaces/{namespaceName}/registryDevices" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "namespaceName": _SERIALIZER.url("namespace_name", namespace_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -2049,7 +2227,7 @@ def build_schema_versions_list_by_schema_request( # pylint: disable=name-too-lo return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class Operations: +class Operations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2113,7 +2291,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -2156,7 +2337,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class OperationStatusOperations: +class OperationStatusOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2243,7 +2424,99 @@ def get(self, location: str, operation_id: str, **kwargs: Any) -> _models.Operat return deserialized # type: ignore -class AssetsOperations: +class AsyncOperationStatusOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s + :attr:`async_operation_status` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-11-01", + params_added_on={"2026-11-01": ["api_version", "subscription_id", "location", "operation_id", "accept"]}, + api_versions_list=["2026-11-01"], + ) + def get(self, location: str, operation_id: str, **kwargs: Any) -> _models.OperationStatusResult: + """Returns the current status of an async operation. + + :param location: The location name. Required. + :type location: str + :param operation_id: The ID of an ongoing async operation. Required. + :type operation_id: str + :return: OperationStatusResult. The OperationStatusResult is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.OperationStatusResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OperationStatusResult] = kwargs.pop("cls", None) + + _request = build_async_operation_status_get_request( + location=location, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OperationStatusResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class AssetsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2331,7 +2604,11 @@ def get(self, resource_group_name: str, asset_name: str, **kwargs: Any) -> _mode return deserialized # type: ignore def _create_or_replace_initial( - self, resource_group_name: str, asset_name: str, resource: Union[_models.Asset, JSON, IO[bytes]], **kwargs: Any + self, + resource_group_name: str, + asset_name: str, + resource: Union[_models.Asset, _types.Asset, IO[bytes]], + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2436,7 +2713,7 @@ def begin_create_or_replace( self, resource_group_name: str, asset_name: str, - resource: JSON, + resource: _types.Asset, *, content_type: str = "application/json", **kwargs: Any @@ -2449,7 +2726,7 @@ def begin_create_or_replace( :param asset_name: Asset name parameter. Required. :type asset_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.deviceregistry.types.Asset :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2489,18 +2766,23 @@ def begin_create_or_replace( @distributed_trace def begin_create_or_replace( - self, resource_group_name: str, asset_name: str, resource: Union[_models.Asset, JSON, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Asset]: - """Create a Asset. - + self, + resource_group_name: str, + asset_name: str, + resource: Union[_models.Asset, _types.Asset, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Asset]: + """Create a Asset. + :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param asset_name: Asset name parameter. Required. :type asset_name: str - :param resource: Resource create parameters. Is one of the following types: Asset, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.Asset or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a Asset type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.deviceregistry.models.Asset or + ~azure.mgmt.deviceregistry.types.Asset or IO[bytes] :return: An instance of LROPoller that returns Asset. The Asset is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Asset] @@ -2562,7 +2844,7 @@ def _update_initial( self, resource_group_name: str, asset_name: str, - properties: Union[_models.AssetUpdate, JSON, IO[bytes]], + properties: Union[_models.AssetUpdate, _types.AssetUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -2666,7 +2948,7 @@ def begin_update( self, resource_group_name: str, asset_name: str, - properties: JSON, + properties: _types.AssetUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -2679,7 +2961,7 @@ def begin_update( :param asset_name: Asset name parameter. Required. :type asset_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.deviceregistry.types.AssetUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2722,7 +3004,7 @@ def begin_update( self, resource_group_name: str, asset_name: str, - properties: Union[_models.AssetUpdate, JSON, IO[bytes]], + properties: Union[_models.AssetUpdate, _types.AssetUpdate, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.Asset]: """Update a Asset. @@ -2732,9 +3014,10 @@ def begin_update( :type resource_group_name: str :param asset_name: Asset name parameter. Required. :type asset_name: str - :param properties: The resource properties to be updated. Is one of the following types: - AssetUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.AssetUpdate or JSON or IO[bytes] + :param properties: The resource properties to be updated. Is either a AssetUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.AssetUpdate or + ~azure.mgmt.deviceregistry.types.AssetUpdate or IO[bytes] :return: An instance of LROPoller that returns Asset. The Asset is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Asset] @@ -2960,7 +3243,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3050,7 +3336,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3093,7 +3382,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class AssetEndpointProfilesOperations: +class AssetEndpointProfilesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3186,7 +3475,7 @@ def _create_or_replace_initial( self, resource_group_name: str, asset_endpoint_profile_name: str, - resource: Union[_models.AssetEndpointProfile, JSON, IO[bytes]], + resource: Union[_models.AssetEndpointProfile, _types.AssetEndpointProfile, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3292,7 +3581,7 @@ def begin_create_or_replace( self, resource_group_name: str, asset_endpoint_profile_name: str, - resource: JSON, + resource: _types.AssetEndpointProfile, *, content_type: str = "application/json", **kwargs: Any @@ -3305,7 +3594,7 @@ def begin_create_or_replace( :param asset_endpoint_profile_name: Asset Endpoint Profile name parameter. Required. :type asset_endpoint_profile_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.deviceregistry.types.AssetEndpointProfile :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3348,7 +3637,7 @@ def begin_create_or_replace( self, resource_group_name: str, asset_endpoint_profile_name: str, - resource: Union[_models.AssetEndpointProfile, JSON, IO[bytes]], + resource: Union[_models.AssetEndpointProfile, _types.AssetEndpointProfile, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AssetEndpointProfile]: """Create a AssetEndpointProfile. @@ -3358,9 +3647,10 @@ def begin_create_or_replace( :type resource_group_name: str :param asset_endpoint_profile_name: Asset Endpoint Profile name parameter. Required. :type asset_endpoint_profile_name: str - :param resource: Resource create parameters. Is one of the following types: - AssetEndpointProfile, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.AssetEndpointProfile or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a AssetEndpointProfile type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.AssetEndpointProfile or + ~azure.mgmt.deviceregistry.types.AssetEndpointProfile or IO[bytes] :return: An instance of LROPoller that returns AssetEndpointProfile. The AssetEndpointProfile is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.AssetEndpointProfile] @@ -3422,7 +3712,7 @@ def _update_initial( self, resource_group_name: str, asset_endpoint_profile_name: str, - properties: Union[_models.AssetEndpointProfileUpdate, JSON, IO[bytes]], + properties: Union[_models.AssetEndpointProfileUpdate, _types.AssetEndpointProfileUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -3526,7 +3816,7 @@ def begin_update( self, resource_group_name: str, asset_endpoint_profile_name: str, - properties: JSON, + properties: _types.AssetEndpointProfileUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -3539,7 +3829,7 @@ def begin_update( :param asset_endpoint_profile_name: Asset Endpoint Profile name parameter. Required. :type asset_endpoint_profile_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.deviceregistry.types.AssetEndpointProfileUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -3582,7 +3872,7 @@ def begin_update( self, resource_group_name: str, asset_endpoint_profile_name: str, - properties: Union[_models.AssetEndpointProfileUpdate, JSON, IO[bytes]], + properties: Union[_models.AssetEndpointProfileUpdate, _types.AssetEndpointProfileUpdate, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.AssetEndpointProfile]: """Update a AssetEndpointProfile. @@ -3592,10 +3882,10 @@ def begin_update( :type resource_group_name: str :param asset_endpoint_profile_name: Asset Endpoint Profile name parameter. Required. :type asset_endpoint_profile_name: str - :param properties: The resource properties to be updated. Is one of the following types: - AssetEndpointProfileUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.AssetEndpointProfileUpdate or JSON or - IO[bytes] + :param properties: The resource properties to be updated. Is either a + AssetEndpointProfileUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.AssetEndpointProfileUpdate or + ~azure.mgmt.deviceregistry.types.AssetEndpointProfileUpdate or IO[bytes] :return: An instance of LROPoller that returns AssetEndpointProfile. The AssetEndpointProfile is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.AssetEndpointProfile] @@ -3827,7 +4117,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3917,7 +4210,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -3960,7 +4256,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class BillingContainersOperations: +class BillingContainersOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3988,6 +4284,8 @@ def __init__(self, *args, **kwargs) -> None: "2025-10-01", "2025-11-01-preview", "2026-03-01-preview", + "2026-04-01", + "2026-11-01", ], ) def get(self, billing_container_name: str, **kwargs: Any) -> _models.BillingContainer: @@ -4066,6 +4364,8 @@ def get(self, billing_container_name: str, **kwargs: Any) -> _models.BillingCont "2025-10-01", "2025-11-01-preview", "2026-03-01-preview", + "2026-04-01", + "2026-11-01", ], ) def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.BillingContainer"]: @@ -4115,7 +4415,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -4158,7 +4461,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class NamespacesOperations: +class NamespacesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -4181,7 +4484,14 @@ def __init__(self, *args, **kwargs) -> None: params_added_on={ "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _models.Namespace: """Get a Namespace. @@ -4264,13 +4574,20 @@ def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _ "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def _create_or_replace_initial( self, resource_group_name: str, namespace_name: str, - resource: Union[_models.Namespace, JSON, IO[bytes]], + resource: Union[_models.Namespace, _types.Namespace, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -4376,7 +4693,7 @@ def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - resource: JSON, + resource: _types.Namespace, *, content_type: str = "application/json", **kwargs: Any @@ -4389,7 +4706,7 @@ def begin_create_or_replace( :param namespace_name: The name of the namespace. Required. :type namespace_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.deviceregistry.types.Namespace :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4440,13 +4757,20 @@ def begin_create_or_replace( "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - resource: Union[_models.Namespace, JSON, IO[bytes]], + resource: Union[_models.Namespace, _types.Namespace, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.Namespace]: """Create a Namespace. @@ -4456,9 +4780,10 @@ def begin_create_or_replace( :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param resource: Resource create parameters. Is one of the following types: Namespace, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.Namespace or JSON or IO[bytes] + :param resource: Resource create parameters. Is either a Namespace type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.deviceregistry.models.Namespace or + ~azure.mgmt.deviceregistry.types.Namespace or IO[bytes] :return: An instance of LROPoller that returns Namespace. The Namespace is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Namespace] @@ -4528,13 +4853,20 @@ def get_long_running_output(pipeline_response): "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def _update_initial( self, resource_group_name: str, namespace_name: str, - properties: Union[_models.NamespaceUpdate, JSON, IO[bytes]], + properties: Union[_models.NamespaceUpdate, _types.NamespaceUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -4638,7 +4970,7 @@ def begin_update( self, resource_group_name: str, namespace_name: str, - properties: JSON, + properties: _types.NamespaceUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -4651,7 +4983,7 @@ def begin_update( :param namespace_name: The name of the namespace. Required. :type namespace_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.deviceregistry.types.NamespaceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -4702,13 +5034,20 @@ def begin_update( "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def begin_update( self, resource_group_name: str, namespace_name: str, - properties: Union[_models.NamespaceUpdate, JSON, IO[bytes]], + properties: Union[_models.NamespaceUpdate, _types.NamespaceUpdate, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.Namespace]: """Update a Namespace. @@ -4718,9 +5057,10 @@ def begin_update( :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param properties: The resource properties to be updated. Is one of the following types: - NamespaceUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceUpdate or JSON or IO[bytes] + :param properties: The resource properties to be updated. Is either a NamespaceUpdate type or a + IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceUpdate or + ~azure.mgmt.deviceregistry.types.NamespaceUpdate or IO[bytes] :return: An instance of LROPoller that returns Namespace. The Namespace is compatible with MutableMapping :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Namespace] @@ -4783,7 +5123,14 @@ def get_long_running_output(pipeline_response): params_added_on={ "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def _delete_initial(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { @@ -4850,7 +5197,14 @@ def _delete_initial(self, resource_group_name: str, namespace_name: str, **kwarg params_added_on={ "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def begin_delete(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> LROPoller[None]: """Delete a Namespace. @@ -4912,7 +5266,14 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @api_version_validation( method_added_on="2025-07-01-preview", params_added_on={"2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.Namespace"]: """List Namespace resources by resource group. @@ -4965,7 +5326,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5011,7 +5375,14 @@ def get_next(next_link=None): @api_version_validation( method_added_on="2025-07-01-preview", params_added_on={"2025-07-01-preview": ["api_version", "subscription_id", "accept"]}, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.Namespace"]: """List Namespace resources by subscription ID. @@ -5060,7 +5431,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -5114,13 +5488,20 @@ def get_next(next_link=None): "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def _migrate_initial( self, resource_group_name: str, namespace_name: str, - body: Union[_models.NamespaceMigrateRequest, JSON, IO[bytes]], + body: Union[_models.NamespaceMigrateRequest, _types.NamespaceMigrateRequest, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -5226,7 +5607,7 @@ def begin_migrate( self, resource_group_name: str, namespace_name: str, - body: JSON, + body: _types.NamespaceMigrateRequest, *, content_type: str = "application/json", **kwargs: Any @@ -5239,7 +5620,7 @@ def begin_migrate( :param namespace_name: The name of the namespace. Required. :type namespace_name: str :param body: The content of the action request. Required. - :type body: JSON + :type body: ~azure.mgmt.deviceregistry.types.NamespaceMigrateRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -5288,13 +5669,20 @@ def begin_migrate( "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def begin_migrate( self, resource_group_name: str, namespace_name: str, - body: Union[_models.NamespaceMigrateRequest, JSON, IO[bytes]], + body: Union[_models.NamespaceMigrateRequest, _types.NamespaceMigrateRequest, IO[bytes]], **kwargs: Any ) -> LROPoller[None]: """Migrate the resources into Namespace. @@ -5304,9 +5692,10 @@ def begin_migrate( :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param body: The content of the action request. Is one of the following types: - NamespaceMigrateRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.deviceregistry.models.NamespaceMigrateRequest or JSON or IO[bytes] + :param body: The content of the action request. Is either a NamespaceMigrateRequest type or a + IO[bytes] type. Required. + :type body: ~azure.mgmt.deviceregistry.models.NamespaceMigrateRequest or + ~azure.mgmt.deviceregistry.types.NamespaceMigrateRequest or IO[bytes] :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -5359,14 +5748,14 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore -class CredentialsOperations: +class NamespaceAssetsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s - :attr:`credentials` attribute. + :attr:`namespace_assets` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -5378,22 +5767,40 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace @api_version_validation( - method_added_on="2025-11-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2025-11-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "asset_name", + "accept", + ] }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _models.Credential: - """Get a Credential. + def get( + self, resource_group_name: str, namespace_name: str, asset_name: str, **kwargs: Any + ) -> _models.NamespaceAsset: + """Get a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :return: Credential. The Credential is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.Credential + :param asset_name: The name of the asset. Required. + :type asset_name: str + :return: NamespaceAsset. The NamespaceAsset is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.NamespaceAsset :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -5407,11 +5814,12 @@ def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.Credential] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceAsset] = kwargs.pop("cls", None) - _request = build_credentials_get_request( + _request = build_namespace_assets_get_request( resource_group_name=resource_group_name, namespace_name=namespace_name, + asset_name=asset_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -5446,7 +5854,7 @@ def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _ if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Credential, response.json()) + deserialized = _deserialize(_models.NamespaceAsset, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -5454,24 +5862,33 @@ def get(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> _ return deserialized # type: ignore @api_version_validation( - method_added_on="2025-11-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2025-11-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", + "asset_name", "content_type", "accept", ] }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def _create_or_update_initial( + def _create_or_replace_initial( self, resource_group_name: str, namespace_name: str, - resource: Union[_models.Credential, JSON, IO[bytes]], + asset_name: str, + resource: Union[_models.NamespaceAsset, _types.NamespaceAsset, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -5495,9 +5912,10 @@ def _create_or_update_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_credentials_create_or_update_request( + _request = build_namespace_assets_create_or_replace_request( resource_group_name=resource_group_name, namespace_name=namespace_name, + asset_name=asset_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -5545,138 +5963,160 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - resource: _models.Credential, + asset_name: str, + resource: _models.NamespaceAsset, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Credential]: - """Create a Credential. + ) -> LROPoller[_models.NamespaceAsset]: + """Create a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str + :param asset_name: The name of the asset. Required. + :type asset_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.Credential + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceAsset :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Credential. The Credential is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Credential] + :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - resource: JSON, + asset_name: str, + resource: _types.NamespaceAsset, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Credential]: - """Create a Credential. + ) -> LROPoller[_models.NamespaceAsset]: + """Create a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str + :param asset_name: The name of the asset. Required. + :type asset_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.deviceregistry.types.NamespaceAsset :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Credential. The Credential is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Credential] + :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, + asset_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Credential]: - """Create a Credential. + ) -> LROPoller[_models.NamespaceAsset]: + """Create a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str + :param asset_name: The name of the asset. Required. + :type asset_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Credential. The Credential is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Credential] + :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2025-11-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2025-11-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", + "asset_name", "content_type", "accept", ] }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def begin_create_or_update( + def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - resource: Union[_models.Credential, JSON, IO[bytes]], + asset_name: str, + resource: Union[_models.NamespaceAsset, _types.NamespaceAsset, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Credential]: - """Create a Credential. + ) -> LROPoller[_models.NamespaceAsset]: + """Create a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param resource: Resource create parameters. Is one of the following types: Credential, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.Credential or JSON or IO[bytes] - :return: An instance of LROPoller that returns Credential. The Credential is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Credential] + :param asset_name: The name of the asset. Required. + :type asset_name: str + :param resource: Resource create parameters. Is either a NamespaceAsset type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceAsset or + ~azure.mgmt.deviceregistry.types.NamespaceAsset or IO[bytes] + :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Credential] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceAsset] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, + asset_name=asset_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -5689,7 +6129,7 @@ def begin_create_or_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Credential, response.json()) + deserialized = _deserialize(_models.NamespaceAsset, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -5707,24 +6147,46 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Credential].from_continuation_token( + return LROPoller[_models.NamespaceAsset].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Credential]( + return LROPoller[_models.NamespaceAsset]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2025-11-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2025-11-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name"] + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "asset_name", + "content_type", + "accept", + ] }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def _delete_initial(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> Iterator[bytes]: + def _update_initial( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + properties: Union[_models.NamespaceAssetUpdate, _types.NamespaceAssetUpdate, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -5733,16 +6195,27 @@ def _delete_initial(self, resource_group_name: str, namespace_name: str, **kwarg } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_credentials_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_namespace_assets_update_request( resource_group_name=resource_group_name, namespace_name=namespace_name, + asset_name=asset_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -5759,7 +6232,7 @@ def _delete_initial(self, resource_group_name: str, namespace_name: str, **kwarg response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -5783,184 +6256,34 @@ def _delete_initial(self, resource_group_name: str, namespace_name: str, **kwarg return deserialized # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2025-11-01-preview", - params_added_on={ - "2025-11-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name"] - }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], - ) - def begin_delete(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete a Credential. + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + asset_name: str, + properties: _models.NamespaceAssetUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NamespaceAsset]: + """Update a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @api_version_validation( - method_added_on="2025-11-01-preview", - params_added_on={ - "2025-11-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], - ) - def _update_initial( - self, - resource_group_name: str, - namespace_name: str, - properties: Union[_models.CredentialUpdate, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = kwargs.pop("params", {}) or {} - - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_credentials_update_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - namespace_name: str, - properties: _models.CredentialUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Credential]: - """Update a Credential. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.deviceregistry.models.CredentialUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns Credential. The Credential is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Credential] + :param asset_name: The name of the asset. Required. + :type asset_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceAssetUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -5969,26 +6292,29 @@ def begin_update( self, resource_group_name: str, namespace_name: str, - properties: JSON, + asset_name: str, + properties: _types.NamespaceAssetUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Credential]: - """Update a Credential. + ) -> LROPoller[_models.NamespaceAsset]: + """Update a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str + :param asset_name: The name of the asset. Required. + :type asset_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.deviceregistry.types.NamespaceAssetUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Credential. The Credential is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Credential] + :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -5997,71 +6323,86 @@ def begin_update( self, resource_group_name: str, namespace_name: str, + asset_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Credential]: - """Update a Credential. + ) -> LROPoller[_models.NamespaceAsset]: + """Update a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str + :param asset_name: The name of the asset. Required. + :type asset_name: str :param properties: The resource properties to be updated. Required. :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Credential. The Credential is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Credential] + :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2025-11-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2025-11-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", + "asset_name", "content_type", "accept", ] }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def begin_update( self, resource_group_name: str, namespace_name: str, - properties: Union[_models.CredentialUpdate, JSON, IO[bytes]], + asset_name: str, + properties: Union[_models.NamespaceAssetUpdate, _types.NamespaceAssetUpdate, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Credential]: - """Update a Credential. + ) -> LROPoller[_models.NamespaceAsset]: + """Update a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param properties: The resource properties to be updated. Is one of the following types: - CredentialUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.CredentialUpdate or JSON or IO[bytes] - :return: An instance of LROPoller that returns Credential. The Credential is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Credential] + :param asset_name: The name of the asset. Required. + :type asset_name: str + :param properties: The resource properties to be updated. Is either a NamespaceAssetUpdate type + or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceAssetUpdate or + ~azure.mgmt.deviceregistry.types.NamespaceAssetUpdate or IO[bytes] + :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Credential] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceAsset] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -6069,6 +6410,7 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, + asset_name=asset_name, properties=properties, content_type=content_type, cls=lambda x, y, z: x, @@ -6081,7 +6423,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Credential, response.json()) + deserialized = _deserialize(_models.NamespaceAsset, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -6099,43 +6441,39 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Credential].from_continuation_token( + return LROPoller[_models.NamespaceAsset].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Credential]( + return LROPoller[_models.NamespaceAsset]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @distributed_trace @api_version_validation( - method_added_on="2025-11-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2025-11-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "asset_name", + ] }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def list_by_resource_group( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> ItemPaged["_models.Credential"]: - """List Credential resources by Namespace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :return: An iterator like instance of Credential - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.Credential] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Credential]] = kwargs.pop("cls", None) - + def _delete_initial( + self, resource_group_name: str, namespace_name: str, asset_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -6144,101 +6482,15 @@ def list_by_resource_group( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: - - _request = build_credentials_list_by_resource_group_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - return _request + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Credential], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @api_version_validation( - method_added_on="2025-11-01-preview", - params_added_on={ - "2025-11-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name"] - }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], - ) - def _synchronize_initial(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_credentials_synchronize_request( + _request = build_namespace_assets_delete_request( resource_group_name=resource_group_name, namespace_name=namespace_name, + asset_name=asset_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -6257,7 +6509,7 @@ def _synchronize_initial(self, resource_group_name: str, namespace_name: str, ** response = pipeline_response.http_response - if response.status_code not in [202]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -6270,8 +6522,9 @@ def _synchronize_initial(self, resource_group_name: str, namespace_name: str, ** raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -6282,20 +6535,37 @@ def _synchronize_initial(self, resource_group_name: str, namespace_name: str, ** @distributed_trace @api_version_validation( - method_added_on="2025-11-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2025-11-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name"] + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "asset_name", + ] }, - api_versions_list=["2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def begin_synchronize(self, resource_group_name: str, namespace_name: str, **kwargs: Any) -> LROPoller[None]: - """A long-running resource action. + def begin_delete( + self, resource_group_name: str, namespace_name: str, asset_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a NamespaceAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str + :param asset_name: The name of the asset. Required. + :type asset_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -6308,9 +6578,10 @@ def begin_synchronize(self, resource_group_name: str, namespace_name: str, **kwa lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._synchronize_initial( + raw_result = self._delete_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, + asset_name=asset_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -6344,53 +6615,40 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - -class PoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s - :attr:`policies` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2026-03-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "policy_name", - "accept", - ] + "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def get(self, resource_group_name: str, namespace_name: str, policy_name: str, **kwargs: Any) -> _models.Policy: - """Get a Policy. + def list_by_namespace( + self, resource_group_name: str, namespace_name: str, **kwargs: Any + ) -> ItemPaged["_models.NamespaceAsset"]: + """List NamespaceAsset resources by Namespace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :return: Policy. The Policy is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.Policy + :return: An iterator like instance of NamespaceAsset + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.NamespaceAsset] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NamespaceAsset]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -6399,77 +6657,101 @@ def get(self, resource_group_name: str, namespace_name: str, policy_name: str, * } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + def prepare_request(next_link=None): + if not next_link: + + _request = build_namespace_assets_list_by_namespace_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - cls: ClsType[_models.Policy] = kwargs.pop("cls", None) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _request = build_policies_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NamespaceAsset], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - response = pipeline_response.http_response + def get_next(next_link=None): + _request = prepare_request(next_link) - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response = pipeline_response.http_response - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Policy, response.json()) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return ItemPaged(get_next, extract_data) @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2026-04-01", params_added_on={ - "2026-03-01-preview": [ + "2026-04-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", + "asset_name", "content_type", "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=["2026-04-01", "2026-11-01"], ) - def _create_or_update_initial( + def _execute_action_initial( self, resource_group_name: str, namespace_name: str, - policy_name: str, - resource: Union[_models.Policy, JSON, IO[bytes]], + asset_name: str, + body: Union[_models.NamespaceAssetExecuteActionRequest, _types.NamespaceAssetExecuteActionRequest, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -6488,15 +6770,15 @@ def _create_or_update_initial( content_type = content_type or "application/json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(body, (IOBase, bytes)): + _content = body else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_policies_create_or_update_request( + _request = build_namespace_assets_execute_action_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, + asset_name=asset_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -6517,7 +6799,7 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -6530,10 +6812,11 @@ def _create_or_update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: + if response.status_code == 202: response_headers["Azure-AsyncOperation"] = self._deserialize( "str", response.headers.get("Azure-AsyncOperation") ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -6544,153 +6827,150 @@ def _create_or_update_initial( return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_execute_action( self, resource_group_name: str, namespace_name: str, - policy_name: str, - resource: _models.Policy, + asset_name: str, + body: _models.NamespaceAssetExecuteActionRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Policy]: - """Create a Policy. + ) -> LROPoller[None]: + """A long-running resource action. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.Policy + :param asset_name: The name of the asset. Required. + :type asset_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.deviceregistry.models.NamespaceAssetExecuteActionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Policy] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_execute_action( self, resource_group_name: str, namespace_name: str, - policy_name: str, - resource: JSON, + asset_name: str, + body: _types.NamespaceAssetExecuteActionRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Policy]: - """Create a Policy. + ) -> LROPoller[None]: + """A long-running resource action. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON + :param asset_name: The name of the asset. Required. + :type asset_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.deviceregistry.types.NamespaceAssetExecuteActionRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Policy] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_update( + def begin_execute_action( self, resource_group_name: str, namespace_name: str, - policy_name: str, - resource: IO[bytes], + asset_name: str, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Policy]: - """Create a Policy. + ) -> LROPoller[None]: + """A long-running resource action. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] + :param asset_name: The name of the asset. Required. + :type asset_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Policy] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2026-04-01", params_added_on={ - "2026-03-01-preview": [ + "2026-04-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", + "asset_name", "content_type", "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=["2026-04-01", "2026-11-01"], ) - def begin_create_or_update( + def begin_execute_action( self, resource_group_name: str, namespace_name: str, - policy_name: str, - resource: Union[_models.Policy, JSON, IO[bytes]], + asset_name: str, + body: Union[_models.NamespaceAssetExecuteActionRequest, _types.NamespaceAssetExecuteActionRequest, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Policy]: - """Create a Policy. + ) -> LROPoller[None]: + """A long-running resource action. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param resource: Resource create parameters. Is one of the following types: Policy, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.Policy or JSON or IO[bytes] - :return: An instance of LROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Policy] + :param asset_name: The name of the asset. Required. + :type asset_name: str + :param body: The content of the action request. Is either a NamespaceAssetExecuteActionRequest + type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.deviceregistry.models.NamespaceAssetExecuteActionRequest or + ~azure.mgmt.deviceregistry.types.NamespaceAssetExecuteActionRequest or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Policy] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_update_initial( + raw_result = self._execute_action_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, - resource=resource, + asset_name=asset_name, + body=body, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -6700,12 +6980,9 @@ def begin_create_or_update( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.Policy, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -6720,32 +6997,70 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Policy].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Policy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class NamespaceDevicesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s + :attr:`namespace_devices` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", + "device_name", + "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def _delete_initial( - self, resource_group_name: str, namespace_name: str, policy_name: str, **kwargs: Any - ) -> Iterator[bytes]: + def get( + self, resource_group_name: str, namespace_name: str, device_name: str, **kwargs: Any + ) -> _models.NamespaceDevice: + """Get a NamespaceDevice. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param device_name: The name of the device. Required. + :type device_name: str + :return: NamespaceDevice. The NamespaceDevice is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.NamespaceDevice + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -6757,12 +7072,12 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceDevice] = kwargs.pop("cls", None) - _request = build_policies_delete_request( + _request = build_namespace_devices_get_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, + device_name=device_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -6774,18 +7089,19 @@ def _delete_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -6793,114 +7109,44 @@ def _delete_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NamespaceDevice, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - @api_version_validation( - method_added_on="2026-03-01-preview", - params_added_on={ - "2026-03-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "policy_name", - ] - }, - api_versions_list=["2026-03-01-preview"], - ) - def begin_delete( - self, resource_group_name: str, namespace_name: str, policy_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a Policy. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - policy_name=policy_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", + "device_name", "content_type", "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def _update_initial( + def _create_or_replace_initial( self, resource_group_name: str, namespace_name: str, - policy_name: str, - properties: Union[_models.PolicyUpdate, JSON, IO[bytes]], + device_name: str, + resource: Union[_models.NamespaceDevice, _types.NamespaceDevice, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -6919,15 +7165,15 @@ def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties + if isinstance(resource, (IOBase, bytes)): + _content = resource else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_policies_update_request( + _request = build_namespace_devices_create_or_replace_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, + device_name=device_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -6948,7 +7194,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -6961,8 +7207,10 @@ def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -6973,153 +7221,161 @@ def _update_initial( return deserialized # type: ignore @overload - def begin_update( + def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - policy_name: str, - properties: _models.PolicyUpdate, + device_name: str, + resource: _models.NamespaceDevice, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Policy]: - """Update a Policy. + ) -> LROPoller[_models.NamespaceDevice]: + """Create a NamespaceDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.deviceregistry.models.PolicyUpdate + :param device_name: The name of the device. Required. + :type device_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDevice :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Policy] + :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - policy_name: str, - properties: JSON, + device_name: str, + resource: _types.NamespaceDevice, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Policy]: - """Update a Policy. + ) -> LROPoller[_models.NamespaceDevice]: + """Create a NamespaceDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON + :param device_name: The name of the device. Required. + :type device_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.types.NamespaceDevice :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Policy] + :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - policy_name: str, - properties: IO[bytes], + device_name: str, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.Policy]: - """Update a Policy. + ) -> LROPoller[_models.NamespaceDevice]: + """Create a NamespaceDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] + :param device_name: The name of the device. Required. + :type device_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Policy] + :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", + "device_name", "content_type", "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def begin_update( + def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - policy_name: str, - properties: Union[_models.PolicyUpdate, JSON, IO[bytes]], + device_name: str, + resource: Union[_models.NamespaceDevice, _types.NamespaceDevice, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Policy]: - """Update a Policy. + ) -> LROPoller[_models.NamespaceDevice]: + """Create a NamespaceDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param properties: The resource properties to be updated. Is one of the following types: - PolicyUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.PolicyUpdate or JSON or IO[bytes] - :return: An instance of LROPoller that returns Policy. The Policy is compatible with - MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.Policy] - :raises ~azure.core.exceptions.HttpResponseError: + :param device_name: The name of the device. Required. + :type device_name: str + :param resource: Resource create parameters. Is either a NamespaceDevice type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDevice or + ~azure.mgmt.deviceregistry.types.NamespaceDevice or IO[bytes] + :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Policy] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceDevice] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, - properties=properties, + device_name=device_name, + resource=resource, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -7131,7 +7387,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.Policy, response.json()) + deserialized = _deserialize(_models.NamespaceDevice, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -7149,137 +7405,45 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.Policy].from_continuation_token( + return LROPoller[_models.NamespaceDevice].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.Policy]( + return LROPoller[_models.NamespaceDevice]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @distributed_trace - @api_version_validation( - method_added_on="2026-03-01-preview", - params_added_on={ - "2026-03-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] - }, - api_versions_list=["2026-03-01-preview"], - ) - def list_by_resource_group( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> ItemPaged["_models.Policy"]: - """List Policy resources by Credential. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :return: An iterator like instance of Policy - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.Policy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Policy]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_policies_list_by_resource_group_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Policy], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", + "device_name", + "content_type", + "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def _revoke_issuer_initial( - self, resource_group_name: str, namespace_name: str, policy_name: str, **kwargs: Any + def _update_initial( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + properties: Union[_models.NamespaceDeviceUpdate, _types.NamespaceDeviceUpdate, IO[bytes]], + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7289,17 +7453,27 @@ def _revoke_issuer_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_policies_revoke_issuer_request( + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_namespace_devices_update_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, + device_name=device_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -7316,7 +7490,7 @@ def _revoke_issuer_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -7340,48 +7514,163 @@ def _revoke_issuer_initial( return deserialized # type: ignore + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + properties: _models.NamespaceDeviceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NamespaceDevice]: + """Update a NamespaceDevice. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param device_name: The name of the device. Required. + :type device_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDeviceUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + properties: _types.NamespaceDeviceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NamespaceDevice]: + """Update a NamespaceDevice. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param device_name: The name of the device. Required. + :type device_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.types.NamespaceDeviceUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NamespaceDevice]: + """Update a NamespaceDevice. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param device_name: The name of the device. Required. + :type device_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", + "device_name", + "content_type", + "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def begin_revoke_issuer( - self, resource_group_name: str, namespace_name: str, policy_name: str, **kwargs: Any - ) -> LROPoller[None]: - """A long-running resource action. + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + device_name: str, + properties: Union[_models.NamespaceDeviceUpdate, _types.NamespaceDeviceUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.NamespaceDevice]: + """Update a NamespaceDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param device_name: The name of the device. Required. + :type device_name: str + :param properties: The resource properties to be updated. Is either a NamespaceDeviceUpdate + type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDeviceUpdate or + ~azure.mgmt.deviceregistry.types.NamespaceDeviceUpdate or IO[bytes] + :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NamespaceDevice] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._revoke_issuer_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, + device_name=device_name, + properties=properties, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -7390,9 +7679,12 @@ def begin_revoke_issuer( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.NamespaceDevice, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -7407,35 +7699,38 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.NamespaceDevice].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return LROPoller[_models.NamespaceDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", - "content_type", + "device_name", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def _activate_bring_your_own_root_initial( - self, - resource_group_name: str, - namespace_name: str, - policy_name: str, - body: Union[_models.ActivateBringYourOwnRootRequest, JSON, IO[bytes]], - **kwargs: Any + def _delete_initial( + self, resource_group_name: str, namespace_name: str, device_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -7445,27 +7740,17 @@ def _activate_bring_your_own_root_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_policies_activate_bring_your_own_root_request( + _request = build_namespace_devices_delete_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, + device_name=device_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -7506,155 +7791,55 @@ def _activate_bring_your_own_root_initial( return deserialized # type: ignore - @overload - def begin_activate_bring_your_own_root( - self, - resource_group_name: str, - namespace_name: str, - policy_name: str, - body: _models.ActivateBringYourOwnRootRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Activates or renews a Bring Your Own Root policy by accepting a customer-provided signed - certificate. This is a long-running operation that returns no content upon completion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.deviceregistry.models.ActivateBringYourOwnRootRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_activate_bring_your_own_root( - self, - resource_group_name: str, - namespace_name: str, - policy_name: str, - body: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Activates or renews a Bring Your Own Root policy by accepting a customer-provided signed - certificate. This is a long-running operation that returns no content upon completion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param body: The content of the action request. Required. - :type body: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_activate_bring_your_own_root( - self, - resource_group_name: str, - namespace_name: str, - policy_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Activates or renews a Bring Your Own Root policy by accepting a customer-provided signed - certificate. This is a long-running operation that returns no content upon completion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param body: The content of the action request. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2025-07-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2025-07-01-preview": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "policy_name", - "content_type", + "device_name", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def begin_activate_bring_your_own_root( - self, - resource_group_name: str, - namespace_name: str, - policy_name: str, - body: Union[_models.ActivateBringYourOwnRootRequest, JSON, IO[bytes]], - **kwargs: Any + def begin_delete( + self, resource_group_name: str, namespace_name: str, device_name: str, **kwargs: Any ) -> LROPoller[None]: - """Activates or renews a Bring Your Own Root policy by accepting a customer-provided signed - certificate. This is a long-running operation that returns no content upon completion. + """Delete a NamespaceDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param policy_name: The name of the Policy proxy resource. Required. - :type policy_name: str - :param body: The content of the action request. Is one of the following types: - ActivateBringYourOwnRootRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.deviceregistry.models.ActivateBringYourOwnRootRequest or JSON or - IO[bytes] + :param device_name: The name of the device. Required. + :type device_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._activate_bring_your_own_root_initial( + raw_result = self._delete_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - policy_name=policy_name, - body=body, - content_type=content_type, + device_name=device_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -7688,55 +7873,40 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - -class NamespaceAssetsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s - :attr:`namespace_assets` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace @api_version_validation( method_added_on="2025-07-01-preview", params_added_on={ - "2025-07-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "asset_name", - "accept", - ] + "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def get( - self, resource_group_name: str, namespace_name: str, asset_name: str, **kwargs: Any - ) -> _models.NamespaceAsset: - """Get a NamespaceAsset. + def list_by_namespace( + self, resource_group_name: str, namespace_name: str, **kwargs: Any + ) -> ItemPaged["_models.NamespaceDevice"]: + """List NamespaceDevice resources by Namespace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str - :return: NamespaceAsset. The NamespaceAsset is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.NamespaceAsset + :return: An iterator like instance of NamespaceDevice + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.NamespaceDevice] :raises ~azure.core.exceptions.HttpResponseError: """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NamespaceDevice]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -7745,26 +7915,165 @@ def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + def prepare_request(next_link=None): + if not next_link: - cls: ClsType[_models.NamespaceAsset] = kwargs.pop("cls", None) + _request = build_namespace_devices_list_by_namespace_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _request = build_namespace_assets_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - asset_name=asset_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _decompress = kwargs.pop("decompress", True) + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NamespaceDevice], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NamespaceDiscoveredAssetsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s + :attr:`namespace_discovered_assets` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2025-07-01-preview", + params_added_on={ + "2025-07-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "discovered_asset_name", + "accept", + ] + }, + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + def get( + self, resource_group_name: str, namespace_name: str, discovered_asset_name: str, **kwargs: Any + ) -> _models.NamespaceDiscoveredAsset: + """Get a NamespaceDiscoveredAsset. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str + :return: NamespaceDiscoveredAsset. The NamespaceDiscoveredAsset is compatible with + MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NamespaceDiscoveredAsset] = kwargs.pop("cls", None) + + _request = build_namespace_discovered_assets_get_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + discovered_asset_name=discovered_asset_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs @@ -7788,7 +8097,7 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.NamespaceAsset, response.json()) + deserialized = _deserialize(_models.NamespaceDiscoveredAsset, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -7803,19 +8112,26 @@ def get( "subscription_id", "resource_group_name", "namespace_name", - "asset_name", + "discovered_asset_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def _create_or_replace_initial( self, resource_group_name: str, namespace_name: str, - asset_name: str, - resource: Union[_models.NamespaceAsset, JSON, IO[bytes]], + discovered_asset_name: str, + resource: Union[_models.NamespaceDiscoveredAsset, _types.NamespaceDiscoveredAsset, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -7839,10 +8155,10 @@ def _create_or_replace_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_namespace_assets_create_or_replace_request( + _request = build_namespace_discovered_assets_create_or_replace_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - asset_name=asset_name, + discovered_asset_name=discovered_asset_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -7894,29 +8210,30 @@ def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - asset_name: str, - resource: _models.NamespaceAsset, + discovered_asset_name: str, + resource: _models.NamespaceDiscoveredAsset, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceAsset]: - """Create a NamespaceAsset. + ) -> LROPoller[_models.NamespaceDiscoveredAsset]: + """Create a NamespaceDiscoveredAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceAsset + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -7925,29 +8242,30 @@ def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - asset_name: str, - resource: JSON, + discovered_asset_name: str, + resource: _types.NamespaceDiscoveredAsset, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceAsset]: - """Create a NamespaceAsset. + ) -> LROPoller[_models.NamespaceDiscoveredAsset]: + """Create a NamespaceDiscoveredAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredAsset :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -7956,29 +8274,30 @@ def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - asset_name: str, + discovered_asset_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceAsset]: - """Create a NamespaceAsset. + ) -> LROPoller[_models.NamespaceDiscoveredAsset]: + """Create a NamespaceDiscoveredAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -7991,43 +8310,52 @@ def begin_create_or_replace( "subscription_id", "resource_group_name", "namespace_name", - "asset_name", + "discovered_asset_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - asset_name: str, - resource: Union[_models.NamespaceAsset, JSON, IO[bytes]], + discovered_asset_name: str, + resource: Union[_models.NamespaceDiscoveredAsset, _types.NamespaceDiscoveredAsset, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.NamespaceAsset]: - """Create a NamespaceAsset. + ) -> LROPoller[_models.NamespaceDiscoveredAsset]: + """Create a NamespaceDiscoveredAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str - :param resource: Resource create parameters. Is one of the following types: NamespaceAsset, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceAsset or JSON or IO[bytes] - :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str + :param resource: Resource create parameters. Is either a NamespaceDiscoveredAsset type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset or + ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredAsset or IO[bytes] + :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceAsset] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceDiscoveredAsset] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -8035,7 +8363,7 @@ def begin_create_or_replace( raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - asset_name=asset_name, + discovered_asset_name=discovered_asset_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -8048,7 +8376,7 @@ def begin_create_or_replace( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceAsset, response.json()) + deserialized = _deserialize(_models.NamespaceDiscoveredAsset, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -8066,13 +8394,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.NamespaceAsset].from_continuation_token( + return LROPoller[_models.NamespaceDiscoveredAsset].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.NamespaceAsset]( + return LROPoller[_models.NamespaceDiscoveredAsset]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -8084,19 +8412,26 @@ def get_long_running_output(pipeline_response): "subscription_id", "resource_group_name", "namespace_name", - "asset_name", + "discovered_asset_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def _update_initial( self, resource_group_name: str, namespace_name: str, - asset_name: str, - properties: Union[_models.NamespaceAssetUpdate, JSON, IO[bytes]], + discovered_asset_name: str, + properties: Union[_models.NamespaceDiscoveredAssetUpdate, _types.NamespaceDiscoveredAssetUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -8120,10 +8455,10 @@ def _update_initial( else: _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_namespace_assets_update_request( + _request = build_namespace_discovered_assets_update_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - asset_name=asset_name, + discovered_asset_name=discovered_asset_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -8173,29 +8508,30 @@ def begin_update( self, resource_group_name: str, namespace_name: str, - asset_name: str, - properties: _models.NamespaceAssetUpdate, + discovered_asset_name: str, + properties: _models.NamespaceDiscoveredAssetUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceAsset]: - """Update a NamespaceAsset. + ) -> LROPoller[_models.NamespaceDiscoveredAsset]: + """Update a NamespaceDiscoveredAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceAssetUpdate + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAssetUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8204,29 +8540,30 @@ def begin_update( self, resource_group_name: str, namespace_name: str, - asset_name: str, - properties: JSON, + discovered_asset_name: str, + properties: _types.NamespaceDiscoveredAssetUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceAsset]: - """Update a NamespaceAsset. + ) -> LROPoller[_models.NamespaceDiscoveredAsset]: + """Update a NamespaceDiscoveredAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredAssetUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8235,29 +8572,30 @@ def begin_update( self, resource_group_name: str, namespace_name: str, - asset_name: str, + discovered_asset_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceAsset]: - """Update a NamespaceAsset. + ) -> LROPoller[_models.NamespaceDiscoveredAsset]: + """Update a NamespaceDiscoveredAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str :param properties: The resource properties to be updated. Required. :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8270,43 +8608,52 @@ def begin_update( "subscription_id", "resource_group_name", "namespace_name", - "asset_name", + "discovered_asset_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def begin_update( self, resource_group_name: str, namespace_name: str, - asset_name: str, - properties: Union[_models.NamespaceAssetUpdate, JSON, IO[bytes]], + discovered_asset_name: str, + properties: Union[_models.NamespaceDiscoveredAssetUpdate, _types.NamespaceDiscoveredAssetUpdate, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.NamespaceAsset]: - """Update a NamespaceAsset. + ) -> LROPoller[_models.NamespaceDiscoveredAsset]: + """Update a NamespaceDiscoveredAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str - :param properties: The resource properties to be updated. Is one of the following types: - NamespaceAssetUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceAssetUpdate or JSON or IO[bytes] - :return: An instance of LROPoller that returns NamespaceAsset. The NamespaceAsset is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str + :param properties: The resource properties to be updated. Is either a + NamespaceDiscoveredAssetUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAssetUpdate or + ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredAssetUpdate or IO[bytes] + :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The + NamespaceDiscoveredAsset is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceAsset] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceDiscoveredAsset] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -8314,7 +8661,7 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - asset_name=asset_name, + discovered_asset_name=discovered_asset_name, properties=properties, content_type=content_type, cls=lambda x, y, z: x, @@ -8327,7 +8674,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceAsset, response.json()) + deserialized = _deserialize(_models.NamespaceDiscoveredAsset, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -8345,13 +8692,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.NamespaceAsset].from_continuation_token( + return LROPoller[_models.NamespaceDiscoveredAsset].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.NamespaceAsset]( + return LROPoller[_models.NamespaceDiscoveredAsset]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -8363,13 +8710,20 @@ def get_long_running_output(pipeline_response): "subscription_id", "resource_group_name", "namespace_name", - "asset_name", + "discovered_asset_name", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def _delete_initial( - self, resource_group_name: str, namespace_name: str, asset_name: str, **kwargs: Any + self, resource_group_name: str, namespace_name: str, discovered_asset_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8384,10 +8738,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_namespace_assets_delete_request( + _request = build_namespace_discovered_assets_delete_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - asset_name=asset_name, + discovered_asset_name=discovered_asset_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -8439,23 +8793,30 @@ def _delete_initial( "subscription_id", "resource_group_name", "namespace_name", - "asset_name", + "discovered_asset_name", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def begin_delete( - self, resource_group_name: str, namespace_name: str, asset_name: str, **kwargs: Any + self, resource_group_name: str, namespace_name: str, discovered_asset_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a NamespaceAsset. + """Delete a NamespaceDiscoveredAsset. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param asset_name: The name of the asset. Required. - :type asset_name: str + :param discovered_asset_name: The name of the discovered asset. Required. + :type discovered_asset_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -8471,7 +8832,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - asset_name=asset_name, + discovered_asset_name=discovered_asset_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -8511,26 +8872,34 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={ "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def list_by_resource_group( + def list_by_namespace( self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> ItemPaged["_models.NamespaceAsset"]: - """List NamespaceAsset resources by Namespace. + ) -> ItemPaged["_models.NamespaceDiscoveredAsset"]: + """List NamespaceDiscoveredAsset resources by Namespace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :return: An iterator like instance of NamespaceAsset - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.NamespaceAsset] + :return: An iterator like instance of NamespaceDiscoveredAsset + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.NamespaceAsset]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.NamespaceDiscoveredAsset]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -8543,7 +8912,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_namespace_assets_list_by_resource_group_request( + _request = build_namespace_discovered_assets_list_by_namespace_request( resource_group_name=resource_group_name, namespace_name=namespace_name, subscription_id=self._config.subscription_id, @@ -8569,7 +8938,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -8583,7 +8955,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.NamespaceAsset], + List[_models.NamespaceDiscoveredAsset], deserialized.get("value", []), ) if cls: @@ -8612,14 +8984,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class NamespaceDevicesOperations: +class NamespaceDiscoveredDevicesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s - :attr:`namespace_devices` attribute. + :attr:`namespace_discovered_devices` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -8638,26 +9010,34 @@ def __init__(self, *args, **kwargs) -> None: "subscription_id", "resource_group_name", "namespace_name", - "device_name", + "discovered_device_name", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def get( - self, resource_group_name: str, namespace_name: str, device_name: str, **kwargs: Any - ) -> _models.NamespaceDevice: - """Get a NamespaceDevice. + self, resource_group_name: str, namespace_name: str, discovered_device_name: str, **kwargs: Any + ) -> _models.NamespaceDiscoveredDevice: + """Get a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str - :return: NamespaceDevice. The NamespaceDevice is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.NamespaceDevice + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str + :return: NamespaceDiscoveredDevice. The NamespaceDiscoveredDevice is compatible with + MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -8671,12 +9051,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.NamespaceDevice] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceDiscoveredDevice] = kwargs.pop("cls", None) - _request = build_namespace_devices_get_request( + _request = build_namespace_discovered_devices_get_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - device_name=device_name, + discovered_device_name=discovered_device_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -8711,7 +9091,7 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.NamespaceDevice, response.json()) + deserialized = _deserialize(_models.NamespaceDiscoveredDevice, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -8726,19 +9106,26 @@ def get( "subscription_id", "resource_group_name", "namespace_name", - "device_name", + "discovered_device_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def _create_or_replace_initial( self, resource_group_name: str, namespace_name: str, - device_name: str, - resource: Union[_models.NamespaceDevice, JSON, IO[bytes]], + discovered_device_name: str, + resource: Union[_models.NamespaceDiscoveredDevice, _types.NamespaceDiscoveredDevice, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -8762,10 +9149,10 @@ def _create_or_replace_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_namespace_devices_create_or_replace_request( + _request = build_namespace_discovered_devices_create_or_replace_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - device_name=device_name, + discovered_device_name=discovered_device_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -8817,29 +9204,30 @@ def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - device_name: str, - resource: _models.NamespaceDevice, + discovered_device_name: str, + resource: _models.NamespaceDiscoveredDevice, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceDevice]: - """Create a NamespaceDevice. + ) -> LROPoller[_models.NamespaceDiscoveredDevice]: + """Create a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDevice + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8848,29 +9236,30 @@ def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - device_name: str, - resource: JSON, + discovered_device_name: str, + resource: _types.NamespaceDiscoveredDevice, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceDevice]: - """Create a NamespaceDevice. + ) -> LROPoller[_models.NamespaceDiscoveredDevice]: + """Create a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredDevice :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8879,29 +9268,30 @@ def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - device_name: str, + discovered_device_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceDevice]: - """Create a NamespaceDevice. + ) -> LROPoller[_models.NamespaceDiscoveredDevice]: + """Create a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -8914,43 +9304,52 @@ def begin_create_or_replace( "subscription_id", "resource_group_name", "namespace_name", - "device_name", + "discovered_device_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - device_name: str, - resource: Union[_models.NamespaceDevice, JSON, IO[bytes]], + discovered_device_name: str, + resource: Union[_models.NamespaceDiscoveredDevice, _types.NamespaceDiscoveredDevice, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.NamespaceDevice]: - """Create a NamespaceDevice. + ) -> LROPoller[_models.NamespaceDiscoveredDevice]: + """Create a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str - :param resource: Resource create parameters. Is one of the following types: NamespaceDevice, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDevice or JSON or IO[bytes] - :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str + :param resource: Resource create parameters. Is either a NamespaceDiscoveredDevice type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice or + ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredDevice or IO[bytes] + :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceDevice] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceDiscoveredDevice] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -8958,7 +9357,7 @@ def begin_create_or_replace( raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - device_name=device_name, + discovered_device_name=discovered_device_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -8971,7 +9370,7 @@ def begin_create_or_replace( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceDevice, response.json()) + deserialized = _deserialize(_models.NamespaceDiscoveredDevice, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -8989,13 +9388,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.NamespaceDevice].from_continuation_token( + return LROPoller[_models.NamespaceDiscoveredDevice].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.NamespaceDevice]( + return LROPoller[_models.NamespaceDiscoveredDevice]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -9007,19 +9406,26 @@ def get_long_running_output(pipeline_response): "subscription_id", "resource_group_name", "namespace_name", - "device_name", + "discovered_device_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def _update_initial( self, resource_group_name: str, namespace_name: str, - device_name: str, - properties: Union[_models.NamespaceDeviceUpdate, JSON, IO[bytes]], + discovered_device_name: str, + properties: Union[_models.NamespaceDiscoveredDeviceUpdate, _types.NamespaceDiscoveredDeviceUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -9043,10 +9449,10 @@ def _update_initial( else: _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_namespace_devices_update_request( + _request = build_namespace_discovered_devices_update_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - device_name=device_name, + discovered_device_name=discovered_device_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -9096,29 +9502,30 @@ def begin_update( self, resource_group_name: str, namespace_name: str, - device_name: str, - properties: _models.NamespaceDeviceUpdate, + discovered_device_name: str, + properties: _models.NamespaceDiscoveredDeviceUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceDevice]: - """Update a NamespaceDevice. + ) -> LROPoller[_models.NamespaceDiscoveredDevice]: + """Update a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDeviceUpdate + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDeviceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9127,29 +9534,30 @@ def begin_update( self, resource_group_name: str, namespace_name: str, - device_name: str, - properties: JSON, + discovered_device_name: str, + properties: _types.NamespaceDiscoveredDeviceUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceDevice]: - """Update a NamespaceDevice. + ) -> LROPoller[_models.NamespaceDiscoveredDevice]: + """Update a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str :param properties: The resource properties to be updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredDeviceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9158,29 +9566,30 @@ def begin_update( self, resource_group_name: str, namespace_name: str, - device_name: str, + discovered_device_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceDevice]: - """Update a NamespaceDevice. + ) -> LROPoller[_models.NamespaceDiscoveredDevice]: + """Update a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str :param properties: The resource properties to be updated. Required. :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -9193,43 +9602,52 @@ def begin_update( "subscription_id", "resource_group_name", "namespace_name", - "device_name", + "discovered_device_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def begin_update( self, resource_group_name: str, namespace_name: str, - device_name: str, - properties: Union[_models.NamespaceDeviceUpdate, JSON, IO[bytes]], + discovered_device_name: str, + properties: Union[_models.NamespaceDiscoveredDeviceUpdate, _types.NamespaceDiscoveredDeviceUpdate, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.NamespaceDevice]: - """Update a NamespaceDevice. + ) -> LROPoller[_models.NamespaceDiscoveredDevice]: + """Update a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str - :param properties: The resource properties to be updated. Is one of the following types: - NamespaceDeviceUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDeviceUpdate or JSON or IO[bytes] - :return: An instance of LROPoller that returns NamespaceDevice. The NamespaceDevice is - compatible with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str + :param properties: The resource properties to be updated. Is either a + NamespaceDiscoveredDeviceUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDeviceUpdate or + ~azure.mgmt.deviceregistry.types.NamespaceDiscoveredDeviceUpdate or IO[bytes] + :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The + NamespaceDiscoveredDevice is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceDevice] = kwargs.pop("cls", None) + cls: ClsType[_models.NamespaceDiscoveredDevice] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -9237,7 +9655,7 @@ def begin_update( raw_result = self._update_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - device_name=device_name, + discovered_device_name=discovered_device_name, properties=properties, content_type=content_type, cls=lambda x, y, z: x, @@ -9250,7 +9668,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceDevice, response.json()) + deserialized = _deserialize(_models.NamespaceDiscoveredDevice, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -9268,13 +9686,13 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.NamespaceDevice].from_continuation_token( + return LROPoller[_models.NamespaceDiscoveredDevice].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.NamespaceDevice]( + return LROPoller[_models.NamespaceDiscoveredDevice]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @@ -9286,13 +9704,20 @@ def get_long_running_output(pipeline_response): "subscription_id", "resource_group_name", "namespace_name", - "device_name", + "discovered_device_name", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def _delete_initial( - self, resource_group_name: str, namespace_name: str, device_name: str, **kwargs: Any + self, resource_group_name: str, namespace_name: str, discovered_device_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9307,10 +9732,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_namespace_devices_delete_request( + _request = build_namespace_discovered_devices_delete_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - device_name=device_name, + discovered_device_name=discovered_device_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -9362,23 +9787,30 @@ def _delete_initial( "subscription_id", "resource_group_name", "namespace_name", - "device_name", + "discovered_device_name", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def begin_delete( - self, resource_group_name: str, namespace_name: str, device_name: str, **kwargs: Any + self, resource_group_name: str, namespace_name: str, discovered_device_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a NamespaceDevice. + """Delete a NamespaceDiscoveredDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str + :param discovered_device_name: The name of the discovered device. Required. + :type discovered_device_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -9394,7 +9826,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - device_name=device_name, + discovered_device_name=discovered_device_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -9434,26 +9866,34 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- params_added_on={ "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def list_by_resource_group( + def list_by_namespace( self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> ItemPaged["_models.NamespaceDevice"]: - """List NamespaceDevice resources by Namespace. + ) -> ItemPaged["_models.NamespaceDiscoveredDevice"]: + """List NamespaceDiscoveredDevice resources by Namespace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :return: An iterator like instance of NamespaceDevice - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.NamespaceDevice] + :return: An iterator like instance of NamespaceDiscoveredDevice + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.NamespaceDevice]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.NamespaceDiscoveredDevice]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -9466,7 +9906,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_namespace_devices_list_by_resource_group_request( + _request = build_namespace_discovered_devices_list_by_namespace_request( resource_group_name=resource_group_name, namespace_name=namespace_name, subscription_id=self._config.subscription_id, @@ -9492,7 +9932,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -9506,7 +9949,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.NamespaceDevice], + List[_models.NamespaceDiscoveredDevice], deserialized.get("value", []), ) if cls: @@ -9534,29 +9977,58 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) + +class SchemaRegistriesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s + :attr:`schema_registries` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2024-09-01-preview": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "device_name", - "content_type", + "schema_registry_name", "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def _revoke_initial( - self, - resource_group_name: str, - namespace_name: str, - device_name: str, - body: Union[_models.DeviceCredentialsRevokeRequest, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + def get(self, resource_group_name: str, schema_registry_name: str, **kwargs: Any) -> _models.SchemaRegistry: + """Get a SchemaRegistry. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :return: SchemaRegistry. The SchemaRegistry is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.SchemaRegistry + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -9565,27 +10037,16 @@ def _revoke_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.SchemaRegistry] = kwargs.pop("cls", None) - _request = build_namespace_devices_revoke_request( + _request = build_schema_registries_get_request( resource_group_name=resource_group_name, - namespace_name=namespace_name, - device_name=device_name, + schema_registry_name=schema_registry_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -9595,18 +10056,19 @@ def _revoke_initial( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = kwargs.pop("stream", False) pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -9614,166 +10076,258 @@ def _revoke_initial( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SchemaRegistry, response.json()) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @overload - def begin_revoke( + @api_version_validation( + method_added_on="2024-09-01-preview", + params_added_on={ + "2024-09-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "schema_registry_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + def _create_or_replace_initial( self, resource_group_name: str, - namespace_name: str, - device_name: str, - body: _models.DeviceCredentialsRevokeRequest, + schema_registry_name: str, + resource: Union[_models.SchemaRegistry, _types.SchemaRegistry, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_schema_registries_create_or_replace_request( + resource_group_name=resource_group_name, + schema_registry_name=schema_registry_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + resource: _models.SchemaRegistry, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """A long-running resource action. + ) -> LROPoller[_models.SchemaRegistry]: + """Create a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str - :param body: The content of the action request. Required. - :type body: ~azure.mgmt.deviceregistry.models.DeviceCredentialsRevokeRequest + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.models.SchemaRegistry :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_revoke( + def begin_create_or_replace( self, resource_group_name: str, - namespace_name: str, - device_name: str, - body: JSON, + schema_registry_name: str, + resource: _types.SchemaRegistry, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """A long-running resource action. + ) -> LROPoller[_models.SchemaRegistry]: + """Create a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str - :param body: The content of the action request. Required. - :type body: JSON + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.types.SchemaRegistry :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_revoke( + def begin_create_or_replace( self, resource_group_name: str, - namespace_name: str, - device_name: str, - body: IO[bytes], + schema_registry_name: str, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[None]: - """A long-running resource action. + ) -> LROPoller[_models.SchemaRegistry]: + """Create a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str - :param body: The content of the action request. Required. - :type body: IO[bytes] + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2026-03-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2026-03-01-preview": [ + "2024-09-01-preview": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "device_name", + "schema_registry_name", "content_type", "accept", ] }, - api_versions_list=["2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def begin_revoke( + def begin_create_or_replace( self, resource_group_name: str, - namespace_name: str, - device_name: str, - body: Union[_models.DeviceCredentialsRevokeRequest, JSON, IO[bytes]], + schema_registry_name: str, + resource: Union[_models.SchemaRegistry, _types.SchemaRegistry, IO[bytes]], **kwargs: Any - ) -> LROPoller[None]: - """A long-running resource action. + ) -> LROPoller[_models.SchemaRegistry]: + """Create a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param device_name: The name of the device. Required. - :type device_name: str - :param body: The content of the action request. Is one of the following types: - DeviceCredentialsRevokeRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.deviceregistry.models.DeviceCredentialsRevokeRequest or JSON or - IO[bytes] - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param resource: Resource create parameters. Is either a SchemaRegistry type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.SchemaRegistry or + ~azure.mgmt.deviceregistry.types.SchemaRegistry or IO[bytes] + :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.SchemaRegistry] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._revoke_initial( + raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, - namespace_name=namespace_name, - device_name=device_name, - body=body, + schema_registry_name=schema_registry_name, + resource=resource, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -9783,9 +10337,12 @@ def begin_revoke( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SchemaRegistry, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -9800,143 +10357,43 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.SchemaRegistry].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - -class NamespaceDiscoveredAssetsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s - :attr:`namespace_discovered_assets` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return LROPoller[_models.SchemaRegistry]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @distributed_trace @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2025-07-01-preview": [ + "2024-09-01-preview": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "discovered_asset_name", + "schema_registry_name", + "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def get( - self, resource_group_name: str, namespace_name: str, discovered_asset_name: str, **kwargs: Any - ) -> _models.NamespaceDiscoveredAsset: - """Get a NamespaceDiscoveredAsset. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :return: NamespaceDiscoveredAsset. The NamespaceDiscoveredAsset is compatible with - MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.NamespaceDiscoveredAsset] = kwargs.pop("cls", None) - - _request = build_namespace_discovered_assets_get_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - discovered_asset_name=discovered_asset_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.NamespaceDiscoveredAsset, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @api_version_validation( - method_added_on="2025-07-01-preview", - params_added_on={ - "2025-07-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "discovered_asset_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], - ) - def _create_or_replace_initial( + def _update_initial( self, resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - resource: Union[_models.NamespaceDiscoveredAsset, JSON, IO[bytes]], + schema_registry_name: str, + properties: Union[_models.SchemaRegistryUpdate, _types.SchemaRegistryUpdate, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -9955,15 +10412,14 @@ def _create_or_replace_initial( content_type = content_type or "application/json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(properties, (IOBase, bytes)): + _content = properties else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_namespace_discovered_assets_create_or_replace_request( + _request = build_schema_registries_update_request( resource_group_name=resource_group_name, - namespace_name=namespace_name, - discovered_asset_name=discovered_asset_name, + schema_registry_name=schema_registry_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -9984,7 +10440,7 @@ def _create_or_replace_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -9997,10 +10453,8 @@ def _create_or_replace_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -10011,157 +10465,148 @@ def _create_or_replace_initial( return deserialized # type: ignore @overload - def begin_create_or_replace( + def begin_update( self, resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - resource: _models.NamespaceDiscoveredAsset, + schema_registry_name: str, + properties: _models.SchemaRegistryUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredAsset]: - """Create a NamespaceDiscoveredAsset. + ) -> LROPoller[_models.SchemaRegistry]: + """Update a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.models.SchemaRegistryUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_replace( + def begin_update( self, resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - resource: JSON, + schema_registry_name: str, + properties: _types.SchemaRegistryUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredAsset]: - """Create a NamespaceDiscoveredAsset. + ) -> LROPoller[_models.SchemaRegistry]: + """Update a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.types.SchemaRegistryUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_replace( + def begin_update( self, resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - resource: IO[bytes], + schema_registry_name: str, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredAsset]: - """Create a NamespaceDiscoveredAsset. + ) -> LROPoller[_models.SchemaRegistry]: + """Update a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2025-07-01-preview": [ + "2024-09-01-preview": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "discovered_asset_name", + "schema_registry_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def begin_create_or_replace( + def begin_update( self, resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - resource: Union[_models.NamespaceDiscoveredAsset, JSON, IO[bytes]], + schema_registry_name: str, + properties: Union[_models.SchemaRegistryUpdate, _types.SchemaRegistryUpdate, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredAsset]: - """Create a NamespaceDiscoveredAsset. + ) -> LROPoller[_models.SchemaRegistry]: + """Update a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param resource: Resource create parameters. Is one of the following types: - NamespaceDiscoveredAsset, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset or JSON or IO[bytes] - :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param properties: The resource properties to be updated. Is either a SchemaRegistryUpdate type + or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.SchemaRegistryUpdate or + ~azure.mgmt.deviceregistry.types.SchemaRegistryUpdate or IO[bytes] + :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceDiscoveredAsset] = kwargs.pop("cls", None) + cls: ClsType[_models.SchemaRegistry] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_replace_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, - namespace_name=namespace_name, - discovered_asset_name=discovered_asset_name, - resource=resource, + schema_registry_name=schema_registry_name, + properties=properties, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -10173,7 +10618,7 @@ def begin_create_or_replace( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceDiscoveredAsset, response.json()) + deserialized = _deserialize(_models.SchemaRegistry, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -10191,39 +10636,32 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.NamespaceDiscoveredAsset].from_continuation_token( + return LROPoller[_models.SchemaRegistry].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.NamespaceDiscoveredAsset]( + return LROPoller[_models.SchemaRegistry]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2025-07-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "discovered_asset_name", - "content_type", - "accept", - ] + "2024-09-01-preview": ["api_version", "subscription_id", "resource_group_name", "schema_registry_name"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], - ) - def _update_initial( - self, - resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - properties: Union[_models.NamespaceDiscoveredAssetUpdate, JSON, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + def _delete_initial(self, resource_group_name: str, schema_registry_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -10232,27 +10670,16 @@ def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_namespace_discovered_assets_update_request( + _request = build_schema_registries_delete_request( resource_group_name=resource_group_name, - namespace_name=namespace_name, - discovered_asset_name=discovered_asset_name, + schema_registry_name=schema_registry_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -10269,7 +10696,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -10293,160 +10720,45 @@ def _update_initial( return deserialized # type: ignore - @overload - def begin_update( - self, - resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - properties: _models.NamespaceDiscoveredAssetUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredAsset]: - """Update a NamespaceDiscoveredAsset. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAssetUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredAsset]: - """Update a NamespaceDiscoveredAsset. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredAsset]: - """Update a NamespaceDiscoveredAsset. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2025-07-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "discovered_asset_name", - "content_type", - "accept", - ] + "2024-09-01-preview": ["api_version", "subscription_id", "resource_group_name", "schema_registry_name"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def begin_update( - self, - resource_group_name: str, - namespace_name: str, - discovered_asset_name: str, - properties: Union[_models.NamespaceDiscoveredAssetUpdate, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredAsset]: - """Update a NamespaceDiscoveredAsset. + def begin_delete(self, resource_group_name: str, schema_registry_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete a SchemaRegistry. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :param properties: The resource properties to be updated. Is one of the following types: - NamespaceDiscoveredAssetUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAssetUpdate or JSON or - IO[bytes] - :return: An instance of LROPoller that returns NamespaceDiscoveredAsset. The - NamespaceDiscoveredAsset is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceDiscoveredAsset] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._delete_initial( resource_group_name=resource_group_name, - namespace_name=namespace_name, - discovered_asset_name=discovered_asset_name, - properties=properties, - content_type=content_type, + schema_registry_name=schema_registry_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -10455,12 +10767,9 @@ def begin_update( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceDiscoveredAsset, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -10475,32 +10784,43 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.NamespaceDiscoveredAsset].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.NamespaceDiscoveredAsset]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + @distributed_trace @api_version_validation( - method_added_on="2025-07-01-preview", - params_added_on={ - "2025-07-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "discovered_asset_name", - ] - }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + method_added_on="2024-09-01-preview", + params_added_on={"2024-09-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def _delete_initial( - self, resource_group_name: str, namespace_name: str, discovered_asset_name: str, **kwargs: Any - ) -> Iterator[bytes]: + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.SchemaRegistry"]: + """List SchemaRegistry resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of SchemaRegistry + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SchemaRegistry]] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -10509,159 +10829,104 @@ def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + def prepare_request(next_link=None): + if not next_link: - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + _request = build_schema_registries_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - _request = build_namespace_discovered_assets_delete_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - discovered_asset_name=discovered_asset_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - response = pipeline_response.http_response + return _request - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SchemaRegistry], + deserialized.get("value", []), ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) - - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2025-07-01-preview", - params_added_on={ - "2025-07-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "discovered_asset_name", - ] - }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], - ) - def begin_delete( - self, resource_group_name: str, namespace_name: str, discovered_asset_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a NamespaceDiscoveredAsset. + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_asset_name: The name of the discovered asset. Required. - :type discovered_asset_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} + def get_next(next_link=None): + _request = prepare_request(next_link) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - namespace_name=namespace_name, - discovered_asset_name=discovered_asset_name, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + response = pipeline_response.http_response - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } + return pipeline_response - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return ItemPaged(get_next, extract_data) @distributed_trace @api_version_validation( - method_added_on="2025-07-01-preview", - params_added_on={ - "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] - }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + method_added_on="2024-09-01-preview", + params_added_on={"2024-09-01-preview": ["api_version", "subscription_id", "accept"]}, + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) - def list_by_resource_group( - self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> ItemPaged["_models.NamespaceDiscoveredAsset"]: - """List NamespaceDiscoveredAsset resources by Namespace. + def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.SchemaRegistry"]: + """List SchemaRegistry resources by subscription ID. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :return: An iterator like instance of NamespaceDiscoveredAsset - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredAsset] + :return: An iterator like instance of SchemaRegistry + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.SchemaRegistry] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.NamespaceDiscoveredAsset]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.SchemaRegistry]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -10674,9 +10939,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_namespace_discovered_assets_list_by_resource_group_request( - resource_group_name=resource_group_name, - namespace_name=namespace_name, + _request = build_schema_registries_list_by_subscription_request( subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -10700,7 +10963,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -10714,7 +10980,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.NamespaceDiscoveredAsset], + List[_models.SchemaRegistry], deserialized.get("value", []), ) if cls: @@ -10743,14 +11009,14 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class NamespaceDiscoveredDevicesOperations: +class SchemasOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s - :attr:`namespace_discovered_devices` attribute. + :attr:`schemas` attribute. """ def __init__(self, *args, **kwargs) -> None: @@ -10762,34 +11028,41 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2024-09-01-preview", params_added_on={ - "2025-07-01-preview": [ + "2024-09-01-preview": [ "api_version", "subscription_id", "resource_group_name", - "namespace_name", - "discovered_device_name", + "schema_registry_name", + "schema_name", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], ) def get( - self, resource_group_name: str, namespace_name: str, discovered_device_name: str, **kwargs: Any - ) -> _models.NamespaceDiscoveredDevice: - """Get a NamespaceDiscoveredDevice. + self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any + ) -> _models.Schema: + """Get a Schema. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str - :return: NamespaceDiscoveredDevice. The NamespaceDiscoveredDevice is compatible with - MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :return: Schema. The Schema is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.Schema :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -10803,12 +11076,12 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.NamespaceDiscoveredDevice] = kwargs.pop("cls", None) + cls: ClsType[_models.Schema] = kwargs.pop("cls", None) - _request = build_namespace_discovered_devices_get_request( + _request = build_schemas_get_request( resource_group_name=resource_group_name, - namespace_name=namespace_name, - discovered_device_name=discovered_device_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -10843,40 +11116,1265 @@ def get( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.NamespaceDiscoveredDevice, response.json()) + deserialized = _deserialize(_models.Schema, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @api_version_validation( - method_added_on="2025-07-01-preview", - params_added_on={ - "2025-07-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "namespace_name", - "discovered_device_name", - "content_type", - "accept", - ] - }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], - ) - def _create_or_replace_initial( + @overload + def create_or_replace( self, resource_group_name: str, - namespace_name: str, - discovered_device_name: str, - resource: Union[_models.NamespaceDiscoveredDevice, JSON, IO[bytes]], + schema_registry_name: str, + schema_name: str, + resource: _models.Schema, + *, + content_type: str = "application/json", **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, + ) -> _models.Schema: + """Create a Schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.models.Schema + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Schema. The Schema is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.Schema + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + resource: _types.Schema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Schema: + """Create a Schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.types.Schema + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Schema. The Schema is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.Schema + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Schema: + """Create a Schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Schema. The Schema is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.Schema + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-09-01-preview", + params_added_on={ + "2024-09-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "schema_registry_name", + "schema_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + resource: Union[_models.Schema, _types.Schema, IO[bytes]], + **kwargs: Any + ) -> _models.Schema: + """Create a Schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param resource: Resource create parameters. Is either a Schema type or a IO[bytes] type. + Required. + :type resource: ~azure.mgmt.deviceregistry.models.Schema or + ~azure.mgmt.deviceregistry.types.Schema or IO[bytes] + :return: Schema. The Schema is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.Schema + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Schema] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_schemas_create_or_replace_request( + resource_group_name=resource_group_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Schema, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-10-01", + params_added_on={ + "2025-10-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "schema_registry_name", + "schema_name", + ] + }, + api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview", "2026-04-01", "2026-11-01"], + ) + def _delete_initial( + self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_schemas_delete_request( + resource_group_name=resource_group_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-01", + params_added_on={ + "2025-10-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "schema_registry_name", + "schema_name", + ] + }, + api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview", "2026-04-01", "2026-11-01"], + ) + def begin_delete( + self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a Schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-09-01-preview", + params_added_on={ + "2024-09-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "schema_registry_name", + "accept", + ] + }, + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + def list_by_schema_registry( + self, resource_group_name: str, schema_registry_name: str, **kwargs: Any + ) -> ItemPaged["_models.Schema"]: + """List Schema resources by SchemaRegistry. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :return: An iterator like instance of Schema + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.Schema] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Schema]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_schemas_list_by_schema_registry_request( + resource_group_name=resource_group_name, + schema_registry_name=schema_registry_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Schema], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SchemaVersionsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s + :attr:`schema_versions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2024-09-01-preview", + params_added_on={ + "2024-09-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "schema_registry_name", + "schema_name", + "schema_version_name", + "accept", + ] + }, + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + def get( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + **kwargs: Any + ) -> _models.SchemaVersion: + """Get a SchemaVersion. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param schema_version_name: Schema version name parameter. Required. + :type schema_version_name: str + :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SchemaVersion] = kwargs.pop("cls", None) + + _request = build_schema_versions_get_request( + resource_group_name=resource_group_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, + schema_version_name=schema_version_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SchemaVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + resource: _models.SchemaVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SchemaVersion: + """Create a SchemaVersion. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param schema_version_name: Schema version name parameter. Required. + :type schema_version_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.models.SchemaVersion + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + resource: _types.SchemaVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SchemaVersion: + """Create a SchemaVersion. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param schema_version_name: Schema version name parameter. Required. + :type schema_version_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.types.SchemaVersion + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SchemaVersion: + """Create a SchemaVersion. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param schema_version_name: Schema version name parameter. Required. + :type schema_version_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2024-09-01-preview", + params_added_on={ + "2024-09-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "schema_registry_name", + "schema_name", + "schema_version_name", + "content_type", + "accept", + ] + }, + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + def create_or_replace( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + resource: Union[_models.SchemaVersion, _types.SchemaVersion, IO[bytes]], + **kwargs: Any + ) -> _models.SchemaVersion: + """Create a SchemaVersion. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param schema_version_name: Schema version name parameter. Required. + :type schema_version_name: str + :param resource: Resource create parameters. Is either a SchemaVersion type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.SchemaVersion or + ~azure.mgmt.deviceregistry.types.SchemaVersion or IO[bytes] + :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SchemaVersion] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_schema_versions_create_or_replace_request( + resource_group_name=resource_group_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, + schema_version_name=schema_version_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SchemaVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2025-10-01", + params_added_on={ + "2025-10-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "schema_registry_name", + "schema_name", + "schema_version_name", + ] + }, + api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview", "2026-04-01", "2026-11-01"], + ) + def _delete_initial( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_schema_versions_delete_request( + resource_group_name=resource_group_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, + schema_version_name=schema_version_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2025-10-01", + params_added_on={ + "2025-10-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "schema_registry_name", + "schema_name", + "schema_version_name", + ] + }, + api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview", "2026-04-01", "2026-11-01"], + ) + def begin_delete( + self, + resource_group_name: str, + schema_registry_name: str, + schema_name: str, + schema_version_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Delete a SchemaVersion. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :param schema_version_name: Schema version name parameter. Required. + :type schema_version_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, + schema_version_name=schema_version_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2024-09-01-preview", + params_added_on={ + "2024-09-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "schema_registry_name", + "schema_name", + "accept", + ] + }, + api_versions_list=[ + "2024-09-01-preview", + "2025-07-01-preview", + "2025-10-01", + "2025-11-01-preview", + "2026-03-01-preview", + "2026-04-01", + "2026-11-01", + ], + ) + def list_by_schema( + self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any + ) -> ItemPaged["_models.SchemaVersion"]: + """List SchemaVersion resources by Schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param schema_registry_name: Schema registry name parameter. Required. + :type schema_registry_name: str + :param schema_name: Schema name parameter. Required. + :type schema_name: str + :return: An iterator like instance of SchemaVersion + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.SchemaVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SchemaVersion]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_schema_versions_list_by_schema_request( + resource_group_name=resource_group_name, + schema_registry_name=schema_registry_name, + schema_name=schema_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SchemaVersion], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class CertificateAuthoritiesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s + :attr:`certificate_authorities` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-11-01", + params_added_on={ + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + "accept", + ] + }, + api_versions_list=["2026-11-01"], + ) + def get( + self, resource_group_name: str, namespace_name: str, certificate_authority_name: str, **kwargs: Any + ) -> _models.CertificateAuthority: + """Get a CertificateAuthority. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :return: CertificateAuthority. The CertificateAuthority is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.CertificateAuthority + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CertificateAuthority] = kwargs.pop("cls", None) + + _request = build_certificate_authorities_get_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CertificateAuthority, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @api_version_validation( + method_added_on="2026-11-01", + params_added_on={ + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-11-01"], + ) + def _create_or_replace_initial( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + resource: Union[_models.CertificateAuthority, _types.CertificateAuthority, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, 304: ResourceNotModifiedError, } error_map.update(kwargs.pop("error_map", {}) or {}) @@ -10894,10 +12392,10 @@ def _create_or_replace_initial( else: _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_namespace_discovered_devices_create_or_replace_request( + _request = build_certificate_authorities_create_or_replace_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - discovered_device_name=discovered_device_name, + certificate_authority_name=certificate_authority_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -10949,30 +12447,29 @@ def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - discovered_device_name: str, - resource: _models.NamespaceDiscoveredDevice, + certificate_authority_name: str, + resource: _models.CertificateAuthority, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredDevice]: - """Create a NamespaceDiscoveredDevice. + ) -> LROPoller[_models.CertificateAuthority]: + """Create a CertificateAuthority. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice + :type resource: ~azure.mgmt.deviceregistry.models.CertificateAuthority :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] + :return: An instance of LROPoller that returns CertificateAuthority. The CertificateAuthority + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -10981,30 +12478,29 @@ def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - discovered_device_name: str, - resource: JSON, + certificate_authority_name: str, + resource: _types.CertificateAuthority, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredDevice]: - """Create a NamespaceDiscoveredDevice. + ) -> LROPoller[_models.CertificateAuthority]: + """Create a CertificateAuthority. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str :param resource: Resource create parameters. Required. - :type resource: JSON + :type resource: ~azure.mgmt.deviceregistry.types.CertificateAuthority :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] + :return: An instance of LROPoller that returns CertificateAuthority. The CertificateAuthority + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] :raises ~azure.core.exceptions.HttpResponseError: """ @@ -11013,81 +12509,79 @@ def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - discovered_device_name: str, + certificate_authority_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredDevice]: - """Create a NamespaceDiscoveredDevice. + ) -> LROPoller[_models.CertificateAuthority]: + """Create a CertificateAuthority. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str :param resource: Resource create parameters. Required. :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] + :return: An instance of LROPoller that returns CertificateAuthority. The CertificateAuthority + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2025-07-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "discovered_device_name", + "certificate_authority_name", "content_type", "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) def begin_create_or_replace( self, resource_group_name: str, namespace_name: str, - discovered_device_name: str, - resource: Union[_models.NamespaceDiscoveredDevice, JSON, IO[bytes]], + certificate_authority_name: str, + resource: Union[_models.CertificateAuthority, _types.CertificateAuthority, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredDevice]: - """Create a NamespaceDiscoveredDevice. + ) -> LROPoller[_models.CertificateAuthority]: + """Create a CertificateAuthority. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str - :param resource: Resource create parameters. Is one of the following types: - NamespaceDiscoveredDevice, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice or JSON or - IO[bytes] - :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param resource: Resource create parameters. Is either a CertificateAuthority type or a + IO[bytes] type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.CertificateAuthority or + ~azure.mgmt.deviceregistry.types.CertificateAuthority or IO[bytes] + :return: An instance of LROPoller that returns CertificateAuthority. The CertificateAuthority + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceDiscoveredDevice] = kwargs.pop("cls", None) + cls: ClsType[_models.CertificateAuthority] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) @@ -11095,7 +12589,7 @@ def begin_create_or_replace( raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - discovered_device_name=discovered_device_name, + certificate_authority_name=certificate_authority_name, resource=resource, content_type=content_type, cls=lambda x, y, z: x, @@ -11108,7 +12602,7 @@ def begin_create_or_replace( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceDiscoveredDevice, response.json()) + deserialized = _deserialize(_models.CertificateAuthority, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -11126,38 +12620,31 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.NamespaceDiscoveredDevice].from_continuation_token( + return LROPoller[_models.CertificateAuthority].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.NamespaceDiscoveredDevice]( + return LROPoller[_models.CertificateAuthority]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2025-07-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "discovered_device_name", - "content_type", - "accept", + "certificate_authority_name", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) - def _update_initial( - self, - resource_group_name: str, - namespace_name: str, - discovered_device_name: str, - properties: Union[_models.NamespaceDiscoveredDeviceUpdate, JSON, IO[bytes]], - **kwargs: Any + def _delete_initial( + self, resource_group_name: str, namespace_name: str, certificate_authority_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11167,27 +12654,17 @@ def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties - else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - - _request = build_namespace_discovered_devices_update_request( + _request = build_certificate_authorities_delete_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - discovered_device_name=discovered_device_name, + certificate_authority_name=certificate_authority_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -11204,7 +12681,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -11228,160 +12705,48 @@ def _update_initial( return deserialized # type: ignore - @overload - def begin_update( - self, - resource_group_name: str, - namespace_name: str, - discovered_device_name: str, - properties: _models.NamespaceDiscoveredDeviceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredDevice]: - """Update a NamespaceDiscoveredDevice. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDeviceUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - namespace_name: str, - discovered_device_name: str, - properties: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredDevice]: - """Update a NamespaceDiscoveredDevice. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - namespace_name: str, - discovered_device_name: str, - properties: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredDevice]: - """Update a NamespaceDiscoveredDevice. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param namespace_name: The name of the namespace. Required. - :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2025-07-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "discovered_device_name", - "content_type", - "accept", + "certificate_authority_name", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) - def begin_update( - self, - resource_group_name: str, - namespace_name: str, - discovered_device_name: str, - properties: Union[_models.NamespaceDiscoveredDeviceUpdate, JSON, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.NamespaceDiscoveredDevice]: - """Update a NamespaceDiscoveredDevice. + def begin_delete( + self, resource_group_name: str, namespace_name: str, certificate_authority_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Delete a CertificateAuthority. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str - :param properties: The resource properties to be updated. Is one of the following types: - NamespaceDiscoveredDeviceUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDeviceUpdate or JSON or - IO[bytes] - :return: An instance of LROPoller that returns NamespaceDiscoveredDevice. The - NamespaceDiscoveredDevice is compatible with MutableMapping - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.NamespaceDiscoveredDevice] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._delete_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - discovered_device_name=discovered_device_name, - properties=properties, - content_type=content_type, + certificate_authority_name=certificate_authority_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -11390,12 +12755,9 @@ def begin_update( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.NamespaceDiscoveredDevice, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -11410,31 +12772,36 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.NamespaceDiscoveredDevice].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.NamespaceDiscoveredDevice]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2025-07-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "discovered_device_name", + "certificate_authority_name", + "content_type", + "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) - def _delete_initial( - self, resource_group_name: str, namespace_name: str, discovered_device_name: str, **kwargs: Any + def _update_initial( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: Union[_models.CertificateAuthorityUpdate, _types.CertificateAuthorityUpdate, IO[bytes]], + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11444,17 +12811,27 @@ def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_namespace_discovered_devices_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_certificate_authorities_update_request( resource_group_name=resource_group_name, namespace_name=namespace_name, - discovered_device_name=discovered_device_name, + certificate_authority_name=certificate_authority_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -11471,7 +12848,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -11495,48 +12872,156 @@ def _delete_initial( return deserialized # type: ignore + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: _models.CertificateAuthorityUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CertificateAuthority]: + """Update a CertificateAuthority. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.models.CertificateAuthorityUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns CertificateAuthority. The CertificateAuthority + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: _types.CertificateAuthorityUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CertificateAuthority]: + """Update a CertificateAuthority. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.types.CertificateAuthorityUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns CertificateAuthority. The CertificateAuthority + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CertificateAuthority]: + """Update a CertificateAuthority. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns CertificateAuthority. The CertificateAuthority + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2025-07-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", "namespace_name", - "discovered_device_name", + "certificate_authority_name", + "content_type", + "accept", ] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) - def begin_delete( - self, resource_group_name: str, namespace_name: str, discovered_device_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a NamespaceDiscoveredDevice. + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + properties: Union[_models.CertificateAuthorityUpdate, _types.CertificateAuthorityUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CertificateAuthority]: + """Update a CertificateAuthority. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :param discovered_device_name: The name of the discovered device. Required. - :type discovered_device_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param properties: The resource properties to be updated. Is either a + CertificateAuthorityUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.CertificateAuthorityUpdate or + ~azure.mgmt.deviceregistry.types.CertificateAuthorityUpdate or IO[bytes] + :return: An instance of LROPoller that returns CertificateAuthority. The CertificateAuthority + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificateAuthority] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CertificateAuthority] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._update_initial( resource_group_name=resource_group_name, namespace_name=namespace_name, - discovered_device_name=discovered_device_name, + certificate_authority_name=certificate_authority_name, + properties=properties, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -11545,9 +13030,12 @@ def begin_delete( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CertificateAuthority, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -11562,41 +13050,42 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.CertificateAuthority].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return LROPoller[_models.CertificateAuthority]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace @api_version_validation( - method_added_on="2025-07-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2025-07-01-preview": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] + "2026-11-01": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] }, - api_versions_list=["2025-07-01-preview", "2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) - def list_by_resource_group( + def list_by_namespace( self, resource_group_name: str, namespace_name: str, **kwargs: Any - ) -> ItemPaged["_models.NamespaceDiscoveredDevice"]: - """List NamespaceDiscoveredDevice resources by Namespace. + ) -> ItemPaged["_models.CertificateAuthority"]: + """List CertificateAuthority resources by Namespace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param namespace_name: The name of the namespace. Required. :type namespace_name: str - :return: An iterator like instance of NamespaceDiscoveredDevice - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.NamespaceDiscoveredDevice] + :return: An iterator like instance of CertificateAuthority + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.CertificateAuthority] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.NamespaceDiscoveredDevice]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CertificateAuthority]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -11609,7 +13098,7 @@ def list_by_resource_group( def prepare_request(next_link=None): if not next_link: - _request = build_namespace_discovered_devices_list_by_resource_group_request( + _request = build_certificate_authorities_list_by_namespace_request( resource_group_name=resource_group_name, namespace_name=namespace_name, subscription_id=self._config.subscription_id, @@ -11635,7 +13124,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -11649,7 +13141,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.NamespaceDiscoveredDevice], + List[_models.CertificateAuthority], deserialized.get("value", []), ) if cls: @@ -11665,150 +13157,38 @@ def get_next(next_link=None): ) response = pipeline_response.http_response - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class SchemaRegistriesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s - :attr:`schema_registries` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2024-09-01-preview", - params_added_on={ - "2024-09-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "schema_registry_name", - "accept", - ] - }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], - ) - def get(self, resource_group_name: str, schema_registry_name: str, **kwargs: Any) -> _models.SchemaRegistry: - """Get a SchemaRegistry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :return: SchemaRegistry. The SchemaRegistry is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.SchemaRegistry - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.SchemaRegistry] = kwargs.pop("cls", None) - - _request = build_schema_registries_get_request( - resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.SchemaRegistry, response.json()) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return ItemPaged(get_next, extract_data) @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", + "namespace_name", + "certificate_authority_name", "content_type", - "accept", ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - def _create_or_replace_initial( + def _activate_initial( self, resource_group_name: str, - schema_registry_name: str, - resource: Union[_models.SchemaRegistry, JSON, IO[bytes]], + namespace_name: str, + certificate_authority_name: str, + body: Union[_models.ActivateCertificateAuthorityRequest, _types.ActivateCertificateAuthorityRequest, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -11827,14 +13207,15 @@ def _create_or_replace_initial( content_type = content_type or "application/json" _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource + if isinstance(body, (IOBase, bytes)): + _content = body else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_schema_registries_create_or_replace_request( + _request = build_certificate_authorities_activate_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -11855,7 +13236,7 @@ def _create_or_replace_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -11868,10 +13249,8 @@ def _create_or_replace_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 201: - response_headers["Azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("Azure-AsyncOperation") - ) + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -11882,146 +13261,305 @@ def _create_or_replace_initial( return deserialized # type: ignore @overload - def begin_create_or_replace( + def begin_activate( self, resource_group_name: str, - schema_registry_name: str, - resource: _models.SchemaRegistry, + namespace_name: str, + certificate_authority_name: str, + body: _models.ActivateCertificateAuthorityRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SchemaRegistry]: - """Create a SchemaRegistry. + ) -> LROPoller[None]: + """Activates a Certificate Authority of type ``ICA`` and issuer type ``External``. If the + Certificate Authority is an invalid type, the API responds with HTTP 400. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.SchemaRegistry + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.deviceregistry.models.ActivateCertificateAuthorityRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_replace( + def begin_activate( self, resource_group_name: str, - schema_registry_name: str, - resource: JSON, + namespace_name: str, + certificate_authority_name: str, + body: _types.ActivateCertificateAuthorityRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SchemaRegistry]: - """Create a SchemaRegistry. + ) -> LROPoller[None]: + """Activates a Certificate Authority of type ``ICA`` and issuer type ``External``. If the + Certificate Authority is an invalid type, the API responds with HTTP 400. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param body: The content of the action request. Required. + :type body: ~azure.mgmt.deviceregistry.types.ActivateCertificateAuthorityRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_or_replace( + def begin_activate( self, resource_group_name: str, - schema_registry_name: str, - resource: IO[bytes], + namespace_name: str, + certificate_authority_name: str, + body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SchemaRegistry]: - """Create a SchemaRegistry. + ) -> LROPoller[None]: + """Activates a Certificate Authority of type ``ICA`` and issuer type ``External``. If the + Certificate Authority is an invalid type, the API responds with HTTP 400. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param body: The content of the action request. Required. + :type body: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", + "namespace_name", + "certificate_authority_name", "content_type", - "accept", ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - def begin_create_or_replace( + def begin_activate( self, resource_group_name: str, - schema_registry_name: str, - resource: Union[_models.SchemaRegistry, JSON, IO[bytes]], + namespace_name: str, + certificate_authority_name: str, + body: Union[_models.ActivateCertificateAuthorityRequest, _types.ActivateCertificateAuthorityRequest, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.SchemaRegistry]: - """Create a SchemaRegistry. + ) -> LROPoller[None]: + """Activates a Certificate Authority of type ``ICA`` and issuer type ``External``. If the + Certificate Authority is an invalid type, the API responds with HTTP 400. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param body: The content of the action request. Is either a ActivateCertificateAuthorityRequest + type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.deviceregistry.models.ActivateCertificateAuthorityRequest or + ~azure.mgmt.deviceregistry.types.ActivateCertificateAuthorityRequest or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._activate_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + body=body, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @api_version_validation( + method_added_on="2026-11-01", + params_added_on={ + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + ] + }, + api_versions_list=["2026-11-01"], + ) + def _revoke_and_rotate_initial( + self, resource_group_name: str, namespace_name: str, certificate_authority_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_certificate_authorities_revoke_and_rotate_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + @api_version_validation( + method_added_on="2026-11-01", + params_added_on={ + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + ] + }, + api_versions_list=["2026-11-01"], + ) + def begin_revoke_and_rotate( + self, resource_group_name: str, namespace_name: str, certificate_authority_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Revokes a Certificate Authority of type ``ICA`` and issuer type ``Microsoft``. If the + Certificate Authority is an invalid type, the API responds with HTTP 400. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param resource: Resource create parameters. Is one of the following types: SchemaRegistry, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.SchemaRegistry or JSON or IO[bytes] - :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SchemaRegistry] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_or_replace_initial( + raw_result = self._revoke_and_rotate_initial( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - resource=resource, - content_type=content_type, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -12030,12 +13568,9 @@ def begin_create_or_replace( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = _deserialize(_models.SchemaRegistry, response.json()) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -12050,41 +13585,153 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.SchemaRegistry].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.SchemaRegistry]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class CertificatePoliciesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s + :attr:`certificate_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + @api_version_validation( + method_added_on="2026-11-01", + params_added_on={ + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + "certificate_policy_name", + "accept", + ] + }, + api_versions_list=["2026-11-01"], + ) + def get( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + **kwargs: Any + ) -> _models.CertificatePolicy: + """Get a CertificatePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :return: CertificatePolicy. The CertificatePolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.CertificatePolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.CertificatePolicy] = kwargs.pop("cls", None) + + _request = build_certificate_policies_get_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + certificate_policy_name=certificate_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CertificatePolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", + "namespace_name", + "certificate_authority_name", + "certificate_policy_name", "content_type", "accept", ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - def _update_initial( + def _create_or_replace_initial( self, resource_group_name: str, - schema_registry_name: str, - properties: Union[_models.SchemaRegistryUpdate, JSON, IO[bytes]], + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: Union[_models.CertificatePolicy, _types.CertificatePolicy, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { @@ -12103,14 +13750,16 @@ def _update_initial( content_type = content_type or "application/json" _content = None - if isinstance(properties, (IOBase, bytes)): - _content = properties + if isinstance(resource, (IOBase, bytes)): + _content = resource else: - _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - _request = build_schema_registries_update_request( + _request = build_certificate_policies_create_or_replace_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + certificate_policy_name=certificate_policy_name, subscription_id=self._config.subscription_id, content_type=content_type, api_version=self._config.api_version, @@ -12131,7 +13780,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -12144,8 +13793,10 @@ def _update_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -12156,145 +13807,168 @@ def _update_initial( return deserialized # type: ignore @overload - def begin_update( + def begin_create_or_replace( self, resource_group_name: str, - schema_registry_name: str, - properties: _models.SchemaRegistryUpdate, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: _models.CertificatePolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SchemaRegistry]: - """Update a SchemaRegistry. + ) -> LROPoller[_models.CertificatePolicy]: + """Create a CertificatePolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param properties: The resource properties to be updated. Required. - :type properties: ~azure.mgmt.deviceregistry.models.SchemaRegistryUpdate + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.models.CertificatePolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :return: An instance of LROPoller that returns CertificatePolicy. The CertificatePolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_create_or_replace( self, resource_group_name: str, - schema_registry_name: str, - properties: JSON, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: _types.CertificatePolicy, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SchemaRegistry]: - """Update a SchemaRegistry. + ) -> LROPoller[_models.CertificatePolicy]: + """Create a CertificatePolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param properties: The resource properties to be updated. Required. - :type properties: JSON + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.types.CertificatePolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :return: An instance of LROPoller that returns CertificatePolicy. The CertificatePolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update( + def begin_create_or_replace( self, resource_group_name: str, - schema_registry_name: str, - properties: IO[bytes], + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.SchemaRegistry]: - """Update a SchemaRegistry. + ) -> LROPoller[_models.CertificatePolicy]: + """Create a CertificatePolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param properties: The resource properties to be updated. Required. - :type properties: IO[bytes] + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :return: An instance of LROPoller that returns CertificatePolicy. The CertificatePolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", + "namespace_name", + "certificate_authority_name", + "certificate_policy_name", "content_type", "accept", ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - def begin_update( + def begin_create_or_replace( self, resource_group_name: str, - schema_registry_name: str, - properties: Union[_models.SchemaRegistryUpdate, JSON, IO[bytes]], + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + resource: Union[_models.CertificatePolicy, _types.CertificatePolicy, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.SchemaRegistry]: - """Update a SchemaRegistry. + ) -> LROPoller[_models.CertificatePolicy]: + """Create a CertificatePolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param properties: The resource properties to be updated. Is one of the following types: - SchemaRegistryUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.deviceregistry.models.SchemaRegistryUpdate or JSON or IO[bytes] - :return: An instance of LROPoller that returns SchemaRegistry. The SchemaRegistry is compatible - with MutableMapping - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param resource: Resource create parameters. Is either a CertificatePolicy type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.CertificatePolicy or + ~azure.mgmt.deviceregistry.types.CertificatePolicy or IO[bytes] + :return: An instance of LROPoller that returns CertificatePolicy. The CertificatePolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SchemaRegistry] = kwargs.pop("cls", None) + cls: ClsType[_models.CertificatePolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_initial( + raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - properties=properties, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + certificate_policy_name=certificate_policy_name, + resource=resource, content_type=content_type, cls=lambda x, y, z: x, headers=_headers, @@ -12306,7 +13980,7 @@ def begin_update( def get_long_running_output(pipeline_response): response = pipeline_response.http_response - deserialized = _deserialize(_models.SchemaRegistry, response.json()) + deserialized = _deserialize(_models.CertificatePolicy, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -12324,30 +13998,38 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.SchemaRegistry].from_continuation_token( + return LROPoller[_models.CertificatePolicy].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.SchemaRegistry]( + return LROPoller[_models.CertificatePolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": ["api_version", "subscription_id", "resource_group_name", "schema_registry_name"] - }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + "certificate_policy_name", + ] + }, + api_versions_list=["2026-11-01"], ) - def _delete_initial(self, resource_group_name: str, schema_registry_name: str, **kwargs: Any) -> Iterator[bytes]: + def _delete_initial( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -12361,9 +14043,11 @@ def _delete_initial(self, resource_group_name: str, schema_registry_name: str, * cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_schema_registries_delete_request( + _request = build_certificate_policies_delete_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + certificate_policy_name=certificate_policy_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -12408,26 +14092,38 @@ def _delete_initial(self, resource_group_name: str, schema_registry_name: str, * @distributed_trace @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": ["api_version", "subscription_id", "resource_group_name", "schema_registry_name"] + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + "certificate_policy_name", + ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - def begin_delete(self, resource_group_name: str, schema_registry_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete a SchemaRegistry. + def begin_delete( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Delete a CertificatePolicy. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -12442,7 +14138,9 @@ def begin_delete(self, resource_group_name: str, schema_registry_name: str, **kw if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + certificate_policy_name=certificate_policy_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -12476,33 +14174,31 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @distributed_trace @api_version_validation( - method_added_on="2024-09-01-preview", - params_added_on={"2024-09-01-preview": ["api_version", "subscription_id", "resource_group_name", "accept"]}, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + method_added_on="2026-11-01", + params_added_on={ + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + "certificate_policy_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-11-01"], ) - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.SchemaRegistry"]: - """List SchemaRegistry resources by resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of SchemaRegistry - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.SchemaRegistry] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.SchemaRegistry]] = kwargs.pop("cls", None) - + def _update_initial( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: Union[_models.CertificatePolicyUpdate, _types.CertificatePolicyUpdate, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -12511,99 +14207,305 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _request = build_schema_registries_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore - return _request + _request = build_certificate_policies_update_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + certificate_policy_name=certificate_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.SchemaRegistry], - deserialized.get("value", []), + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: _models.CertificatePolicyUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CertificatePolicy]: + """Update a CertificatePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.models.CertificatePolicyUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns CertificatePolicy. The CertificatePolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: _types.CertificatePolicyUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CertificatePolicy]: + """Update a CertificatePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.types.CertificatePolicyUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns CertificatePolicy. The CertificatePolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.CertificatePolicy]: + """Update a CertificatePolicy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns CertificatePolicy. The CertificatePolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + @api_version_validation( + method_added_on="2026-11-01", + params_added_on={ + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + "certificate_policy_name", + "content_type", + "accept", + ] + }, + api_versions_list=["2026-11-01"], + ) + def begin_update( + self, + resource_group_name: str, + namespace_name: str, + certificate_authority_name: str, + certificate_policy_name: str, + properties: Union[_models.CertificatePolicyUpdate, _types.CertificatePolicyUpdate, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.CertificatePolicy]: + """Update a CertificatePolicy. - def get_next(next_link=None): - _request = prepare_request(next_link) + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :param certificate_policy_name: The name of the Certificate Policy resource. Required. + :type certificate_policy_name: str + :param properties: The resource properties to be updated. Is either a CertificatePolicyUpdate + type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.CertificatePolicyUpdate or + ~azure.mgmt.deviceregistry.types.CertificatePolicyUpdate or IO[bytes] + :return: An instance of LROPoller that returns CertificatePolicy. The CertificatePolicy is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.CertificatePolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CertificatePolicy] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, + certificate_policy_name=certificate_policy_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs ) - response = pipeline_response.http_response + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.CertificatePolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - return pipeline_response + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } - return ItemPaged(get_next, extract_data) + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.CertificatePolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.CertificatePolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @distributed_trace @api_version_validation( - method_added_on="2024-09-01-preview", - params_added_on={"2024-09-01-preview": ["api_version", "subscription_id", "accept"]}, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + method_added_on="2026-11-01", + params_added_on={ + "2026-11-01": [ + "api_version", + "subscription_id", + "resource_group_name", + "namespace_name", + "certificate_authority_name", + "accept", + ] + }, + api_versions_list=["2026-11-01"], ) - def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.SchemaRegistry"]: - """List SchemaRegistry resources by subscription ID. + def list_by_certificate_authority( + self, resource_group_name: str, namespace_name: str, certificate_authority_name: str, **kwargs: Any + ) -> ItemPaged["_models.CertificatePolicy"]: + """List CertificatePolicy resources by CertificateAuthority. - :return: An iterator like instance of SchemaRegistry - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.SchemaRegistry] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param certificate_authority_name: The name of the Certificate Authority resource. Required. + :type certificate_authority_name: str + :return: An iterator like instance of CertificatePolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.CertificatePolicy] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SchemaRegistry]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.CertificatePolicy]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -12616,7 +14518,10 @@ def list_by_subscription(self, **kwargs: Any) -> ItemPaged["_models.SchemaRegist def prepare_request(next_link=None): if not next_link: - _request = build_schema_registries_list_by_subscription_request( + _request = build_certificate_policies_list_by_certificate_authority_request( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + certificate_authority_name=certificate_authority_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -12640,7 +14545,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -12654,7 +14562,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.SchemaRegistry], + List[_models.CertificatePolicy], deserialized.get("value", []), ) if cls: @@ -12673,262 +14581,62 @@ def get_next(next_link=None): if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class SchemasOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s - :attr:`schemas` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - @api_version_validation( - method_added_on="2024-09-01-preview", - params_added_on={ - "2024-09-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "schema_registry_name", - "schema_name", - "accept", - ] - }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], - ) - def get( - self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any - ) -> _models.Schema: - """Get a Schema. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :return: Schema. The Schema is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.Schema - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[_models.Schema] = kwargs.pop("cls", None) - - _request = build_schemas_get_request( - resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.Schema, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_replace( - self, - resource_group_name: str, - schema_registry_name: str, - schema_name: str, - resource: _models.Schema, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Schema: - """Create a Schema. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.Schema - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Schema. The Schema is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.Schema - :raises ~azure.core.exceptions.HttpResponseError: - """ + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - @overload - def create_or_replace( - self, - resource_group_name: str, - schema_registry_name: str, - schema_name: str, - resource: JSON, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Schema: - """Create a Schema. + return pipeline_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Schema. The Schema is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.Schema - :raises ~azure.core.exceptions.HttpResponseError: - """ + return ItemPaged(get_next, extract_data) - @overload - def create_or_replace( - self, - resource_group_name: str, - schema_registry_name: str, - schema_name: str, - resource: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Schema: - """Create a Schema. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: Schema. The Schema is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.Schema - :raises ~azure.core.exceptions.HttpResponseError: - """ +class RegistryDevicesOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s + :attr:`registry_devices` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", - "schema_name", - "content_type", + "namespace_name", + "registry_device_name", "accept", ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - def create_or_replace( - self, - resource_group_name: str, - schema_registry_name: str, - schema_name: str, - resource: Union[_models.Schema, JSON, IO[bytes]], - **kwargs: Any - ) -> _models.Schema: - """Create a Schema. + def get( + self, resource_group_name: str, namespace_name: str, registry_device_name: str, **kwargs: Any + ) -> _models.RegistryDevice: + """Get a RegistryDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param resource: Resource create parameters. Is one of the following types: Schema, JSON, - IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.Schema or JSON or IO[bytes] - :return: Schema. The Schema is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.Schema + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :return: RegistryDevice. The RegistryDevice is compatible with MutableMapping + :rtype: ~azure.mgmt.deviceregistry.models.RegistryDevice :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -12939,27 +14647,17 @@ def create_or_replace( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Schema] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + cls: ClsType[_models.RegistryDevice] = kwargs.pop("cls", None) - _request = build_schemas_create_or_replace_request( + _request = build_registry_devices_get_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, + namespace_name=namespace_name, + registry_device_name=registry_device_name, subscription_id=self._config.subscription_id, - content_type=content_type, api_version=self._config.api_version, - content=_content, headers=_headers, params=_params, ) @@ -12976,7 +14674,7 @@ def create_or_replace( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: if _stream: try: response.read() # Load the body in memory and close the socket @@ -12992,7 +14690,7 @@ def create_or_replace( if _stream: deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: - deserialized = _deserialize(_models.Schema, response.json()) + deserialized = _deserialize(_models.RegistryDevice, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -13000,20 +14698,27 @@ def create_or_replace( return deserialized # type: ignore @api_version_validation( - method_added_on="2025-10-01", + method_added_on="2026-11-01", params_added_on={ - "2025-10-01": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", - "schema_name", + "namespace_name", + "registry_device_name", + "content_type", + "accept", ] }, - api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) - def _delete_initial( - self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any + def _create_or_replace_initial( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: Union[_models.RegistryDevice, _types.RegistryDevice, IO[bytes]], + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13023,17 +14728,27 @@ def _delete_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_schemas_delete_request( + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_registry_devices_create_or_replace_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, + namespace_name=namespace_name, + registry_device_name=registry_device_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -13050,7 +14765,7 @@ def _delete_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 201]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -13063,8 +14778,10 @@ def _delete_initial( raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) deserialized = response.iter_bytes() if _decompress else response.iter_raw() @@ -13074,48 +14791,156 @@ def _delete_initial( return deserialized # type: ignore + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: _models.RegistryDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RegistryDevice]: + """Create a RegistryDevice. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.models.RegistryDevice + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns RegistryDevice. The RegistryDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: _types.RegistryDevice, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RegistryDevice]: + """Create a RegistryDevice. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.mgmt.deviceregistry.types.RegistryDevice + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns RegistryDevice. The RegistryDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RegistryDevice]: + """Create a RegistryDevice. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param resource: Resource create parameters. Required. + :type resource: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns RegistryDevice. The RegistryDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] + :raises ~azure.core.exceptions.HttpResponseError: + """ + @distributed_trace @api_version_validation( - method_added_on="2025-10-01", + method_added_on="2026-11-01", params_added_on={ - "2025-10-01": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", - "schema_name", + "namespace_name", + "registry_device_name", + "content_type", + "accept", ] }, - api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) - def begin_delete( - self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Delete a Schema. + def begin_create_or_replace( + self, + resource_group_name: str, + namespace_name: str, + registry_device_name: str, + resource: Union[_models.RegistryDevice, _types.RegistryDevice, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.RegistryDevice]: + """Create a RegistryDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :return: An instance of LROPoller that returns None - :rtype: ~azure.core.polling.LROPoller[None] + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param resource: Resource create parameters. Is either a RegistryDevice type or a IO[bytes] + type. Required. + :type resource: ~azure.mgmt.deviceregistry.models.RegistryDevice or + ~azure.mgmt.deviceregistry.types.RegistryDevice or IO[bytes] + :return: An instance of LROPoller that returns RegistryDevice. The RegistryDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[None] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RegistryDevice] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_initial( + raw_result = self._create_or_replace_initial( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, + namespace_name=namespace_name, + registry_device_name=registry_device_name, + resource=resource, + content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -13124,9 +14949,12 @@ def begin_delete( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.RegistryDevice, response.json()) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), @@ -13141,195 +14969,39 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return LROPoller[None].from_continuation_token( + return LROPoller[_models.RegistryDevice].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - @api_version_validation( - method_added_on="2024-09-01-preview", - params_added_on={ - "2024-09-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "schema_registry_name", - "accept", - ] - }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], - ) - def list_by_schema_registry( - self, resource_group_name: str, schema_registry_name: str, **kwargs: Any - ) -> ItemPaged["_models.Schema"]: - """List Schema resources by SchemaRegistry. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :return: An iterator like instance of Schema - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.Schema] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[List[_models.Schema]] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_schemas_list_by_schema_registry_request( - resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - subscription_id=self._config.subscription_id, - api_version=self._config.api_version, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - path_format_arguments = { - "endpoint": self._serialize.url( - "self._config.base_url", self._config.base_url, "str", skip_quote=True - ), - } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - return _request - - def extract_data(pipeline_response): - deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize( - List[_models.Schema], - deserialized.get("value", []), - ) - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.get("nextLink") or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - -class SchemaVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.deviceregistry.DeviceRegistryMgmtClient`'s - :attr:`schema_versions` attribute. - """ - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: DeviceRegistryMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return LROPoller[_models.RegistryDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - @distributed_trace @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", - "schema_name", - "schema_version_name", + "namespace_name", + "registry_device_name", + "content_type", "accept", ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - def get( + def _update_initial( self, resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, + namespace_name: str, + registry_device_name: str, + properties: Union[_models.RegistryDeviceUpdate, _types.RegistryDeviceUpdate, IO[bytes]], **kwargs: Any - ) -> _models.SchemaVersion: - """Get a SchemaVersion. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param schema_version_name: Schema version name parameter. Required. - :type schema_version_name: str - :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -13338,18 +15010,27 @@ def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.SchemaVersion] = kwargs.pop("cls", None) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_schema_versions_get_request( + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_registry_devices_update_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, - schema_version_name=schema_version_name, + namespace_name=namespace_name, + registry_device_name=registry_device_name, subscription_id=self._config.subscription_id, + content_type=content_type, api_version=self._config.api_version, + content=_content, headers=_headers, params=_params, ) @@ -13359,19 +15040,18 @@ def get( _request.url = self._client.format_url(_request.url, **path_format_arguments) _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) error = _failsafe_deserialize( _models.ErrorResponse, @@ -13379,255 +15059,221 @@ def get( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() - else: - deserialized = _deserialize(_models.SchemaVersion, response.json()) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload - def create_or_replace( + def begin_update( self, resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, - resource: _models.SchemaVersion, + namespace_name: str, + registry_device_name: str, + properties: _models.RegistryDeviceUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.SchemaVersion: - """Create a SchemaVersion. + ) -> LROPoller[_models.RegistryDevice]: + """Update a RegistryDevice. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param schema_version_name: Schema version name parameter. Required. - :type schema_version_name: str - :param resource: Resource create parameters. Required. - :type resource: ~azure.mgmt.deviceregistry.models.SchemaVersion + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.models.RegistryDeviceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion + :return: An instance of LROPoller that returns RegistryDevice. The RegistryDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_replace( + def begin_update( self, resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, - resource: JSON, + namespace_name: str, + registry_device_name: str, + properties: _types.RegistryDeviceUpdate, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.SchemaVersion: - """Create a SchemaVersion. + ) -> LROPoller[_models.RegistryDevice]: + """Update a RegistryDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param schema_version_name: Schema version name parameter. Required. - :type schema_version_name: str - :param resource: Resource create parameters. Required. - :type resource: JSON + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.mgmt.deviceregistry.types.RegistryDeviceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion + :return: An instance of LROPoller that returns RegistryDevice. The RegistryDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_replace( + def begin_update( self, resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, - resource: IO[bytes], + namespace_name: str, + registry_device_name: str, + properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.SchemaVersion: - """Create a SchemaVersion. + ) -> LROPoller[_models.RegistryDevice]: + """Update a RegistryDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param schema_version_name: Schema version name parameter. Required. - :type schema_version_name: str - :param resource: Resource create parameters. Required. - :type resource: IO[bytes] + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param properties: The resource properties to be updated. Required. + :type properties: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion + :return: An instance of LROPoller that returns RegistryDevice. The RegistryDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", - "schema_name", - "schema_version_name", + "namespace_name", + "registry_device_name", "content_type", "accept", ] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - def create_or_replace( + def begin_update( self, resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, - resource: Union[_models.SchemaVersion, JSON, IO[bytes]], + namespace_name: str, + registry_device_name: str, + properties: Union[_models.RegistryDeviceUpdate, _types.RegistryDeviceUpdate, IO[bytes]], **kwargs: Any - ) -> _models.SchemaVersion: - """Create a SchemaVersion. + ) -> LROPoller[_models.RegistryDevice]: + """Update a RegistryDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param schema_version_name: Schema version name parameter. Required. - :type schema_version_name: str - :param resource: Resource create parameters. Is one of the following types: SchemaVersion, - JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.deviceregistry.models.SchemaVersion or JSON or IO[bytes] - :return: SchemaVersion. The SchemaVersion is compatible with MutableMapping - :rtype: ~azure.mgmt.deviceregistry.models.SchemaVersion + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str + :param properties: The resource properties to be updated. Is either a RegistryDeviceUpdate type + or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.deviceregistry.models.RegistryDeviceUpdate or + ~azure.mgmt.deviceregistry.types.RegistryDeviceUpdate or IO[bytes] + :return: An instance of LROPoller that returns RegistryDevice. The RegistryDevice is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.deviceregistry.models.RegistryDevice] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SchemaVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.RegistryDevice] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_initial( + resource_group_name=resource_group_name, + namespace_name=namespace_name, + registry_device_name=registry_device_name, + properties=properties, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - content_type = content_type or "application/json" - _content = None - if isinstance(resource, (IOBase, bytes)): - _content = resource - else: - _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.RegistryDevice, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _request = build_schema_versions_create_or_replace_request( - resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, - schema_version_name=schema_version_name, - subscription_id=self._config.subscription_id, - content_type=content_type, - api_version=self._config.api_version, - content=_content, - headers=_headers, - params=_params, - ) path_format_arguments = { "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), } - _request.url = self._client.format_url(_request.url, **path_format_arguments) - - _decompress = kwargs.pop("decompress", True) - _stream = kwargs.pop("stream", False) - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - if response.status_code not in [200, 201]: - if _stream: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize( - _models.ErrorResponse, - response, + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if _stream: - deserialized = response.iter_bytes() if _decompress else response.iter_raw() + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) else: - deserialized = _deserialize(_models.SchemaVersion, response.json()) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + polling_method = polling + if cont_token: + return LROPoller[_models.RegistryDevice].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RegistryDevice]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) @api_version_validation( - method_added_on="2025-10-01", + method_added_on="2026-11-01", params_added_on={ - "2025-10-01": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", - "schema_name", - "schema_version_name", + "namespace_name", + "registry_device_name", ] }, - api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) def _delete_initial( - self, - resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, - **kwargs: Any + self, resource_group_name: str, namespace_name: str, registry_device_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13642,11 +15288,10 @@ def _delete_initial( cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_schema_versions_delete_request( + _request = build_registry_devices_delete_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, - schema_version_name=schema_version_name, + namespace_name=namespace_name, + registry_device_name=registry_device_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -13691,38 +15336,30 @@ def _delete_initial( @distributed_trace @api_version_validation( - method_added_on="2025-10-01", + method_added_on="2026-11-01", params_added_on={ - "2025-10-01": [ + "2026-11-01": [ "api_version", "subscription_id", "resource_group_name", - "schema_registry_name", - "schema_name", - "schema_version_name", + "namespace_name", + "registry_device_name", ] }, - api_versions_list=["2025-10-01", "2025-11-01-preview", "2026-03-01-preview"], + api_versions_list=["2026-11-01"], ) def begin_delete( - self, - resource_group_name: str, - schema_registry_name: str, - schema_name: str, - schema_version_name: str, - **kwargs: Any + self, resource_group_name: str, namespace_name: str, registry_device_name: str, **kwargs: Any ) -> LROPoller[None]: - """Delete a SchemaVersion. + """Delete a RegistryDevice. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :param schema_version_name: Schema version name parameter. Required. - :type schema_version_name: str + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :param registry_device_name: The name of the new device. Required. + :type registry_device_name: str :return: An instance of LROPoller that returns None :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -13737,9 +15374,8 @@ def begin_delete( if cont_token is None: raw_result = self._delete_initial( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, - schema_version_name=schema_version_name, + namespace_name=namespace_name, + registry_device_name=registry_device_name, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -13775,45 +15411,30 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- @distributed_trace @api_version_validation( - method_added_on="2024-09-01-preview", + method_added_on="2026-11-01", params_added_on={ - "2024-09-01-preview": [ - "api_version", - "subscription_id", - "resource_group_name", - "schema_registry_name", - "schema_name", - "accept", - ] + "2026-11-01": ["api_version", "subscription_id", "resource_group_name", "namespace_name", "accept"] }, - api_versions_list=[ - "2024-09-01-preview", - "2025-07-01-preview", - "2025-10-01", - "2025-11-01-preview", - "2026-03-01-preview", - ], + api_versions_list=["2026-11-01"], ) - def list_by_schema( - self, resource_group_name: str, schema_registry_name: str, schema_name: str, **kwargs: Any - ) -> ItemPaged["_models.SchemaVersion"]: - """List SchemaVersion resources by Schema. + def list_by_namespace( + self, resource_group_name: str, namespace_name: str, **kwargs: Any + ) -> ItemPaged["_models.RegistryDevice"]: + """List RegistryDevice resources by Namespace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str - :param schema_registry_name: Schema registry name parameter. Required. - :type schema_registry_name: str - :param schema_name: Schema name parameter. Required. - :type schema_name: str - :return: An iterator like instance of SchemaVersion - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.SchemaVersion] + :param namespace_name: The name of the namespace. Required. + :type namespace_name: str + :return: An iterator like instance of RegistryDevice + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.deviceregistry.models.RegistryDevice] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models.SchemaVersion]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RegistryDevice]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -13826,10 +15447,9 @@ def list_by_schema( def prepare_request(next_link=None): if not next_link: - _request = build_schema_versions_list_by_schema_request( + _request = build_registry_devices_list_by_namespace_request( resource_group_name=resource_group_name, - schema_registry_name=schema_registry_name, - schema_name=schema_name, + namespace_name=namespace_name, subscription_id=self._config.subscription_id, api_version=self._config.api_version, headers=_headers, @@ -13853,7 +15473,10 @@ def prepare_request(next_link=None): ) _next_request_params["api-version"] = self._config.api_version _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + "GET", + urllib.parse.urljoin(next_link, _parsed_next_link.path), + headers=_headers, + params=_next_request_params, ) path_format_arguments = { "endpoint": self._serialize.url( @@ -13867,7 +15490,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() list_of_elem = _deserialize( - List[_models.SchemaVersion], + List[_models.RegistryDevice], deserialized.get("value", []), ) if cls: diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/operations/_patch.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/operations/_patch.py index 87676c65a8f0..ea765788358a 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/operations/_patch.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/operations/_patch.py @@ -8,7 +8,6 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ - __all__: list[str] = [] # Add all objects you want publicly available to users at this package level diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/types.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/types.py new file mode 100644 index 000000000000..c2c04404fcdf --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/azure/mgmt/deviceregistry/types.py @@ -0,0 +1,4004 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, Literal, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +from .models._enums import ( + CertificateAuthorityIssuerType, + CertificateAuthorityType, + DatasetDestinationTarget, + EventDestinationTarget, + StreamDestinationTarget, +) + +if TYPE_CHECKING: + from .models import ( + AuthenticationMethod, + CertificateAuthorityKeyType, + CertificateAuthorityStatus, + CreatedByType, + DataPointObservabilityMode, + EventObservabilityMode, + Format, + HealthStatus, + InboundCallerIdentityType, + ManagedServiceIdentityType, + ManagementActionType, + MessagingEndpointAvailability, + MqttDestinationQos, + NamespaceDiscoveredManagementActionType, + NamespaceLinkingStateValue, + OutboundIdentityType, + ProvisioningEndpointType, + ProvisioningState, + RegistryDeviceEnablementState, + SchemaType, + Scope, + TopicRetainType, + ) + + +class ActivateCertificateAuthorityRequest(TypedDict, total=False): + """Request payload for activating a Certificate Authority with a signed certificate. + + :ivar certificateChain: Certificate chain in PEM format for activating an externally issued + intermediate Certificate Authority, including the signed certificate. The first certificate + must be the signed certificate matching the CSR generated by the service, followed by any + intermediate CAs, and optionally the root CA. Certificates must be ordered from leaf to root + and concatenated in PEM format. Required. + :vartype certificateChain: str + """ + + certificateChain: Required[str] + """Certificate chain in PEM format for activating an externally issued intermediate Certificate + Authority, including the signed certificate. The first certificate must be the signed + certificate matching the CSR generated by the service, followed by any intermediate CAs, and + optionally the root CA. Certificates must be ordered from leaf to root and concatenated in PEM + format. Required.""" + + +class Resource(TypedDict, total=False): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + id: str + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: str + """The name of the resource.""" + type: str + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + systemData: "SystemData" + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: dict[str, str] + """Resource tags.""" + location: Required[str] + """The geo-location where the resource lives. Required.""" + + +class Asset(TrackedResource): + """Asset definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "AssetProperties" + :ivar extendedLocation: The extended location. Required. + :vartype extendedLocation: "ExtendedLocation" + """ + + properties: "AssetProperties" + """The resource-specific properties for this resource.""" + extendedLocation: Required["ExtendedLocation"] + """The extended location. Required.""" + + +class AssetEndpointProfile(TrackedResource): + """Asset Endpoint Profile definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "AssetEndpointProfileProperties" + :ivar extendedLocation: The extended location. Required. + :vartype extendedLocation: "ExtendedLocation" + """ + + properties: "AssetEndpointProfileProperties" + """The resource-specific properties for this resource.""" + extendedLocation: Required["ExtendedLocation"] + """The extended location. Required.""" + + +class AssetEndpointProfileProperties(TypedDict, total=False): + """Defines the Asset Endpoint Profile properties. + + :ivar uuid: Globally unique, immutable, non-reusable id. + :vartype uuid: str + :ivar targetAddress: The local valid URI specifying the network address/DNS name of a + southbound device. The scheme part of the targetAddress URI specifies the type of the device. + The additionalConfiguration field holds further connector type specific configuration. + Required. + :vartype targetAddress: str + :ivar endpointProfileType: Defines the configuration for the connector type that is being used + with the endpoint profile. Required. + :vartype endpointProfileType: str + :ivar authentication: Defines the client authentication mechanism to the server. + :vartype authentication: "Authentication" + :ivar additionalConfiguration: Stringified JSON that contains connectivity type specific + further configuration (e.g. OPC UA, Modbus, ONVIF). + :vartype additionalConfiguration: str + :ivar discoveredAssetEndpointProfileRef: Reference to a discovered asset endpoint profile. + Populated only if the asset endpoint profile has been created from discovery flow. Discovered + asset endpoint profile name must be provided. + :vartype discoveredAssetEndpointProfileRef: str + :ivar status: Read only object to reflect changes that have occurred on the Edge. Similar to + Kubernetes status property for custom resources. + :vartype status: "AssetEndpointProfileStatus" + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + uuid: str + """Globally unique, immutable, non-reusable id.""" + targetAddress: Required[str] + """The local valid URI specifying the network address/DNS name of a southbound device. The scheme + part of the targetAddress URI specifies the type of the device. The additionalConfiguration + field holds further connector type specific configuration. Required.""" + endpointProfileType: Required[str] + """Defines the configuration for the connector type that is being used with the endpoint profile. + Required.""" + authentication: "Authentication" + """Defines the client authentication mechanism to the server.""" + additionalConfiguration: str + """Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, + Modbus, ONVIF).""" + discoveredAssetEndpointProfileRef: str + """Reference to a discovered asset endpoint profile. Populated only if the asset endpoint profile + has been created from discovery flow. Discovered asset endpoint profile name must be provided.""" + status: "AssetEndpointProfileStatus" + """Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes + status property for custom resources.""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", and \"Deleting\".""" + + +class AssetEndpointProfileStatus(TypedDict, total=False): + """Defines the asset endpoint profile status properties. + + :ivar errors: Array object to transfer and persist errors that originate from the Edge. + :vartype errors: list["AssetEndpointProfileStatusError"] + """ + + errors: list["AssetEndpointProfileStatusError"] + """Array object to transfer and persist errors that originate from the Edge.""" + + +class AssetEndpointProfileStatusError(TypedDict, total=False): + """Defines the asset endpoint profile status error properties. + + :ivar code: Error code for classification of errors (ex: 400, 404, 500, etc.). + :vartype code: int + :ivar message: Human readable helpful error message to provide additional context for error + (ex: “targetAddress 'foo' is not a valid url”). + :vartype message: str + """ + + code: int + """Error code for classification of errors (ex: 400, 404, 500, etc.).""" + message: str + """Human readable helpful error message to provide additional context for error (ex: + “targetAddress 'foo' is not a valid url”).""" + + +class AssetEndpointProfileUpdate(TypedDict, total=False): + """The type used for update operations of the AssetEndpointProfile. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "AssetEndpointProfileUpdateProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "AssetEndpointProfileUpdateProperties" + """The resource-specific properties for this resource.""" + + +class AssetEndpointProfileUpdateProperties(TypedDict, total=False): + """The updatable properties of the AssetEndpointProfile. + + :ivar targetAddress: The local valid URI specifying the network address/DNS name of a + southbound device. The scheme part of the targetAddress URI specifies the type of the device. + The additionalConfiguration field holds further connector type specific configuration. + :vartype targetAddress: str + :ivar endpointProfileType: Defines the configuration for the connector type that is being used + with the endpoint profile. + :vartype endpointProfileType: str + :ivar authentication: Defines the client authentication mechanism to the server. + :vartype authentication: "Authentication" + :ivar additionalConfiguration: Stringified JSON that contains connectivity type specific + further configuration (e.g. OPC UA, Modbus, ONVIF). + :vartype additionalConfiguration: str + """ + + targetAddress: str + """The local valid URI specifying the network address/DNS name of a southbound device. The scheme + part of the targetAddress URI specifies the type of the device. The additionalConfiguration + field holds further connector type specific configuration.""" + endpointProfileType: str + """Defines the configuration for the connector type that is being used with the endpoint profile.""" + authentication: "Authentication" + """Defines the client authentication mechanism to the server.""" + additionalConfiguration: str + """Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, + Modbus, ONVIF).""" + + +class AssetProperties(TypedDict, total=False): + """Defines the asset properties. + + :ivar uuid: Globally unique, immutable, non-reusable id. + :vartype uuid: str + :ivar enabled: Enabled/Disabled status of the asset. + :vartype enabled: bool + :ivar externalAssetId: Asset id provided by the customer. + :vartype externalAssetId: str + :ivar displayName: Human-readable display name. + :vartype displayName: str + :ivar description: Human-readable description of the asset. + :vartype description: str + :ivar assetEndpointProfileRef: A reference to the asset endpoint profile (connection + information) used by brokers to connect to an endpoint that provides data points for this + asset. Must provide asset endpoint profile name. Required. + :vartype assetEndpointProfileRef: str + :ivar version: An integer that is incremented each time the resource is modified. + :vartype version: int + :ivar manufacturer: Asset manufacturer name. + :vartype manufacturer: str + :ivar manufacturerUri: Asset manufacturer URI. + :vartype manufacturerUri: str + :ivar model: Asset model name. + :vartype model: str + :ivar productCode: Asset product code. + :vartype productCode: str + :ivar hardwareRevision: Revision number of the hardware. + :vartype hardwareRevision: str + :ivar softwareRevision: Revision number of the software. + :vartype softwareRevision: str + :ivar documentationUri: Reference to the documentation. + :vartype documentationUri: str + :ivar serialNumber: Asset serial number. + :vartype serialNumber: str + :ivar attributes: A set of key-value pairs that contain custom attributes set by the customer. + :vartype attributes: dict[str, Any] + :ivar discoveredAssetRefs: Reference to a list of discovered assets. Populated only if the + asset has been created from discovery flow. Discovered asset names must be provided. + :vartype discoveredAssetRefs: list[str] + :ivar defaultDatasetsConfiguration: Stringified JSON that contains connector-specific default + configuration for all datasets. Each dataset can have its own configuration that overrides the + default settings here. + :vartype defaultDatasetsConfiguration: str + :ivar defaultEventsConfiguration: Stringified JSON that contains connector-specific default + configuration for all events. Each event can have its own configuration that overrides the + default settings here. + :vartype defaultEventsConfiguration: str + :ivar defaultTopic: Object that describes the default topic information for the asset. + :vartype defaultTopic: "Topic" + :ivar datasets: Array of datasets that are part of the asset. Each dataset describes the data + points that make up the set. + :vartype datasets: list["Dataset"] + :ivar events: Array of events that are part of the asset. Each event can have per-event + configuration. + :vartype events: list["Event"] + :ivar status: Read only object to reflect changes that have occurred on the Edge. Similar to + Kubernetes status property for custom resources. + :vartype status: "AssetStatus" + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + uuid: str + """Globally unique, immutable, non-reusable id.""" + enabled: bool + """Enabled/Disabled status of the asset.""" + externalAssetId: str + """Asset id provided by the customer.""" + displayName: str + """Human-readable display name.""" + description: str + """Human-readable description of the asset.""" + assetEndpointProfileRef: Required[str] + """A reference to the asset endpoint profile (connection information) used by brokers to connect + to an endpoint that provides data points for this asset. Must provide asset endpoint profile + name. Required.""" + version: int + """An integer that is incremented each time the resource is modified.""" + manufacturer: str + """Asset manufacturer name.""" + manufacturerUri: str + """Asset manufacturer URI.""" + model: str + """Asset model name.""" + productCode: str + """Asset product code.""" + hardwareRevision: str + """Revision number of the hardware.""" + softwareRevision: str + """Revision number of the software.""" + documentationUri: str + """Reference to the documentation.""" + serialNumber: str + """Asset serial number.""" + attributes: dict[str, Any] + """A set of key-value pairs that contain custom attributes set by the customer.""" + discoveredAssetRefs: list[str] + """Reference to a list of discovered assets. Populated only if the asset has been created from + discovery flow. Discovered asset names must be provided.""" + defaultDatasetsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all datasets. Each + dataset can have its own configuration that overrides the default settings here.""" + defaultEventsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all events. Each + event can have its own configuration that overrides the default settings here.""" + defaultTopic: "Topic" + """Object that describes the default topic information for the asset.""" + datasets: list["Dataset"] + """Array of datasets that are part of the asset. Each dataset describes the data points that make + up the set.""" + events: list["Event"] + """Array of events that are part of the asset. Each event can have per-event configuration.""" + status: "AssetStatus" + """Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes + status property for custom resources.""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", and \"Deleting\".""" + + +class AssetStatus(TypedDict, total=False): + """Defines the asset status properties. + + :ivar errors: Array object to transfer and persist errors that originate from the Edge. + :vartype errors: list["AssetStatusError"] + :ivar version: A read only incremental counter indicating the number of times the configuration + has been modified from the perspective of the current actual (Edge) state of the Asset. Edge + would be the only writer of this value and would sync back up to the cloud. In steady state, + this should equal version. + :vartype version: int + :ivar datasets: Array of dataset statuses that describe the status of each dataset. + :vartype datasets: list["AssetStatusDataset"] + :ivar events: Array of event statuses that describe the status of each event. + :vartype events: list["AssetStatusEvent"] + """ + + errors: list["AssetStatusError"] + """Array object to transfer and persist errors that originate from the Edge.""" + version: int + """A read only incremental counter indicating the number of times the configuration has been + modified from the perspective of the current actual (Edge) state of the Asset. Edge would be + the only writer of this value and would sync back up to the cloud. In steady state, this should + equal version.""" + datasets: list["AssetStatusDataset"] + """Array of dataset statuses that describe the status of each dataset.""" + events: list["AssetStatusEvent"] + """Array of event statuses that describe the status of each event.""" + + +class AssetStatusDataset(TypedDict, total=False): + """Defines the asset status dataset properties. + + :ivar name: The name of the dataset. Must be unique within the status.datasets array. This name + is used to correlate between the spec and status dataset information. Required. + :vartype name: str + :ivar messageSchemaReference: The message schema reference object. + :vartype messageSchemaReference: "MessageSchemaReference" + """ + + name: Required[str] + """The name of the dataset. Must be unique within the status.datasets array. This name is used to + correlate between the spec and status dataset information. Required.""" + messageSchemaReference: "MessageSchemaReference" + """The message schema reference object.""" + + +class AssetStatusError(TypedDict, total=False): + """Defines the asset status error properties. + + :ivar code: Error code for classification of errors (ex: 400, 404, 500, etc.). + :vartype code: int + :ivar message: Human readable helpful error message to provide additional context for error + (ex: “capability Id 'foo' does not exist”). + :vartype message: str + """ + + code: int + """Error code for classification of errors (ex: 400, 404, 500, etc.).""" + message: str + """Human readable helpful error message to provide additional context for error (ex: “capability + Id 'foo' does not exist”).""" + + +class AssetStatusEvent(TypedDict, total=False): + """Defines the asset status event properties. + + :ivar name: The name of the event. Must be unique within the status.events array. This name is + used to correlate between the spec and status event information. Required. + :vartype name: str + :ivar messageSchemaReference: The message schema reference object. + :vartype messageSchemaReference: "MessageSchemaReference" + """ + + name: Required[str] + """The name of the event. Must be unique within the status.events array. This name is used to + correlate between the spec and status event information. Required.""" + messageSchemaReference: "MessageSchemaReference" + """The message schema reference object.""" + + +class AssetUpdate(TypedDict, total=False): + """The type used for update operations of the Asset. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "AssetUpdateProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "AssetUpdateProperties" + """The resource-specific properties for this resource.""" + + +class AssetUpdateProperties(TypedDict, total=False): + """The updatable properties of the Asset. + + :ivar enabled: Enabled/Disabled status of the asset. + :vartype enabled: bool + :ivar displayName: Human-readable display name. + :vartype displayName: str + :ivar description: Human-readable description of the asset. + :vartype description: str + :ivar manufacturer: Asset manufacturer name. + :vartype manufacturer: str + :ivar manufacturerUri: Asset manufacturer URI. + :vartype manufacturerUri: str + :ivar model: Asset model name. + :vartype model: str + :ivar productCode: Asset product code. + :vartype productCode: str + :ivar hardwareRevision: Revision number of the hardware. + :vartype hardwareRevision: str + :ivar softwareRevision: Revision number of the software. + :vartype softwareRevision: str + :ivar documentationUri: Reference to the documentation. + :vartype documentationUri: str + :ivar serialNumber: Asset serial number. + :vartype serialNumber: str + :ivar attributes: A set of key-value pairs that contain custom attributes set by the customer. + :vartype attributes: dict[str, Any] + :ivar defaultDatasetsConfiguration: Stringified JSON that contains connector-specific default + configuration for all datasets. Each dataset can have its own configuration that overrides the + default settings here. + :vartype defaultDatasetsConfiguration: str + :ivar defaultEventsConfiguration: Stringified JSON that contains connector-specific default + configuration for all events. Each event can have its own configuration that overrides the + default settings here. + :vartype defaultEventsConfiguration: str + :ivar defaultTopic: Object that describes the default topic information for the asset. + :vartype defaultTopic: "Topic" + :ivar datasets: Array of datasets that are part of the asset. Each dataset describes the data + points that make up the set. + :vartype datasets: list["Dataset"] + :ivar events: Array of events that are part of the asset. Each event can have per-event + configuration. + :vartype events: list["Event"] + """ + + enabled: bool + """Enabled/Disabled status of the asset.""" + displayName: str + """Human-readable display name.""" + description: str + """Human-readable description of the asset.""" + manufacturer: str + """Asset manufacturer name.""" + manufacturerUri: str + """Asset manufacturer URI.""" + model: str + """Asset model name.""" + productCode: str + """Asset product code.""" + hardwareRevision: str + """Revision number of the hardware.""" + softwareRevision: str + """Revision number of the software.""" + documentationUri: str + """Reference to the documentation.""" + serialNumber: str + """Asset serial number.""" + attributes: dict[str, Any] + """A set of key-value pairs that contain custom attributes set by the customer.""" + defaultDatasetsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all datasets. Each + dataset can have its own configuration that overrides the default settings here.""" + defaultEventsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all events. Each + event can have its own configuration that overrides the default settings here.""" + defaultTopic: "Topic" + """Object that describes the default topic information for the asset.""" + datasets: list["Dataset"] + """Array of datasets that are part of the asset. Each dataset describes the data points that make + up the set.""" + events: list["Event"] + """Array of events that are part of the asset. Each event can have per-event configuration.""" + + +class Authentication(TypedDict, total=False): + """Definition of the client authentication mechanism to the server. + + :ivar method: Defines the method to authenticate the user of the client at the server. + Required. Known values are: "Anonymous", "Certificate", and "UsernamePassword". + :vartype method: Union[str, "AuthenticationMethod"] + :ivar usernamePasswordCredentials: Defines the username and password references when + UsernamePassword user authentication mode is selected. + :vartype usernamePasswordCredentials: "UsernamePasswordCredentials" + :ivar x509Credentials: Defines the certificate reference when Certificate user authentication + mode is selected. + :vartype x509Credentials: "X509Credentials" + """ + + method: Required[Union[str, "AuthenticationMethod"]] + """Defines the method to authenticate the user of the client at the server. Required. Known values + are: \"Anonymous\", \"Certificate\", and \"UsernamePassword\".""" + usernamePasswordCredentials: "UsernamePasswordCredentials" + """Defines the username and password references when UsernamePassword user authentication mode is + selected.""" + x509Credentials: "X509Credentials" + """Defines the certificate reference when Certificate user authentication mode is selected.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + """ + + +class BrokerStateStoreDestinationConfiguration(TypedDict, total=False): + """The configuration for a MQTT broker state store destination. + + :ivar key: The MQTT broker state store destination key. Required. + :vartype key: str + """ + + key: Required[str] + """The MQTT broker state store destination key. Required.""" + + +class CertificateAuthority(TrackedResource): + """A Certificate Authority resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "CertificateAuthorityProperties" + """ + + properties: "CertificateAuthorityProperties" + """The resource-specific properties for this resource.""" + + +class CertificateAuthorityUpdate(TypedDict, total=False): + """Update model for Certificate Authority. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + tags: dict[str, str] + """Resource tags.""" + + +class CertificatePolicy(TrackedResource): + """A Certificate Policy resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "CertificatePolicyProperties" + """ + + properties: "CertificatePolicyProperties" + """The resource-specific properties for this resource.""" + + +class CertificatePolicyConfiguration(TypedDict, total=False): + """The Certificate Policy certificate configuration. + + :ivar validityPeriodInDays: The validity period in days. Required. + :vartype validityPeriodInDays: int + """ + + validityPeriodInDays: Required[int] + """The validity period in days. Required.""" + + +class CertificatePolicyProperties(TypedDict, total=False): + """Details of the Certificate Policy resource. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar uuid: Globally unique, immutable, non-reusable identifier of the Certificate Policy + resource. + :vartype uuid: str + :ivar certificate: The certificate configuration. + :vartype certificate: "CertificatePolicyConfiguration" + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", and \"Deleting\".""" + uuid: str + """Globally unique, immutable, non-reusable identifier of the Certificate Policy resource.""" + certificate: "CertificatePolicyConfiguration" + """The certificate configuration.""" + + +class CertificatePolicyUpdate(TypedDict, total=False): + """The type used for update operations of the CertificatePolicy. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "CertificatePolicyUpdateProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "CertificatePolicyUpdateProperties" + """The resource-specific properties for this resource.""" + + +class CertificatePolicyUpdateProperties(TypedDict, total=False): + """The updatable properties of the CertificatePolicy. + + :ivar certificate: The certificate configuration. + :vartype certificate: "OptionalPropertiesCertificatePolicyConfiguration" + """ + + certificate: "OptionalPropertiesCertificatePolicyConfiguration" + """The certificate configuration.""" + + +class DataPointBase(TypedDict, total=False): + """Defines the data point properties. + + :ivar name: The name of the data point. Required. + :vartype name: str + :ivar dataSource: The address of the source of the data in the asset (e.g. URL) so that a + client can access the data source on the asset. Required. + :vartype dataSource: str + :ivar dataPointConfiguration: Stringified JSON that contains connector-specific configuration + for the data point. For OPC UA, this could include configuration like, publishingInterval, + samplingInterval, and queueSize. + :vartype dataPointConfiguration: str + """ + + name: Required[str] + """The name of the data point. Required.""" + dataSource: Required[str] + """The address of the source of the data in the asset (e.g. URL) so that a client can access the + data source on the asset. Required.""" + dataPointConfiguration: str + """Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, + this could include configuration like, publishingInterval, samplingInterval, and queueSize.""" + + +class DataPoint(DataPointBase): + """Defines the data point properties. + + :ivar name: The name of the data point. Required. + :vartype name: str + :ivar dataSource: The address of the source of the data in the asset (e.g. URL) so that a + client can access the data source on the asset. Required. + :vartype dataSource: str + :ivar dataPointConfiguration: Stringified JSON that contains connector-specific configuration + for the data point. For OPC UA, this could include configuration like, publishingInterval, + samplingInterval, and queueSize. + :vartype dataPointConfiguration: str + :ivar observabilityMode: An indication of how the data point should be mapped to OpenTelemetry. + Known values are: "None", "Counter", "Gauge", "Histogram", and "Log". + :vartype observabilityMode: Union[str, "DataPointObservabilityMode"] + """ + + observabilityMode: Union[str, "DataPointObservabilityMode"] + """An indication of how the data point should be mapped to OpenTelemetry. Known values are: + \"None\", \"Counter\", \"Gauge\", \"Histogram\", and \"Log\".""" + + +class Dataset(TypedDict, total=False): + """Defines the dataset properties. + + :ivar name: Name of the dataset. Required. + :vartype name: str + :ivar datasetConfiguration: Stringified JSON that contains connector-specific JSON string that + describes configuration for the specific dataset. + :vartype datasetConfiguration: str + :ivar topic: Object that describes the topic information for the specific dataset. + :vartype topic: "Topic" + :ivar dataPoints: Array of data points that are part of the dataset. Each data point can have + per-data point configuration. + :vartype dataPoints: list["DataPoint"] + """ + + name: Required[str] + """Name of the dataset. Required.""" + datasetConfiguration: str + """Stringified JSON that contains connector-specific JSON string that describes configuration for + the specific dataset.""" + topic: "Topic" + """Object that describes the topic information for the specific dataset.""" + dataPoints: list["DataPoint"] + """Array of data points that are part of the dataset. Each data point can have per-data point + configuration.""" + + +class DatasetBrokerStateStoreDestination(TypedDict, total=False): + """The type for a MQTT broker state store destination. + + :ivar target: The MQTT broker state store destination target. Required. Broker State Store + target. + :vartype target: Literal[DatasetDestinationTarget.BROKER_STATE_STORE] + :ivar configuration: The MQTT broker state store destination configuration. Required. + :vartype configuration: "BrokerStateStoreDestinationConfiguration" + """ + + target: Required[Literal[DatasetDestinationTarget.BROKER_STATE_STORE]] + """The MQTT broker state store destination target. Required. Broker State Store target.""" + configuration: Required["BrokerStateStoreDestinationConfiguration"] + """The MQTT broker state store destination configuration. Required.""" + + +class DatasetMqttDestination(TypedDict, total=False): + """The type for a MQTT destination. + + :ivar target: The MQTT destination type. Required. MQTT target. + :vartype target: Literal[DatasetDestinationTarget.MQTT] + :ivar configuration: The MQTT destination configuration. Required. + :vartype configuration: "MqttDestinationConfiguration" + """ + + target: Required[Literal[DatasetDestinationTarget.MQTT]] + """The MQTT destination type. Required. MQTT target.""" + configuration: Required["MqttDestinationConfiguration"] + """The MQTT destination configuration. Required.""" + + +class DatasetStorageDestination(TypedDict, total=False): + """The type for a storage destination. + + :ivar target: The storage destination type. Required. Storage target. + :vartype target: Literal[DatasetDestinationTarget.STORAGE] + :ivar configuration: The storage destination configuration. Required. + :vartype configuration: "StorageDestinationConfiguration" + """ + + target: Required[Literal[DatasetDestinationTarget.STORAGE]] + """The storage destination type. Required. Storage target.""" + configuration: Required["StorageDestinationConfiguration"] + """The storage destination configuration. Required.""" + + +class DeviceMessagingEndpoint(TypedDict, total=False): + """Device messaging endpoint model. + + :ivar endpointType: Type of connection used for the messaging endpoint. + :vartype endpointType: str + :ivar address: The endpoint address to connect to. Required. + :vartype address: str + """ + + endpointType: str + """Type of connection used for the messaging endpoint.""" + address: Required[str] + """The endpoint address to connect to. Required.""" + + +class DeviceRef(TypedDict, total=False): + """Defines which device and endpoint to use for this asset. + + :ivar deviceName: Name of the device resource. Required. + :vartype deviceName: str + :ivar endpointName: The name of endpoint to use. Required. + :vartype endpointName: str + """ + + deviceName: Required[str] + """Name of the device resource. Required.""" + endpointName: Required[str] + """The name of endpoint to use. Required.""" + + +class DeviceStatus(TypedDict, total=False): + """Defines the device status properties. + + :ivar config: Defines the device status config properties. + :vartype config: "StatusConfig" + :ivar endpoints: Defines the device status for inbound/outbound endpoints. + :vartype endpoints: "DeviceStatusEndpoints" + """ + + config: "StatusConfig" + """Defines the device status config properties.""" + endpoints: "DeviceStatusEndpoints" + """Defines the device status for inbound/outbound endpoints.""" + + +class DeviceStatusEndpoint(TypedDict, total=False): + """Defines the device status properties. + + :ivar error: Defines the error related to this endpoint. + :vartype error: "StatusError" + :ivar healthState: Health state of the endpoint. + :vartype healthState: "HealthState" + """ + + error: "StatusError" + """Defines the error related to this endpoint.""" + healthState: "HealthState" + """Health state of the endpoint.""" + + +class DeviceStatusEndpoints(TypedDict, total=False): + """Defines the device status for inbound/outbound endpoints. + + :ivar inbound: KeyValue pair representing status of inbound endpoints. + :vartype inbound: dict[str, "DeviceStatusEndpoint"] + """ + + inbound: dict[str, "DeviceStatusEndpoint"] + """KeyValue pair representing status of inbound endpoints.""" + + +class DiscoveredInboundEndpoints(TypedDict, total=False): + """An endpoint to connect to the device. + + :ivar endpointType: Type of connection endpoint. Required. + :vartype endpointType: str + :ivar address: The endpoint address & port. This can be either an IP address (e.g., + 192.168.1.1) or a fully qualified domain name (FQDN, e.g., server.example.com). Required. + :vartype address: str + :ivar version: Protocol version associated with the endpoint e.g. 1 or 2 for endpointType + Microsoft.HTTP, and 3.5 or 5.0 for endpointType Microsoft.Mqtt etc. + :vartype version: str + :ivar supportedAuthenticationMethods: List of supported authentication methods supported by + device for Inbound connections. + :vartype supportedAuthenticationMethods: list[Union[str, "AuthenticationMethod"]] + :ivar additionalConfiguration: Stringified JSON that contains configuration to be used by the + connector (e.g., OPC UA, ONVIF). + :vartype additionalConfiguration: str + :ivar lastUpdatedOn: The timestamp (in UTC) when the endpoint was discovered. + :vartype lastUpdatedOn: str + """ + + endpointType: Required[str] + """Type of connection endpoint. Required.""" + address: Required[str] + """The endpoint address & port. This can be either an IP address (e.g., 192.168.1.1) or a fully + qualified domain name (FQDN, e.g., server.example.com). Required.""" + version: str + """Protocol version associated with the endpoint e.g. 1 or 2 for endpointType Microsoft.HTTP, and + 3.5 or 5.0 for endpointType Microsoft.Mqtt etc.""" + supportedAuthenticationMethods: list[Union[str, "AuthenticationMethod"]] + """List of supported authentication methods supported by device for Inbound connections.""" + additionalConfiguration: str + """Stringified JSON that contains configuration to be used by the connector (e.g., OPC UA, ONVIF).""" + lastUpdatedOn: str + """The timestamp (in UTC) when the endpoint was discovered.""" + + +class DiscoveredMessagingEndpoints(TypedDict, total=False): + """Connection endpoint URL a device can use to connect to a service. + + :ivar inbound: Set of endpoints to connect to the device. + :vartype inbound: dict[str, "DiscoveredInboundEndpoints"] + :ivar outbound: Set of endpoints a device can connect to. + :vartype outbound: "DiscoveredOutboundEndpoints" + """ + + inbound: dict[str, "DiscoveredInboundEndpoints"] + """Set of endpoints to connect to the device.""" + outbound: "DiscoveredOutboundEndpoints" + """Set of endpoints a device can connect to.""" + + +class DiscoveredOutboundEndpoints(TypedDict, total=False): + """Property bag contains the device's outbound endpoints. + + :ivar assigned: Endpoints the device can connect to. Required. + :vartype assigned: dict[str, "DeviceMessagingEndpoint"] + """ + + assigned: Required[dict[str, "DeviceMessagingEndpoint"]] + """Endpoints the device can connect to. Required.""" + + +class ErrorDetails(TypedDict, total=False): + """Defines the error details properties. + + :ivar code: Multi-part error code for classification and root causing of errors (ex: + 400.200.100.432). + :vartype code: str + :ivar message: Human-readable helpful error message to provide additional context for error + (ex: “Authentication method not supported”). + :vartype message: str + :ivar info: Human-readable helpful detailed text context for debugging (ex: “The following + mechanisms are supported...”). + :vartype info: str + :ivar correlationId: Unique identifier for the transaction to aid in debugging. + :vartype correlationId: str + """ + + code: str + """Multi-part error code for classification and root causing of errors (ex: 400.200.100.432).""" + message: str + """Human-readable helpful error message to provide additional context for error (ex: + “Authentication method not supported”).""" + info: str + """Human-readable helpful detailed text context for debugging (ex: “The following mechanisms are + supported...”).""" + correlationId: str + """Unique identifier for the transaction to aid in debugging.""" + + +class EventBase(TypedDict, total=False): + """Defines the event properties. + + :ivar name: The name of the event. Required. + :vartype name: str + :ivar eventNotifier: The address of the notifier of the event in the asset (e.g. URL) so that a + client can access the event on the asset. Required. + :vartype eventNotifier: str + :ivar eventConfiguration: Stringified JSON that contains connector-specific configuration for + the event. For OPC UA, this could include configuration like, publishingInterval, + samplingInterval, and queueSize. + :vartype eventConfiguration: str + :ivar topic: Object that describes the topic information for the specific event. + :vartype topic: "Topic" + """ + + name: Required[str] + """The name of the event. Required.""" + eventNotifier: Required[str] + """The address of the notifier of the event in the asset (e.g. URL) so that a client can access + the event on the asset. Required.""" + eventConfiguration: str + """Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this + could include configuration like, publishingInterval, samplingInterval, and queueSize.""" + topic: "Topic" + """Object that describes the topic information for the specific event.""" + + +class Event(EventBase): + """Defines the event properties. + + :ivar name: The name of the event. Required. + :vartype name: str + :ivar eventNotifier: The address of the notifier of the event in the asset (e.g. URL) so that a + client can access the event on the asset. Required. + :vartype eventNotifier: str + :ivar eventConfiguration: Stringified JSON that contains connector-specific configuration for + the event. For OPC UA, this could include configuration like, publishingInterval, + samplingInterval, and queueSize. + :vartype eventConfiguration: str + :ivar topic: Object that describes the topic information for the specific event. + :vartype topic: "Topic" + :ivar observabilityMode: An indication of how the event should be mapped to OpenTelemetry. + Known values are: "None" and "Log". + :vartype observabilityMode: Union[str, "EventObservabilityMode"] + """ + + observabilityMode: Union[str, "EventObservabilityMode"] + """An indication of how the event should be mapped to OpenTelemetry. Known values are: \"None\" + and \"Log\".""" + + +class EventMqttDestination(TypedDict, total=False): + """The type for a MQTT destination. + + :ivar target: The MQTT destination type. Required. MQTT target. + :vartype target: Literal[EventDestinationTarget.MQTT] + :ivar configuration: The MQTT destination configuration. Required. + :vartype configuration: "MqttDestinationConfiguration" + """ + + target: Required[Literal[EventDestinationTarget.MQTT]] + """The MQTT destination type. Required. MQTT target.""" + configuration: Required["MqttDestinationConfiguration"] + """The MQTT destination configuration. Required.""" + + +class EventStorageDestination(TypedDict, total=False): + """The type for a storage destination. + + :ivar target: The storage destination type. Required. Storage target. + :vartype target: Literal[EventDestinationTarget.STORAGE] + :ivar configuration: The storage destination configuration. Required. + :vartype configuration: "StorageDestinationConfiguration" + """ + + target: Required[Literal[EventDestinationTarget.STORAGE]] + """The storage destination type. Required. Storage target.""" + configuration: Required["StorageDestinationConfiguration"] + """The storage destination configuration. Required.""" + + +class ExtendedLocation(TypedDict, total=False): + """The extended location. + + :ivar type: The extended location type. Required. + :vartype type: str + :ivar name: The extended location name. Required. + :vartype name: str + """ + + type: Required[str] + """The extended location type. Required.""" + name: Required[str] + """The extended location name. Required.""" + + +class ExternalCertificateAuthorityIssuer(TypedDict, total=False): + """An external issuer for an intermediate Certificate Authority. + + :ivar issuerType: The external issuer type. Required. The intermediate Certificate Authority is + issued by an external Certificate Authority. + :vartype issuerType: Literal[CertificateAuthorityIssuerType.EXTERNAL] + :ivar certificateSigningRequest: Certificate Signing Request (CSR) in PEM format, generated by + the service. + :vartype certificateSigningRequest: str + :ivar thumbprint: Thumbprint of the Certificate Authority certificate signed by the external + issuer. + :vartype thumbprint: str + :ivar status: The status of the external issuer certificate lifecycle. Known values are: + "PendingActivation", "Active", and "ActiveButPendingRenewal". + :vartype status: Union[str, "CertificateAuthorityStatus"] + """ + + issuerType: Required[Literal[CertificateAuthorityIssuerType.EXTERNAL]] + """The external issuer type. Required. The intermediate Certificate Authority is issued by an + external Certificate Authority.""" + certificateSigningRequest: str + """Certificate Signing Request (CSR) in PEM format, generated by the service.""" + thumbprint: str + """Thumbprint of the Certificate Authority certificate signed by the external issuer.""" + status: Union[str, "CertificateAuthorityStatus"] + """The status of the external issuer certificate lifecycle. Known values are: + \"PendingActivation\", \"Active\", and \"ActiveButPendingRenewal\".""" + + +class HealthState(TypedDict, total=False): + """Represents the health state of a resource. + + :ivar status: The high-level health status of the resource. Known values are: "Unknown", + "Available", "Degraded", and "Unavailable". + :vartype status: Union[str, "HealthStatus"] + :ivar lastTransitionTime: The timestamp (RFC3339) when the health status last changed. + :vartype lastTransitionTime: str + :ivar lastUpdateTime: The timestamp (RFC3339) when the health status was last updated, even if + the status did not change. + :vartype lastUpdateTime: str + :ivar message: A human-readable message describing the last transition. + :vartype message: str + :ivar reasonCode: Unique, CamelCase reason code describing the cause of the last health state + transition. + :vartype reasonCode: str + """ + + status: Union[str, "HealthStatus"] + """The high-level health status of the resource. Known values are: \"Unknown\", \"Available\", + \"Degraded\", and \"Unavailable\".""" + lastTransitionTime: str + """The timestamp (RFC3339) when the health status last changed.""" + lastUpdateTime: str + """The timestamp (RFC3339) when the health status was last updated, even if the status did not + change.""" + message: str + """A human-readable message describing the last transition.""" + reasonCode: str + """Unique, CamelCase reason code describing the cause of the last health state transition.""" + + +class HostAuthentication(TypedDict, total=False): + """Definition of the client authentication mechanism to the host. + + :ivar method: Defines the method to authenticate the user of the client at the server. + Required. Known values are: "Anonymous", "Certificate", and "UsernamePassword". + :vartype method: Union[str, "AuthenticationMethod"] + :ivar usernamePasswordCredentials: Defines the username and password references when + UsernamePassword user authentication mode is selected. + :vartype usernamePasswordCredentials: "UsernamePasswordCredentials" + :ivar x509Credentials: Defines the certificate reference when Certificate user authentication + mode is selected. + :vartype x509Credentials: "X509CertificateCredentials" + """ + + method: Required[Union[str, "AuthenticationMethod"]] + """Defines the method to authenticate the user of the client at the server. Required. Known values + are: \"Anonymous\", \"Certificate\", and \"UsernamePassword\".""" + usernamePasswordCredentials: "UsernamePasswordCredentials" + """Defines the username and password references when UsernamePassword user authentication mode is + selected.""" + x509Credentials: "X509CertificateCredentials" + """Defines the certificate reference when Certificate user authentication mode is selected.""" + + +class InboundCallerIdentity(TypedDict, total=False): + """The identity a linked resource uses for inbound calls to the ADR namespace. + + :ivar type: The identity type. Required. Known values are: "SystemAssigned" and "UserAssigned". + :vartype type: Union[str, "InboundCallerIdentityType"] + :ivar userAssignedIdentity: The resource ID of the user-assigned managed identity. Required + when type is UserAssigned. + :vartype userAssignedIdentity: str + """ + + type: Required[Union[str, "InboundCallerIdentityType"]] + """The identity type. Required. Known values are: \"SystemAssigned\" and \"UserAssigned\".""" + userAssignedIdentity: str + """The resource ID of the user-assigned managed identity. Required when type is UserAssigned.""" + + +class InboundEndpoints(TypedDict, total=False): + """An endpoint to connect to the device. + + :ivar endpointType: Type of connection endpoint. Required. + :vartype endpointType: str + :ivar address: The endpoint address & port. This can be either an IP address (e.g., + 192.168.1.1) or a fully qualified domain name (FQDN, e.g., server.example.com). Required. + :vartype address: str + :ivar version: Protocol version associated with the endpoint e.g. 1 or 2 for endpointType + Microsoft.HTTP, and 3.5 or 5.0 for endpointType Microsoft.Mqtt etc. + :vartype version: str + :ivar authentication: Defines the client authentication mechanism to the server. + :vartype authentication: "HostAuthentication" + :ivar trustSettings: Defines server trust settings for the endpoint. + :vartype trustSettings: "TrustSettings" + :ivar additionalConfiguration: Stringified JSON that contains configuration to be used by the + connector (e.g., OPC UA, ONVIF). + :vartype additionalConfiguration: str + """ + + endpointType: Required[str] + """Type of connection endpoint. Required.""" + address: Required[str] + """The endpoint address & port. This can be either an IP address (e.g., 192.168.1.1) or a fully + qualified domain name (FQDN, e.g., server.example.com). Required.""" + version: str + """Protocol version associated with the endpoint e.g. 1 or 2 for endpointType Microsoft.HTTP, and + 3.5 or 5.0 for endpointType Microsoft.Mqtt etc.""" + authentication: "HostAuthentication" + """Defines the client authentication mechanism to the server.""" + trustSettings: "TrustSettings" + """Defines server trust settings for the endpoint.""" + additionalConfiguration: str + """Stringified JSON that contains configuration to be used by the connector (e.g., OPC UA, ONVIF).""" + + +class IntermediateCertificateAuthorityProperties(TypedDict, total=False): # pylint: disable=name-too-long + """Properties for an intermediate Certificate Authority signed by another same-namespace + Certificate Authority. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar uuid: Globally unique, immutable, non-reusable identifier of the Certificate Authority + resource. + :vartype uuid: str + :ivar keyType: Crypto type: ECC. Required. "ECC" + :vartype keyType: Union[str, "CertificateAuthorityKeyType"] + :ivar subject: Certificate subject. + :vartype subject: str + :ivar validityNotBefore: Certificate is valid not before this date. Format ISO8601. + :vartype validityNotBefore: str + :ivar validityNotAfter: Certificate is valid not after this date. Format ISO8601. + :vartype validityNotAfter: str + :ivar certificateAuthorityType: The intermediate Certificate Authority type. Required. + Intermediate Certificate Authority signed by another Certificate Authority. + :vartype certificateAuthorityType: Literal[CertificateAuthorityType.ICA] + :ivar issuer: The issuer for the intermediate Certificate Authority. Required. + :vartype issuer: "CertificateAuthorityIssuer" + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", and \"Deleting\".""" + uuid: str + """Globally unique, immutable, non-reusable identifier of the Certificate Authority resource.""" + keyType: Required[Union[str, "CertificateAuthorityKeyType"]] + """Crypto type: ECC. Required. \"ECC\"""" + subject: str + """Certificate subject.""" + validityNotBefore: str + """Certificate is valid not before this date. Format ISO8601.""" + validityNotAfter: str + """Certificate is valid not after this date. Format ISO8601.""" + certificateAuthorityType: Required[Literal[CertificateAuthorityType.ICA]] + """The intermediate Certificate Authority type. Required. Intermediate Certificate Authority + signed by another Certificate Authority.""" + issuer: Required["CertificateAuthorityIssuer"] + """The issuer for the intermediate Certificate Authority. Required.""" + + +class ManagedServiceIdentity(TypedDict, total=False): + """Managed service identity (system assigned and/or user assigned identities). + + :ivar principalId: The service principal ID of the system assigned identity. This property will + only be provided for a system assigned identity. + :vartype principalId: str + :ivar tenantId: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenantId: str + :ivar type: The type of managed identity assigned to this resource. Required. Known values are: + "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: Union[str, "ManagedServiceIdentityType"] + :ivar userAssignedIdentities: The identities assigned to this resource by the user. + :vartype userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """ + + principalId: str + """The service principal ID of the system assigned identity. This property will only be provided + for a system assigned identity.""" + tenantId: str + """The tenant ID of the system assigned identity. This property will only be provided for a system + assigned identity.""" + type: Required[Union[str, "ManagedServiceIdentityType"]] + """The type of managed identity assigned to this resource. Required. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + userAssignedIdentities: dict[str, "UserAssignedIdentity"] + """The identities assigned to this resource by the user.""" + + +class Management(TypedDict, total=False): + """The namespace management endpoints model. + + :ivar endpoints: Dictionary of management endpoints. + :vartype endpoints: dict[str, "ManagementEndpoint"] + """ + + endpoints: dict[str, "ManagementEndpoint"] + """Dictionary of management endpoints.""" + + +class ManagementAction(TypedDict, total=False): + """Defines the action properties. + + :ivar name: Name of the action. Required. + :vartype name: str + :ivar actionConfiguration: Stringified JSON that contains connector-specific configuration for + the action. + :vartype actionConfiguration: str + :ivar targetUri: The target URI on which a client can invoke the specific action. Required. + :vartype targetUri: str + :ivar typeRef: URI or type definition ID. + :vartype typeRef: str + :ivar topic: The MQTT topic path on which a client will receive the request for the action. + :vartype topic: str + :ivar actionType: The type of the action. Known values are: "Call", "Read", and "Write". + :vartype actionType: Union[str, "ManagementActionType"] + :ivar timeoutInSeconds: Response timeout for the action. + :vartype timeoutInSeconds: int + """ + + name: Required[str] + """Name of the action. Required.""" + actionConfiguration: str + """Stringified JSON that contains connector-specific configuration for the action.""" + targetUri: Required[str] + """The target URI on which a client can invoke the specific action. Required.""" + typeRef: str + """URI or type definition ID.""" + topic: str + """The MQTT topic path on which a client will receive the request for the action.""" + actionType: Union[str, "ManagementActionType"] + """The type of the action. Known values are: \"Call\", \"Read\", and \"Write\".""" + timeoutInSeconds: int + """Response timeout for the action.""" + + +class ManagementEndpoint(TypedDict, total=False): + """Namespace management endpoint model used by service to connect to device. + + :ivar endpointType: Type of connection used for management endpoint. Required. + :vartype endpointType: str + :ivar address: The endpoint address to connect to. Required. + :vartype address: str + :ivar scopeId: The scope ID for the management endpoint. Required. + :vartype scopeId: str + :ivar resourceId: The messaging endpoint Azure resource Id. Required. + :vartype resourceId: str + """ + + endpointType: Required[str] + """Type of connection used for management endpoint. Required.""" + address: Required[str] + """The endpoint address to connect to. Required.""" + scopeId: Required[str] + """The scope ID for the management endpoint. Required.""" + resourceId: Required[str] + """The messaging endpoint Azure resource Id. Required.""" + + +class ManagementGroup(TypedDict, total=False): + """Defines the management group properties. + + :ivar name: Name of the management group. Required. + :vartype name: str + :ivar dataSource: Reference to a data source for a given management group. + :vartype dataSource: str + :ivar managementGroupConfiguration: Stringified JSON that contains connector-specific + configuration for the management group. + :vartype managementGroupConfiguration: str + :ivar typeRef: URI or type definition ID. + :vartype typeRef: str + :ivar defaultTopic: Default MQTT topic path on which a client will receive the request for all + actions that are part of the management group. + :vartype defaultTopic: str + :ivar defaultTimeoutInSeconds: Default response timeout for all actions that are part of the + management group. + :vartype defaultTimeoutInSeconds: int + :ivar actions: Array of actions that are part of the management group. Each action can have an + individual configuration. + :vartype actions: list["ManagementAction"] + """ + + name: Required[str] + """Name of the management group. Required.""" + dataSource: str + """Reference to a data source for a given management group.""" + managementGroupConfiguration: str + """Stringified JSON that contains connector-specific configuration for the management group.""" + typeRef: str + """URI or type definition ID.""" + defaultTopic: str + """Default MQTT topic path on which a client will receive the request for all actions that are + part of the management group.""" + defaultTimeoutInSeconds: int + """Default response timeout for all actions that are part of the management group.""" + actions: list["ManagementAction"] + """Array of actions that are part of the management group. Each action can have an individual + configuration.""" + + +class MessageSchemaReference(TypedDict, total=False): + """Defines the message schema reference properties. + + :ivar schemaRegistryNamespace: The message schema registry namespace. Required. + :vartype schemaRegistryNamespace: str + :ivar schemaName: The message schema name. Required. + :vartype schemaName: str + :ivar schemaVersion: The message schema version. Required. + :vartype schemaVersion: str + """ + + schemaRegistryNamespace: Required[str] + """The message schema registry namespace. Required.""" + schemaName: Required[str] + """The message schema name. Required.""" + schemaVersion: Required[str] + """The message schema version. Required.""" + + +class Messaging(TypedDict, total=False): + """The namespace messaging endpoints model. + + :ivar endpoints: Dictionary of messaging endpoints. + :vartype endpoints: dict[str, "MessagingEndpoint"] + """ + + endpoints: dict[str, "MessagingEndpoint"] + """Dictionary of messaging endpoints.""" + + +class MessagingEndpoint(TypedDict, total=False): + """Namespace messaging endpoint model used by a device to connect to a service. + + :ivar endpointType: Type of connection used for messaging endpoint. + :vartype endpointType: str + :ivar address: The endpoint address to connect to. + :vartype address: str + :ivar resourceId: The messaging endpoint Azure resource Id. + :vartype resourceId: str + :ivar deviceAddress: The endpoint address used by devices. + :vartype deviceAddress: str + :ivar inboundCallerIdentity: The identity the linked resource uses to call the ADR namespace. + :vartype inboundCallerIdentity: "InboundCallerIdentity" + :ivar linkingState: The linking state of this messaging endpoint. Known values are: + "InProgress", "Succeeded", and "Failed". + :vartype linkingState: Union[str, "NamespaceLinkingStateValue"] + :ivar linkingError: The error detail surfaced when this messaging endpoint is in the Failed + linking state. + :vartype linkingError: "NamespaceLinkingError" + :ivar provisioning: The provisioning configuration for this messaging endpoint. + :vartype provisioning: "MessagingEndpointProvisioning" + """ + + endpointType: str + """Type of connection used for messaging endpoint.""" + address: str + """The endpoint address to connect to.""" + resourceId: str + """The messaging endpoint Azure resource Id.""" + deviceAddress: str + """The endpoint address used by devices.""" + inboundCallerIdentity: "InboundCallerIdentity" + """The identity the linked resource uses to call the ADR namespace.""" + linkingState: Union[str, "NamespaceLinkingStateValue"] + """The linking state of this messaging endpoint. Known values are: \"InProgress\", \"Succeeded\", + and \"Failed\".""" + linkingError: "NamespaceLinkingError" + """The error detail surfaced when this messaging endpoint is in the Failed linking state.""" + provisioning: "MessagingEndpointProvisioning" + """The provisioning configuration for this messaging endpoint.""" + + +class MessagingEndpointProvisioning(TypedDict, total=False): + """The provisioning configuration for a messaging endpoint. + + :ivar availability: The availability status of the messaging endpoint. Known values are: + "Available" and "Disabled". + :vartype availability: Union[str, "MessagingEndpointAvailability"] + :ivar allocationWeight: The allocation weight for this messaging endpoint. + :vartype allocationWeight: int + """ + + availability: Union[str, "MessagingEndpointAvailability"] + """The availability status of the messaging endpoint. Known values are: \"Available\" and + \"Disabled\".""" + allocationWeight: int + """The allocation weight for this messaging endpoint.""" + + +class MessagingEndpoints(TypedDict, total=False): + """Connection endpoint URL a device can use to connect to a service. + + :ivar inbound: Set of endpoints to connect to the device. + :vartype inbound: dict[str, "InboundEndpoints"] + :ivar outbound: Set of endpoints a device can connect to. + :vartype outbound: "OutboundEndpoints" + """ + + inbound: dict[str, "InboundEndpoints"] + """Set of endpoints to connect to the device.""" + outbound: "OutboundEndpoints" + """Set of endpoints a device can connect to.""" + + +class MicrosoftCertificateAuthorityIssuer(TypedDict, total=False): + """A Microsoft issuer for an intermediate Certificate Authority. + + :ivar issuerType: The Microsoft issuer type. Required. The intermediate Certificate Authority + is issued by Microsoft. + :vartype issuerType: Literal[CertificateAuthorityIssuerType.MICROSOFT] + :ivar certificateAuthorityResourceId: The resource ID of the root issuer Certificate Authority + in the same namespace. Required. + :vartype certificateAuthorityResourceId: str + """ + + issuerType: Required[Literal[CertificateAuthorityIssuerType.MICROSOFT]] + """The Microsoft issuer type. Required. The intermediate Certificate Authority is issued by + Microsoft.""" + certificateAuthorityResourceId: Required[str] + """The resource ID of the root issuer Certificate Authority in the same namespace. Required.""" + + +class MqttDestinationConfiguration(TypedDict, total=False): + """The configuration for a MQTT destination. + + :ivar topic: The MQTT topic. Required. + :vartype topic: str + :ivar retain: When set to 'Keep', messages published to an MQTT broker will have the retain + flag set. Default: 'Never'. Known values are: "Keep" and "Never". + :vartype retain: Union[str, "TopicRetainType"] + :ivar qos: The MQTT QoS setting. Defaults to QoS 1. Known values are: "Qos0" and "Qos1". + :vartype qos: Union[str, "MqttDestinationQos"] + :ivar ttl: The MQTT TTL setting. + :vartype ttl: int + """ + + topic: Required[str] + """The MQTT topic. Required.""" + retain: Union[str, "TopicRetainType"] + """When set to 'Keep', messages published to an MQTT broker will have the retain flag set. + Default: 'Never'. Known values are: \"Keep\" and \"Never\".""" + qos: Union[str, "MqttDestinationQos"] + """The MQTT QoS setting. Defaults to QoS 1. Known values are: \"Qos0\" and \"Qos1\".""" + ttl: int + """The MQTT TTL setting.""" + + +class Namespace(TrackedResource): + """Namespace definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "NamespaceProperties" + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + properties: "NamespaceProperties" + """The resource-specific properties for this resource.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +class NamespaceAsset(TrackedResource): + """Asset definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "NamespaceAssetProperties" + :ivar extendedLocation: The extended location. Required. + :vartype extendedLocation: "ExtendedLocation" + """ + + properties: "NamespaceAssetProperties" + """The resource-specific properties for this resource.""" + extendedLocation: Required["ExtendedLocation"] + """The extended location. Required.""" + + +class NamespaceAssetExecuteActionRequest(TypedDict, total=False): + """The request body for the executeAction operation on NamespaceAsset. + + :ivar managementActionName: Name of the management action to be executed. Required. + :vartype managementActionName: str + :ivar managementGroupName: Name of the management group under which the action is to be + executed. Required. + :vartype managementGroupName: str + :ivar payload: Payload required for executing the management action. + :vartype payload: dict[str, Any] + """ + + managementActionName: Required[str] + """Name of the management action to be executed. Required.""" + managementGroupName: Required[str] + """Name of the management group under which the action is to be executed. Required.""" + payload: dict[str, Any] + """Payload required for executing the management action.""" + + +class NamespaceAssetProperties(TypedDict, total=False): + """Defines the asset properties. + + :ivar uuid: Globally unique, immutable, non-reusable ID. + :vartype uuid: str + :ivar enabled: Enabled/disabled status of the asset. + :vartype enabled: bool + :ivar externalAssetId: Asset ID provided by the customer. + :vartype externalAssetId: str + :ivar displayName: Human-readable display name. + :vartype displayName: str + :ivar description: Human-readable description of the asset. + :vartype description: str + :ivar deviceRef: Reference to the device that provides data for this asset. Must provide device + name & endpoint on the device to use. Required. + :vartype deviceRef: "DeviceRef" + :ivar assetTypeRefs: URIs or type definition IDs. + :vartype assetTypeRefs: list[str] + :ivar version: An integer that is incremented each time the resource is modified. + :vartype version: int + :ivar lastTransitionTime: A timestamp (in UTC) that is updated each time the resource is + modified. + :vartype lastTransitionTime: str + :ivar manufacturer: Asset manufacturer. + :vartype manufacturer: str + :ivar manufacturerUri: Asset manufacturer URI. + :vartype manufacturerUri: str + :ivar model: Asset model. + :vartype model: str + :ivar productCode: Asset product code. + :vartype productCode: str + :ivar hardwareRevision: Asset hardware revision number. + :vartype hardwareRevision: str + :ivar softwareRevision: Asset software revision number. + :vartype softwareRevision: str + :ivar documentationUri: Asset documentation reference. + :vartype documentationUri: str + :ivar serialNumber: Asset serial number. + :vartype serialNumber: str + :ivar attributes: A set of key-value pairs that contain custom attributes set by the customer. + :vartype attributes: dict[str, Any] + :ivar discoveredAssetRefs: Reference to a list of discovered assets. Populated only if the + asset has been created from discovery flow. Discovered asset names must be provided. + :vartype discoveredAssetRefs: list[str] + :ivar defaultDatasetsConfiguration: Stringified JSON that contains connector-specific default + configuration for all datasets. Each dataset can have its own configuration that overrides the + default settings here. + :vartype defaultDatasetsConfiguration: str + :ivar defaultEventsConfiguration: Stringified JSON that contains connector-specific default + configuration for all events. Each event can have its own configuration that overrides the + default settings here. + :vartype defaultEventsConfiguration: str + :ivar defaultStreamsConfiguration: Stringified JSON that contains connector-specific default + configuration for all streams. Each stream can have its own configuration that overrides the + default settings here. + :vartype defaultStreamsConfiguration: str + :ivar defaultManagementGroupsConfiguration: Stringified JSON that contains connector-specific + default configuration for all management groups. Each management group can have its own + configuration that overrides the default settings here. + :vartype defaultManagementGroupsConfiguration: str + :ivar defaultDatasetsDestinations: Default destinations for a dataset. + :vartype defaultDatasetsDestinations: list["DatasetDestination"] + :ivar defaultEventsDestinations: Default destinations for an event. + :vartype defaultEventsDestinations: list["EventDestination"] + :ivar defaultStreamsDestinations: Default destinations for a stream. + :vartype defaultStreamsDestinations: list["StreamDestination"] + :ivar datasets: Array of datasets that are part of the asset. Each dataset describes the data + points that make up the set. + :vartype datasets: list["NamespaceDataset"] + :ivar eventGroups: Array of event groups that are part of the asset. Each event group can have + per-event group configuration. + :vartype eventGroups: list["NamespaceEventGroup"] + :ivar streams: Array of streams that are part of the asset. Each stream can have a per-stream + configuration. + :vartype streams: list["NamespaceStream"] + :ivar managementGroups: Array of management groups that are part of the asset. Each management + group can have a per-group configuration. + :vartype managementGroups: list["ManagementGroup"] + :ivar status: Read only object to reflect changes that have occurred on the Edge. Similar to + Kubernetes status property for custom resources. + :vartype status: "NamespaceAssetStatus" + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + uuid: str + """Globally unique, immutable, non-reusable ID.""" + enabled: bool + """Enabled/disabled status of the asset.""" + externalAssetId: str + """Asset ID provided by the customer.""" + displayName: str + """Human-readable display name.""" + description: str + """Human-readable description of the asset.""" + deviceRef: Required["DeviceRef"] + """Reference to the device that provides data for this asset. Must provide device name & endpoint + on the device to use. Required.""" + assetTypeRefs: list[str] + """URIs or type definition IDs.""" + version: int + """An integer that is incremented each time the resource is modified.""" + lastTransitionTime: str + """A timestamp (in UTC) that is updated each time the resource is modified.""" + manufacturer: str + """Asset manufacturer.""" + manufacturerUri: str + """Asset manufacturer URI.""" + model: str + """Asset model.""" + productCode: str + """Asset product code.""" + hardwareRevision: str + """Asset hardware revision number.""" + softwareRevision: str + """Asset software revision number.""" + documentationUri: str + """Asset documentation reference.""" + serialNumber: str + """Asset serial number.""" + attributes: dict[str, Any] + """A set of key-value pairs that contain custom attributes set by the customer.""" + discoveredAssetRefs: list[str] + """Reference to a list of discovered assets. Populated only if the asset has been created from + discovery flow. Discovered asset names must be provided.""" + defaultDatasetsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all datasets. Each + dataset can have its own configuration that overrides the default settings here.""" + defaultEventsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all events. Each + event can have its own configuration that overrides the default settings here.""" + defaultStreamsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all streams. Each + stream can have its own configuration that overrides the default settings here.""" + defaultManagementGroupsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all management + groups. Each management group can have its own configuration that overrides the default + settings here.""" + defaultDatasetsDestinations: list["DatasetDestination"] + """Default destinations for a dataset.""" + defaultEventsDestinations: list["EventDestination"] + """Default destinations for an event.""" + defaultStreamsDestinations: list["StreamDestination"] + """Default destinations for a stream.""" + datasets: list["NamespaceDataset"] + """Array of datasets that are part of the asset. Each dataset describes the data points that make + up the set.""" + eventGroups: list["NamespaceEventGroup"] + """Array of event groups that are part of the asset. Each event group can have per-event group + configuration.""" + streams: list["NamespaceStream"] + """Array of streams that are part of the asset. Each stream can have a per-stream configuration.""" + managementGroups: list["ManagementGroup"] + """Array of management groups that are part of the asset. Each management group can have a + per-group configuration.""" + status: "NamespaceAssetStatus" + """Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes + status property for custom resources.""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", and \"Deleting\".""" + + +class NamespaceAssetStatus(TypedDict, total=False): + """Defines the asset status properties. + + :ivar config: Defines the asset status config properties. + :vartype config: "StatusConfig" + :ivar datasets: Array of dataset statuses that describe the status of each dataset. + :vartype datasets: list["NamespaceAssetStatusDataset"] + :ivar eventGroups: Array of event group statuses that describe the status of each event group. + :vartype eventGroups: list["NamespaceAssetStatusEventGroup"] + :ivar streams: Array of stream statuses that describe the status of each stream. + :vartype streams: list["NamespaceAssetStatusStream"] + :ivar managementGroups: Array of management group statuses that describe the status of each + management group. + :vartype managementGroups: list["NamespaceAssetStatusManagementGroup"] + :ivar healthState: The details about the runtime health state of the asset. + :vartype healthState: "HealthState" + """ + + config: "StatusConfig" + """Defines the asset status config properties.""" + datasets: list["NamespaceAssetStatusDataset"] + """Array of dataset statuses that describe the status of each dataset.""" + eventGroups: list["NamespaceAssetStatusEventGroup"] + """Array of event group statuses that describe the status of each event group.""" + streams: list["NamespaceAssetStatusStream"] + """Array of stream statuses that describe the status of each stream.""" + managementGroups: list["NamespaceAssetStatusManagementGroup"] + """Array of management group statuses that describe the status of each management group.""" + healthState: "HealthState" + """The details about the runtime health state of the asset.""" + + +class NamespaceAssetStatusDataset(TypedDict, total=False): + """Defines the asset status dataset properties. + + :ivar name: The name of the dataset. Must be unique within the status.datasets array. This name + is used to correlate between the spec and status dataset information. Required. + :vartype name: str + :ivar messageSchemaReference: The message schema reference object. + :vartype messageSchemaReference: "NamespaceMessageSchemaReference" + :ivar error: Object to transfer and persist errors that originate from the edge. + :vartype error: "StatusError" + """ + + name: Required[str] + """The name of the dataset. Must be unique within the status.datasets array. This name is used to + correlate between the spec and status dataset information. Required.""" + messageSchemaReference: "NamespaceMessageSchemaReference" + """The message schema reference object.""" + error: "StatusError" + """Object to transfer and persist errors that originate from the edge.""" + + +class NamespaceAssetStatusEvent(TypedDict, total=False): + """Defines the asset status event properties. + + :ivar name: The name of the event. Must be unique within the status.events array. This name is + used to correlate between the spec and status event information. Required. + :vartype name: str + :ivar messageSchemaReference: The message schema reference object. + :vartype messageSchemaReference: "NamespaceMessageSchemaReference" + :ivar error: Object to transfer and persist errors that originate from the edge. + :vartype error: "StatusError" + """ + + name: Required[str] + """The name of the event. Must be unique within the status.events array. This name is used to + correlate between the spec and status event information. Required.""" + messageSchemaReference: "NamespaceMessageSchemaReference" + """The message schema reference object.""" + error: "StatusError" + """Object to transfer and persist errors that originate from the edge.""" + + +class NamespaceAssetStatusEventGroup(TypedDict, total=False): + """Defines the asset status event group properties. + + :ivar name: The name of the event group. Must be unique within the status.eventGroups array. + This name is used to correlate between the spec and status event group information. Required. + :vartype name: str + :ivar events: Array of event statuses that describe the status of each event in the event + group. + :vartype events: list["NamespaceAssetStatusEvent"] + """ + + name: Required[str] + """The name of the event group. Must be unique within the status.eventGroups array. This name is + used to correlate between the spec and status event group information. Required.""" + events: list["NamespaceAssetStatusEvent"] + """Array of event statuses that describe the status of each event in the event group.""" + + +class NamespaceAssetStatusManagementAction(TypedDict, total=False): + """Defines the asset status action properties. + + :ivar name: The name of the action. Must be unique within the status.actions array. This name + is used to correlate between the spec and status event information. Required. + :vartype name: str + :ivar requestMessageSchemaReference: The request message schema reference object for the + action. + :vartype requestMessageSchemaReference: "NamespaceMessageSchemaReference" + :ivar responseMessageSchemaReference: The response message schema reference object for the + action. + :vartype responseMessageSchemaReference: "NamespaceMessageSchemaReference" + :ivar error: Object to transfer and persist errors that originate from the edge. + :vartype error: "StatusError" + """ + + name: Required[str] + """The name of the action. Must be unique within the status.actions array. This name is used to + correlate between the spec and status event information. Required.""" + requestMessageSchemaReference: "NamespaceMessageSchemaReference" + """The request message schema reference object for the action.""" + responseMessageSchemaReference: "NamespaceMessageSchemaReference" + """The response message schema reference object for the action.""" + error: "StatusError" + """Object to transfer and persist errors that originate from the edge.""" + + +class NamespaceAssetStatusManagementGroup(TypedDict, total=False): + """Defines the asset status management group properties. + + :ivar name: The name of the management group. Must be unique within the status.managementGroups + array. This name is used to correlate between the spec and status event information. Required. + :vartype name: str + :ivar actions: Array of action statuses that describe the status of each action. + :vartype actions: list["NamespaceAssetStatusManagementAction"] + """ + + name: Required[str] + """The name of the management group. Must be unique within the status.managementGroups array. This + name is used to correlate between the spec and status event information. Required.""" + actions: list["NamespaceAssetStatusManagementAction"] + """Array of action statuses that describe the status of each action.""" + + +class NamespaceAssetStatusStream(TypedDict, total=False): + """Defines the asset status stream properties. + + :ivar name: The name of the stream. Must be unique within the status.streams array. This name + is used to correlate between the spec and status event information. Required. + :vartype name: str + :ivar messageSchemaReference: The message schema reference object. + :vartype messageSchemaReference: "NamespaceMessageSchemaReference" + :ivar error: Object to transfer and persist errors that originate from the edge. + :vartype error: "StatusError" + """ + + name: Required[str] + """The name of the stream. Must be unique within the status.streams array. This name is used to + correlate between the spec and status event information. Required.""" + messageSchemaReference: "NamespaceMessageSchemaReference" + """The message schema reference object.""" + error: "StatusError" + """Object to transfer and persist errors that originate from the edge.""" + + +class NamespaceAssetUpdate(TypedDict, total=False): + """The type used for update operations of the NamespaceAsset. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "NamespaceAssetUpdateProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "NamespaceAssetUpdateProperties" + """The resource-specific properties for this resource.""" + + +class NamespaceAssetUpdateProperties(TypedDict, total=False): + """The updatable properties of the NamespaceAsset. + + :ivar enabled: Enabled/disabled status of the asset. + :vartype enabled: bool + :ivar displayName: Human-readable display name. + :vartype displayName: str + :ivar description: Human-readable description of the asset. + :vartype description: str + :ivar assetTypeRefs: URIs or type definition IDs. + :vartype assetTypeRefs: list[str] + :ivar manufacturer: Asset manufacturer. + :vartype manufacturer: str + :ivar manufacturerUri: Asset manufacturer URI. + :vartype manufacturerUri: str + :ivar model: Asset model. + :vartype model: str + :ivar productCode: Asset product code. + :vartype productCode: str + :ivar hardwareRevision: Asset hardware revision number. + :vartype hardwareRevision: str + :ivar softwareRevision: Asset software revision number. + :vartype softwareRevision: str + :ivar documentationUri: Asset documentation reference. + :vartype documentationUri: str + :ivar serialNumber: Asset serial number. + :vartype serialNumber: str + :ivar attributes: A set of key-value pairs that contain custom attributes set by the customer. + :vartype attributes: dict[str, Any] + :ivar defaultDatasetsConfiguration: Stringified JSON that contains connector-specific default + configuration for all datasets. Each dataset can have its own configuration that overrides the + default settings here. + :vartype defaultDatasetsConfiguration: str + :ivar defaultEventsConfiguration: Stringified JSON that contains connector-specific default + configuration for all events. Each event can have its own configuration that overrides the + default settings here. + :vartype defaultEventsConfiguration: str + :ivar defaultStreamsConfiguration: Stringified JSON that contains connector-specific default + configuration for all streams. Each stream can have its own configuration that overrides the + default settings here. + :vartype defaultStreamsConfiguration: str + :ivar defaultManagementGroupsConfiguration: Stringified JSON that contains connector-specific + default configuration for all management groups. Each management group can have its own + configuration that overrides the default settings here. + :vartype defaultManagementGroupsConfiguration: str + :ivar defaultDatasetsDestinations: Default destinations for a dataset. + :vartype defaultDatasetsDestinations: list["DatasetDestination"] + :ivar defaultEventsDestinations: Default destinations for an event. + :vartype defaultEventsDestinations: list["EventDestination"] + :ivar defaultStreamsDestinations: Default destinations for a stream. + :vartype defaultStreamsDestinations: list["StreamDestination"] + :ivar datasets: Array of datasets that are part of the asset. Each dataset describes the data + points that make up the set. + :vartype datasets: list["NamespaceDataset"] + :ivar eventGroups: Array of event groups that are part of the asset. Each event group can have + per-event group configuration. + :vartype eventGroups: list["NamespaceEventGroup"] + :ivar streams: Array of streams that are part of the asset. Each stream can have a per-stream + configuration. + :vartype streams: list["NamespaceStream"] + :ivar managementGroups: Array of management groups that are part of the asset. Each management + group can have a per-group configuration. + :vartype managementGroups: list["ManagementGroup"] + """ + + enabled: bool + """Enabled/disabled status of the asset.""" + displayName: str + """Human-readable display name.""" + description: str + """Human-readable description of the asset.""" + assetTypeRefs: list[str] + """URIs or type definition IDs.""" + manufacturer: str + """Asset manufacturer.""" + manufacturerUri: str + """Asset manufacturer URI.""" + model: str + """Asset model.""" + productCode: str + """Asset product code.""" + hardwareRevision: str + """Asset hardware revision number.""" + softwareRevision: str + """Asset software revision number.""" + documentationUri: str + """Asset documentation reference.""" + serialNumber: str + """Asset serial number.""" + attributes: dict[str, Any] + """A set of key-value pairs that contain custom attributes set by the customer.""" + defaultDatasetsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all datasets. Each + dataset can have its own configuration that overrides the default settings here.""" + defaultEventsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all events. Each + event can have its own configuration that overrides the default settings here.""" + defaultStreamsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all streams. Each + stream can have its own configuration that overrides the default settings here.""" + defaultManagementGroupsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all management + groups. Each management group can have its own configuration that overrides the default + settings here.""" + defaultDatasetsDestinations: list["DatasetDestination"] + """Default destinations for a dataset.""" + defaultEventsDestinations: list["EventDestination"] + """Default destinations for an event.""" + defaultStreamsDestinations: list["StreamDestination"] + """Default destinations for a stream.""" + datasets: list["NamespaceDataset"] + """Array of datasets that are part of the asset. Each dataset describes the data points that make + up the set.""" + eventGroups: list["NamespaceEventGroup"] + """Array of event groups that are part of the asset. Each event group can have per-event group + configuration.""" + streams: list["NamespaceStream"] + """Array of streams that are part of the asset. Each stream can have a per-stream configuration.""" + managementGroups: list["ManagementGroup"] + """Array of management groups that are part of the asset. Each management group can have a + per-group configuration.""" + + +class NamespaceDataset(TypedDict, total=False): + """Defines the dataset properties. + + :ivar name: Name of the dataset. Required. + :vartype name: str + :ivar dataSource: Reference to a data source for a given dataset. + :vartype dataSource: str + :ivar typeRef: URI or type definition ID. + :vartype typeRef: str + :ivar datasetConfiguration: Stringified JSON that contains connector-specific JSON string that + describes configuration for the specific dataset. + :vartype datasetConfiguration: str + :ivar destinations: Destinations for a dataset. + :vartype destinations: list["DatasetDestination"] + :ivar dataPoints: Array of data points that are part of the dataset. Each data point can have + per-data point configuration. + :vartype dataPoints: list["NamespaceDatasetDataPoint"] + """ + + name: Required[str] + """Name of the dataset. Required.""" + dataSource: str + """Reference to a data source for a given dataset.""" + typeRef: str + """URI or type definition ID.""" + datasetConfiguration: str + """Stringified JSON that contains connector-specific JSON string that describes configuration for + the specific dataset.""" + destinations: list["DatasetDestination"] + """Destinations for a dataset.""" + dataPoints: list["NamespaceDatasetDataPoint"] + """Array of data points that are part of the dataset. Each data point can have per-data point + configuration.""" + + +class NamespaceDatasetDataPoint(TypedDict, total=False): + """Defines the dataset data point properties. + + :ivar name: The name of the data point. Required. + :vartype name: str + :ivar dataSource: The address of the source of the data in the asset (e.g. URL) so that a + client can access the data source on the asset. Required. + :vartype dataSource: str + :ivar dataPointConfiguration: Stringified JSON that contains connector-specific configuration + for the data point. For OPC UA, this could include configuration like, publishingInterval, + samplingInterval, and queueSize. + :vartype dataPointConfiguration: str + :ivar typeRef: URI or type definition ID. + :vartype typeRef: str + """ + + name: Required[str] + """The name of the data point. Required.""" + dataSource: Required[str] + """The address of the source of the data in the asset (e.g. URL) so that a client can access the + data source on the asset. Required.""" + dataPointConfiguration: str + """Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, + this could include configuration like, publishingInterval, samplingInterval, and queueSize.""" + typeRef: str + """URI or type definition ID.""" + + +class NamespaceDevice(TrackedResource): + """Device definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "NamespaceDeviceProperties" + :ivar etag: Resource Tag. + :vartype etag: str + :ivar extendedLocation: The extended location. + :vartype extendedLocation: "ExtendedLocation" + """ + + properties: "NamespaceDeviceProperties" + """The resource-specific properties for this resource.""" + etag: str + """Resource Tag.""" + extendedLocation: "ExtendedLocation" + """The extended location.""" + + +class NamespaceDeviceProperties(TypedDict, total=False): + """Defines the device properties. + + :ivar uuid: A unique identifier for the device. + :vartype uuid: str + :ivar enabled: Indicates if the resource is enabled or not. + :vartype enabled: bool + :ivar externalDeviceId: The Device ID provided by the customer. + :vartype externalDeviceId: str + :ivar discoveredDeviceRef: Reference to a device. Populated only if the device had been created + from discovery flow. Discovered device name must be provided. + :vartype discoveredDeviceRef: str + :ivar manufacturer: Device manufacturer. + :vartype manufacturer: str + :ivar model: Device model. + :vartype model: str + :ivar operatingSystem: Device operating system. + :vartype operatingSystem: str + :ivar operatingSystemVersion: Device operating system version. + :vartype operatingSystemVersion: str + :ivar endpoints: Property bag containing the device's unassigned and assigned endpoints. + :vartype endpoints: "MessagingEndpoints" + :ivar attributes: A set of key-value pairs that contain custom attributes set by the customer. + :vartype attributes: dict[str, Any] + :ivar status: Device status updates. + :vartype status: "DeviceStatus" + :ivar version: An integer that is incremented each time the resource is modified. + :vartype version: int + :ivar lastTransitionTime: A timestamp (in UTC) that is updated each time the resource is + modified. + :vartype lastTransitionTime: str + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + uuid: str + """A unique identifier for the device.""" + enabled: bool + """Indicates if the resource is enabled or not.""" + externalDeviceId: str + """The Device ID provided by the customer.""" + discoveredDeviceRef: str + """Reference to a device. Populated only if the device had been created from discovery flow. + Discovered device name must be provided.""" + manufacturer: str + """Device manufacturer.""" + model: str + """Device model.""" + operatingSystem: str + """Device operating system.""" + operatingSystemVersion: str + """Device operating system version.""" + endpoints: "MessagingEndpoints" + """Property bag containing the device's unassigned and assigned endpoints.""" + attributes: dict[str, Any] + """A set of key-value pairs that contain custom attributes set by the customer.""" + status: "DeviceStatus" + """Device status updates.""" + version: int + """An integer that is incremented each time the resource is modified.""" + lastTransitionTime: str + """A timestamp (in UTC) that is updated each time the resource is modified.""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", and \"Deleting\".""" + + +class NamespaceDeviceUpdate(TypedDict, total=False): + """The type used for update operations of the NamespaceDevice. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "NamespaceDeviceUpdateProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "NamespaceDeviceUpdateProperties" + """The resource-specific properties for this resource.""" + + +class NamespaceDeviceUpdateProperties(TypedDict, total=False): + """The updatable properties of the NamespaceDevice. + + :ivar operatingSystemVersion: Device operating system version. + :vartype operatingSystemVersion: str + :ivar endpoints: Property bag containing the device's unassigned and assigned endpoints. + :vartype endpoints: "MessagingEndpoints" + :ivar attributes: A set of key-value pairs that contain custom attributes set by the customer. + :vartype attributes: dict[str, Any] + :ivar enabled: Indicates if the resource and identity are enabled or not. A disabled device + cannot authenticate with Microsoft Entra ID. + :vartype enabled: bool + """ + + operatingSystemVersion: str + """Device operating system version.""" + endpoints: "MessagingEndpoints" + """Property bag containing the device's unassigned and assigned endpoints.""" + attributes: dict[str, Any] + """A set of key-value pairs that contain custom attributes set by the customer.""" + enabled: bool + """Indicates if the resource and identity are enabled or not. A disabled device cannot + authenticate with Microsoft Entra ID.""" + + +class NamespaceDiscoveredAsset(TrackedResource): + """Discovered asset definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "NamespaceDiscoveredAssetProperties" + :ivar extendedLocation: The extended location. Required. + :vartype extendedLocation: "ExtendedLocation" + """ + + properties: "NamespaceDiscoveredAssetProperties" + """The resource-specific properties for this resource.""" + extendedLocation: Required["ExtendedLocation"] + """The extended location. Required.""" + + +class NamespaceDiscoveredAssetProperties(TypedDict, total=False): + """Defines the discovered asset properties. + + :ivar deviceRef: Reference to the device that provides data for this asset. Must provide device + name & endpoint on the device to use. Required. + :vartype deviceRef: "DeviceRef" + :ivar displayName: Human-readable display name. + :vartype displayName: str + :ivar assetTypeRefs: URIs or type definition IDs. + :vartype assetTypeRefs: list[str] + :ivar description: Human-readable description of the asset. + :vartype description: str + :ivar discoveryId: Identifier used to detect changes in the asset. Required. + :vartype discoveryId: str + :ivar externalAssetId: Asset ID provided by the customer. + :vartype externalAssetId: str + :ivar version: An integer that is incremented each time the resource is modified. Required. + :vartype version: int + :ivar manufacturer: Asset manufacturer. + :vartype manufacturer: str + :ivar manufacturerUri: Asset manufacturer URI. + :vartype manufacturerUri: str + :ivar model: Asset model. + :vartype model: str + :ivar productCode: Asset product code. + :vartype productCode: str + :ivar hardwareRevision: Asset hardware revision number. + :vartype hardwareRevision: str + :ivar softwareRevision: Asset software revision number. + :vartype softwareRevision: str + :ivar documentationUri: Asset documentation reference. + :vartype documentationUri: str + :ivar serialNumber: Asset serial number. + :vartype serialNumber: str + :ivar attributes: A set of key-value pairs that contain custom attributes. + :vartype attributes: dict[str, Any] + :ivar defaultDatasetsConfiguration: Stringified JSON that contains connector-specific default + configuration for all datasets. Each dataset can have its own configuration that overrides the + default settings here. + :vartype defaultDatasetsConfiguration: str + :ivar defaultEventsConfiguration: Stringified JSON that contains connector-specific default + configuration for all events. Each event can have its own configuration that overrides the + default settings here. + :vartype defaultEventsConfiguration: str + :ivar defaultStreamsConfiguration: Stringified JSON that contains connector-specific default + configuration for all streams. Each stream can have its own configuration that overrides the + default settings here. + :vartype defaultStreamsConfiguration: str + :ivar defaultManagementGroupsConfiguration: Stringified JSON that contains connector-specific + default configuration for all management groups. Each management group can have its own + configuration that overrides the default settings here. + :vartype defaultManagementGroupsConfiguration: str + :ivar defaultDatasetsDestinations: Default destinations for a dataset. + :vartype defaultDatasetsDestinations: list["DatasetDestination"] + :ivar defaultEventsDestinations: Default destinations for an event. + :vartype defaultEventsDestinations: list["EventDestination"] + :ivar defaultStreamsDestinations: Default destinations for a stream. + :vartype defaultStreamsDestinations: list["StreamDestination"] + :ivar datasets: Array of datasets that are part of the asset. Each dataset spec describes the + data points that make up the set. + :vartype datasets: list["NamespaceDiscoveredDataset"] + :ivar eventGroups: Array of event groups that are part of the asset. Each event group can have + per-event group configuration. + :vartype eventGroups: list["NamespaceDiscoveredEventGroup"] + :ivar streams: Array of streams that are part of the asset. Each stream can have a per-stream + configuration. + :vartype streams: list["NamespaceDiscoveredStream"] + :ivar managementGroups: Array of management groups that are part of the asset. Each management + group can have a per-group configuration. + :vartype managementGroups: list["NamespaceDiscoveredManagementGroup"] + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + deviceRef: Required["DeviceRef"] + """Reference to the device that provides data for this asset. Must provide device name & endpoint + on the device to use. Required.""" + displayName: str + """Human-readable display name.""" + assetTypeRefs: list[str] + """URIs or type definition IDs.""" + description: str + """Human-readable description of the asset.""" + discoveryId: Required[str] + """Identifier used to detect changes in the asset. Required.""" + externalAssetId: str + """Asset ID provided by the customer.""" + version: Required[int] + """An integer that is incremented each time the resource is modified. Required.""" + manufacturer: str + """Asset manufacturer.""" + manufacturerUri: str + """Asset manufacturer URI.""" + model: str + """Asset model.""" + productCode: str + """Asset product code.""" + hardwareRevision: str + """Asset hardware revision number.""" + softwareRevision: str + """Asset software revision number.""" + documentationUri: str + """Asset documentation reference.""" + serialNumber: str + """Asset serial number.""" + attributes: dict[str, Any] + """A set of key-value pairs that contain custom attributes.""" + defaultDatasetsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all datasets. Each + dataset can have its own configuration that overrides the default settings here.""" + defaultEventsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all events. Each + event can have its own configuration that overrides the default settings here.""" + defaultStreamsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all streams. Each + stream can have its own configuration that overrides the default settings here.""" + defaultManagementGroupsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all management + groups. Each management group can have its own configuration that overrides the default + settings here.""" + defaultDatasetsDestinations: list["DatasetDestination"] + """Default destinations for a dataset.""" + defaultEventsDestinations: list["EventDestination"] + """Default destinations for an event.""" + defaultStreamsDestinations: list["StreamDestination"] + """Default destinations for a stream.""" + datasets: list["NamespaceDiscoveredDataset"] + """Array of datasets that are part of the asset. Each dataset spec describes the data points that + make up the set.""" + eventGroups: list["NamespaceDiscoveredEventGroup"] + """Array of event groups that are part of the asset. Each event group can have per-event group + configuration.""" + streams: list["NamespaceDiscoveredStream"] + """Array of streams that are part of the asset. Each stream can have a per-stream configuration.""" + managementGroups: list["NamespaceDiscoveredManagementGroup"] + """Array of management groups that are part of the asset. Each management group can have a + per-group configuration.""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", and \"Deleting\".""" + + +class NamespaceDiscoveredAssetUpdate(TypedDict, total=False): + """The type used for update operations of the NamespaceDiscoveredAsset. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "NamespaceDiscoveredAssetUpdateProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "NamespaceDiscoveredAssetUpdateProperties" + """The resource-specific properties for this resource.""" + + +class NamespaceDiscoveredAssetUpdateProperties(TypedDict, total=False): + """The updatable properties of the NamespaceDiscoveredAsset. + + :ivar deviceRef: Reference to the device that provides data for this asset. Must provide device + name & endpoint on the device to use. + :vartype deviceRef: "DeviceRef" + :ivar displayName: Human-readable display name. + :vartype displayName: str + :ivar assetTypeRefs: URIs or type definition IDs. + :vartype assetTypeRefs: list[str] + :ivar description: Human-readable description of the asset. + :vartype description: str + :ivar discoveryId: Identifier used to detect changes in the asset. + :vartype discoveryId: str + :ivar version: An integer that is incremented each time the resource is modified. + :vartype version: int + :ivar manufacturer: Asset manufacturer. + :vartype manufacturer: str + :ivar manufacturerUri: Asset manufacturer URI. + :vartype manufacturerUri: str + :ivar model: Asset model. + :vartype model: str + :ivar productCode: Asset product code. + :vartype productCode: str + :ivar hardwareRevision: Asset hardware revision number. + :vartype hardwareRevision: str + :ivar softwareRevision: Asset software revision number. + :vartype softwareRevision: str + :ivar documentationUri: Asset documentation reference. + :vartype documentationUri: str + :ivar serialNumber: Asset serial number. + :vartype serialNumber: str + :ivar attributes: A set of key-value pairs that contain custom attributes. + :vartype attributes: dict[str, Any] + :ivar defaultDatasetsConfiguration: Stringified JSON that contains connector-specific default + configuration for all datasets. Each dataset can have its own configuration that overrides the + default settings here. + :vartype defaultDatasetsConfiguration: str + :ivar defaultEventsConfiguration: Stringified JSON that contains connector-specific default + configuration for all events. Each event can have its own configuration that overrides the + default settings here. + :vartype defaultEventsConfiguration: str + :ivar defaultStreamsConfiguration: Stringified JSON that contains connector-specific default + configuration for all streams. Each stream can have its own configuration that overrides the + default settings here. + :vartype defaultStreamsConfiguration: str + :ivar defaultManagementGroupsConfiguration: Stringified JSON that contains connector-specific + default configuration for all management groups. Each management group can have its own + configuration that overrides the default settings here. + :vartype defaultManagementGroupsConfiguration: str + :ivar defaultDatasetsDestinations: Default destinations for a dataset. + :vartype defaultDatasetsDestinations: list["DatasetDestination"] + :ivar defaultEventsDestinations: Default destinations for an event. + :vartype defaultEventsDestinations: list["EventDestination"] + :ivar defaultStreamsDestinations: Default destinations for a stream. + :vartype defaultStreamsDestinations: list["StreamDestination"] + :ivar datasets: Array of datasets that are part of the asset. Each dataset spec describes the + data points that make up the set. + :vartype datasets: list["NamespaceDiscoveredDataset"] + :ivar eventGroups: Array of event groups that are part of the asset. Each event group can have + per-event group configuration. + :vartype eventGroups: list["NamespaceDiscoveredEventGroup"] + :ivar streams: Array of streams that are part of the asset. Each stream can have a per-stream + configuration. + :vartype streams: list["NamespaceDiscoveredStream"] + :ivar managementGroups: Array of management groups that are part of the asset. Each management + group can have a per-group configuration. + :vartype managementGroups: list["NamespaceDiscoveredManagementGroup"] + """ + + deviceRef: "DeviceRef" + """Reference to the device that provides data for this asset. Must provide device name & endpoint + on the device to use.""" + displayName: str + """Human-readable display name.""" + assetTypeRefs: list[str] + """URIs or type definition IDs.""" + description: str + """Human-readable description of the asset.""" + discoveryId: str + """Identifier used to detect changes in the asset.""" + version: int + """An integer that is incremented each time the resource is modified.""" + manufacturer: str + """Asset manufacturer.""" + manufacturerUri: str + """Asset manufacturer URI.""" + model: str + """Asset model.""" + productCode: str + """Asset product code.""" + hardwareRevision: str + """Asset hardware revision number.""" + softwareRevision: str + """Asset software revision number.""" + documentationUri: str + """Asset documentation reference.""" + serialNumber: str + """Asset serial number.""" + attributes: dict[str, Any] + """A set of key-value pairs that contain custom attributes.""" + defaultDatasetsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all datasets. Each + dataset can have its own configuration that overrides the default settings here.""" + defaultEventsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all events. Each + event can have its own configuration that overrides the default settings here.""" + defaultStreamsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all streams. Each + stream can have its own configuration that overrides the default settings here.""" + defaultManagementGroupsConfiguration: str + """Stringified JSON that contains connector-specific default configuration for all management + groups. Each management group can have its own configuration that overrides the default + settings here.""" + defaultDatasetsDestinations: list["DatasetDestination"] + """Default destinations for a dataset.""" + defaultEventsDestinations: list["EventDestination"] + """Default destinations for an event.""" + defaultStreamsDestinations: list["StreamDestination"] + """Default destinations for a stream.""" + datasets: list["NamespaceDiscoveredDataset"] + """Array of datasets that are part of the asset. Each dataset spec describes the data points that + make up the set.""" + eventGroups: list["NamespaceDiscoveredEventGroup"] + """Array of event groups that are part of the asset. Each event group can have per-event group + configuration.""" + streams: list["NamespaceDiscoveredStream"] + """Array of streams that are part of the asset. Each stream can have a per-stream configuration.""" + managementGroups: list["NamespaceDiscoveredManagementGroup"] + """Array of management groups that are part of the asset. Each management group can have a + per-group configuration.""" + + +class NamespaceDiscoveredDataset(TypedDict, total=False): + """Defines the dataset properties. + + :ivar name: Name of the dataset. Required. + :vartype name: str + :ivar dataSource: Reference to a data source for a given dataset. + :vartype dataSource: str + :ivar typeRef: URI or type definition ID. + :vartype typeRef: str + :ivar datasetConfiguration: Stringified JSON that contains connector-specific properties that + describes configuration for the specific dataset. + :vartype datasetConfiguration: str + :ivar destinations: Destinations for a dataset. + :vartype destinations: list["DatasetDestination"] + :ivar dataPoints: Array of data points that are part of the dataset. Each data point can have + per-data point configuration. + :vartype dataPoints: list["NamespaceDiscoveredDatasetDataPoint"] + :ivar lastUpdatedOn: Timestamp (in UTC) indicating when the dataset was added or modified. + :vartype lastUpdatedOn: str + """ + + name: Required[str] + """Name of the dataset. Required.""" + dataSource: str + """Reference to a data source for a given dataset.""" + typeRef: str + """URI or type definition ID.""" + datasetConfiguration: str + """Stringified JSON that contains connector-specific properties that describes configuration for + the specific dataset.""" + destinations: list["DatasetDestination"] + """Destinations for a dataset.""" + dataPoints: list["NamespaceDiscoveredDatasetDataPoint"] + """Array of data points that are part of the dataset. Each data point can have per-data point + configuration.""" + lastUpdatedOn: str + """Timestamp (in UTC) indicating when the dataset was added or modified.""" + + +class NamespaceDiscoveredDatasetDataPoint(TypedDict, total=False): + """Defines the discovered dataset data point properties. + + :ivar name: The name of the data point. Required. + :vartype name: str + :ivar dataSource: The address of the source of the data in the asset (e.g. URL) so that a + client can access the data source on the asset. Required. + :vartype dataSource: str + :ivar dataPointConfiguration: Stringified JSON that contains connector-specific configuration + for the data point. For OPC UA, this could include configuration like, publishingInterval, + samplingInterval, and queueSize. + :vartype dataPointConfiguration: str + :ivar lastUpdatedOn: UTC timestamp indicating when the data point was added or modified. + :vartype lastUpdatedOn: str + :ivar typeRef: URI or type definition ID. + :vartype typeRef: str + """ + + name: Required[str] + """The name of the data point. Required.""" + dataSource: Required[str] + """The address of the source of the data in the asset (e.g. URL) so that a client can access the + data source on the asset. Required.""" + dataPointConfiguration: str + """Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, + this could include configuration like, publishingInterval, samplingInterval, and queueSize.""" + lastUpdatedOn: str + """UTC timestamp indicating when the data point was added or modified.""" + typeRef: str + """URI or type definition ID.""" + + +class NamespaceDiscoveredDevice(TrackedResource): + """Discovered device definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "NamespaceDiscoveredDeviceProperties" + :ivar extendedLocation: The extended location. Required. + :vartype extendedLocation: "ExtendedLocation" + """ + + properties: "NamespaceDiscoveredDeviceProperties" + """The resource-specific properties for this resource.""" + extendedLocation: Required["ExtendedLocation"] + """The extended location. Required.""" + + +class NamespaceDiscoveredDeviceProperties(TypedDict, total=False): + """Defines the discovered device properties. + + :ivar externalDeviceId: A device ID that represents the device in a system external to Azure. + Unique within scope of an Azure tenant. + :vartype externalDeviceId: str + :ivar endpoints: Endpoints for discovered devices. + :vartype endpoints: "DiscoveredMessagingEndpoints" + :ivar manufacturer: Device manufacturer. + :vartype manufacturer: str + :ivar model: Device model. + :vartype model: str + :ivar operatingSystem: Device operating system name. + :vartype operatingSystem: str + :ivar operatingSystemVersion: Device operating system version. + :vartype operatingSystemVersion: str + :ivar attributes: A set of key-value pairs that contain custom attributes. + :vartype attributes: dict[str, Any] + :ivar discoveryId: Identifier used to detect changes in the discovered device. Required. + :vartype discoveryId: str + :ivar version: An integer that is incremented each time the resource is modified. Required. + :vartype version: int + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + externalDeviceId: str + """A device ID that represents the device in a system external to Azure. Unique within scope of an + Azure tenant.""" + endpoints: "DiscoveredMessagingEndpoints" + """Endpoints for discovered devices.""" + manufacturer: str + """Device manufacturer.""" + model: str + """Device model.""" + operatingSystem: str + """Device operating system name.""" + operatingSystemVersion: str + """Device operating system version.""" + attributes: dict[str, Any] + """A set of key-value pairs that contain custom attributes.""" + discoveryId: Required[str] + """Identifier used to detect changes in the discovered device. Required.""" + version: Required[int] + """An integer that is incremented each time the resource is modified. Required.""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", and \"Deleting\".""" + + +class NamespaceDiscoveredDeviceUpdate(TypedDict, total=False): + """The type used for update operations of the NamespaceDiscoveredDevice. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "NamespaceDiscoveredDeviceUpdateProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "NamespaceDiscoveredDeviceUpdateProperties" + """The resource-specific properties for this resource.""" + + +class NamespaceDiscoveredDeviceUpdateProperties(TypedDict, total=False): # pylint: disable=name-too-long + """The updatable properties of the NamespaceDiscoveredDevice. + + :ivar externalDeviceId: A device ID that represents the device in a system external to Azure. + Unique within scope of an Azure tenant. + :vartype externalDeviceId: str + :ivar endpoints: Endpoints for discovered devices. + :vartype endpoints: "DiscoveredMessagingEndpoints" + :ivar operatingSystemVersion: Device operating system version. + :vartype operatingSystemVersion: str + :ivar attributes: A set of key-value pairs that contain custom attributes. + :vartype attributes: dict[str, Any] + :ivar discoveryId: Identifier used to detect changes in the discovered device. + :vartype discoveryId: str + :ivar version: An integer that is incremented each time the resource is modified. + :vartype version: int + """ + + externalDeviceId: str + """A device ID that represents the device in a system external to Azure. Unique within scope of an + Azure tenant.""" + endpoints: "DiscoveredMessagingEndpoints" + """Endpoints for discovered devices.""" + operatingSystemVersion: str + """Device operating system version.""" + attributes: dict[str, Any] + """A set of key-value pairs that contain custom attributes.""" + discoveryId: str + """Identifier used to detect changes in the discovered device.""" + version: int + """An integer that is incremented each time the resource is modified.""" + + +class NamespaceDiscoveredEvent(TypedDict, total=False): + """Defines the event properties. + + :ivar name: The name of the event. Required. + :vartype name: str + :ivar dataSource: Reference to a data source for a given event. + :vartype dataSource: str + :ivar eventConfiguration: Stringified JSON that contains connector-specific configuration for + the event. For OPC UA, this could include configuration like, publishingInterval, + samplingInterval, and queueSize. + :vartype eventConfiguration: str + :ivar destinations: Destinations for an event. + :vartype destinations: list["EventDestination"] + :ivar typeRef: URI or type definition ID. + :vartype typeRef: str + :ivar lastUpdatedOn: UTC timestamp indicating when the event was added or modified. + :vartype lastUpdatedOn: str + """ + + name: Required[str] + """The name of the event. Required.""" + dataSource: str + """Reference to a data source for a given event.""" + eventConfiguration: str + """Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this + could include configuration like, publishingInterval, samplingInterval, and queueSize.""" + destinations: list["EventDestination"] + """Destinations for an event.""" + typeRef: str + """URI or type definition ID.""" + lastUpdatedOn: str + """UTC timestamp indicating when the event was added or modified.""" + + +class NamespaceDiscoveredEventGroup(TypedDict, total=False): + """Defines the discovered event group properties. + + :ivar name: The name of the event group. Required. + :vartype name: str + :ivar dataSource: The address of the notifier of the event group in the asset (e.g. URL) so + that a client can access the event group on the asset. + :vartype dataSource: str + :ivar eventGroupConfiguration: Stringified JSON that contains connector-specific configuration + for the event group. For OPC UA, this could include configuration like, publishingInterval, + samplingInterval, and queueSize. + :vartype eventGroupConfiguration: str + :ivar defaultDestinations: Destinations for events. Default destinations when destinations is + not defined at the event level. + :vartype defaultDestinations: list["EventDestination"] + :ivar typeRef: URI or type definition ID. + :vartype typeRef: str + :ivar events: Array of events that are part of the event group. + :vartype events: list["NamespaceDiscoveredEvent"] + """ + + name: Required[str] + """The name of the event group. Required.""" + dataSource: str + """The address of the notifier of the event group in the asset (e.g. URL) so that a client can + access the event group on the asset.""" + eventGroupConfiguration: str + """Stringified JSON that contains connector-specific configuration for the event group. For OPC + UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize.""" + defaultDestinations: list["EventDestination"] + """Destinations for events. Default destinations when destinations is not defined at the event + level.""" + typeRef: str + """URI or type definition ID.""" + events: list["NamespaceDiscoveredEvent"] + """Array of events that are part of the event group.""" + + +class NamespaceDiscoveredManagementAction(TypedDict, total=False): + """Defines the action properties. + + :ivar name: Name of the action. Required. + :vartype name: str + :ivar actionConfiguration: Stringified JSON that contains connector-specific configuration for + the action. + :vartype actionConfiguration: str + :ivar targetUri: The target URI on which a client can invoke the specific action. Required. + :vartype targetUri: str + :ivar typeRef: URI or type definition ID. + :vartype typeRef: str + :ivar topic: The MQTT topic path on which a client will receive the request for the action. + :vartype topic: str + :ivar actionType: The type of the action. Known values are: "Call", "Read", and "Write". + :vartype actionType: Union[str, "NamespaceDiscoveredManagementActionType"] + :ivar timeoutInSeconds: Response timeout for the action. + :vartype timeoutInSeconds: int + :ivar lastUpdatedOn: Timestamp (in UTC) indicating when the management action was added or + modified. + :vartype lastUpdatedOn: str + """ + + name: Required[str] + """Name of the action. Required.""" + actionConfiguration: str + """Stringified JSON that contains connector-specific configuration for the action.""" + targetUri: Required[str] + """The target URI on which a client can invoke the specific action. Required.""" + typeRef: str + """URI or type definition ID.""" + topic: str + """The MQTT topic path on which a client will receive the request for the action.""" + actionType: Union[str, "NamespaceDiscoveredManagementActionType"] + """The type of the action. Known values are: \"Call\", \"Read\", and \"Write\".""" + timeoutInSeconds: int + """Response timeout for the action.""" + lastUpdatedOn: str + """Timestamp (in UTC) indicating when the management action was added or modified.""" + + +class NamespaceDiscoveredManagementGroup(TypedDict, total=False): + """Defines the management group properties. + + :ivar name: Name of the management group. Required. + :vartype name: str + :ivar managementGroupConfiguration: Stringified JSON that contains connector-specific + configuration for the management group. + :vartype managementGroupConfiguration: str + :ivar typeRef: URI or type definition ID. + :vartype typeRef: str + :ivar dataSource: Reference to a data source for a given management group. + :vartype dataSource: str + :ivar defaultTopic: Default MQTT topic path on which a client will receive the request for all + actions that are part of the management group. + :vartype defaultTopic: str + :ivar defaultTimeoutInSeconds: Default response timeout for all actions that are part of the + management group. + :vartype defaultTimeoutInSeconds: int + :ivar actions: Array of actions that are part of the management group. Each action can have an + individual configuration. + :vartype actions: list["NamespaceDiscoveredManagementAction"] + :ivar lastUpdatedOn: Timestamp (in UTC) indicating when the management group was added or + modified. + :vartype lastUpdatedOn: str + """ + + name: Required[str] + """Name of the management group. Required.""" + managementGroupConfiguration: str + """Stringified JSON that contains connector-specific configuration for the management group.""" + typeRef: str + """URI or type definition ID.""" + dataSource: str + """Reference to a data source for a given management group.""" + defaultTopic: str + """Default MQTT topic path on which a client will receive the request for all actions that are + part of the management group.""" + defaultTimeoutInSeconds: int + """Default response timeout for all actions that are part of the management group.""" + actions: list["NamespaceDiscoveredManagementAction"] + """Array of actions that are part of the management group. Each action can have an individual + configuration.""" + lastUpdatedOn: str + """Timestamp (in UTC) indicating when the management group was added or modified.""" + + +class NamespaceDiscoveredStream(TypedDict, total=False): + """Defines the stream properties. + + :ivar name: Name of the stream definition. Required. + :vartype name: str + :ivar streamConfiguration: Stringified JSON that contains connector-specific configuration for + the specific stream. + :vartype streamConfiguration: str + :ivar typeRef: URI or type definition ID. + :vartype typeRef: str + :ivar destinations: Destinations for a stream. + :vartype destinations: list["StreamDestination"] + :ivar lastUpdatedOn: Timestamp (in UTC) indicating when the stream was added or modified. + :vartype lastUpdatedOn: str + """ + + name: Required[str] + """Name of the stream definition. Required.""" + streamConfiguration: str + """Stringified JSON that contains connector-specific configuration for the specific stream.""" + typeRef: str + """URI or type definition ID.""" + destinations: list["StreamDestination"] + """Destinations for a stream.""" + lastUpdatedOn: str + """Timestamp (in UTC) indicating when the stream was added or modified.""" + + +class NamespaceEvent(TypedDict, total=False): + """Defines the event properties. + + :ivar name: The name of the event. Required. + :vartype name: str + :ivar dataSource: Reference to a data source for a given event. + :vartype dataSource: str + :ivar eventConfiguration: Stringified JSON that contains connector-specific configuration for + the event. For OPC UA, this could include configuration like, publishingInterval, + samplingInterval, and queueSize. + :vartype eventConfiguration: str + :ivar destinations: Destinations for an event. + :vartype destinations: list["EventDestination"] + :ivar typeRef: URI or type definition ID. + :vartype typeRef: str + """ + + name: Required[str] + """The name of the event. Required.""" + dataSource: str + """Reference to a data source for a given event.""" + eventConfiguration: str + """Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this + could include configuration like, publishingInterval, samplingInterval, and queueSize.""" + destinations: list["EventDestination"] + """Destinations for an event.""" + typeRef: str + """URI or type definition ID.""" + + +class NamespaceEventGroup(TypedDict, total=False): + """Defines the event group properties. + + :ivar name: The name of the event group. Required. + :vartype name: str + :ivar dataSource: The address of the notifier of the event group in the asset (e.g. URL) so + that a client can access the event group on the asset. + :vartype dataSource: str + :ivar eventGroupConfiguration: Stringified JSON that contains connector-specific configuration + for the event group. For OPC UA, this could include configuration like, publishingInterval, + samplingInterval, and queueSize. + :vartype eventGroupConfiguration: str + :ivar defaultDestinations: Destinations for events. Default destinations when destinations is + not defined at the event level. + :vartype defaultDestinations: list["EventDestination"] + :ivar typeRef: URI or type definition ID. + :vartype typeRef: str + :ivar events: Array of events that are part of the event group. + :vartype events: list["NamespaceEvent"] + """ + + name: Required[str] + """The name of the event group. Required.""" + dataSource: str + """The address of the notifier of the event group in the asset (e.g. URL) so that a client can + access the event group on the asset.""" + eventGroupConfiguration: str + """Stringified JSON that contains connector-specific configuration for the event group. For OPC + UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize.""" + defaultDestinations: list["EventDestination"] + """Destinations for events. Default destinations when destinations is not defined at the event + level.""" + typeRef: str + """URI or type definition ID.""" + events: list["NamespaceEvent"] + """Array of events that are part of the event group.""" + + +class NamespaceLinkingError(TypedDict, total=False): + """Error detail for an endpoint whose linking state is Failed. Present only while the linking + state is Failed and removed when the endpoint recovers. + + :ivar code: Error code that classifies the linking failure. + :vartype code: str + :ivar message: Human-readable message describing the linking failure. + :vartype message: str + """ + + code: str + """Error code that classifies the linking failure.""" + message: str + """Human-readable message describing the linking failure.""" + + +class NamespaceMessageSchemaReference(TypedDict, total=False): + """Defines the message schema reference properties. + + :ivar schemaRegistryNamespace: The message schema registry namespace. Required. + :vartype schemaRegistryNamespace: str + :ivar schemaName: The message schema name. Required. + :vartype schemaName: str + :ivar schemaVersion: The message schema version. Required. + :vartype schemaVersion: str + """ + + schemaRegistryNamespace: Required[str] + """The message schema registry namespace. Required.""" + schemaName: Required[str] + """The message schema name. Required.""" + schemaVersion: Required[str] + """The message schema version. Required.""" + + +class NamespaceMigrateRequest(TypedDict, total=False): + """Request body for the migrate resources operation in to Namespace resource. + + :ivar scope: Scope of the migrate resources operation. "Resources" + :vartype scope: Union[str, "Scope"] + :ivar resourceIds: List of asset resources to be migrated. + :vartype resourceIds: list[str] + """ + + scope: Union[str, "Scope"] + """Scope of the migrate resources operation. \"Resources\"""" + resourceIds: list[str] + """List of asset resources to be migrated.""" + + +class NamespaceProperties(TypedDict, total=False): + """The namespace properties model. + + :ivar uuid: Globally unique, immutable, non-reusable ID. + :vartype uuid: str + :ivar messaging: Assigned and unassigned messaging endpoints. + :vartype messaging: "Messaging" + :ivar management: Assigned and unassigned management endpoints. + :vartype management: "Management" + :ivar provisioning: The provisioning endpoints associated with this namespace. + :vartype provisioning: "NamespaceProvisioning" + :ivar outboundIdentity: The identity used for outbound calls from the ADR namespace. If not + specified and the namespace has a system-assigned identity enabled, the system-assigned + identity is used by default. + :vartype outboundIdentity: "OutboundIdentity" + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + uuid: str + """Globally unique, immutable, non-reusable ID.""" + messaging: "Messaging" + """Assigned and unassigned messaging endpoints.""" + management: "Management" + """Assigned and unassigned management endpoints.""" + provisioning: "NamespaceProvisioning" + """The provisioning endpoints associated with this namespace.""" + outboundIdentity: "OutboundIdentity" + """The identity used for outbound calls from the ADR namespace. If not specified and the namespace + has a system-assigned identity enabled, the system-assigned identity is used by default.""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", and \"Deleting\".""" + + +class NamespaceProvisioning(TypedDict, total=False): + """The provisioning endpoints associated with this namespace. + + :ivar endpoints: Dictionary of provisioning endpoints. + :vartype endpoints: dict[str, "ProvisioningEndpoint"] + """ + + endpoints: dict[str, "ProvisioningEndpoint"] + """Dictionary of provisioning endpoints.""" + + +class NamespaceStream(TypedDict, total=False): + """Defines the stream properties. + + :ivar name: Name of the stream definition. Required. + :vartype name: str + :ivar streamConfiguration: Stringified JSON that contains connector-specific configuration for + the specific stream. + :vartype streamConfiguration: str + :ivar typeRef: URI or type definition ID. + :vartype typeRef: str + :ivar destinations: Destinations for a stream. + :vartype destinations: list["StreamDestination"] + """ + + name: Required[str] + """Name of the stream definition. Required.""" + streamConfiguration: str + """Stringified JSON that contains connector-specific configuration for the specific stream.""" + typeRef: str + """URI or type definition ID.""" + destinations: list["StreamDestination"] + """Destinations for a stream.""" + + +class NamespaceUpdate(TypedDict, total=False): + """The type used for update operations of the Namespace. + + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "NamespaceUpdateProperties" + """ + + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + tags: dict[str, str] + """Resource tags.""" + properties: "NamespaceUpdateProperties" + """The resource-specific properties for this resource.""" + + +class NamespaceUpdateProperties(TypedDict, total=False): + """The updatable properties of the Namespace. + + :ivar messaging: Assigned and unassigned messaging endpoints. + :vartype messaging: "Messaging" + :ivar management: Assigned and unassigned management endpoints. + :vartype management: "Management" + :ivar provisioning: The provisioning endpoints associated with this namespace. + :vartype provisioning: "NamespaceProvisioning" + :ivar outboundIdentity: The identity used for outbound calls from the ADR namespace. If not + specified and the namespace has a system-assigned identity enabled, the system-assigned + identity is used by default. + :vartype outboundIdentity: "OutboundIdentity" + """ + + messaging: "Messaging" + """Assigned and unassigned messaging endpoints.""" + management: "Management" + """Assigned and unassigned management endpoints.""" + provisioning: "NamespaceProvisioning" + """The provisioning endpoints associated with this namespace.""" + outboundIdentity: "OutboundIdentity" + """The identity used for outbound calls from the ADR namespace. If not specified and the namespace + has a system-assigned identity enabled, the system-assigned identity is used by default.""" + + +class OptionalPropertiesCertificatePolicyConfiguration(TypedDict, total=False): # pylint: disable=name-too-long + """The template for adding optional properties. + + :ivar validityPeriodInDays: The validity period in days. + :vartype validityPeriodInDays: int + """ + + validityPeriodInDays: int + """The validity period in days.""" + + +class OutboundEndpoints(TypedDict, total=False): + """Property bag contains the device's outbound endpoints. + + :ivar assigned: Endpoints the device can connect to. Required. + :vartype assigned: dict[str, "DeviceMessagingEndpoint"] + :ivar unassigned: Set of most recently removed endpoints. + :vartype unassigned: dict[str, "DeviceMessagingEndpoint"] + """ + + assigned: Required[dict[str, "DeviceMessagingEndpoint"]] + """Endpoints the device can connect to. Required.""" + unassigned: dict[str, "DeviceMessagingEndpoint"] + """Set of most recently removed endpoints.""" + + +class OutboundIdentity(TypedDict, total=False): + """The identity the ADR namespace uses for outbound calls. If this property is null and the + namespace has a system-assigned identity enabled, the namespace defaults to using the + system-assigned identity for outbound calls. + + :ivar type: The identity type. Required. Known values are: "SystemAssigned" and "UserAssigned". + :vartype type: Union[str, "OutboundIdentityType"] + :ivar userAssignedIdentity: The resource ID of the user-assigned managed identity. Required + when type is UserAssigned. + :vartype userAssignedIdentity: str + """ + + type: Required[Union[str, "OutboundIdentityType"]] + """The identity type. Required. Known values are: \"SystemAssigned\" and \"UserAssigned\".""" + userAssignedIdentity: str + """The resource ID of the user-assigned managed identity. Required when type is UserAssigned.""" + + +class ProvisioningEndpoint(TypedDict, total=False): + """A provisioning service endpoint linked to this namespace. + + :ivar endpointType: Type of provisioning resource. Required. + "Microsoft.Devices/provisioningServices" + :vartype endpointType: Union[str, "ProvisioningEndpointType"] + :ivar resourceId: The provisioning endpoint Azure resource Id. Required. + :vartype resourceId: str + :ivar inboundCallerIdentity: The identity the linked resource uses to call the ADR namespace. + Required. + :vartype inboundCallerIdentity: "InboundCallerIdentity" + :ivar linkingState: The linking state of this provisioning endpoint. Known values are: + "InProgress", "Succeeded", and "Failed". + :vartype linkingState: Union[str, "NamespaceLinkingStateValue"] + :ivar linkingError: The error detail surfaced when this provisioning endpoint is in the Failed + linking state. + :vartype linkingError: "NamespaceLinkingError" + """ + + endpointType: Required[Union[str, "ProvisioningEndpointType"]] + """Type of provisioning resource. Required. \"Microsoft.Devices/provisioningServices\"""" + resourceId: Required[str] + """The provisioning endpoint Azure resource Id. Required.""" + inboundCallerIdentity: Required["InboundCallerIdentity"] + """The identity the linked resource uses to call the ADR namespace. Required.""" + linkingState: Union[str, "NamespaceLinkingStateValue"] + """The linking state of this provisioning endpoint. Known values are: \"InProgress\", + \"Succeeded\", and \"Failed\".""" + linkingError: "NamespaceLinkingError" + """The error detail surfaced when this provisioning endpoint is in the Failed linking state.""" + + +class RegistryDevice(TrackedResource): + """A Registry Device resource is a tracked resource with a provisioning lifecycle. The different + capabilities of the device are defined through child Device Capability resources. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "RegistryDeviceProperties" + :ivar etag: Resource etag. + :vartype etag: str + """ + + properties: "RegistryDeviceProperties" + """The resource-specific properties for this resource.""" + etag: str + """Resource etag.""" + + +class RegistryDeviceProperties(TypedDict, total=False): + """The properties of a registry device. + + :ivar enablementState: Whether the device is enabled or disabled. A disabled device cannot send + messages, be updated, or reprovision. Required. Known values are: "Enabled" and "Disabled". + :vartype enablementState: Union[str, "RegistryDeviceEnablementState"] + :ivar uuid: Globally unique, immutable, non-reusable ID. + :vartype uuid: str + :ivar externalDeviceId: A Device ID provided by the customer. + :vartype externalDeviceId: str + :ivar manufacturer: Device manufacturer. + :vartype manufacturer: str + :ivar model: Device model. + :vartype model: str + :ivar hardwareRevision: Device hardware revision. + :vartype hardwareRevision: str + :ivar softwareRevision: Device software revision. + :vartype softwareRevision: str + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + enablementState: Required[Union[str, "RegistryDeviceEnablementState"]] + """Whether the device is enabled or disabled. A disabled device cannot send messages, be updated, + or reprovision. Required. Known values are: \"Enabled\" and \"Disabled\".""" + uuid: str + """Globally unique, immutable, non-reusable ID.""" + externalDeviceId: str + """A Device ID provided by the customer.""" + manufacturer: str + """Device manufacturer.""" + model: str + """Device model.""" + hardwareRevision: str + """Device hardware revision.""" + softwareRevision: str + """Device software revision.""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", and \"Deleting\".""" + + +class RegistryDeviceUpdate(TypedDict, total=False): + """The type used for update operations of the RegistryDevice. + + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "RegistryDeviceUpdateProperties" + """ + + tags: dict[str, str] + """Resource tags.""" + properties: "RegistryDeviceUpdateProperties" + """The resource-specific properties for this resource.""" + + +class RegistryDeviceUpdateProperties(TypedDict, total=False): + """The updatable properties of the RegistryDevice. + + :ivar enablementState: Whether the device is enabled or disabled. A disabled device cannot send + messages, be updated, or reprovision. Known values are: "Enabled" and "Disabled". + :vartype enablementState: Union[str, "RegistryDeviceEnablementState"] + :ivar manufacturer: Device manufacturer. + :vartype manufacturer: str + :ivar model: Device model. + :vartype model: str + :ivar hardwareRevision: Device hardware revision. + :vartype hardwareRevision: str + :ivar softwareRevision: Device software revision. + :vartype softwareRevision: str + """ + + enablementState: Union[str, "RegistryDeviceEnablementState"] + """Whether the device is enabled or disabled. A disabled device cannot send messages, be updated, + or reprovision. Known values are: \"Enabled\" and \"Disabled\".""" + manufacturer: str + """Device manufacturer.""" + model: str + """Device model.""" + hardwareRevision: str + """Device hardware revision.""" + softwareRevision: str + """Device software revision.""" + + +class RootCertificateAuthorityProperties(TypedDict, total=False): + """Properties for a self-signed, service-managed root Certificate Authority. + + :ivar provisioningState: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar uuid: Globally unique, immutable, non-reusable identifier of the Certificate Authority + resource. + :vartype uuid: str + :ivar keyType: Crypto type: ECC. Required. "ECC" + :vartype keyType: Union[str, "CertificateAuthorityKeyType"] + :ivar subject: Certificate subject. + :vartype subject: str + :ivar validityNotBefore: Certificate is valid not before this date. Format ISO8601. + :vartype validityNotBefore: str + :ivar validityNotAfter: Certificate is valid not after this date. Format ISO8601. + :vartype validityNotAfter: str + :ivar certificateAuthorityType: The self-signed, service-managed root Certificate Authority + type. Required. Self-signed, service-managed root Certificate Authority. + :vartype certificateAuthorityType: Literal[CertificateAuthorityType.ROOT] + """ + + provisioningState: Union[str, "ProvisioningState"] + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", and \"Deleting\".""" + uuid: str + """Globally unique, immutable, non-reusable identifier of the Certificate Authority resource.""" + keyType: Required[Union[str, "CertificateAuthorityKeyType"]] + """Crypto type: ECC. Required. \"ECC\"""" + subject: str + """Certificate subject.""" + validityNotBefore: str + """Certificate is valid not before this date. Format ISO8601.""" + validityNotAfter: str + """Certificate is valid not after this date. Format ISO8601.""" + certificateAuthorityType: Required[Literal[CertificateAuthorityType.ROOT]] + """The self-signed, service-managed root Certificate Authority type. Required. Self-signed, + service-managed root Certificate Authority.""" + + +class Schema(ProxyResource): + """Schema definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "SchemaProperties" + """ + + properties: "SchemaProperties" + """The resource-specific properties for this resource.""" + + +class SchemaProperties(TypedDict, total=False): + """Defines the schema properties. + + :ivar uuid: Globally unique, immutable, non-reusable id. + :vartype uuid: str + :ivar displayName: Human-readable display name. + :vartype displayName: str + :ivar description: Human-readable description of the schema. + :vartype description: str + :ivar format: Format of the schema. Required. Known values are: "JsonSchema/draft-07", + "Delta/1.0", and "JsonLD/1.1". + :vartype format: Union[str, "Format"] + :ivar schemaType: Type of the schema. Required. Known values are: "MessageSchema", + "ThingModel", and "ThingDescription". + :vartype schemaType: Union[str, "SchemaType"] + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioningState: Union[str, "ProvisioningState"] + :ivar tags: Schema tags. + :vartype tags: dict[str, str] + """ + + uuid: str + """Globally unique, immutable, non-reusable id.""" + displayName: str + """Human-readable display name.""" + description: str + """Human-readable description of the schema.""" + format: Required[Union[str, "Format"]] + """Format of the schema. Required. Known values are: \"JsonSchema/draft-07\", \"Delta/1.0\", and + \"JsonLD/1.1\".""" + schemaType: Required[Union[str, "SchemaType"]] + """Type of the schema. Required. Known values are: \"MessageSchema\", \"ThingModel\", and + \"ThingDescription\".""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", and \"Deleting\".""" + tags: dict[str, str] + """Schema tags.""" + + +class SchemaRegistry(TrackedResource): + """Schema registry definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "SchemaRegistryProperties" + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + """ + + properties: "SchemaRegistryProperties" + """The resource-specific properties for this resource.""" + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + + +class SchemaRegistryProperties(TypedDict, total=False): + """Defines the schema registry properties. + + :ivar uuid: Globally unique, immutable, non-reusable id. + :vartype uuid: str + :ivar namespace: Schema registry namespace. Uniquely identifies a schema registry within a + tenant. Required. + :vartype namespace: str + :ivar displayName: Human-readable display name. + :vartype displayName: str + :ivar description: Human-readable description of the schema registry. + :vartype description: str + :ivar storageAccountContainerUrl: The Storage Account's Container URL where schemas will be + stored. Required. + :vartype storageAccountContainerUrl: str + :ivar outboundIdentity: The identity used for outbound calls from the ADR schema registry. If + not specified and the schema registry has a system-assigned identity enabled, the + system-assigned identity is used by default. + :vartype outboundIdentity: "OutboundIdentity" + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + uuid: str + """Globally unique, immutable, non-reusable id.""" + namespace: Required[str] + """Schema registry namespace. Uniquely identifies a schema registry within a tenant. Required.""" + displayName: str + """Human-readable display name.""" + description: str + """Human-readable description of the schema registry.""" + storageAccountContainerUrl: Required[str] + """The Storage Account's Container URL where schemas will be stored. Required.""" + outboundIdentity: "OutboundIdentity" + """The identity used for outbound calls from the ADR schema registry. If not specified and the + schema registry has a system-assigned identity enabled, the system-assigned identity is used by + default.""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", and \"Deleting\".""" + + +class SchemaRegistryUpdate(TypedDict, total=False): + """The type used for update operations of the SchemaRegistry. + + :ivar identity: The managed service identities assigned to this resource. + :vartype identity: "ManagedServiceIdentity" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "SchemaRegistryUpdateProperties" + """ + + identity: "ManagedServiceIdentity" + """The managed service identities assigned to this resource.""" + tags: dict[str, str] + """Resource tags.""" + properties: "SchemaRegistryUpdateProperties" + """The resource-specific properties for this resource.""" + + +class SchemaRegistryUpdateProperties(TypedDict, total=False): + """The updatable properties of the SchemaRegistry. + + :ivar displayName: Human-readable display name. + :vartype displayName: str + :ivar description: Human-readable description of the schema registry. + :vartype description: str + :ivar outboundIdentity: The identity used for outbound calls from the ADR schema registry. If + not specified and the schema registry has a system-assigned identity enabled, the + system-assigned identity is used by default. + :vartype outboundIdentity: "OutboundIdentity" + """ + + displayName: str + """Human-readable display name.""" + description: str + """Human-readable description of the schema registry.""" + outboundIdentity: "OutboundIdentity" + """The identity used for outbound calls from the ADR schema registry. If not specified and the + schema registry has a system-assigned identity enabled, the system-assigned identity is used by + default.""" + + +class SchemaVersion(ProxyResource): + """Schema version's definition. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar systemData: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype systemData: "SystemData" + :ivar properties: The resource-specific properties for this resource. + :vartype properties: "SchemaVersionProperties" + """ + + properties: "SchemaVersionProperties" + """The resource-specific properties for this resource.""" + + +class SchemaVersionProperties(TypedDict, total=False): + """Defines the schema version properties. + + :ivar uuid: Globally unique, immutable, non-reusable id. + :vartype uuid: str + :ivar description: Human-readable description of the schema. + :vartype description: str + :ivar schemaContent: Schema content. Required. + :vartype schemaContent: str + :ivar hash: Hash of the schema content. + :vartype hash: str + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Accepted", and "Deleting". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + uuid: str + """Globally unique, immutable, non-reusable id.""" + description: str + """Human-readable description of the schema.""" + schemaContent: Required[str] + """Schema content. Required.""" + hash: str + """Hash of the schema content.""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Accepted\", and \"Deleting\".""" + + +class StatusConfig(TypedDict, total=False): + """Defines the status config properties. + + :ivar version: A read-only incremental counter indicating the number of times the configuration + has been modified from the perspective of the current actual (edge) state of the CRD. Edge + would be the only writer of this value and would sync back up to the cloud. In steady state, + this should equal version. + :vartype version: int + :ivar lastTransitionTime: A read-only timestamp indicating the last time the configuration has + been modified from the perspective of the current actual (edge) state of the CRD. Edge would be + the only writer of this value and would sync back up to the cloud. + :vartype lastTransitionTime: str + :ivar error: Object to transfer and persist errors that originate from the edge. + :vartype error: "StatusError" + """ + + version: int + """A read-only incremental counter indicating the number of times the configuration has been + modified from the perspective of the current actual (edge) state of the CRD. Edge would be the + only writer of this value and would sync back up to the cloud. In steady state, this should + equal version.""" + lastTransitionTime: str + """A read-only timestamp indicating the last time the configuration has been modified from the + perspective of the current actual (edge) state of the CRD. Edge would be the only writer of + this value and would sync back up to the cloud.""" + error: "StatusError" + """Object to transfer and persist errors that originate from the edge.""" + + +class StatusError(TypedDict, total=False): + """Defines the status config error properties. + + :ivar code: Error code for classification of errors (ex: '400', '404', '500', etc.). + :vartype code: str + :ivar message: Human-readable helpful error message to provide additional context for error + (e.g.,: “Capability ID 'foo' does not exist”). + :vartype message: str + :ivar details: Array of error details that describe the status of each error. + :vartype details: list["ErrorDetails"] + """ + + code: str + """Error code for classification of errors (ex: '400', '404', '500', etc.).""" + message: str + """Human-readable helpful error message to provide additional context for error (e.g.,: + “Capability ID 'foo' does not exist”).""" + details: list["ErrorDetails"] + """Array of error details that describe the status of each error.""" + + +class StorageDestinationConfiguration(TypedDict, total=False): + """The configuration for a storage destination. + + :ivar path: The storage destination path. Required. + :vartype path: str + """ + + path: Required[str] + """The storage destination path. Required.""" + + +class StreamMqttDestination(TypedDict, total=False): + """The type for a MQTT destination. + + :ivar target: The MQTT destination type. Required. MQTT target. + :vartype target: Literal[StreamDestinationTarget.MQTT] + :ivar configuration: The MQTT destination configuration. Required. + :vartype configuration: "MqttDestinationConfiguration" + """ + + target: Required[Literal[StreamDestinationTarget.MQTT]] + """The MQTT destination type. Required. MQTT target.""" + configuration: Required["MqttDestinationConfiguration"] + """The MQTT destination configuration. Required.""" + + +class StreamStorageDestination(TypedDict, total=False): + """The type for a storage destination. + + :ivar target: The storage destination type. Required. Storage target. + :vartype target: Literal[StreamDestinationTarget.STORAGE] + :ivar configuration: The storage destination configuration. Required. + :vartype configuration: "StorageDestinationConfiguration" + """ + + target: Required[Literal[StreamDestinationTarget.STORAGE]] + """The storage destination type. Required. Storage target.""" + configuration: Required["StorageDestinationConfiguration"] + """The storage destination configuration. Required.""" + + +class SystemData(TypedDict, total=False): + """Metadata pertaining to creation and last modification of the resource. + + :ivar createdBy: The identity that created the resource. + :vartype createdBy: str + :ivar createdByType: The type of identity that created the resource. Known values are: "User", + "Application", "ManagedIdentity", and "Key". + :vartype createdByType: Union[str, "CreatedByType"] + :ivar createdAt: The timestamp of resource creation (UTC). + :vartype createdAt: str + :ivar lastModifiedBy: The identity that last modified the resource. + :vartype lastModifiedBy: str + :ivar lastModifiedByType: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype lastModifiedByType: Union[str, "CreatedByType"] + :ivar lastModifiedAt: The timestamp of resource last modification (UTC). + :vartype lastModifiedAt: str + """ + + createdBy: str + """The identity that created the resource.""" + createdByType: Union[str, "CreatedByType"] + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + createdAt: str + """The timestamp of resource creation (UTC).""" + lastModifiedBy: str + """The identity that last modified the resource.""" + lastModifiedByType: Union[str, "CreatedByType"] + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + lastModifiedAt: str + """The timestamp of resource last modification (UTC).""" + + +class Topic(TypedDict, total=False): + """Object that describes the topic information. + + :ivar path: The topic path for messages published to an MQTT broker. Required. + :vartype path: str + :ivar retain: When set to 'Keep', messages published to an MQTT broker will have the retain + flag set. Default: 'Never'. Known values are: "Keep" and "Never". + :vartype retain: Union[str, "TopicRetainType"] + """ + + path: Required[str] + """The topic path for messages published to an MQTT broker. Required.""" + retain: Union[str, "TopicRetainType"] + """When set to 'Keep', messages published to an MQTT broker will have the retain flag set. + Default: 'Never'. Known values are: \"Keep\" and \"Never\".""" + + +class TrustSettings(TypedDict, total=False): + """Defines server trust settings for an endpoint. + + :ivar trustList: Defines a secret reference for certificates to trust. + :vartype trustList: str + """ + + trustList: str + """Defines a secret reference for certificates to trust.""" + + +class UserAssignedIdentity(TypedDict, total=False): + """User assigned identity properties. + + :ivar principalId: The principal ID of the assigned identity. + :vartype principalId: str + :ivar clientId: The client ID of the assigned identity. + :vartype clientId: str + """ + + principalId: str + """The principal ID of the assigned identity.""" + clientId: str + """The client ID of the assigned identity.""" + + +class UsernamePasswordCredentials(TypedDict, total=False): + """The credentials for authentication mode UsernamePassword. + + :ivar usernameSecretName: The name of the secret containing the username. Required. + :vartype usernameSecretName: str + :ivar passwordSecretName: The name of the secret containing the password. Required. + :vartype passwordSecretName: str + """ + + usernameSecretName: Required[str] + """The name of the secret containing the username. Required.""" + passwordSecretName: Required[str] + """The name of the secret containing the password. Required.""" + + +class X509CertificateCredentials(TypedDict, total=False): + """The x509 certificate for authentication mode Certificate. + + :ivar certificateSecretName: The name of the secret containing the certificate and private key + (e.g. stored as .der/.pem or .der/.pfx). Required. + :vartype certificateSecretName: str + :ivar keySecretName: The name of the secret containing the certificate private key in PEM or + DER format. + :vartype keySecretName: str + :ivar intermediateCertificatesSecretName: The name of the secret containing the combined + intermediate certificates in PEM format. + :vartype intermediateCertificatesSecretName: str + """ + + certificateSecretName: Required[str] + """The name of the secret containing the certificate and private key (e.g. stored as .der/.pem or + .der/.pfx). Required.""" + keySecretName: str + """The name of the secret containing the certificate private key in PEM or DER format.""" + intermediateCertificatesSecretName: str + """The name of the secret containing the combined intermediate certificates in PEM format.""" + + +class X509Credentials(TypedDict, total=False): + """The x509 certificate for authentication mode Certificate. + + :ivar certificateSecretName: The name of the secret containing the certificate and private key + (e.g. stored as .der/.pem or .der/.pfx). Required. + :vartype certificateSecretName: str + """ + + certificateSecretName: Required[str] + """The name of the secret containing the certificate and private key (e.g. stored as .der/.pem or + .der/.pfx). Required.""" + + +CertificateAuthorityIssuer = Union[ExternalCertificateAuthorityIssuer, MicrosoftCertificateAuthorityIssuer] +CertificateAuthorityProperties = Union[IntermediateCertificateAuthorityProperties, RootCertificateAuthorityProperties] +DatasetDestination = Union[DatasetBrokerStateStoreDestination, DatasetMqttDestination, DatasetStorageDestination] +EventDestination = Union[EventMqttDestination, EventStorageDestination] +StreamDestination = Union[StreamMqttDestination, StreamStorageDestination] diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/activate_certificate_authority.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/activate_certificate_authority.py new file mode 100644 index 000000000000..dd082832bf88 --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/activate_certificate_authority.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-deviceregistry +# USAGE + python activate_certificate_authority.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DeviceRegistryMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.certificate_authorities.begin_activate( + resource_group_name="rgdeviceregistry", + namespace_name="mynamespace", + certificate_authority_name="myexternalica", + body={"certificateChain": "-----BEGIN CERTIFICATE-----\\nMIID...\\n-----END CERTIFICATE-----"}, + ).result() + + +# x-ms-original-file: 2026-11-01/Activate_CertificateAuthority.json +if __name__ == "__main__": + main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_endpoint_profile.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_endpoint_profile.py index bcd9bde3747c..50ca4318add9 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_endpoint_profile.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_endpoint_profile.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_AssetEndpointProfile.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_AssetEndpointProfile.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_endpoint_profile_with_discovered_aep_ref.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_endpoint_profile_with_discovered_aep_ref.py index 5d6055a7b4e0..15196431ff91 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_endpoint_profile_with_discovered_aep_ref.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_endpoint_profile_with_discovered_aep_ref.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_AssetEndpointProfile_With_DiscoveredAepRef.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_AssetEndpointProfile_With_DiscoveredAepRef.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_with_discovered_asset_ref.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_with_discovered_asset_ref.py index 8ec70e5c30aa..aa07c8432f05 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_with_discovered_asset_ref.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_with_discovered_asset_ref.py @@ -101,6 +101,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_Asset_With_DiscoveredAssetRef.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_Asset_With_DiscoveredAssetRef.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_with_external_asset_id.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_with_external_asset_id.py index 02e5bb30f0fa..26db9523e415 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_with_external_asset_id.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_with_external_asset_id.py @@ -100,6 +100,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_Asset_With_ExternalAssetId.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_Asset_With_ExternalAssetId.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_without_display_name.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_without_display_name.py index 24ce782b0385..3ccfc89601f4 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_without_display_name.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_without_display_name.py @@ -99,6 +99,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_Asset_Without_DisplayName.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_Asset_Without_DisplayName.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_without_external_asset_id.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_without_external_asset_id.py index 4b23905a57bf..c3a8a8bcec6a 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_without_external_asset_id.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_asset_without_external_asset_id.py @@ -99,6 +99,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_Asset_Without_ExternalAssetId.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_Asset_Without_ExternalAssetId.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_policies.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_certificate_authority_icaexternal_issuer.py similarity index 73% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_policies.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_certificate_authority_icaexternal_issuer.py index 6486cb545f9a..ec453fd69af7 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_policies.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_certificate_authority_icaexternal_issuer.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python create_or_replace_policies.py + python create_or_replace_certificate_authority_icaexternal_issuer.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,22 +30,19 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.policies.begin_create_or_update( + response = client.certificate_authorities.begin_create_or_replace( resource_group_name="rgdeviceregistry", namespace_name="mynamespace", - policy_name="mypolicy", + certificate_authority_name="myexternalica", resource={ - "properties": { - "certificate": { - "certificateAuthorityConfiguration": {"bringYourOwnRoot": {"enabled": True}, "keyType": "ECC"}, - "leafCertificateConfiguration": {"validityPeriodInDays": 10}, - } - } + "location": "East US 2", + "properties": {"certificateAuthorityType": "ICA", "issuer": {"issuerType": "External"}, "keyType": "ECC"}, + "tags": {"environment": "production"}, }, ).result() print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_Policies.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_CertificateAuthority_ICAExternalIssuer.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_certificate_authority_icainternal_issuer.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_certificate_authority_icainternal_issuer.py new file mode 100644 index 000000000000..41099023af50 --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_certificate_authority_icainternal_issuer.py @@ -0,0 +1,56 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-deviceregistry +# USAGE + python create_or_replace_certificate_authority_icainternal_issuer.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DeviceRegistryMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.certificate_authorities.begin_create_or_replace( + resource_group_name="rgdeviceregistry", + namespace_name="mynamespace", + certificate_authority_name="myica", + resource={ + "location": "East US 2", + "properties": { + "certificateAuthorityType": "ICA", + "issuer": { + "certificateAuthorityResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgdeviceregistry/providers/Microsoft.DeviceRegistry/namespaces/mynamespace/certificateAuthorities/myrootca", + "issuerType": "Microsoft", + }, + "keyType": "ECC", + }, + "tags": {"environment": "production"}, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-11-01/CreateOrReplace_CertificateAuthority_ICAInternalIssuer.json +if __name__ == "__main__": + main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_policies.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_certificate_authority_root.py similarity index 75% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_policies.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_certificate_authority_root.py index ba499507d86c..af3246f02a93 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_policies.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_certificate_authority_root.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python update_policies.py + python create_or_replace_certificate_authority_root.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,22 +30,19 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.policies.begin_update( + response = client.certificate_authorities.begin_create_or_replace( resource_group_name="rgdeviceregistry", namespace_name="mynamespace", - policy_name="mypolicy", - properties={ - "properties": { - "certificate": { - "certificateAuthorityConfiguration": {}, - "leafCertificateConfiguration": {"validityPeriodInDays": 10}, - } - } + certificate_authority_name="myrootca", + resource={ + "location": "East US 2", + "properties": {"certificateAuthorityType": "Root", "keyType": "ECC"}, + "tags": {"environment": "production"}, }, ).result() print(response) -# x-ms-original-file: 2026-03-01-preview/Update_Policies.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_CertificateAuthority_Root.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_certificate_policy.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_certificate_policy.py new file mode 100644 index 000000000000..d36f7e266809 --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_certificate_policy.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-deviceregistry +# USAGE + python create_or_replace_certificate_policy.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DeviceRegistryMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.certificate_policies.begin_create_or_replace( + resource_group_name="rgdeviceregistry", + namespace_name="mynamespace", + certificate_authority_name="myrootca", + certificate_policy_name="mycertificatepolicy", + resource={"location": "East US 2", "properties": {"certificate": {"validityPeriodInDays": 30}}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-11-01/CreateOrReplace_CertificatePolicy.json +if __name__ == "__main__": + main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_asset.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_asset.py index c9566df7d275..b229e15047b5 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_asset.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_asset.py @@ -42,7 +42,7 @@ def main(): }, "location": "West Europe", "properties": { - "assetTypeRefs": ["myAssetTypeRef1", "myAssetTypeRef2"], + "assetTypeRefs": ["myAssetTypeRef1"], "attributes": {"floor": "1"}, "datasets": [ { @@ -52,13 +52,7 @@ def main(): "dataSource": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3", "name": "dataset1DataPoint1", "typeRef": "dataset1DataPoint1TypeRef", - }, - { - "dataPointConfiguration": '{"publishingInterval":8,"samplingInterval":8,"queueSize":4}', - "dataSource": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4", - "name": "dataset1DataPoint2", - "typeRef": "dataset1DataPoint2TypeRef", - }, + } ], "dataSource": "nsu=http://microsoft.com/Opc/OpcPlc/Oven;i=5", "datasetConfiguration": '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', @@ -87,6 +81,30 @@ def main(): "displayName": "AssetDisplayName", "documentationUri": "https://www.example.com/manual", "enabled": True, + "eventGroups": [ + { + "events": [ + { + "dataSource": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt5", + "destinations": [ + { + "configuration": { + "qos": "Qos0", + "retain": "Keep", + "topic": "/contoso/testEvent1", + "ttl": 7200, + }, + "target": "Mqtt", + } + ], + "eventConfiguration": '{"publishingInterval":7,"samplingInterval":1,"queueSize":8}', + "name": "event1", + "typeRef": "event1Ref", + } + ], + "name": "default", + } + ], "externalAssetId": "8ZBA6LRHU0A458969", "hardwareRevision": "1.0", "managementGroups": [ @@ -100,16 +118,7 @@ def main(): "timeoutInSeconds": 60, "topic": "/contoso/managementGroup1/action1", "typeRef": "action1TypeRef", - }, - { - "actionConfiguration": '{"retryCount":5,"retryBackoffInterval":5}', - "actionType": "Call", - "name": "action2", - "targetUri": "/onvif/device_service?ONVIFProfile=Profile2", - "timeoutInSeconds": 60, - "topic": "/contoso/managementGroup1/action2", - "typeRef": "action2TypeRef", - }, + } ], "defaultTimeoutInSeconds": 100, "defaultTopic": "/contoso/managementGroup1", @@ -130,23 +139,7 @@ def main(): "name": "stream1", "streamConfiguration": '{"publishingInterval":8,"samplingInterval":8,"queueSize":4}', "typeRef": "stream1TypeRef", - }, - { - "destinations": [ - { - "configuration": { - "qos": "Qos0", - "retain": "Never", - "topic": "/contoso/testStream2", - "ttl": 7200, - }, - "target": "Mqtt", - } - ], - "name": "stream2", - "streamConfiguration": '{"publishingInterval":8,"samplingInterval":8,"queueSize":4}', - "typeRef": "stream2TypeRef", - }, + } ], }, "tags": {"site": "building-1"}, @@ -155,6 +148,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_NamespaceAsset.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_NamespaceAsset.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device.py index 37f9a933205c..0b5b439d4370 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device.py @@ -42,19 +42,20 @@ def main(): "endpoints": { "outbound": { "assigned": { - "iothubEndpoint": { - "address": "https://iothub-for-dps.azure-devices.net", - "endpointType": "Microsoft.Devices/IotHubs", + "eventGridEndpoint": { + "address": "https://myeventgridtopic.westeurope-1.eventgrid.azure.net/api/events", + "endpointType": "Microsoft.Devices", } } } }, + "externalDeviceId": "adr-smart-device3-7a848b15-af47-40a7-8c06-a3f43314d44f", }, }, ).result() print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_NamespaceDevice.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_NamespaceDevice.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device_edge_anonymous.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device_edge_anonymous.py index a35ae7e596f0..20b6829fd1f4 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device_edge_anonymous.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device_edge_anonymous.py @@ -49,7 +49,7 @@ def main(): "theOnlyOPCUABroker": { "address": "opc.tcp://192.168.86.23:51211/UA/SampleServer", "authentication": {"method": "Anonymous"}, - "endpointType": "microsoft.opcua:v1", + "endpointType": "microsoft.opcua", "version": "2", } } @@ -61,6 +61,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_NamespaceDevice_Edge_Anonymous.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_NamespaceDevice_Edge_Anonymous.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device_edge_username_pass.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device_edge_username_pass.py index 2999b0f234b8..d4c5485b9f9c 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device_edge_username_pass.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device_edge_username_pass.py @@ -55,7 +55,7 @@ def main(): "usernameSecretName": "user-ref", }, }, - "endpointType": "microsoft.opcua:v1", + "endpointType": "microsoft.opcua", "version": "2", } } @@ -67,6 +67,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_NamespaceDevice_Edge_UsernamePass.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_NamespaceDevice_Edge_UsernamePass.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device_edge_x509.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device_edge_x509.py index de916909343a..bdaa6aecf565 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device_edge_x509.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_device_edge_x509.py @@ -50,7 +50,11 @@ def main(): "address": "opc.tcp://192.168.86.23:51211/UA/SampleServer", "authentication": { "method": "Certificate", - "x509Credentials": {"certificateSecretName": "cert-secret"}, + "x509Credentials": { + "certificateSecretName": "cert-secret", + "intermediateCertificatesSecretName": "intermediate-certs-secret", + "keySecretName": "key-secret", + }, }, "endpointType": "microsoft.opcua", "version": "2", @@ -74,6 +78,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_NamespaceDevice_Edge_x509.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_NamespaceDevice_Edge_x509.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_discovered_asset.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_discovered_asset.py index 947209a04f05..e5d6c8255770 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_discovered_asset.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_discovered_asset.py @@ -42,7 +42,7 @@ def main(): }, "location": "West Europe", "properties": { - "assetTypeRefs": ["myAssetTypeRef1", "myAssetTypeRef2"], + "assetTypeRefs": ["myAssetTypeRef1"], "attributes": {"floor": "1"}, "datasets": [ { @@ -53,14 +53,7 @@ def main(): "lastUpdatedOn": "2024-04-09T14:20:00.52Z", "name": "dataset1DataPoint1", "typeRef": "dataset1DataPoint1TypeRef", - }, - { - "dataPointConfiguration": '{"publishingInterval":8,"samplingInterval":8,"queueSize":4}', - "dataSource": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4", - "lastUpdatedOn": "2024-04-09T14:20:00.52Z", - "name": "dataset1DataPoint2", - "typeRef": "dataset1DataPoint2TypeRef", - }, + } ], "dataSource": "nsu=http://microsoft.com/Opc/OpcPlc/Boiler;i=5", "datasetConfiguration": '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', @@ -87,6 +80,31 @@ def main(): "deviceRef": {"deviceName": "myDevice", "endpointName": "opcuaendpointname"}, "discoveryId": "11111111-1111-1111-1111-111111111111", "documentationUri": "https://www.example.com/manual", + "eventGroups": [ + { + "events": [ + { + "dataSource": "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3", + "destinations": [ + { + "configuration": { + "qos": "Qos0", + "retain": "Keep", + "topic": "/contoso/testEvent1", + "ttl": 7200, + }, + "target": "Mqtt", + } + ], + "eventConfiguration": '{"publishingInterval":7,"samplingInterval":1,"queueSize":8}', + "lastUpdatedOn": "2024-04-09T14:20:00.52Z", + "name": "event1", + "typeRef": "event1Ref", + } + ], + "name": "default", + } + ], "hardwareRevision": "1.0", "managementGroups": [ { @@ -100,17 +118,7 @@ def main(): "timeoutInSeconds": 60, "topic": "/contoso/managementGroup1/action1", "typeRef": "action1TypeRef", - }, - { - "actionConfiguration": '{"retryCount":5,"retryBackoffInterval":5}', - "actionType": "Call", - "lastUpdatedOn": "2024-04-09T14:20:00.52Z", - "name": "action2", - "targetUri": "/onvif/device_service?ONVIFProfile=Profile2", - "timeoutInSeconds": 60, - "topic": "/contoso/managementGroup1/action2", - "typeRef": "action2TypeRef", - }, + } ], "defaultTimeoutInSeconds": 100, "defaultTopic": "/contoso/managementGroup1", @@ -133,24 +141,7 @@ def main(): "name": "stream1", "streamConfiguration": '{"publishingInterval":8,"samplingInterval":8,"queueSize":4}', "typeRef": "stream1TypeRef", - }, - { - "destinations": [ - { - "configuration": { - "qos": "Qos0", - "retain": "Never", - "topic": "/contoso/testStream2", - "ttl": 7200, - }, - "target": "Mqtt", - } - ], - "lastUpdatedOn": "2024-04-09T14:20:00.52Z", - "name": "stream2", - "streamConfiguration": '{"publishingInterval":8,"samplingInterval":8,"queueSize":4}', - "typeRef": "stream2TypeRef", - }, + } ], "version": 73766, }, @@ -160,6 +151,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_NamespaceDiscoveredAsset.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_NamespaceDiscoveredAsset.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_discovered_device.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_discovered_device.py index 08d6a108b0af..3441eea00fb6 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_discovered_device.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_discovered_device.py @@ -46,9 +46,9 @@ def main(): "endpoints": { "outbound": { "assigned": { - "iothubEndpoint": { - "address": "https://iothub-for-dps.azure-devices.net", - "endpointType": "Microsoft.Devices/IotHubs", + "eventGridEndpoint": { + "address": "https://myeventgridtopic.westeurope-1.eventgrid.azure.net/api/events", + "endpointType": "Microsoft.Devices", } } } @@ -61,6 +61,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_NamespaceDiscoveredDevice.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_NamespaceDiscoveredDevice.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_with_management_endpoints.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_with_management_endpoints.py new file mode 100644 index 000000000000..6f939fb2c34a --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_with_management_endpoints.py @@ -0,0 +1,64 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-deviceregistry +# USAGE + python create_or_replace_namespace_with_management_endpoints.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DeviceRegistryMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.namespaces.begin_create_or_replace( + resource_group_name="myResourceGroup", + namespace_name="adr-namespace-gbk0925-n01", + resource={ + "location": "North Europe", + "properties": { + "management": { + "endpoints": { + "customLocation1": { + "address": "eg-for-adr.eastus2-1.ts.eventgrid.azure.net", + "endpointType": "Microsoft.EventGrid/Namespaces", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.EventGrid/Namespaces/eg-for-adr", + "scopeId": "scope-id-for-management-endpoint-1", + }, + "customLocation2": { + "address": "eg-for-adr1.eastus2-1.ts.eventgrid.azure.net", + "endpointType": "Microsoft.EventGrid/Namespaces", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.EventGrid/Namespaces/eg-for-adr1", + "scopeId": "scope-id-for-management-endpoint-2", + }, + } + } + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-11-01/CreateOrReplace_Namespace_With_ManagementEndpoints.json +if __name__ == "__main__": + main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_with_messaging_and_provisioning_endpoints.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_with_messaging_and_provisioning_endpoints.py new file mode 100644 index 000000000000..319890717920 --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_with_messaging_and_provisioning_endpoints.py @@ -0,0 +1,75 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-deviceregistry +# USAGE + python create_or_replace_namespace_with_messaging_and_provisioning_endpoints.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DeviceRegistryMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.namespaces.begin_create_or_replace( + resource_group_name="myResourceGroup", + namespace_name="mynamespace", + resource={ + "identity": {"type": "SystemAssigned"}, + "location": "northeurope", + "properties": { + "messaging": { + "endpoints": { + "myPrimaryIotHubEndpoint": { + "endpointType": "Microsoft.Devices/IotHubs", + "inboundCallerIdentity": {"type": "SystemAssigned"}, + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/myIotHub1", + }, + "mySecondaryIotHubEndpoint": { + "endpointType": "Microsoft.Devices/IotHubs", + "inboundCallerIdentity": { + "type": "UserAssigned", + "userAssignedIdentity": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myAdrCallerUami", + }, + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/myIotHub2", + }, + } + }, + "provisioning": { + "endpoints": { + "myDpsEndpoint": { + "endpointType": "Microsoft.Devices/provisioningServices", + "inboundCallerIdentity": {"type": "SystemAssigned"}, + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Devices/provisioningServices/myDps", + } + } + }, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-11-01/CreateOrReplace_Namespace_With_MessagingAndProvisioningEndpoints.json +if __name__ == "__main__": + main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_registry_device.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_registry_device.py new file mode 100644 index 000000000000..dcf0455828cb --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_registry_device.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-deviceregistry +# USAGE + python create_or_replace_registry_device.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DeviceRegistryMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.registry_devices.begin_create_or_replace( + resource_group_name="myResourceGroup", + namespace_name="my-namespace-1", + registry_device_name="adr-smart-device3-f191f536-f652-4eb4-b9a0-1a9d43300cab", + resource={ + "location": "North Europe", + "properties": { + "enablementState": "Enabled", + "externalDeviceId": "adr-smart-device3-f191f536-f652-4eb4-b9a0-1a9d43300cab", + "hardwareRevision": "1.0", + "manufacturer": "Contoso", + "model": "SmartSensor", + "softwareRevision": "5.15", + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-11-01/CreateOrReplace_RegistryDevice.json +if __name__ == "__main__": + main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_schema.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_schema.py index ae8d7a2436d9..a767195a8eda 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_schema.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_schema.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_Schema.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_Schema.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_schema_registry.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_schema_registry.py index 36f16f5a2179..04e206373f09 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_schema_registry.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_schema_registry.py @@ -39,7 +39,7 @@ def main(): "description": "This is a sample Schema Registry", "displayName": "Schema Registry namespace 001", "namespace": "sr-namespace-001", - "storageAccountContainerUrl": "my-blob-storage.blob.core.windows.net/my-container", + "storageAccountContainerUrl": "https://my-blob-storage.blob.core.windows.net/my-container", }, "tags": {}, }, @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_SchemaRegistry.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_SchemaRegistry.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_schema_version.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_schema_version.py index d87d3422c16f..26732138fe8a 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_schema_version.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_schema_version.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_SchemaVersion.json +# x-ms-original-file: 2026-11-01/CreateOrReplace_SchemaVersion.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_asset.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_asset.py index 7a4050330279..f8399507bc74 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_asset.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_asset.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-03-01-preview/Delete_Asset.json +# x-ms-original-file: 2026-11-01/Delete_Asset.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_asset_endpoint_profile.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_asset_endpoint_profile.py index 068951db0274..4cff9a711e8f 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_asset_endpoint_profile.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_asset_endpoint_profile.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-03-01-preview/Delete_AssetEndpointProfile.json +# x-ms-original-file: 2026-11-01/Delete_AssetEndpointProfile.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/policies_revoke_issuer.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_certificate_authority.py similarity index 86% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/policies_revoke_issuer.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_certificate_authority.py index de8f8b448ee9..1ae4019d466a 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/policies_revoke_issuer.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_certificate_authority.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python policies_revoke_issuer.py + python delete_certificate_authority.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,13 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.policies.begin_revoke_issuer( + client.certificate_authorities.begin_delete( resource_group_name="rgdeviceregistry", namespace_name="mynamespace", - policy_name="mypolicy", + certificate_authority_name="myrootca", ).result() -# x-ms-original-file: 2026-03-01-preview/Policies_RevokeIssuer.json +# x-ms-original-file: 2026-11-01/Delete_CertificateAuthority.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_credentials.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_certificate_policy.py similarity index 84% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_credentials.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_certificate_policy.py index 503a76c8f9c2..a8bc8a7e430f 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_credentials.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_certificate_policy.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python delete_credentials.py + python delete_certificate_policy.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,12 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.credentials.begin_delete( + client.certificate_policies.begin_delete( resource_group_name="rgdeviceregistry", namespace_name="mynamespace", + certificate_authority_name="myrootca", + certificate_policy_name="mycertificatepolicy", ).result() -# x-ms-original-file: 2026-03-01-preview/Delete_Credentials.json +# x-ms-original-file: 2026-11-01/Delete_CertificatePolicy.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace.py index ae1a34c6ed46..db6b61e2c83c 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-03-01-preview/Delete_Namespace.json +# x-ms-original-file: 2026-11-01/Delete_Namespace.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_asset.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_asset.py index 39a93b5249e8..30247187b66c 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_asset.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_asset.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-03-01-preview/Delete_NamespaceAsset.json +# x-ms-original-file: 2026-11-01/Delete_NamespaceAsset.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_device.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_device.py index bf09ab598e34..053e0d1652f9 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_device.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_device.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-03-01-preview/Delete_NamespaceDevice.json +# x-ms-original-file: 2026-11-01/Delete_NamespaceDevice.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_discovered_asset.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_discovered_asset.py index bdc3e39f4f18..17467726b95c 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_discovered_asset.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_discovered_asset.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-03-01-preview/Delete_NamespaceDiscoveredAsset.json +# x-ms-original-file: 2026-11-01/Delete_NamespaceDiscoveredAsset.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_discovered_device.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_discovered_device.py index 4649e186a61c..210fe03afb1f 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_discovered_device.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_namespace_discovered_device.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-03-01-preview/Delete_NamespaceDiscoveredDevice.json +# x-ms-original-file: 2026-11-01/Delete_NamespaceDiscoveredDevice.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_registry_device.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_registry_device.py new file mode 100644 index 000000000000..96630fce8c22 --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_registry_device.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-deviceregistry +# USAGE + python delete_registry_device.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DeviceRegistryMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.registry_devices.begin_delete( + resource_group_name="myResourceGroup", + namespace_name="my-namespace-1", + registry_device_name="adr-smart-device3-f191f536-f652-4eb4-b9a0-1a9d43300cab", + ).result() + + +# x-ms-original-file: 2026-11-01/Delete_RegistryDevice.json +if __name__ == "__main__": + main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_schema.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_schema.py index 78b6043b5207..35987e591955 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_schema.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_schema.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: 2026-03-01-preview/Delete_Schema.json +# x-ms-original-file: 2026-11-01/Delete_Schema.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_schema_registry.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_schema_registry.py index 034566314f63..ebef937cc469 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_schema_registry.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_schema_registry.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2026-03-01-preview/Delete_SchemaRegistry.json +# x-ms-original-file: 2026-11-01/Delete_SchemaRegistry.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_schema_version.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_schema_version.py index c7bb77f1494f..6f6785668b0b 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_schema_version.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_schema_version.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: 2026-03-01-preview/Delete_SchemaVersion.json +# x-ms-original-file: 2026-11-01/Delete_SchemaVersion.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/execute_action_assets_namespace.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/execute_action_assets_namespace.py new file mode 100644 index 000000000000..8c341ee3e609 --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/execute_action_assets_namespace.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-deviceregistry +# USAGE + python execute_action_assets_namespace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DeviceRegistryMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.namespace_assets.begin_execute_action( + resource_group_name="myResourceGroup", + namespace_name="my-namespace-1", + asset_name="my-asset-1", + body={ + "managementActionName": "my-asset-action-1", + "managementGroupName": "my-asset-group-1", + "payload": {"prop1": "value1", "prop2": "123", "prop3": True, "prop4": {"subProp1": "subValue1"}}, + }, + ).result() + + +# x-ms-original-file: 2026-11-01/ExecuteAction_Assets_Namespace.json +if __name__ == "__main__": + main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset.py index a80ae204ce30..38cd1bff15d4 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Get_Asset.json +# x-ms-original-file: 2026-11-01/Get_Asset.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset_endpoint_profile.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset_endpoint_profile.py index 2a00e0cc604a..d7589e0dfd22 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset_endpoint_profile.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset_endpoint_profile.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Get_AssetEndpointProfile.json +# x-ms-original-file: 2026-11-01/Get_AssetEndpointProfile.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset_endpoint_profile_with_sync_status.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset_endpoint_profile_with_sync_status.py index fbcd97a8bd94..0244ff7a2c97 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset_endpoint_profile_with_sync_status.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset_endpoint_profile_with_sync_status.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Get_AssetEndpointProfile_With_SyncStatus.json +# x-ms-original-file: 2026-11-01/Get_AssetEndpointProfile_With_SyncStatus.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset_with_sync_status.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset_with_sync_status.py index f854251ae2a0..d3364671657c 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset_with_sync_status.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_asset_with_sync_status.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Get_Asset_With_SyncStatus.json +# x-ms-original-file: 2026-11-01/Get_Asset_With_SyncStatus.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_policies.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_async_operation_status.py similarity index 82% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_policies.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_async_operation_status.py index 7daf4013955f..c2b09670992b 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/delete_policies.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_async_operation_status.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python delete_policies.py + python get_async_operation_status.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,13 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.policies.begin_delete( - resource_group_name="rgdeviceregistry", - namespace_name="mynamespace", - policy_name="mypolicy", - ).result() + response = client.async_operation_status.get( + location="eastus", + operation_id="00000000-0000-0000-0000-000000000001", + ) + print(response) -# x-ms-original-file: 2026-03-01-preview/Delete_Policies.json +# x-ms-original-file: 2026-11-01/Get_AsyncOperationStatus.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_billing_container.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_billing_container.py index 585e4a68cd16..888b90c0bd9a 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_billing_container.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_billing_container.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Get_BillingContainer.json +# x-ms-original-file: 2026-11-01/Get_BillingContainer.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_credentials.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_certificate_authority_icaexternal_issuer.py similarity index 84% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_credentials.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_certificate_authority_icaexternal_issuer.py index c898190f2596..4c423cd6e7fa 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_credentials.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_certificate_authority_icaexternal_issuer.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python update_credentials.py + python get_certificate_authority_icaexternal_issuer.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.credentials.begin_update( + response = client.certificate_authorities.get( resource_group_name="rgdeviceregistry", namespace_name="mynamespace", - properties={"tags": {"key9580": "tpbwnljiiwtlyuiayalpkxyfwnrz"}}, - ).result() + certificate_authority_name="myexternalica", + ) print(response) -# x-ms-original-file: 2026-03-01-preview/Update_Credentials.json +# x-ms-original-file: 2026-11-01/Get_CertificateAuthority_ICAExternalIssuer.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_policies.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_certificate_authority_icainternal_issuer.py similarity index 85% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_policies.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_certificate_authority_icainternal_issuer.py index c16998a96811..378a1022726e 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_policies.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_certificate_authority_icainternal_issuer.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python get_policies.py + python get_certificate_authority_icainternal_issuer.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.policies.get( + response = client.certificate_authorities.get( resource_group_name="rgdeviceregistry", namespace_name="mynamespace", - policy_name="myPolicy", + certificate_authority_name="myica", ) print(response) -# x-ms-original-file: 2026-03-01-preview/Get_Policies.json +# x-ms-original-file: 2026-11-01/Get_CertificateAuthority_ICAInternalIssuer.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_credentials.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_certificate_authority_root.py similarity index 86% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_credentials.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_certificate_authority_root.py index 0f244c01f19f..940f9fb47377 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_credentials.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_certificate_authority_root.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python get_credentials.py + python get_certificate_authority_root.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,13 +30,14 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.credentials.get( + response = client.certificate_authorities.get( resource_group_name="rgdeviceregistry", namespace_name="mynamespace", + certificate_authority_name="myrootca", ) print(response) -# x-ms-original-file: 2026-03-01-preview/Get_Credentials.json +# x-ms-original-file: 2026-11-01/Get_CertificateAuthority_Root.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_certificate_policy.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_certificate_policy.py new file mode 100644 index 000000000000..ea68c04d3df3 --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_certificate_policy.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-deviceregistry +# USAGE + python get_certificate_policy.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DeviceRegistryMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.certificate_policies.get( + resource_group_name="rgdeviceregistry", + namespace_name="mynamespace", + certificate_authority_name="myrootca", + certificate_policy_name="mycertificatepolicy", + ) + print(response) + + +# x-ms-original-file: 2026-11-01/Get_CertificatePolicy.json +if __name__ == "__main__": + main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace.py index dd68466513ff..c16350333412 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace.py @@ -32,11 +32,11 @@ def main(): response = client.namespaces.get( resource_group_name="myResourceGroup", - namespace_name="adr-namespace-gbk0925-n01", + namespace_name="mynamespace", ) print(response) -# x-ms-original-file: 2026-03-01-preview/Get_Namespace.json +# x-ms-original-file: 2026-11-01/Get_Namespace.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_asset.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_asset.py index 07cfbb650139..1e3699d19a1a 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_asset.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_asset.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Get_NamespaceAsset.json +# x-ms-original-file: 2026-11-01/Get_NamespaceAsset.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_device.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_device.py index 33594e6917f7..3bdceaece191 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_device.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_device.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Get_NamespaceDevice.json +# x-ms-original-file: 2026-11-01/Get_NamespaceDevice.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_device_with_endpoint_error_status.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_device_with_endpoint_error_status.py index bf72cc7988a3..ced0fcb429e5 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_device_with_endpoint_error_status.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_device_with_endpoint_error_status.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Get_NamespaceDeviceWithEndpointErrorStatus.json +# x-ms-original-file: 2026-11-01/Get_NamespaceDeviceWithEndpointErrorStatus.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_discovered_asset.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_discovered_asset.py index fc092c18763d..40db0254bce7 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_discovered_asset.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_discovered_asset.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Get_NamespaceDiscoveredAsset.json +# x-ms-original-file: 2026-11-01/Get_NamespaceDiscoveredAsset.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_discovered_device.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_discovered_device.py index 2ca9b0094161..febdbf520cfd 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_discovered_device.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_discovered_device.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Get_NamespaceDiscoveredDevice.json +# x-ms-original-file: 2026-11-01/Get_NamespaceDiscoveredDevice.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/credentials_synchronize.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_with_failed_linking_endpoint.py similarity index 81% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/credentials_synchronize.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_with_failed_linking_endpoint.py index 788fa05aba34..0d8ae7626d19 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/credentials_synchronize.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_namespace_with_failed_linking_endpoint.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python credentials_synchronize.py + python get_namespace_with_failed_linking_endpoint.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,12 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.credentials.begin_synchronize( - resource_group_name="rgdeviceregistry", - namespace_name="mynamespace", - ).result() + response = client.namespaces.get( + resource_group_name="myResourceGroup", + namespace_name="my-namespace", + ) + print(response) -# x-ms-original-file: 2026-03-01-preview/Credentials_Synchronize.json +# x-ms-original-file: 2026-11-01/Get_Namespace_With_FailedLinkingEndpoint.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_operation_status.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_operation_status.py index 272208d19f96..29697aa3df3c 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_operation_status.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_operation_status.py @@ -31,12 +31,12 @@ def main(): ) response = client.operation_status.get( - location="testLocation", - operation_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + location="eastus", + operation_id="00000000-0000-0000-0000-000000000001", ) print(response) -# x-ms-original-file: 2026-03-01-preview/Get_OperationStatus.json +# x-ms-original-file: 2026-11-01/Get_OperationStatus.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_registry_device.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_registry_device.py new file mode 100644 index 000000000000..492e82f1e629 --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_registry_device.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-deviceregistry +# USAGE + python get_registry_device.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DeviceRegistryMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.registry_devices.get( + resource_group_name="myResourceGroup", + namespace_name="my-namespace-1", + registry_device_name="adr-smart-device3-f191f536-f652-4eb4-b9a0-1a9d43300cab", + ) + print(response) + + +# x-ms-original-file: 2026-11-01/Get_RegistryDevice.json +if __name__ == "__main__": + main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_schema.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_schema.py index 34fe5d80c859..f6c756d90e79 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_schema.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_schema.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Get_Schema.json +# x-ms-original-file: 2026-11-01/Get_Schema.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_schema_registry.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_schema_registry.py index dfd311f8accd..fce7b0153a86 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_schema_registry.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_schema_registry.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Get_SchemaRegistry.json +# x-ms-original-file: 2026-11-01/Get_SchemaRegistry.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_schema_version.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_schema_version.py index 99e065fa81a2..7611bfd28b20 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_schema_version.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/get_schema_version.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Get_SchemaVersion.json +# x-ms-original-file: 2026-11-01/Get_SchemaVersion.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_asset_endpoint_profiles_by_resource_group.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_asset_endpoint_profiles_by_resource_group.py index 210caa2b27ab..1b9b6fe004c9 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_asset_endpoint_profiles_by_resource_group.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_asset_endpoint_profiles_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_AssetEndpointProfiles_ByResourceGroup.json +# x-ms-original-file: 2026-11-01/List_AssetEndpointProfiles_ByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_asset_endpoint_profiles_by_subscription.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_asset_endpoint_profiles_by_subscription.py index f8104600a311..e91876457a37 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_asset_endpoint_profiles_by_subscription.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_asset_endpoint_profiles_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_AssetEndpointProfiles_BySubscription.json +# x-ms-original-file: 2026-11-01/List_AssetEndpointProfiles_BySubscription.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_assets_by_resource_group.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_assets_by_resource_group.py index e55da2fac1f1..4140f0dca9d0 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_assets_by_resource_group.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_assets_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_Assets_ByResourceGroup.json +# x-ms-original-file: 2026-11-01/List_Assets_ByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_assets_by_subscription.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_assets_by_subscription.py index 1e547654b361..5d50a443e175 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_assets_by_subscription.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_assets_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_Assets_BySubscription.json +# x-ms-original-file: 2026-11-01/List_Assets_BySubscription.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_billing_containers_by_subscription.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_billing_containers_by_subscription.py index bdaee16abcb8..5a596f82e286 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_billing_containers_by_subscription.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_billing_containers_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_BillingContainers_BySubscription.json +# x-ms-original-file: 2026-11-01/List_BillingContainers_BySubscription.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_policies_by_resource_group.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_certificate_authorities_by_namespace.py similarity index 87% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_policies_by_resource_group.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_certificate_authorities_by_namespace.py index 0a31083341de..176a381b2a4a 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_policies_by_resource_group.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_certificate_authorities_by_namespace.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python list_policies_by_resource_group.py + python list_certificate_authorities_by_namespace.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,7 +30,7 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.policies.list_by_resource_group( + response = client.certificate_authorities.list_by_namespace( resource_group_name="rgdeviceregistry", namespace_name="mynamespace", ) @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_Policies_ByResourceGroup.json +# x-ms-original-file: 2026-11-01/List_CertificateAuthorities_ByNamespace.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_credentials_by_resource_group.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_certificate_policies_by_certificate_authority.py similarity index 83% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_credentials_by_resource_group.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_certificate_policies_by_certificate_authority.py index 63b856223cc8..1065525195d5 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_credentials_by_resource_group.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_certificate_policies_by_certificate_authority.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python list_credentials_by_resource_group.py + python list_certificate_policies_by_certificate_authority.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,15 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.credentials.list_by_resource_group( + response = client.certificate_policies.list_by_certificate_authority( resource_group_name="rgdeviceregistry", namespace_name="mynamespace", + certificate_authority_name="myrootca", ) for item in response: print(item) -# x-ms-original-file: 2026-03-01-preview/List_Credentials_ByResourceGroup.json +# x-ms-original-file: 2026-11-01/List_CertificatePolicies_ByCertificateAuthority.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_assets_by_resource_group.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_assets_by_namespace.py similarity index 87% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_assets_by_resource_group.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_assets_by_namespace.py index 66cca1bdb856..2cd7b4270c7a 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_assets_by_resource_group.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_assets_by_namespace.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python list_namespace_assets_by_resource_group.py + python list_namespace_assets_by_namespace.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,7 +30,7 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.namespace_assets.list_by_resource_group( + response = client.namespace_assets.list_by_namespace( resource_group_name="myResourceGroup", namespace_name="adr-namespace-gbk0925-n01", ) @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_NamespaceAssets_ByResourceGroup.json +# x-ms-original-file: 2026-11-01/List_NamespaceAssets_ByNamespace.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_by_resource_group.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_by_resource_group.py index 87b77d253429..f77add87f872 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_by_resource_group.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_Namespace_ByResourceGroup.json +# x-ms-original-file: 2026-11-01/List_Namespace_ByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_by_subscription.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_by_subscription.py index 0c98fbbec48b..e5c12316f064 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_by_subscription.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_Namespace_BySubscription.json +# x-ms-original-file: 2026-11-01/List_Namespace_BySubscription.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_devices_by_resource_group.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_devices_by_namespace.py similarity index 87% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_devices_by_resource_group.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_devices_by_namespace.py index af191bcd0bb4..ce96ab1f1a7f 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_devices_by_resource_group.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_devices_by_namespace.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python list_namespace_devices_by_resource_group.py + python list_namespace_devices_by_namespace.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,7 +30,7 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.namespace_devices.list_by_resource_group( + response = client.namespace_devices.list_by_namespace( resource_group_name="myResourceGroup", namespace_name="adr-namespace-gbk0925-n01", ) @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_NamespaceDevices_ByResourceGroup.json +# x-ms-original-file: 2026-11-01/List_NamespaceDevices_ByNamespace.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_discovered_assets_by_resource_group.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_discovered_assets_by_namespace.py similarity index 85% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_discovered_assets_by_resource_group.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_discovered_assets_by_namespace.py index 5a7eb115163c..380232d8a64a 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_discovered_assets_by_resource_group.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_discovered_assets_by_namespace.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python list_namespace_discovered_assets_by_resource_group.py + python list_namespace_discovered_assets_by_namespace.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,7 +30,7 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.namespace_discovered_assets.list_by_resource_group( + response = client.namespace_discovered_assets.list_by_namespace( resource_group_name="myResourceGroup", namespace_name="my-namespace-1", ) @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_NamespaceDiscoveredAssets_ByResourceGroup.json +# x-ms-original-file: 2026-11-01/List_NamespaceDiscoveredAssets_ByNamespace.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_discovered_devices_by_resource_group.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_discovered_devices_by_namespace.py similarity index 85% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_discovered_devices_by_resource_group.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_discovered_devices_by_namespace.py index ce2115965e7a..615eb0d2299f 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_discovered_devices_by_resource_group.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_namespace_discovered_devices_by_namespace.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python list_namespace_discovered_devices_by_resource_group.py + python list_namespace_discovered_devices_by_namespace.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,7 +30,7 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.namespace_discovered_devices.list_by_resource_group( + response = client.namespace_discovered_devices.list_by_namespace( resource_group_name="myResourceGroup", namespace_name="my-namespace-1", ) @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_NamespaceDiscoveredDevices_ByResourceGroup.json +# x-ms-original-file: 2026-11-01/List_NamespaceDiscoveredDevices_ByNamespace.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_operations.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_operations.py index c0352f2a5c0a..455266903623 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_operations.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_operations.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_Operations.json +# x-ms-original-file: 2026-11-01/List_Operations.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_registry_devices_by_namespace.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_registry_devices_by_namespace.py new file mode 100644 index 000000000000..6200f56a91d4 --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_registry_devices_by_namespace.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-deviceregistry +# USAGE + python list_registry_devices_by_namespace.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DeviceRegistryMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.registry_devices.list_by_namespace( + resource_group_name="myResourceGroup", + namespace_name="my-namespace-1", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-11-01/List_RegistryDevices_ByNamespace.json +if __name__ == "__main__": + main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schema_registries_by_resource_group.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schema_registries_by_resource_group.py index a7dd44f57565..6a7edc156161 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schema_registries_by_resource_group.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schema_registries_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_SchemaRegistries_ByResourceGroup.json +# x-ms-original-file: 2026-11-01/List_SchemaRegistries_ByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schema_registries_by_subscription.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schema_registries_by_subscription.py index ee8af7cc8d8f..27f6809f8bd7 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schema_registries_by_subscription.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schema_registries_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_SchemaRegistries_BySubscription.json +# x-ms-original-file: 2026-11-01/List_SchemaRegistries_BySubscription.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schema_versions_by_schema.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schema_versions_by_schema.py index fb17e3a5fc4c..ff71108f1b75 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schema_versions_by_schema.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schema_versions_by_schema.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_SchemaVersions_BySchema.json +# x-ms-original-file: 2026-11-01/List_SchemaVersions_BySchema.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schemas_by_schema_registry.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schemas_by_schema_registry.py index dd0aea7be7a4..b57d7f8c9ef6 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schemas_by_schema_registry.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/list_schemas_by_schema_registry.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2026-03-01-preview/List_Schemas_BySchemaRegistry.json +# x-ms-original-file: 2026-11-01/List_Schemas_BySchemaRegistry.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/migrate_assets_namespace.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/migrate_assets_namespace.py index 4f8eba566395..f307e00826b1 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/migrate_assets_namespace.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/migrate_assets_namespace.py @@ -45,6 +45,6 @@ def main(): ).result() -# x-ms-original-file: 2026-03-01-preview/Migrate_Assets_Namespace.json +# x-ms-original-file: 2026-11-01/Migrate_Assets_Namespace.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/namespace_devices_revoke_failure.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/namespace_devices_revoke_failure.py deleted file mode 100644 index b8f4cae1ee32..000000000000 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/namespace_devices_revoke_failure.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-deviceregistry -# USAGE - python namespace_devices_revoke_failure.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = DeviceRegistryMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.namespace_devices.begin_revoke( - resource_group_name="rgdeviceregistry", - namespace_name="mynamespace", - device_name="device1", - body={"disable": True}, - ).result() - - -# x-ms-original-file: 2026-03-01-preview/NamespaceDevices_RevokeFailure.json -if __name__ == "__main__": - main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/policies_activate_bring_your_own_root.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/policies_activate_bring_your_own_root.py deleted file mode 100644 index d535f437d8d0..000000000000 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/policies_activate_bring_your_own_root.py +++ /dev/null @@ -1,46 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) Python Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-deviceregistry -# USAGE - python policies_activate_bring_your_own_root.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = DeviceRegistryMgmtClient( - credential=DefaultAzureCredential(), - subscription_id="SUBSCRIPTION_ID", - ) - - client.policies.begin_activate_bring_your_own_root( - resource_group_name="rgdeviceregistry", - namespace_name="mynamespace", - policy_name="mypolicy", - body={ - "certificateChain": "-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJAKL0UG+mRkmWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMjQwMTAxMDAwMDAwWhcNMjUwMTAxMDAwMDAwWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAw...\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDXTCCAkWgAwIBAgIJAKL0UG+mRkmXMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMjQwMTAxMDAwMDAwWhcNMjUwMTAxMDAwMDAwWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAx...\n-----END CERTIFICATE-----" - }, - ).result() - - -# x-ms-original-file: 2026-03-01-preview/Policies_ActivateBringYourOwnRoot.json -if __name__ == "__main__": - main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/namespace_devices_revoke.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/revoke_and_rotate_certificate_authority.py similarity index 85% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/namespace_devices_revoke.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/revoke_and_rotate_certificate_authority.py index 837f7e1147da..c762f062aa99 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/namespace_devices_revoke.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/revoke_and_rotate_certificate_authority.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python namespace_devices_revoke.py + python revoke_and_rotate_certificate_authority.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,13 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - client.namespace_devices.begin_revoke( + client.certificate_authorities.begin_revoke_and_rotate( resource_group_name="rgdeviceregistry", namespace_name="mynamespace", - device_name="device1", - body={"disable": True}, + certificate_authority_name="myica", ).result() -# x-ms-original-file: 2026-03-01-preview/NamespaceDevices_Revoke.json +# x-ms-original-file: 2026-11-01/RevokeAndRotate_CertificateAuthority.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_asset.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_asset.py index 30e70323193d..7e24ae26f2b1 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_asset.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_asset.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Update_Asset.json +# x-ms-original-file: 2026-11-01/Update_Asset.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_asset_endpoint_profile.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_asset_endpoint_profile.py index 1985cd07e8b8..dfc1370c52e3 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_asset_endpoint_profile.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_asset_endpoint_profile.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Update_AssetEndpointProfile.json +# x-ms-original-file: 2026-11-01/Update_AssetEndpointProfile.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_credentials.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_certificate_authority.py similarity index 82% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_credentials.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_certificate_authority.py index a58df2e8983f..0f180f202fb6 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_credentials.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_certificate_authority.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python create_or_replace_credentials.py + python update_certificate_authority.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,14 +30,15 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.credentials.begin_create_or_update( + response = client.certificate_authorities.begin_update( resource_group_name="rgdeviceregistry", namespace_name="mynamespace", - resource={"location": "East US 2", "properties": {}, "tags": {"key7121": "mtdjqipusqaqhdvekrknyjeo"}}, + certificate_authority_name="myrootca", + properties={"tags": {"environment": "production"}}, ).result() print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_Credentials.json +# x-ms-original-file: 2026-11-01/Update_CertificateAuthority.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_certificate_policy.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_certificate_policy.py new file mode 100644 index 000000000000..1f077335242e --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_certificate_policy.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-deviceregistry +# USAGE + python update_certificate_policy.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DeviceRegistryMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.certificate_policies.begin_update( + resource_group_name="rgdeviceregistry", + namespace_name="mynamespace", + certificate_authority_name="myrootca", + certificate_policy_name="mycertificatepolicy", + properties={"properties": {"certificate": {"validityPeriodInDays": 60}}, "tags": {"environment": "production"}}, + ).result() + print(response) + + +# x-ms-original-file: 2026-11-01/Update_CertificatePolicy.json +if __name__ == "__main__": + main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_asset.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_asset.py index 6b707f184a1c..12c4c9afff75 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_asset.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_asset.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Update_NamespaceAsset.json +# x-ms-original-file: 2026-11-01/Update_NamespaceAsset.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_device.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_device.py index 97b066aa6178..9b6b851054ae 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_device.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_device.py @@ -41,9 +41,9 @@ def main(): "endpoints": { "outbound": { "assigned": { - "iothubEndpoint": { - "address": "https://iothub-for-dps.azure-devices.net", - "endpointType": "Microsoft.Devices/IotHubs", + "eventGridEndpoint": { + "address": "https://myeventgridtopic.westeurope-1.eventgrid.azure.net/api/events", + "endpointType": "Microsoft.Devices", } } } @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Update_NamespaceDevice.json +# x-ms-original-file: 2026-11-01/Update_NamespaceDevice.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_discovered_asset.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_discovered_asset.py index bbe5542c00eb..93bcefd3f3ed 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_discovered_asset.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_discovered_asset.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Update_NamespaceDiscoveredAsset.json +# x-ms-original-file: 2026-11-01/Update_NamespaceDiscoveredAsset.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_discovered_device.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_discovered_device.py index c080bf86a0bd..7cf8731a9590 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_discovered_device.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_discovered_device.py @@ -39,9 +39,9 @@ def main(): "endpoints": { "outbound": { "assigned": { - "newIothubEndpoint": { - "address": "https://iothub-for-dps.azure-devices.net", - "endpointType": "Microsoft.Devices/IotHubs", + "newEventGridEndpoint": { + "address": "https://myneweventgridtopic.westeurope-1.eventgrid.azure.net/api/events", + "endpointType": "Microsoft.Devices", } } } @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Update_NamespaceDiscoveredDevice.json +# x-ms-original-file: 2026-11-01/Update_NamespaceDiscoveredDevice.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_with_endpoints.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_management_endpoints.py similarity index 65% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_with_endpoints.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_management_endpoints.py index da32ef4abb83..c3c9e0cb3450 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/create_or_replace_namespace_with_endpoints.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_management_endpoints.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -15,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python create_or_replace_namespace_with_endpoints.py + python update_namespace_management_endpoints.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,30 +31,27 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.namespaces.begin_create_or_replace( + response = client.namespaces.begin_update( resource_group_name="myResourceGroup", namespace_name="adr-namespace-gbk0925-n01", - resource={ - "location": "North Europe", + properties={ "properties": { - "messaging": { + "management": { "endpoints": { - "anotherIothubEndpoint": { - "address": "https://iothub-for-dps-2.azure-devices.net", - "endpointType": "Microsoft.Devices/IotHubs", - }, - "iothubEndpoint": { - "address": "https://iothub-for-dps.azure-devices.net", - "endpointType": "Microsoft.Devices/IotHubs", - }, + "customLocation1": { + "address": "eg-for-adr.eastus2-1.ts.eventgrid.azure.net", + "endpointType": "Microsoft.EventGrid/Namespaces", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.EventGrid/Namespaces/eg-for-adr", + "scopeId": "scope-id-for-management-endpoint-1", + } } } - }, + } }, ).result() print(response) -# x-ms-original-file: 2026-03-01-preview/CreateOrReplace_Namespace_With_Endpoints.json +# x-ms-original-file: 2026-11-01/Update_Namespace_ManagementEndpoints.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_messaging_endpoints.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_messaging_endpoints.py new file mode 100644 index 000000000000..d12702ec506c --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_messaging_endpoints.py @@ -0,0 +1,63 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-deviceregistry +# USAGE + python update_namespace_messaging_endpoints.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DeviceRegistryMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.namespaces.begin_update( + resource_group_name="myResourceGroup", + namespace_name="mynamespace", + properties={ + "properties": { + "messaging": { + "endpoints": { + "myPrimaryIotHubEndpoint": { + "endpointType": "Microsoft.Devices/IotHubs", + "inboundCallerIdentity": {"type": "SystemAssigned"}, + "provisioning": {"allocationWeight": 1, "availability": "Available"}, + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/myIotHub1", + }, + "mySecondaryIotHubEndpoint": { + "endpointType": "Microsoft.Devices/IotHubs", + "inboundCallerIdentity": {"type": "SystemAssigned"}, + "provisioning": {"allocationWeight": 1, "availability": "Available"}, + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/myIotHub2", + }, + } + } + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-11-01/Update_Namespace_MessagingEndpoints.json +if __name__ == "__main__": + main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_provisioning_endpoints.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_provisioning_endpoints.py new file mode 100644 index 000000000000..6fa7830684f9 --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_provisioning_endpoints.py @@ -0,0 +1,56 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-deviceregistry +# USAGE + python update_namespace_provisioning_endpoints.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = DeviceRegistryMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.namespaces.begin_update( + resource_group_name="myResourceGroup", + namespace_name="mynamespace", + properties={ + "properties": { + "provisioning": { + "endpoints": { + "myDpsEndpoint": { + "endpointType": "Microsoft.Devices/provisioningServices", + "inboundCallerIdentity": {"type": "SystemAssigned"}, + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Devices/provisioningServices/myDps", + } + } + } + } + }, + ).result() + print(response) + + +# x-ms-original-file: 2026-11-01/Update_Namespace_ProvisioningEndpoints.json +if __name__ == "__main__": + main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_endpoints.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_registry_device.py similarity index 71% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_endpoints.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_registry_device.py index 7c3348dc47a9..934874b0a201 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_namespace_endpoints.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_registry_device.py @@ -15,7 +15,7 @@ pip install azure-identity pip install azure-mgmt-deviceregistry # USAGE - python update_namespace_endpoints.py + python update_registry_device.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -30,25 +30,23 @@ def main(): subscription_id="SUBSCRIPTION_ID", ) - response = client.namespaces.begin_update( + response = client.registry_devices.begin_update( resource_group_name="myResourceGroup", - namespace_name="adr-namespace-gbk0925-n01", + namespace_name="my-namespace-1", + registry_device_name="adr-smart-device3-f191f536-f652-4eb4-b9a0-1a9d43300cab", properties={ "properties": { - "messaging": { - "endpoints": { - "iothubEndpoint": { - "address": "https://iothub-for-dps.azure-devices.net", - "endpointType": "Microsoft.Devices/IotHubs", - } - } - } + "enablementState": "Enabled", + "hardwareRevision": "1.0", + "manufacturer": "Contoso", + "model": "SmartSensorV2", + "softwareRevision": "6.1", } }, ).result() print(response) -# x-ms-original-file: 2026-03-01-preview/Update_Namespace_Endpoints.json +# x-ms-original-file: 2026-11-01/Update_RegistryDevice.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_schema_registry.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_schema_registry.py index ca31c7549e11..d13e6ea54189 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_schema_registry.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_samples/update_schema_registry.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: 2026-03-01-preview/Update_SchemaRegistry.json +# x-ms-original-file: 2026-11-01/Update_SchemaRegistry.json if __name__ == "__main__": main() diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_async_operation_status_operations.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_async_operation_status_operations.py new file mode 100644 index 000000000000..967f61a3f1a0 --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_async_operation_status_operations.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDeviceRegistryMgmtAsyncOperationStatusOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DeviceRegistryMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_async_operation_status_get(self, resource_group): + response = self.client.async_operation_status.get( + location="str", + operation_id="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_async_operation_status_operations_async.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_async_operation_status_operations_async.py new file mode 100644 index 000000000000..e5e983ce7ee2 --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_async_operation_status_operations_async.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.deviceregistry.aio import DeviceRegistryMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDeviceRegistryMgmtAsyncOperationStatusOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DeviceRegistryMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_async_operation_status_get(self, resource_group): + response = await self.client.async_operation_status.get( + location="str", + operation_id="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_policies_operations.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_certificate_authorities_operations.py similarity index 55% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_policies_operations.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_certificate_authorities_operations.py index 24d9e1ea05c6..56fb1871fc79 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_policies_operations.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_certificate_authorities_operations.py @@ -14,17 +14,17 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestDeviceRegistryMgmtPoliciesOperations(AzureMgmtRecordedTestCase): +class TestDeviceRegistryMgmtCertificateAuthoritiesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(DeviceRegistryMgmtClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_policies_get(self, resource_group): - response = self.client.policies.get( + def test_certificate_authorities_get(self, resource_group): + response = self.client.certificate_authorities.get( resource_group_name=resource_group.name, namespace_name="str", - policy_name="str", + certificate_authority_name="str", ) # please add some check logic here by yourself @@ -32,32 +32,16 @@ def test_policies_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_policies_begin_create_or_update(self, resource_group): - response = self.client.policies.begin_create_or_update( + def test_certificate_authorities_begin_create_or_replace(self, resource_group): + response = self.client.certificate_authorities.begin_create_or_replace( resource_group_name=resource_group.name, namespace_name="str", - policy_name="str", + certificate_authority_name="str", resource={ + "location": "str", "id": "str", "name": "str", - "properties": { - "certificate": { - "certificateAuthorityConfiguration": { - "keyType": "str", - "bringYourOwnRoot": { - "enabled": bool, - "certificateSigningRequest": "str", - "issuingCertificateThumbprint": "str", - "status": "str", - }, - "subject": "str", - "validityNotAfter": "2020-02-20 00:00:00", - "validityNotBefore": "2020-02-20 00:00:00", - }, - "leafCertificateConfiguration": {"validityPeriodInDays": 0}, - }, - "provisioningState": "str", - }, + "properties": "certificate_authority_properties", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -66,6 +50,7 @@ def test_policies_begin_create_or_update(self, resource_group): "lastModifiedBy": "str", "lastModifiedByType": "str", }, + "tags": {"str": "str"}, "type": "str", }, ).result() # call '.result()' to poll until service return final result @@ -75,11 +60,11 @@ def test_policies_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_policies_begin_delete(self, resource_group): - response = self.client.policies.begin_delete( + def test_certificate_authorities_begin_delete(self, resource_group): + response = self.client.certificate_authorities.begin_delete( resource_group_name=resource_group.name, namespace_name="str", - policy_name="str", + certificate_authority_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -87,30 +72,12 @@ def test_policies_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_policies_begin_update(self, resource_group): - response = self.client.policies.begin_update( + def test_certificate_authorities_begin_update(self, resource_group): + response = self.client.certificate_authorities.begin_update( resource_group_name=resource_group.name, namespace_name="str", - policy_name="str", - properties={ - "properties": { - "certificate": { - "certificateAuthorityConfiguration": { - "keyType": "str", - "bringYourOwnRoot": { - "enabled": bool, - "certificateSigningRequest": "str", - "issuingCertificateThumbprint": "str", - "status": "str", - }, - "subject": "str", - "validityNotAfter": "2020-02-20 00:00:00", - "validityNotBefore": "2020-02-20 00:00:00", - }, - "leafCertificateConfiguration": {"validityPeriodInDays": 0}, - } - } - }, + certificate_authority_name="str", + properties={"tags": {"str": "str"}}, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -118,8 +85,8 @@ def test_policies_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_policies_list_by_resource_group(self, resource_group): - response = self.client.policies.list_by_resource_group( + def test_certificate_authorities_list_by_namespace(self, resource_group): + response = self.client.certificate_authorities.list_by_namespace( resource_group_name=resource_group.name, namespace_name="str", ) @@ -129,11 +96,12 @@ def test_policies_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_policies_begin_revoke_issuer(self, resource_group): - response = self.client.policies.begin_revoke_issuer( + def test_certificate_authorities_begin_activate(self, resource_group): + response = self.client.certificate_authorities.begin_activate( resource_group_name=resource_group.name, namespace_name="str", - policy_name="str", + certificate_authority_name="str", + body={"certificateChain": "str"}, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -141,12 +109,11 @@ def test_policies_begin_revoke_issuer(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_policies_begin_activate_bring_your_own_root(self, resource_group): - response = self.client.policies.begin_activate_bring_your_own_root( + def test_certificate_authorities_begin_revoke_and_rotate(self, resource_group): + response = self.client.certificate_authorities.begin_revoke_and_rotate( resource_group_name=resource_group.name, namespace_name="str", - policy_name="str", - body={"certificateChain": "str"}, + certificate_authority_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_policies_operations_async.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_certificate_authorities_operations_async.py similarity index 56% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_policies_operations_async.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_certificate_authorities_operations_async.py index dabafc711935..19aab333c0e0 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_policies_operations_async.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_certificate_authorities_operations_async.py @@ -15,17 +15,17 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestDeviceRegistryMgmtPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestDeviceRegistryMgmtCertificateAuthoritiesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(DeviceRegistryMgmtClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_policies_get(self, resource_group): - response = await self.client.policies.get( + async def test_certificate_authorities_get(self, resource_group): + response = await self.client.certificate_authorities.get( resource_group_name=resource_group.name, namespace_name="str", - policy_name="str", + certificate_authority_name="str", ) # please add some check logic here by yourself @@ -33,33 +33,17 @@ async def test_policies_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_policies_begin_create_or_update(self, resource_group): + async def test_certificate_authorities_begin_create_or_replace(self, resource_group): response = await ( - await self.client.policies.begin_create_or_update( + await self.client.certificate_authorities.begin_create_or_replace( resource_group_name=resource_group.name, namespace_name="str", - policy_name="str", + certificate_authority_name="str", resource={ + "location": "str", "id": "str", "name": "str", - "properties": { - "certificate": { - "certificateAuthorityConfiguration": { - "keyType": "str", - "bringYourOwnRoot": { - "enabled": bool, - "certificateSigningRequest": "str", - "issuingCertificateThumbprint": "str", - "status": "str", - }, - "subject": "str", - "validityNotAfter": "2020-02-20 00:00:00", - "validityNotBefore": "2020-02-20 00:00:00", - }, - "leafCertificateConfiguration": {"validityPeriodInDays": 0}, - }, - "provisioningState": "str", - }, + "properties": "certificate_authority_properties", "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -68,6 +52,7 @@ async def test_policies_begin_create_or_update(self, resource_group): "lastModifiedBy": "str", "lastModifiedByType": "str", }, + "tags": {"str": "str"}, "type": "str", }, ) @@ -78,12 +63,12 @@ async def test_policies_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_policies_begin_delete(self, resource_group): + async def test_certificate_authorities_begin_delete(self, resource_group): response = await ( - await self.client.policies.begin_delete( + await self.client.certificate_authorities.begin_delete( resource_group_name=resource_group.name, namespace_name="str", - policy_name="str", + certificate_authority_name="str", ) ).result() # call '.result()' to poll until service return final result @@ -92,31 +77,13 @@ async def test_policies_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_policies_begin_update(self, resource_group): + async def test_certificate_authorities_begin_update(self, resource_group): response = await ( - await self.client.policies.begin_update( + await self.client.certificate_authorities.begin_update( resource_group_name=resource_group.name, namespace_name="str", - policy_name="str", - properties={ - "properties": { - "certificate": { - "certificateAuthorityConfiguration": { - "keyType": "str", - "bringYourOwnRoot": { - "enabled": bool, - "certificateSigningRequest": "str", - "issuingCertificateThumbprint": "str", - "status": "str", - }, - "subject": "str", - "validityNotAfter": "2020-02-20 00:00:00", - "validityNotBefore": "2020-02-20 00:00:00", - }, - "leafCertificateConfiguration": {"validityPeriodInDays": 0}, - } - } - }, + certificate_authority_name="str", + properties={"tags": {"str": "str"}}, ) ).result() # call '.result()' to poll until service return final result @@ -125,8 +92,8 @@ async def test_policies_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_policies_list_by_resource_group(self, resource_group): - response = self.client.policies.list_by_resource_group( + async def test_certificate_authorities_list_by_namespace(self, resource_group): + response = self.client.certificate_authorities.list_by_namespace( resource_group_name=resource_group.name, namespace_name="str", ) @@ -136,12 +103,13 @@ async def test_policies_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_policies_begin_revoke_issuer(self, resource_group): + async def test_certificate_authorities_begin_activate(self, resource_group): response = await ( - await self.client.policies.begin_revoke_issuer( + await self.client.certificate_authorities.begin_activate( resource_group_name=resource_group.name, namespace_name="str", - policy_name="str", + certificate_authority_name="str", + body={"certificateChain": "str"}, ) ).result() # call '.result()' to poll until service return final result @@ -150,13 +118,12 @@ async def test_policies_begin_revoke_issuer(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_policies_begin_activate_bring_your_own_root(self, resource_group): + async def test_certificate_authorities_begin_revoke_and_rotate(self, resource_group): response = await ( - await self.client.policies.begin_activate_bring_your_own_root( + await self.client.certificate_authorities.begin_revoke_and_rotate( resource_group_name=resource_group.name, namespace_name="str", - policy_name="str", - body={"certificateChain": "str"}, + certificate_authority_name="str", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_credentials_operations.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_certificate_policies_operations.py similarity index 67% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_credentials_operations.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_certificate_policies_operations.py index 39f19433a37c..9611df3cfea5 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_credentials_operations.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_certificate_policies_operations.py @@ -14,16 +14,18 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestDeviceRegistryMgmtCredentialsOperations(AzureMgmtRecordedTestCase): +class TestDeviceRegistryMgmtCertificatePoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(DeviceRegistryMgmtClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_credentials_get(self, resource_group): - response = self.client.credentials.get( + def test_certificate_policies_get(self, resource_group): + response = self.client.certificate_policies.get( resource_group_name=resource_group.name, namespace_name="str", + certificate_authority_name="str", + certificate_policy_name="str", ) # please add some check logic here by yourself @@ -31,15 +33,17 @@ def test_credentials_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_credentials_begin_create_or_update(self, resource_group): - response = self.client.credentials.begin_create_or_update( + def test_certificate_policies_begin_create_or_replace(self, resource_group): + response = self.client.certificate_policies.begin_create_or_replace( resource_group_name=resource_group.name, namespace_name="str", + certificate_authority_name="str", + certificate_policy_name="str", resource={ "location": "str", "id": "str", "name": "str", - "properties": {"provisioningState": "str"}, + "properties": {"certificate": {"validityPeriodInDays": 0}, "provisioningState": "str", "uuid": "str"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -58,10 +62,12 @@ def test_credentials_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_credentials_begin_delete(self, resource_group): - response = self.client.credentials.begin_delete( + def test_certificate_policies_begin_delete(self, resource_group): + response = self.client.certificate_policies.begin_delete( resource_group_name=resource_group.name, namespace_name="str", + certificate_authority_name="str", + certificate_policy_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -69,11 +75,13 @@ def test_credentials_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_credentials_begin_update(self, resource_group): - response = self.client.credentials.begin_update( + def test_certificate_policies_begin_update(self, resource_group): + response = self.client.certificate_policies.begin_update( resource_group_name=resource_group.name, namespace_name="str", - properties={"tags": {"str": "str"}}, + certificate_authority_name="str", + certificate_policy_name="str", + properties={"properties": {"certificate": {"validityPeriodInDays": 0}}, "tags": {"str": "str"}}, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -81,22 +89,12 @@ def test_credentials_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_credentials_list_by_resource_group(self, resource_group): - response = self.client.credentials.list_by_resource_group( + def test_certificate_policies_list_by_certificate_authority(self, resource_group): + response = self.client.certificate_policies.list_by_certificate_authority( resource_group_name=resource_group.name, namespace_name="str", + certificate_authority_name="str", ) result = [r for r in response] # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_credentials_begin_synchronize(self, resource_group): - response = self.client.credentials.begin_synchronize( - resource_group_name=resource_group.name, - namespace_name="str", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_credentials_operations_async.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_certificate_policies_operations_async.py similarity index 67% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_credentials_operations_async.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_certificate_policies_operations_async.py index 999a9782f5c0..6b9265f28950 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_credentials_operations_async.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_certificate_policies_operations_async.py @@ -15,16 +15,18 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestDeviceRegistryMgmtCredentialsOperationsAsync(AzureMgmtRecordedTestCase): +class TestDeviceRegistryMgmtCertificatePoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(DeviceRegistryMgmtClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_credentials_get(self, resource_group): - response = await self.client.credentials.get( + async def test_certificate_policies_get(self, resource_group): + response = await self.client.certificate_policies.get( resource_group_name=resource_group.name, namespace_name="str", + certificate_authority_name="str", + certificate_policy_name="str", ) # please add some check logic here by yourself @@ -32,16 +34,22 @@ async def test_credentials_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_credentials_begin_create_or_update(self, resource_group): + async def test_certificate_policies_begin_create_or_replace(self, resource_group): response = await ( - await self.client.credentials.begin_create_or_update( + await self.client.certificate_policies.begin_create_or_replace( resource_group_name=resource_group.name, namespace_name="str", + certificate_authority_name="str", + certificate_policy_name="str", resource={ "location": "str", "id": "str", "name": "str", - "properties": {"provisioningState": "str"}, + "properties": { + "certificate": {"validityPeriodInDays": 0}, + "provisioningState": "str", + "uuid": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -61,11 +69,13 @@ async def test_credentials_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_credentials_begin_delete(self, resource_group): + async def test_certificate_policies_begin_delete(self, resource_group): response = await ( - await self.client.credentials.begin_delete( + await self.client.certificate_policies.begin_delete( resource_group_name=resource_group.name, namespace_name="str", + certificate_authority_name="str", + certificate_policy_name="str", ) ).result() # call '.result()' to poll until service return final result @@ -74,12 +84,14 @@ async def test_credentials_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_credentials_begin_update(self, resource_group): + async def test_certificate_policies_begin_update(self, resource_group): response = await ( - await self.client.credentials.begin_update( + await self.client.certificate_policies.begin_update( resource_group_name=resource_group.name, namespace_name="str", - properties={"tags": {"str": "str"}}, + certificate_authority_name="str", + certificate_policy_name="str", + properties={"properties": {"certificate": {"validityPeriodInDays": 0}}, "tags": {"str": "str"}}, ) ).result() # call '.result()' to poll until service return final result @@ -88,24 +100,12 @@ async def test_credentials_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_credentials_list_by_resource_group(self, resource_group): - response = self.client.credentials.list_by_resource_group( + async def test_certificate_policies_list_by_certificate_authority(self, resource_group): + response = self.client.certificate_policies.list_by_certificate_authority( resource_group_name=resource_group.name, namespace_name="str", + certificate_authority_name="str", ) result = [r async for r in response] # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_credentials_begin_synchronize(self, resource_group): - response = await ( - await self.client.credentials.begin_synchronize( - resource_group_name=resource_group.name, - namespace_name="str", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_assets_operations.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_assets_operations.py index 95b46c0707e3..89b09d3a1bea 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_assets_operations.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_assets_operations.py @@ -168,6 +168,13 @@ def test_namespace_assets_begin_create_or_replace(self, resource_group): ], } ], + "healthState": { + "lastTransitionTime": "str", + "lastUpdateTime": "str", + "message": "str", + "reasonCode": "str", + "status": "str", + }, "managementGroups": [ { "name": "str", @@ -350,11 +357,24 @@ def test_namespace_assets_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_namespace_assets_list_by_resource_group(self, resource_group): - response = self.client.namespace_assets.list_by_resource_group( + def test_namespace_assets_list_by_namespace(self, resource_group): + response = self.client.namespace_assets.list_by_namespace( resource_group_name=resource_group.name, namespace_name="str", ) result = [r for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_namespace_assets_begin_execute_action(self, resource_group): + response = self.client.namespace_assets.begin_execute_action( + resource_group_name=resource_group.name, + namespace_name="str", + asset_name="str", + body={"managementActionName": "str", "managementGroupName": "str", "payload": {"str": {}}}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_assets_operations_async.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_assets_operations_async.py index e1cfe77534a9..e53720029d11 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_assets_operations_async.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_assets_operations_async.py @@ -182,6 +182,13 @@ async def test_namespace_assets_begin_create_or_replace(self, resource_group): ], } ], + "healthState": { + "lastTransitionTime": "str", + "lastUpdateTime": "str", + "message": "str", + "reasonCode": "str", + "status": "str", + }, "managementGroups": [ { "name": "str", @@ -379,11 +386,26 @@ async def test_namespace_assets_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_namespace_assets_list_by_resource_group(self, resource_group): - response = self.client.namespace_assets.list_by_resource_group( + async def test_namespace_assets_list_by_namespace(self, resource_group): + response = self.client.namespace_assets.list_by_namespace( resource_group_name=resource_group.name, namespace_name="str", ) result = [r async for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_namespace_assets_begin_execute_action(self, resource_group): + response = await ( + await self.client.namespace_assets.begin_execute_action( + resource_group_name=resource_group.name, + namespace_name="str", + asset_name="str", + body={"managementActionName": "str", "managementGroupName": "str", "payload": {"str": {}}}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_devices_operations.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_devices_operations.py index 38579538ea50..59b6d51032f9 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_devices_operations.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_devices_operations.py @@ -80,7 +80,6 @@ def test_namespace_devices_begin_create_or_replace(self, resource_group): "model": "str", "operatingSystem": "str", "operatingSystemVersion": "str", - "policy": {"resourceId": "str"}, "provisioningState": "str", "status": { "config": { @@ -101,7 +100,14 @@ def test_namespace_devices_begin_create_or_replace(self, resource_group): {"code": "str", "correlationId": "str", "info": "str", "message": "str"} ], "message": "str", - } + }, + "healthState": { + "lastTransitionTime": "str", + "lastUpdateTime": "str", + "message": "str", + "reasonCode": "str", + "status": "str", + }, } } }, @@ -164,7 +170,6 @@ def test_namespace_devices_begin_update(self, resource_group): }, }, "operatingSystemVersion": "str", - "policy": {"resourceId": "str"}, }, "tags": {"str": "str"}, }, @@ -187,24 +192,11 @@ def test_namespace_devices_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_namespace_devices_list_by_resource_group(self, resource_group): - response = self.client.namespace_devices.list_by_resource_group( + def test_namespace_devices_list_by_namespace(self, resource_group): + response = self.client.namespace_devices.list_by_namespace( resource_group_name=resource_group.name, namespace_name="str", ) result = [r for r in response] # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_namespace_devices_begin_revoke(self, resource_group): - response = self.client.namespace_devices.begin_revoke( - resource_group_name=resource_group.name, - namespace_name="str", - device_name="str", - body={"disable": bool}, - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_devices_operations_async.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_devices_operations_async.py index c9087e7bec04..854269e936ab 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_devices_operations_async.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_devices_operations_async.py @@ -82,7 +82,6 @@ async def test_namespace_devices_begin_create_or_replace(self, resource_group): "model": "str", "operatingSystem": "str", "operatingSystemVersion": "str", - "policy": {"resourceId": "str"}, "provisioningState": "str", "status": { "config": { @@ -105,7 +104,14 @@ async def test_namespace_devices_begin_create_or_replace(self, resource_group): {"code": "str", "correlationId": "str", "info": "str", "message": "str"} ], "message": "str", - } + }, + "healthState": { + "lastTransitionTime": "str", + "lastUpdateTime": "str", + "message": "str", + "reasonCode": "str", + "status": "str", + }, } } }, @@ -170,7 +176,6 @@ async def test_namespace_devices_begin_update(self, resource_group): }, }, "operatingSystemVersion": "str", - "policy": {"resourceId": "str"}, }, "tags": {"str": "str"}, }, @@ -196,26 +201,11 @@ async def test_namespace_devices_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_namespace_devices_list_by_resource_group(self, resource_group): - response = self.client.namespace_devices.list_by_resource_group( + async def test_namespace_devices_list_by_namespace(self, resource_group): + response = self.client.namespace_devices.list_by_namespace( resource_group_name=resource_group.name, namespace_name="str", ) result = [r async for r in response] # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_namespace_devices_begin_revoke(self, resource_group): - response = await ( - await self.client.namespace_devices.begin_revoke( - resource_group_name=resource_group.name, - namespace_name="str", - device_name="str", - body={"disable": bool}, - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_assets_operations.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_assets_operations.py index a6d84a35a658..31fd23b8b53f 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_assets_operations.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_assets_operations.py @@ -277,8 +277,8 @@ def test_namespace_discovered_assets_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_namespace_discovered_assets_list_by_resource_group(self, resource_group): - response = self.client.namespace_discovered_assets.list_by_resource_group( + def test_namespace_discovered_assets_list_by_namespace(self, resource_group): + response = self.client.namespace_discovered_assets.list_by_namespace( resource_group_name=resource_group.name, namespace_name="str", ) diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_assets_operations_async.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_assets_operations_async.py index 68b4e956c6e1..a33bbed73db6 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_assets_operations_async.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_assets_operations_async.py @@ -284,8 +284,8 @@ async def test_namespace_discovered_assets_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_namespace_discovered_assets_list_by_resource_group(self, resource_group): - response = self.client.namespace_discovered_assets.list_by_resource_group( + async def test_namespace_discovered_assets_list_by_namespace(self, resource_group): + response = self.client.namespace_discovered_assets.list_by_namespace( resource_group_name=resource_group.name, namespace_name="str", ) diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_devices_operations.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_devices_operations.py index eb89a2b9467a..9853906dc9e0 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_devices_operations.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_devices_operations.py @@ -131,8 +131,8 @@ def test_namespace_discovered_devices_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_namespace_discovered_devices_list_by_resource_group(self, resource_group): - response = self.client.namespace_discovered_devices.list_by_resource_group( + def test_namespace_discovered_devices_list_by_namespace(self, resource_group): + response = self.client.namespace_discovered_devices.list_by_namespace( resource_group_name=resource_group.name, namespace_name="str", ) diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_devices_operations_async.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_devices_operations_async.py index f66c727b5ebb..1221af014354 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_devices_operations_async.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespace_discovered_devices_operations_async.py @@ -138,8 +138,8 @@ async def test_namespace_discovered_devices_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_namespace_discovered_devices_list_by_resource_group(self, resource_group): - response = self.client.namespace_discovered_devices.list_by_resource_group( + async def test_namespace_discovered_devices_list_by_namespace(self, resource_group): + response = self.client.namespace_discovered_devices.list_by_namespace( resource_group_name=resource_group.name, namespace_name="str", ) diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespaces_operations.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespaces_operations.py index a979d537779b..863c6f6d069b 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespaces_operations.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespaces_operations.py @@ -38,10 +38,45 @@ def test_namespaces_begin_create_or_replace(self, resource_group): resource={ "location": "str", "id": "str", - "identity": {"type": "str", "principalId": "str", "tenantId": "str"}, + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", "properties": { - "messaging": {"endpoints": {"str": {"address": "str", "endpointType": "str", "resourceId": "str"}}}, + "management": { + "endpoints": { + "str": {"address": "str", "endpointType": "str", "resourceId": "str", "scopeId": "str"} + } + }, + "messaging": { + "endpoints": { + "str": { + "address": "str", + "deviceAddress": "str", + "endpointType": "str", + "inboundCallerIdentity": {"type": "str", "userAssignedIdentity": "str"}, + "linkingError": {"code": "str", "message": "str"}, + "linkingState": "str", + "provisioning": {"allocationWeight": 0, "availability": "str"}, + "resourceId": "str", + } + } + }, + "outboundIdentity": {"type": "str", "userAssignedIdentity": "str"}, + "provisioning": { + "endpoints": { + "str": { + "endpointType": "str", + "inboundCallerIdentity": {"type": "str", "userAssignedIdentity": "str"}, + "resourceId": "str", + "linkingError": {"code": "str", "message": "str"}, + "linkingState": "str", + } + } + }, "provisioningState": "str", "uuid": "str", }, @@ -68,9 +103,44 @@ def test_namespaces_begin_update(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", properties={ - "identity": {"type": "str", "principalId": "str", "tenantId": "str"}, + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "properties": { - "messaging": {"endpoints": {"str": {"address": "str", "endpointType": "str", "resourceId": "str"}}} + "management": { + "endpoints": { + "str": {"address": "str", "endpointType": "str", "resourceId": "str", "scopeId": "str"} + } + }, + "messaging": { + "endpoints": { + "str": { + "address": "str", + "deviceAddress": "str", + "endpointType": "str", + "inboundCallerIdentity": {"type": "str", "userAssignedIdentity": "str"}, + "linkingError": {"code": "str", "message": "str"}, + "linkingState": "str", + "provisioning": {"allocationWeight": 0, "availability": "str"}, + "resourceId": "str", + } + } + }, + "outboundIdentity": {"type": "str", "userAssignedIdentity": "str"}, + "provisioning": { + "endpoints": { + "str": { + "endpointType": "str", + "inboundCallerIdentity": {"type": "str", "userAssignedIdentity": "str"}, + "resourceId": "str", + "linkingError": {"code": "str", "message": "str"}, + "linkingState": "str", + } + } + }, }, "tags": {"str": "str"}, }, diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespaces_operations_async.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespaces_operations_async.py index a5ac52a4e5a0..3ffd588a2ce8 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespaces_operations_async.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_namespaces_operations_async.py @@ -40,11 +40,44 @@ async def test_namespaces_begin_create_or_replace(self, resource_group): resource={ "location": "str", "id": "str", - "identity": {"type": "str", "principalId": "str", "tenantId": "str"}, + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", "properties": { + "management": { + "endpoints": { + "str": {"address": "str", "endpointType": "str", "resourceId": "str", "scopeId": "str"} + } + }, "messaging": { - "endpoints": {"str": {"address": "str", "endpointType": "str", "resourceId": "str"}} + "endpoints": { + "str": { + "address": "str", + "deviceAddress": "str", + "endpointType": "str", + "inboundCallerIdentity": {"type": "str", "userAssignedIdentity": "str"}, + "linkingError": {"code": "str", "message": "str"}, + "linkingState": "str", + "provisioning": {"allocationWeight": 0, "availability": "str"}, + "resourceId": "str", + } + } + }, + "outboundIdentity": {"type": "str", "userAssignedIdentity": "str"}, + "provisioning": { + "endpoints": { + "str": { + "endpointType": "str", + "inboundCallerIdentity": {"type": "str", "userAssignedIdentity": "str"}, + "resourceId": "str", + "linkingError": {"code": "str", "message": "str"}, + "linkingState": "str", + } + } }, "provisioningState": "str", "uuid": "str", @@ -74,11 +107,44 @@ async def test_namespaces_begin_update(self, resource_group): resource_group_name=resource_group.name, namespace_name="str", properties={ - "identity": {"type": "str", "principalId": "str", "tenantId": "str"}, + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "properties": { + "management": { + "endpoints": { + "str": {"address": "str", "endpointType": "str", "resourceId": "str", "scopeId": "str"} + } + }, "messaging": { - "endpoints": {"str": {"address": "str", "endpointType": "str", "resourceId": "str"}} - } + "endpoints": { + "str": { + "address": "str", + "deviceAddress": "str", + "endpointType": "str", + "inboundCallerIdentity": {"type": "str", "userAssignedIdentity": "str"}, + "linkingError": {"code": "str", "message": "str"}, + "linkingState": "str", + "provisioning": {"allocationWeight": 0, "availability": "str"}, + "resourceId": "str", + } + } + }, + "outboundIdentity": {"type": "str", "userAssignedIdentity": "str"}, + "provisioning": { + "endpoints": { + "str": { + "endpointType": "str", + "inboundCallerIdentity": {"type": "str", "userAssignedIdentity": "str"}, + "resourceId": "str", + "linkingError": {"code": "str", "message": "str"}, + "linkingState": "str", + } + } + }, }, "tags": {"str": "str"}, }, diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_registry_devices_operations.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_registry_devices_operations.py new file mode 100644 index 000000000000..b3d7f2920638 --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_registry_devices_operations.py @@ -0,0 +1,114 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDeviceRegistryMgmtRegistryDevicesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DeviceRegistryMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_registry_devices_get(self, resource_group): + response = self.client.registry_devices.get( + resource_group_name=resource_group.name, + namespace_name="str", + registry_device_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_registry_devices_begin_create_or_replace(self, resource_group): + response = self.client.registry_devices.begin_create_or_replace( + resource_group_name=resource_group.name, + namespace_name="str", + registry_device_name="str", + resource={ + "location": "str", + "etag": "str", + "id": "str", + "name": "str", + "properties": { + "enablementState": "str", + "externalDeviceId": "str", + "hardwareRevision": "str", + "manufacturer": "str", + "model": "str", + "provisioningState": "str", + "softwareRevision": "str", + "uuid": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_registry_devices_begin_update(self, resource_group): + response = self.client.registry_devices.begin_update( + resource_group_name=resource_group.name, + namespace_name="str", + registry_device_name="str", + properties={ + "properties": { + "enablementState": "str", + "hardwareRevision": "str", + "manufacturer": "str", + "model": "str", + "softwareRevision": "str", + }, + "tags": {"str": "str"}, + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_registry_devices_begin_delete(self, resource_group): + response = self.client.registry_devices.begin_delete( + resource_group_name=resource_group.name, + namespace_name="str", + registry_device_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_registry_devices_list_by_namespace(self, resource_group): + response = self.client.registry_devices.list_by_namespace( + resource_group_name=resource_group.name, + namespace_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_registry_devices_operations_async.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_registry_devices_operations_async.py new file mode 100644 index 000000000000..44bcced0f159 --- /dev/null +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_registry_devices_operations_async.py @@ -0,0 +1,121 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.deviceregistry.aio import DeviceRegistryMgmtClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestDeviceRegistryMgmtRegistryDevicesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(DeviceRegistryMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_registry_devices_get(self, resource_group): + response = await self.client.registry_devices.get( + resource_group_name=resource_group.name, + namespace_name="str", + registry_device_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_registry_devices_begin_create_or_replace(self, resource_group): + response = await ( + await self.client.registry_devices.begin_create_or_replace( + resource_group_name=resource_group.name, + namespace_name="str", + registry_device_name="str", + resource={ + "location": "str", + "etag": "str", + "id": "str", + "name": "str", + "properties": { + "enablementState": "str", + "externalDeviceId": "str", + "hardwareRevision": "str", + "manufacturer": "str", + "model": "str", + "provisioningState": "str", + "softwareRevision": "str", + "uuid": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_registry_devices_begin_update(self, resource_group): + response = await ( + await self.client.registry_devices.begin_update( + resource_group_name=resource_group.name, + namespace_name="str", + registry_device_name="str", + properties={ + "properties": { + "enablementState": "str", + "hardwareRevision": "str", + "manufacturer": "str", + "model": "str", + "softwareRevision": "str", + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_registry_devices_begin_delete(self, resource_group): + response = await ( + await self.client.registry_devices.begin_delete( + resource_group_name=resource_group.name, + namespace_name="str", + registry_device_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_registry_devices_list_by_namespace(self, resource_group): + response = self.client.registry_devices.list_by_namespace( + resource_group_name=resource_group.name, + namespace_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_schema_registries_operations.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_schema_registries_operations.py index 5ac65283510d..5ba2f83b389a 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_schema_registries_operations.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_schema_registries_operations.py @@ -38,13 +38,19 @@ def test_schema_registries_begin_create_or_replace(self, resource_group): resource={ "location": "str", "id": "str", - "identity": {"type": "str", "principalId": "str", "tenantId": "str"}, + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", "properties": { "namespace": "str", "storageAccountContainerUrl": "str", "description": "str", "displayName": "str", + "outboundIdentity": {"type": "str", "userAssignedIdentity": "str"}, "provisioningState": "str", "uuid": "str", }, @@ -71,8 +77,17 @@ def test_schema_registries_begin_update(self, resource_group): resource_group_name=resource_group.name, schema_registry_name="str", properties={ - "identity": {"type": "str", "principalId": "str", "tenantId": "str"}, - "properties": {"description": "str", "displayName": "str"}, + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "description": "str", + "displayName": "str", + "outboundIdentity": {"type": "str", "userAssignedIdentity": "str"}, + }, "tags": {"str": "str"}, }, ).result() # call '.result()' to poll until service return final result diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_schema_registries_operations_async.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_schema_registries_operations_async.py index 1ea2592f92d0..f5b6391e7e9f 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_schema_registries_operations_async.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/generated_tests/test_device_registry_mgmt_schema_registries_operations_async.py @@ -40,13 +40,19 @@ async def test_schema_registries_begin_create_or_replace(self, resource_group): resource={ "location": "str", "id": "str", - "identity": {"type": "str", "principalId": "str", "tenantId": "str"}, + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", "properties": { "namespace": "str", "storageAccountContainerUrl": "str", "description": "str", "displayName": "str", + "outboundIdentity": {"type": "str", "userAssignedIdentity": "str"}, "provisioningState": "str", "uuid": "str", }, @@ -75,8 +81,17 @@ async def test_schema_registries_begin_update(self, resource_group): resource_group_name=resource_group.name, schema_registry_name="str", properties={ - "identity": {"type": "str", "principalId": "str", "tenantId": "str"}, - "properties": {"description": "str", "displayName": "str"}, + "identity": { + "type": "str", + "principalId": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "description": "str", + "displayName": "str", + "outboundIdentity": {"type": "str", "userAssignedIdentity": "str"}, + }, "tags": {"str": "str"}, }, ) diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/pyproject.toml b/sdk/deviceregistry/azure-mgmt-deviceregistry/pyproject.toml index 462bed9a2fa4..fadede9e040a 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/pyproject.toml +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/pyproject.toml @@ -13,17 +13,17 @@ authors = [ description = "Microsoft Azure Deviceregistry Management Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ] -requires-python = ">=3.9" +requires-python = ">=3.10" keywords = [ "azure", "azure sdk", @@ -79,7 +79,7 @@ package_name = "azure-mgmt-deviceregistry" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Deviceregistry Management" package_doc_id = "" -is_stable = false +is_stable = true is_arm = true need_msrestazure = false need_azuremgmtcore = true diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/tests/test_device_registry_mgmt_credentials_and_policies_flow.py b/sdk/deviceregistry/azure-mgmt-deviceregistry/tests/disable_test_device_registry_mgmt_credentials_and_policies_flow.py similarity index 99% rename from sdk/deviceregistry/azure-mgmt-deviceregistry/tests/test_device_registry_mgmt_credentials_and_policies_flow.py rename to sdk/deviceregistry/azure-mgmt-deviceregistry/tests/disable_test_device_registry_mgmt_credentials_and_policies_flow.py index f7d5ae04f08a..72aaaa62d2e1 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/tests/test_device_registry_mgmt_credentials_and_policies_flow.py +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/tests/disable_test_device_registry_mgmt_credentials_and_policies_flow.py @@ -28,6 +28,7 @@ $env:AZURE_TEST_RUN_LIVE = "true" pytest tests/test_device_registry_mgmt_credentials_and_policies_flow.py -v -s """ + import time import uuid @@ -35,7 +36,7 @@ from azure.core.exceptions import HttpResponseError, ResourceNotFoundError from azure.mgmt.deviceregistry import DeviceRegistryMgmtClient from azure.mgmt.deviceregistry.models import ( - ActivateBringYourOwnRootRequest, + ActivateCertificateAuthorityRequest, CertificateAuthorityConfiguration, CertificateConfiguration, Credential, @@ -409,7 +410,7 @@ def test_credential_and_policy_flow(self): resource_group_name=RESOURCE_GROUP_NAME, namespace_name=NAMESPACE_NAME, policy_name=BYOR_POLICY_NAME, - body=ActivateBringYourOwnRootRequest(certificate_chain=fake_cert_chain), + body=ActivateCertificateAuthorityRequest(certificate_chain=fake_cert_chain), ).result() # Verify BYOR state unchanged after failed activation diff --git a/sdk/deviceregistry/azure-mgmt-deviceregistry/tsp-location.yaml b/sdk/deviceregistry/azure-mgmt-deviceregistry/tsp-location.yaml index 82c17bdf7d0c..23609d104cd0 100644 --- a/sdk/deviceregistry/azure-mgmt-deviceregistry/tsp-location.yaml +++ b/sdk/deviceregistry/azure-mgmt-deviceregistry/tsp-location.yaml @@ -1,4 +1,4 @@ -directory: specification/deviceregistry/DeviceRegistry.Management -commit: 5038b362fae5e6f54bb6fe7e0a0d18370a946acf +directory: specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/DeviceRegistry +commit: 73972b766e47d15a5342c90913a738bb7809ccee repo: Azure/azure-rest-api-specs additionalDirectories: