From 5479e842ac3bd6a29575c272c6d324e13c7e2752 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Fri, 21 Aug 2026 20:01:30 +0000 Subject: [PATCH] Configurations: 'specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/IoTFirmwareDefense/tspconfig.yaml', SDK Release Type: beta, and CommitSHA: '4362bdee9aba8de72a82c14063e3bd5f3e55c3bf' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6732595 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../CHANGELOG.md | 32 + .../azure-mgmt-iotfirmwaredefense/MANIFEST.in | 8 +- .../azure-mgmt-iotfirmwaredefense/README.md | 6 +- .../_metadata.json | 12 +- .../azure-mgmt-iotfirmwaredefense/api.md | 2363 +++++++++++++++++ .../api.metadata.yml | 3 + .../apiview-properties.json | 19 +- .../azure/__init__.py | 2 +- .../azure/mgmt/__init__.py | 2 +- .../azure/mgmt/iotfirmwaredefense/_client.py | 38 +- .../mgmt/iotfirmwaredefense/_configuration.py | 19 +- .../azure/mgmt/iotfirmwaredefense/_patch.py | 3 +- .../iotfirmwaredefense/_utils/model_base.py | 792 +++++- .../_utils/serialization.py | 187 +- .../azure/mgmt/iotfirmwaredefense/_version.py | 2 +- .../mgmt/iotfirmwaredefense/aio/_client.py | 38 +- .../iotfirmwaredefense/aio/_configuration.py | 19 +- .../mgmt/iotfirmwaredefense/aio/_patch.py | 3 +- .../aio/operations/__init__.py | 2 + .../aio/operations/_operations.py | 511 +++- .../aio/operations/_patch.py | 3 +- .../iotfirmwaredefense/models/__init__.py | 24 + .../mgmt/iotfirmwaredefense/models/_enums.py | 100 +- .../mgmt/iotfirmwaredefense/models/_models.py | 755 +++++- .../mgmt/iotfirmwaredefense/models/_patch.py | 3 +- .../iotfirmwaredefense/operations/__init__.py | 2 + .../operations/_operations.py | 585 +++- .../iotfirmwaredefense/operations/_patch.py | 3 +- .../azure/mgmt/iotfirmwaredefense/types.py | 321 +++ ...dening_list_by_firmware_maximum_set_gen.py | 2 +- ...dening_list_by_firmware_minimum_set_gen.py | 2 +- ...icates_list_by_firmware_maximum_set_gen.py | 2 +- ...icates_list_by_firmware_minimum_set_gen.py | 2 +- ...o_keys_list_by_firmware_maximum_set_gen.py | 2 +- ...o_keys_list_by_firmware_minimum_set_gen.py | 2 +- .../cves_list_by_firmware_maximum_set_gen.py | 2 +- .../cves_list_by_firmware_minimum_set_gen.py | 2 +- .../firmwares_create_maximum_set_gen.py | 2 +- .../firmwares_create_minimum_set_gen.py | 2 +- .../firmwares_delete_maximum_set_gen.py | 2 +- .../firmwares_delete_minimum_set_gen.py | 2 +- .../firmwares_get_maximum_set_gen.py | 2 +- .../firmwares_get_minimum_set_gen.py | 2 +- ...wares_list_by_workspace_maximum_set_gen.py | 2 +- ...wares_list_by_workspace_minimum_set_gen.py | 2 +- .../firmwares_update_maximum_set_gen.py | 2 +- .../firmwares_update_minimum_set_gen.py | 56 + .../operations_list_maximum_set_gen.py | 2 +- .../operations_list_minimum_set_gen.py | 2 +- ...hashes_list_by_firmware_maximum_set_gen.py | 2 +- ...hashes_list_by_firmware_minimum_set_gen.py | 2 +- ...onents_list_by_firmware_maximum_set_gen.py | 2 +- ...onents_list_by_firmware_minimum_set_gen.py | 2 +- .../summaries_get_maximum_set_gen.py | 2 +- .../summaries_get_minimum_set_gen.py | 2 +- ...maries_list_by_firmware_maximum_set_gen.py | 2 +- ...maries_list_by_firmware_minimum_set_gen.py | 2 +- ..._calls_list_by_firmware_maximum_set_gen.py | 44 + ..._calls_list_by_firmware_minimum_set_gen.py | 44 + .../usage_metrics_get_maximum_set_gen.py | 2 +- ...trics_list_by_workspace_maximum_set_gen.py | 2 +- .../workspaces_create_maximum_set_gen.py | 2 +- .../workspaces_create_minimum_set_gen.py | 2 +- .../workspaces_delete_maximum_set_gen.py | 2 +- .../workspaces_delete_minimum_set_gen.py | 2 +- ...ces_generate_upload_url_maximum_set_gen.py | 2 +- ...ces_generate_upload_url_minimum_set_gen.py | 2 +- .../workspaces_get_maximum_set_gen.py | 2 +- .../workspaces_get_minimum_set_gen.py | 2 +- ..._list_by_resource_group_maximum_set_gen.py | 2 +- ..._list_by_resource_group_minimum_set_gen.py | 2 +- ...es_list_by_subscription_maximum_set_gen.py | 2 +- ...es_list_by_subscription_minimum_set_gen.py | 2 +- .../workspaces_update_maximum_set_gen.py | 2 +- .../workspaces_update_minimum_set_gen.py | 46 + ...e_mgmt_unsafe_function_calls_operations.py | 31 + ..._unsafe_function_calls_operations_async.py | 32 + .../pyproject.toml | 72 +- .../azure-mgmt-iotfirmwaredefense/setup.py | 83 - .../tsp-location.yaml | 4 +- 80 files changed, 5683 insertions(+), 670 deletions(-) create mode 100644 sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/api.md create mode 100644 sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/api.metadata.yml create mode 100644 sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/types.py create mode 100644 sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_update_minimum_set_gen.py create mode 100644 sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/unsafe_function_calls_list_by_firmware_maximum_set_gen.py create mode 100644 sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/unsafe_function_calls_list_by_firmware_minimum_set_gen.py create mode 100644 sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_update_minimum_set_gen.py create mode 100644 sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_tests/test_io_tfirmware_defense_mgmt_unsafe_function_calls_operations.py create mode 100644 sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_tests/test_io_tfirmware_defense_mgmt_unsafe_function_calls_operations_async.py delete mode 100644 sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/setup.py diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/CHANGELOG.md b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/CHANGELOG.md index a4b1d03ba7ae..7281ea1c856f 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/CHANGELOG.md +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/CHANGELOG.md @@ -1,5 +1,37 @@ # Release History +## 2.1.0b1 (2026-08-21) + +### Features Added + + - Client `IoTFirmwareDefenseMgmtClient` added parameter `cloud_setting` in method `__init__` + - Client `IoTFirmwareDefenseMgmtClient` added operation group `unsafe_function_calls` + - Model `CveResult` added property `cwes` + - Model `CveResult` added property `effective_exploit_maturity` + - Model `CveResult` added property `effective_vector_string` + - Model `CveResult` added property `epss` + - Model `CveResult` added property `fixed_in_versions` + - Model `CveResult` added property `kev` + - Model `CvssScore` added property `exploit_maturity` + - Model `CvssScore` added property `vector_string` + - Enum `SummaryType` added member `CVE` + - Enum `SummaryType` added member `PASSWORD_HASH` + - Enum `SummaryType` added member `SBOM` + - Enum `SummaryType` added member `UNSAFE_FUNCTION_CALLS` + - Added model `CveSummaryResource` + - Added model `CweProperties` + - Added model `EpssProperties` + - Added enum `ExploitMaturityLevel` + - Added model `FunctionCall` + - Added model `KevProperties` + - Added model `PasswordHashSummaryResource` + - Added enum `RansomwareCampaignUse` + - Added model `SbomSummaryResource` + - Added model `UnsafeFunctionCallsResource` + - Added model `UnsafeFunctionCallsResult` + - Added model `UnsafeFunctionCallsSummaryResource` + - Added operation group `UnsafeFunctionCallsOperations` + ## 2.0.0 (2025-09-04) ### Features Added diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/MANIFEST.in b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/MANIFEST.in index f6860bc392b1..562b9828b6ca 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/MANIFEST.in +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/MANIFEST.in @@ -1,7 +1,7 @@ -recursive-include tests *.py *.json -recursive-include samples *.py *.md include *.md -include azure/__init__.py -include azure/mgmt/__init__.py include LICENSE include azure/mgmt/iotfirmwaredefense/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/mgmt/__init__.py diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/README.md b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/README.md index 1123ceba9d75..b1563b7ae27f 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/README.md +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Iotfirmwaredefense 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/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/_metadata.json b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/_metadata.json index 44dbb49ce286..e31f0928270a 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/_metadata.json +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/_metadata.json @@ -1,7 +1,11 @@ { - "apiVersion": "2025-08-02", - "commit": "222af3670e36c5083cb0dc8a9c2677a8f77f8958", + "apiVersion": "2026-06-01-preview", + "apiVersions": { + "Microsoft.IoTFirmwareDefense": "2026-06-01-preview" + }, + "commit": "4362bdee9aba8de72a82c14063e3bd5f3e55c3bf", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "typespec_src": "specification/fist/IotFirmwareDefense.Management", - "emitterVersion": "0.48.2" + "typespec_src": "specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/IoTFirmwareDefense", + "emitterVersion": "0.63.5", + "httpClientPythonVersion": "^0.36.0" } \ No newline at end of file diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/api.md b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/api.md new file mode 100644 index 000000000000..6ef54786e351 --- /dev/null +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/api.md @@ -0,0 +1,2363 @@ +```py +namespace azure.mgmt.iotfirmwaredefense + + class azure.mgmt.iotfirmwaredefense.IoTFirmwareDefenseMgmtClient: implements ContextManager + binary_hardening: BinaryHardeningOperations + crypto_certificates: CryptoCertificatesOperations + crypto_keys: CryptoKeysOperations + cves: CvesOperations + firmwares: FirmwaresOperations + operations: Operations + password_hashes: PasswordHashesOperations + sbom_components: SbomComponentsOperations + summaries: SummariesOperations + unsafe_function_calls: UnsafeFunctionCallsOperations + usage_metrics: UsageMetricsOperations + workspaces: WorkspacesOperations + + 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.iotfirmwaredefense.aio + + class azure.mgmt.iotfirmwaredefense.aio.IoTFirmwareDefenseMgmtClient: implements AsyncContextManager + binary_hardening: BinaryHardeningOperations + crypto_certificates: CryptoCertificatesOperations + crypto_keys: CryptoKeysOperations + cves: CvesOperations + firmwares: FirmwaresOperations + operations: Operations + password_hashes: PasswordHashesOperations + sbom_components: SbomComponentsOperations + summaries: SummariesOperations + unsafe_function_calls: UnsafeFunctionCallsOperations + usage_metrics: UsageMetricsOperations + workspaces: WorkspacesOperations + + 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.iotfirmwaredefense.aio.operations + + class azure.mgmt.iotfirmwaredefense.aio.operations.BinaryHardeningOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> AsyncItemPaged[BinaryHardeningResource]: ... + + + class azure.mgmt.iotfirmwaredefense.aio.operations.CryptoCertificatesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> AsyncItemPaged[CryptoCertificateResource]: ... + + + class azure.mgmt.iotfirmwaredefense.aio.operations.CryptoKeysOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> AsyncItemPaged[CryptoKeyResource]: ... + + + class azure.mgmt.iotfirmwaredefense.aio.operations.CvesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-08-02', params_added_on={'2025-08-02': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'firmware_id', 'accept']}, api_versions_list=['2025-08-02', '2025-12-01-preview', '2026-06-01-preview']) + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> AsyncItemPaged[CveResource]: ... + + + class azure.mgmt.iotfirmwaredefense.aio.operations.FirmwaresOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + async def create( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + resource: Firmware, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Firmware: ... + + @overload + async def create( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + resource: Firmware, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Firmware: ... + + @overload + async def create( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Firmware: ... + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> Firmware: ... + + @distributed_trace + def list_by_workspace( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Firmware]: ... + + @overload + async def update( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + properties: FirmwareUpdateDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Firmware: ... + + @overload + async def update( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + properties: FirmwareUpdateDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Firmware: ... + + @overload + async def update( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Firmware: ... + + + class azure.mgmt.iotfirmwaredefense.aio.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged[Operation]: ... + + + class azure.mgmt.iotfirmwaredefense.aio.operations.PasswordHashesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> AsyncItemPaged[PasswordHashResource]: ... + + + class azure.mgmt.iotfirmwaredefense.aio.operations.SbomComponentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> AsyncItemPaged[SbomComponentResource]: ... + + + class azure.mgmt.iotfirmwaredefense.aio.operations.SummariesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + summary_type: Union[str, SummaryType], + **kwargs: Any + ) -> SummaryResource: ... + + @distributed_trace + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> AsyncItemPaged[SummaryResource]: ... + + + class azure.mgmt.iotfirmwaredefense.aio.operations.UnsafeFunctionCallsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-06-01-preview', params_added_on={'2026-06-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'firmware_id', 'accept']}, api_versions_list=['2026-06-01-preview']) + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> AsyncItemPaged[UnsafeFunctionCallsResource]: ... + + + class azure.mgmt.iotfirmwaredefense.aio.operations.UsageMetricsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any + ) -> UsageMetric: ... + + @distributed_trace + def list_by_workspace( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> AsyncItemPaged[UsageMetric]: ... + + + class azure.mgmt.iotfirmwaredefense.aio.operations.WorkspacesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace_async + @api_version_validation(method_added_on='2025-08-02', params_added_on={'2025-08-02': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name']}, api_versions_list=['2025-08-02', '2025-12-01-preview', '2026-06-01-preview']) + async def begin_delete( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: ... + + @overload + async def create( + self, + resource_group_name: str, + workspace_name: str, + resource: Workspace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Workspace: ... + + @overload + async def create( + self, + resource_group_name: str, + workspace_name: str, + resource: Workspace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Workspace: ... + + @overload + async def create( + self, + resource_group_name: str, + workspace_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Workspace: ... + + @overload + async def generate_upload_url( + self, + resource_group_name: str, + workspace_name: str, + body: GenerateUploadUrlRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> UrlToken: ... + + @overload + async def generate_upload_url( + self, + resource_group_name: str, + workspace_name: str, + body: GenerateUploadUrlRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> UrlToken: ... + + @overload + async def generate_upload_url( + self, + resource_group_name: str, + workspace_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> UrlToken: ... + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> Workspace: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncItemPaged[Workspace]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncItemPaged[Workspace]: ... + + @overload + async def update( + self, + resource_group_name: str, + workspace_name: str, + properties: WorkspaceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Workspace: ... + + @overload + async def update( + self, + resource_group_name: str, + workspace_name: str, + properties: WorkspaceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Workspace: ... + + @overload + async def update( + self, + resource_group_name: str, + workspace_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Workspace: ... + + +namespace azure.mgmt.iotfirmwaredefense.models + + class azure.mgmt.iotfirmwaredefense.models.ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + INTERNAL = "Internal" + + + class azure.mgmt.iotfirmwaredefense.models.BinaryHardeningFeatures(_Model): + canary: Optional[bool] + no_execute: Optional[bool] + position_independent_executable: Optional[bool] + relocation_read_only: Optional[bool] + stripped: Optional[bool] + + @overload + def __init__( + self, + *, + canary: Optional[bool] = ..., + no_execute: Optional[bool] = ..., + position_independent_executable: Optional[bool] = ..., + relocation_read_only: Optional[bool] = ..., + stripped: Optional[bool] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.BinaryHardeningResource(ProxyResource): + id: str + name: str + properties: Optional[BinaryHardeningResult] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[BinaryHardeningResult] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.BinaryHardeningResult(_Model): + binary_hardening_id: Optional[str] + executable_architecture: Optional[str] + executable_class: Optional[Union[str, ExecutableClass]] + file_path: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + rpath: Optional[str] + runpath: Optional[str] + security_hardening_features: Optional[BinaryHardeningFeatures] + + @overload + def __init__( + self, + *, + binary_hardening_id: Optional[str] = ..., + executable_architecture: Optional[str] = ..., + executable_class: Optional[Union[str, ExecutableClass]] = ..., + file_path: Optional[str] = ..., + rpath: Optional[str] = ..., + runpath: Optional[str] = ..., + security_hardening_features: Optional[BinaryHardeningFeatures] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.BinaryHardeningSummaryResource(SummaryResourceProperties, discriminator='BinaryHardening'): + not_executable_stack_count: Optional[int] + position_independent_executable_count: Optional[int] + provisioning_state: Union[str, ProvisioningState] + relocation_read_only_count: Optional[int] + stack_canary_count: Optional[int] + stripped_binary_count: Optional[int] + summary_type: Literal[SummaryType.BINARY_HARDENING] + total_files: Optional[int] + + @overload + def __init__( + self, + *, + not_executable_stack_count: Optional[int] = ..., + position_independent_executable_count: Optional[int] = ..., + relocation_read_only_count: Optional[int] = ..., + stack_canary_count: Optional[int] = ..., + stripped_binary_count: Optional[int] = ..., + total_files: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.CertificateUsage(str, Enum, metaclass=CaseInsensitiveEnumMeta): + CLIENT_AUTHENTICATION = "clientAuth" + CODE_SIGNING = "codeSigning" + CONTENT_COMMITMENT = "contentCommitment" + CRL_SIGN = "crlSign" + DATA_ENCIPHERMENT = "dataEncipherment" + DECIPHER_ONLY = "decipherOnly" + DIGITAL_SIGNATURE = "digitalSignature" + EMAIL_PROTECTION = "emailProtection" + ENCIPHER_ONLY = "encipherOnly" + KEY_AGREEMENT = "keyAgreement" + KEY_CERT_SIGN = "keyCertSign" + KEY_ENCIPHERMENT = "keyEncipherment" + NON_REPUDIATION = "nonRepudiation" + OCSP_SIGNING = "ocspSigning" + SERVER_AUTHENTICATION = "serverAuth" + TIME_STAMPING = "timeStamping" + + + class azure.mgmt.iotfirmwaredefense.models.CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + APPLICATION = "Application" + KEY = "Key" + MANAGED_IDENTITY = "ManagedIdentity" + USER = "User" + + + class azure.mgmt.iotfirmwaredefense.models.CryptoCertificate(_Model): + certificate_key_algorithm: Optional[str] + certificate_key_size: Optional[int] + certificate_name: Optional[str] + certificate_role: Optional[str] + certificate_usage: Optional[list[Union[str, CertificateUsage]]] + crypto_cert_id: Optional[str] + encoding: Optional[str] + expiration_date: Optional[datetime] + file_paths: Optional[list[str]] + fingerprint: Optional[str] + is_expired: Optional[bool] + is_self_signed: Optional[bool] + is_short_key_size: Optional[bool] + is_weak_signature: Optional[bool] + issued_date: Optional[datetime] + issuer: Optional[CryptoCertificateEntity] + paired_key: Optional[PairedKey] + provisioning_state: Optional[Union[str, ProvisioningState]] + serial_number: Optional[str] + signature_algorithm: Optional[str] + subject: Optional[CryptoCertificateEntity] + + @overload + def __init__( + self, + *, + certificate_key_algorithm: Optional[str] = ..., + certificate_key_size: Optional[int] = ..., + certificate_name: Optional[str] = ..., + certificate_role: Optional[str] = ..., + certificate_usage: Optional[list[Union[str, CertificateUsage]]] = ..., + crypto_cert_id: Optional[str] = ..., + encoding: Optional[str] = ..., + expiration_date: Optional[datetime] = ..., + fingerprint: Optional[str] = ..., + is_expired: Optional[bool] = ..., + is_self_signed: Optional[bool] = ..., + is_short_key_size: Optional[bool] = ..., + is_weak_signature: Optional[bool] = ..., + issued_date: Optional[datetime] = ..., + issuer: Optional[CryptoCertificateEntity] = ..., + paired_key: Optional[PairedKey] = ..., + serial_number: Optional[str] = ..., + signature_algorithm: Optional[str] = ..., + subject: Optional[CryptoCertificateEntity] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.CryptoCertificateEntity(_Model): + common_name: Optional[str] + country: Optional[str] + organization: Optional[str] + organizational_unit: Optional[str] + state: Optional[str] + + @overload + def __init__( + self, + *, + common_name: Optional[str] = ..., + country: Optional[str] = ..., + organization: Optional[str] = ..., + organizational_unit: Optional[str] = ..., + state: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.CryptoCertificateResource(ProxyResource): + id: str + name: str + properties: Optional[CryptoCertificate] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[CryptoCertificate] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.CryptoCertificateSummaryResource(SummaryResourceProperties, discriminator='CryptoCertificate'): + expired_certificate_count: Optional[int] + expiring_soon_certificate_count: Optional[int] + paired_key_count: Optional[int] + provisioning_state: Union[str, ProvisioningState] + self_signed_certificate_count: Optional[int] + short_key_size_count: Optional[int] + summary_type: Literal[SummaryType.CRYPTO_CERTIFICATE] + total_certificate_count: Optional[int] + weak_signature_count: Optional[int] + + @overload + def __init__( + self, + *, + expired_certificate_count: Optional[int] = ..., + expiring_soon_certificate_count: Optional[int] = ..., + paired_key_count: Optional[int] = ..., + self_signed_certificate_count: Optional[int] = ..., + short_key_size_count: Optional[int] = ..., + total_certificate_count: Optional[int] = ..., + weak_signature_count: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.CryptoKey(_Model): + crypto_key_id: Optional[str] + crypto_key_size: Optional[int] + file_paths: Optional[list[str]] + is_short_key_size: Optional[bool] + key_algorithm: Optional[str] + key_type: Optional[Union[str, CryptoKeyType]] + paired_key: Optional[PairedKey] + provisioning_state: Optional[Union[str, ProvisioningState]] + usage: Optional[list[str]] + + @overload + def __init__( + self, + *, + crypto_key_id: Optional[str] = ..., + crypto_key_size: Optional[int] = ..., + is_short_key_size: Optional[bool] = ..., + key_algorithm: Optional[str] = ..., + key_type: Optional[Union[str, CryptoKeyType]] = ..., + paired_key: Optional[PairedKey] = ..., + usage: Optional[list[str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.CryptoKeyResource(ProxyResource): + id: str + name: str + properties: Optional[CryptoKey] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[CryptoKey] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.CryptoKeySummaryResource(SummaryResourceProperties, discriminator='CryptoKey'): + paired_key_count: Optional[int] + private_key_count: Optional[int] + provisioning_state: Union[str, ProvisioningState] + public_key_count: Optional[int] + short_key_size_count: Optional[int] + summary_type: Literal[SummaryType.CRYPTO_KEY] + total_key_count: Optional[int] + + @overload + def __init__( + self, + *, + paired_key_count: Optional[int] = ..., + private_key_count: Optional[int] = ..., + public_key_count: Optional[int] = ..., + short_key_size_count: Optional[int] = ..., + total_key_count: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.CryptoKeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + PRIVATE = "Private" + PUBLIC = "Public" + + + class azure.mgmt.iotfirmwaredefense.models.CveComponent(_Model): + component_id: Optional[str] + name: Optional[str] + version: Optional[str] + + @overload + def __init__( + self, + *, + component_id: Optional[str] = ..., + name: Optional[str] = ..., + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.CveLink(_Model): + href: Optional[str] + label: Optional[str] + + @overload + def __init__( + self, + *, + href: Optional[str] = ..., + label: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.CveResource(ProxyResource): + id: str + name: str + properties: Optional[CveResult] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[CveResult] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.CveResult(_Model): + component: Optional[CveComponent] + component_id: Optional[str] + component_name: Optional[str] + component_version: Optional[str] + cve_id: Optional[str] + cve_name: Optional[str] + cvss_score: Optional[str] + cvss_scores: Optional[list[CvssScore]] + cvss_v2_score: Optional[str] + cvss_v3_score: Optional[str] + cvss_version: Optional[str] + cwes: Optional[list[CweProperties]] + description: Optional[str] + effective_cvss_score: Optional[float] + effective_cvss_version: Optional[int] + effective_exploit_maturity: Optional[Union[str, ExploitMaturityLevel]] + effective_vector_string: Optional[str] + epss: Optional[EpssProperties] + fixed_in_versions: Optional[list[str]] + kev: Optional[KevProperties] + links: Optional[list[CveLink]] + provisioning_state: Optional[Union[str, ProvisioningState]] + severity: Optional[str] + + @overload + def __init__( + self, + *, + component: Optional[CveComponent] = ..., + component_id: Optional[str] = ..., + component_name: Optional[str] = ..., + component_version: Optional[str] = ..., + cve_id: Optional[str] = ..., + cve_name: Optional[str] = ..., + cvss_score: Optional[str] = ..., + cvss_scores: Optional[list[CvssScore]] = ..., + cvss_v2_score: Optional[str] = ..., + cvss_v3_score: Optional[str] = ..., + cvss_version: Optional[str] = ..., + cwes: Optional[list[CweProperties]] = ..., + description: Optional[str] = ..., + effective_cvss_score: Optional[float] = ..., + effective_cvss_version: Optional[int] = ..., + effective_exploit_maturity: Optional[Union[str, ExploitMaturityLevel]] = ..., + effective_vector_string: Optional[str] = ..., + epss: Optional[EpssProperties] = ..., + fixed_in_versions: Optional[list[str]] = ..., + kev: Optional[KevProperties] = ..., + severity: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.CveSummary(SummaryResourceProperties, discriminator='CommonVulnerabilitiesAndExposures'): + critical_cve_count: Optional[int] + high_cve_count: Optional[int] + low_cve_count: Optional[int] + medium_cve_count: Optional[int] + provisioning_state: Union[str, ProvisioningState] + summary_type: Literal[SummaryType.COMMON_VULNERABILITIES_AND_EXPOSURES] + unknown_cve_count: Optional[int] + + @overload + def __init__( + self, + *, + critical_cve_count: Optional[int] = ..., + high_cve_count: Optional[int] = ..., + low_cve_count: Optional[int] = ..., + medium_cve_count: Optional[int] = ..., + unknown_cve_count: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.CveSummaryResource(SummaryResourceProperties, discriminator='CVE'): + critical_cve_count: Optional[int] + high_cve_count: Optional[int] + low_cve_count: Optional[int] + medium_cve_count: Optional[int] + provisioning_state: Union[str, ProvisioningState] + schema_version: Optional[str] + summary_type: Literal[SummaryType.CVE] + total_cve_count: Optional[int] + unknown_cve_count: Optional[int] + + @overload + def __init__( + self, + *, + critical_cve_count: Optional[int] = ..., + high_cve_count: Optional[int] = ..., + low_cve_count: Optional[int] = ..., + medium_cve_count: Optional[int] = ..., + schema_version: Optional[str] = ..., + total_cve_count: Optional[int] = ..., + unknown_cve_count: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.CvssScore(_Model): + exploit_maturity: Optional[Union[str, ExploitMaturityLevel]] + score: Optional[float] + vector_string: Optional[str] + version: int + + @overload + def __init__( + self, + *, + exploit_maturity: Optional[Union[str, ExploitMaturityLevel]] = ..., + score: Optional[float] = ..., + vector_string: Optional[str] = ..., + version: int + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.CweProperties(_Model): + cwe_id: Optional[str] + cwe_name: Optional[str] + description: Optional[str] + + @overload + def __init__( + self, + *, + cwe_id: Optional[str] = ..., + cwe_name: Optional[str] = ..., + description: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.EpssProperties(_Model): + percentile: Optional[float] + score: Optional[float] + + @overload + def __init__( + self, + *, + percentile: Optional[float] = ..., + score: Optional[float] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.ErrorAdditionalInfo(_Model): + info: Optional[Any] + type: Optional[str] + + + class azure.mgmt.iotfirmwaredefense.models.ErrorDetail(_Model): + additional_info: Optional[list[ErrorAdditionalInfo]] + code: Optional[str] + details: Optional[list[ErrorDetail]] + message: Optional[str] + target: Optional[str] + + + class azure.mgmt.iotfirmwaredefense.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.iotfirmwaredefense.models.ExecutableClass(str, Enum, metaclass=CaseInsensitiveEnumMeta): + X64 = "x64" + X86 = "x86" + + + class azure.mgmt.iotfirmwaredefense.models.ExploitMaturityLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ATTACKED = "ATTACKED" + NOT_DEFINED = "NOT_DEFINED" + PROOF_OF_CONCEPT = "PROOF_OF_CONCEPT" + UNREPORTED = "UNREPORTED" + + + class azure.mgmt.iotfirmwaredefense.models.Firmware(ProxyResource): + id: str + name: str + properties: Optional[FirmwareProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[FirmwareProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.FirmwareProperties(_Model): + description: Optional[str] + file_name: Optional[str] + file_size: Optional[int] + model: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + status: Optional[Union[str, Status]] + status_messages: Optional[list[StatusMessage]] + vendor: Optional[str] + version: Optional[str] + + @overload + def __init__( + self, + *, + description: Optional[str] = ..., + file_name: Optional[str] = ..., + file_size: Optional[int] = ..., + model: Optional[str] = ..., + status: Optional[Union[str, Status]] = ..., + status_messages: Optional[list[StatusMessage]] = ..., + vendor: Optional[str] = ..., + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.FirmwareSummary(SummaryResourceProperties, discriminator='Firmware'): + analysis_time_seconds: Optional[int] + binary_count: Optional[int] + component_count: Optional[int] + extracted_file_count: Optional[int] + extracted_size: Optional[int] + file_size: Optional[int] + provisioning_state: Union[str, ProvisioningState] + root_file_systems: Optional[int] + summary_type: Literal[SummaryType.FIRMWARE] + + @overload + def __init__( + self, + *, + analysis_time_seconds: Optional[int] = ..., + binary_count: Optional[int] = ..., + component_count: Optional[int] = ..., + extracted_file_count: Optional[int] = ..., + extracted_size: Optional[int] = ..., + file_size: Optional[int] = ..., + root_file_systems: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.FirmwareUpdateDefinition(_Model): + properties: Optional[FirmwareProperties] + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[FirmwareProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.FunctionCall(_Model): + count: int + function_name: str + + @overload + def __init__( + self, + *, + count: int, + function_name: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.GenerateUploadUrlRequest(_Model): + firmware_id: Optional[str] + + @overload + def __init__( + self, + *, + firmware_id: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.KevProperties(_Model): + date_added: Optional[datetime] + known_ransomware_campaign_use: Optional[Union[str, RansomwareCampaignUse]] + remediation_due_date: Optional[datetime] + required_action: Optional[str] + + @overload + def __init__( + self, + *, + date_added: Optional[datetime] = ..., + known_ransomware_campaign_use: Optional[Union[str, RansomwareCampaignUse]] = ..., + remediation_due_date: Optional[datetime] = ..., + required_action: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.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.iotfirmwaredefense.models.OperationDisplay(_Model): + description: Optional[str] + operation: Optional[str] + provider: Optional[str] + resource: Optional[str] + + + class azure.mgmt.iotfirmwaredefense.models.Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + SYSTEM = "system" + USER = "user" + USER_SYSTEM = "user,system" + + + class azure.mgmt.iotfirmwaredefense.models.PairedKey(_Model): + paired_key_id: Optional[str] + type: Optional[str] + + @overload + def __init__( + self, + *, + paired_key_id: Optional[str] = ..., + type: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.PasswordHash(_Model): + algorithm: Optional[str] + context: Optional[str] + file_path: Optional[str] + hash: Optional[str] + password_hash_id: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + salt: Optional[str] + username: Optional[str] + + @overload + def __init__( + self, + *, + algorithm: Optional[str] = ..., + context: Optional[str] = ..., + file_path: Optional[str] = ..., + hash: Optional[str] = ..., + password_hash_id: Optional[str] = ..., + salt: Optional[str] = ..., + username: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.PasswordHashResource(ProxyResource): + id: str + name: str + properties: Optional[PasswordHash] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[PasswordHash] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.PasswordHashSummaryResource(SummaryResourceProperties, discriminator='PasswordHash'): + provisioning_state: Union[str, ProvisioningState] + summary_type: Literal[SummaryType.PASSWORD_HASH] + total_password_hash_count: Optional[int] + + @overload + def __init__( + self, + *, + total_password_hash_count: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANALYZING = "Analyzing" + CANCELED = "Canceled" + EXTRACTING = "Extracting" + FAILED = "Failed" + PENDING = "Pending" + SUCCEEDED = "Succeeded" + + + class azure.mgmt.iotfirmwaredefense.models.ProxyResource(Resource): + id: str + name: str + system_data: SystemData + type: str + + + class azure.mgmt.iotfirmwaredefense.models.RansomwareCampaignUse(str, Enum, metaclass=CaseInsensitiveEnumMeta): + KNOWN = "Known" + UNKNOWN = "Unknown" + + + class azure.mgmt.iotfirmwaredefense.models.Resource(_Model): + id: Optional[str] + name: Optional[str] + system_data: Optional[SystemData] + type: Optional[str] + + + class azure.mgmt.iotfirmwaredefense.models.SbomComponent(_Model): + component_id: Optional[str] + component_name: Optional[str] + file_paths: Optional[list[str]] + license: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + version: Optional[str] + + @overload + def __init__( + self, + *, + component_id: Optional[str] = ..., + component_name: Optional[str] = ..., + file_paths: Optional[list[str]] = ..., + license: Optional[str] = ..., + version: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.SbomComponentResource(ProxyResource): + id: str + name: str + properties: Optional[SbomComponent] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[SbomComponent] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.SbomSummaryResource(SummaryResourceProperties, discriminator='SBOM'): + provisioning_state: Union[str, ProvisioningState] + summary_type: Literal[SummaryType.SBOM] + total_component_count: Optional[int] + + @overload + def __init__( + self, + *, + total_component_count: Optional[int] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.Sku(_Model): + capacity: Optional[int] + family: Optional[str] + name: str + size: Optional[str] + tier: Optional[Union[str, SkuTier]] + + @overload + def __init__( + self, + *, + capacity: Optional[int] = ..., + family: Optional[str] = ..., + name: str, + size: Optional[str] = ..., + tier: Optional[Union[str, SkuTier]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BASIC = "Basic" + FREE = "Free" + PREMIUM = "Premium" + STANDARD = "Standard" + + + class azure.mgmt.iotfirmwaredefense.models.Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): + ANALYZING = "Analyzing" + ERROR = "Error" + EXTRACTING = "Extracting" + PENDING = "Pending" + READY = "Ready" + + + class azure.mgmt.iotfirmwaredefense.models.StatusMessage(_Model): + error_code: Optional[int] + message: Optional[str] + + @overload + def __init__( + self, + *, + error_code: Optional[int] = ..., + message: Optional[str] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.SummaryResource(ProxyResource): + id: str + name: str + properties: Optional[SummaryResourceProperties] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[SummaryResourceProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.SummaryResourceProperties(_Model): + provisioning_state: Optional[Union[str, ProvisioningState]] + summary_type: str + + @overload + def __init__( + self, + *, + summary_type: str + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.SummaryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + BINARY_HARDENING = "BinaryHardening" + COMMON_VULNERABILITIES_AND_EXPOSURES = "CommonVulnerabilitiesAndExposures" + CRYPTO_CERTIFICATE = "CryptoCertificate" + CRYPTO_KEY = "CryptoKey" + CVE = "CVE" + FIRMWARE = "Firmware" + PASSWORD_HASH = "PasswordHash" + SBOM = "SBOM" + UNSAFE_FUNCTION_CALLS = "UnsafeFunctionCalls" + + + class azure.mgmt.iotfirmwaredefense.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.iotfirmwaredefense.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.iotfirmwaredefense.models.UnsafeFunctionCallsResource(ProxyResource): + id: str + name: str + properties: Optional[UnsafeFunctionCallsResult] + system_data: SystemData + type: str + + @overload + def __init__( + self, + *, + properties: Optional[UnsafeFunctionCallsResult] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.UnsafeFunctionCallsResult(_Model): + file_name: Optional[str] + file_path: Optional[str] + provisioning_state: Optional[Union[str, ProvisioningState]] + total_network_call_count: Optional[int] + total_unsafe_call_count: Optional[int] + unsafe_function_calls: Optional[list[FunctionCall]] + + @overload + def __init__( + self, + *, + file_name: Optional[str] = ..., + file_path: Optional[str] = ..., + total_network_call_count: Optional[int] = ..., + total_unsafe_call_count: Optional[int] = ..., + unsafe_function_calls: Optional[list[FunctionCall]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.UnsafeFunctionCallsSummaryResource(SummaryResourceProperties, discriminator='UnsafeFunctionCalls'): + provisioning_state: Union[str, ProvisioningState] + summary_type: Literal[SummaryType.UNSAFE_FUNCTION_CALLS] + total_file_count: Optional[int] + total_network_call_count: Optional[int] + total_unsafe_call_count: Optional[int] + unsafe_call_totals: Optional[list[FunctionCall]] + + @overload + def __init__( + self, + *, + total_file_count: Optional[int] = ..., + total_network_call_count: Optional[int] = ..., + total_unsafe_call_count: Optional[int] = ..., + unsafe_call_totals: Optional[list[FunctionCall]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.UrlToken(_Model): + url: Optional[str] + + + class azure.mgmt.iotfirmwaredefense.models.UsageMetric(ProxyResource): + id: str + name: str + properties: Optional[UsageMetricProperties] + system_data: SystemData + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + properties: Optional[UsageMetricProperties] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.UsageMetricProperties(_Model): + monthly_firmware_upload_count: int + provisioning_state: Optional[Union[str, ProvisioningState]] + total_firmware_count: int + + + class azure.mgmt.iotfirmwaredefense.models.Workspace(TrackedResource): + id: str + location: str + name: str + properties: Optional[WorkspaceProperties] + sku: Optional[Sku] + system_data: SystemData + tags: dict[str, str] + type: str + + def __getattr__(self, name: str) -> Any: ... + + @overload + def __init__( + self, + *, + location: str, + properties: Optional[WorkspaceProperties] = ..., + sku: Optional[Sku] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + def __setattr__( + self, + key: str, + value: Any + ) -> None: ... + + + class azure.mgmt.iotfirmwaredefense.models.WorkspaceProperties(_Model): + provisioning_state: Optional[Union[str, ProvisioningState]] + + + class azure.mgmt.iotfirmwaredefense.models.WorkspaceUpdate(_Model): + sku: Optional[Sku] + tags: Optional[dict[str, str]] + + @overload + def __init__( + self, + *, + sku: Optional[Sku] = ..., + tags: Optional[dict[str, str]] = ... + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: ... + + +namespace azure.mgmt.iotfirmwaredefense.operations + + class azure.mgmt.iotfirmwaredefense.operations.BinaryHardeningOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> ItemPaged[BinaryHardeningResource]: ... + + + class azure.mgmt.iotfirmwaredefense.operations.CryptoCertificatesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> ItemPaged[CryptoCertificateResource]: ... + + + class azure.mgmt.iotfirmwaredefense.operations.CryptoKeysOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> ItemPaged[CryptoKeyResource]: ... + + + class azure.mgmt.iotfirmwaredefense.operations.CvesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-08-02', params_added_on={'2025-08-02': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'firmware_id', 'accept']}, api_versions_list=['2025-08-02', '2025-12-01-preview', '2026-06-01-preview']) + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> ItemPaged[CveResource]: ... + + + class azure.mgmt.iotfirmwaredefense.operations.FirmwaresOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @overload + def create( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + resource: Firmware, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Firmware: ... + + @overload + def create( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + resource: Firmware, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Firmware: ... + + @overload + def create( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Firmware: ... + + @distributed_trace + def delete( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> Firmware: ... + + @distributed_trace + def list_by_workspace( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> ItemPaged[Firmware]: ... + + @overload + def update( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + properties: FirmwareUpdateDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Firmware: ... + + @overload + def update( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + properties: FirmwareUpdateDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Firmware: ... + + @overload + def update( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Firmware: ... + + + class azure.mgmt.iotfirmwaredefense.operations.Operations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged[Operation]: ... + + + class azure.mgmt.iotfirmwaredefense.operations.PasswordHashesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> ItemPaged[PasswordHashResource]: ... + + + class azure.mgmt.iotfirmwaredefense.operations.SbomComponentsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> ItemPaged[SbomComponentResource]: ... + + + class azure.mgmt.iotfirmwaredefense.operations.SummariesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + summary_type: Union[str, SummaryType], + **kwargs: Any + ) -> SummaryResource: ... + + @distributed_trace + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> ItemPaged[SummaryResource]: ... + + + class azure.mgmt.iotfirmwaredefense.operations.UnsafeFunctionCallsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2026-06-01-preview', params_added_on={'2026-06-01-preview': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name', 'firmware_id', 'accept']}, api_versions_list=['2026-06-01-preview']) + def list_by_firmware( + self, + resource_group_name: str, + workspace_name: str, + firmware_id: str, + **kwargs: Any + ) -> ItemPaged[UnsafeFunctionCallsResource]: ... + + + class azure.mgmt.iotfirmwaredefense.operations.UsageMetricsOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any + ) -> UsageMetric: ... + + @distributed_trace + def list_by_workspace( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> ItemPaged[UsageMetric]: ... + + + class azure.mgmt.iotfirmwaredefense.operations.WorkspacesOperations: + + def __init__( + self, + *args, + **kwargs + ) -> None: ... + + @distributed_trace + @api_version_validation(method_added_on='2025-08-02', params_added_on={'2025-08-02': ['api_version', 'subscription_id', 'resource_group_name', 'workspace_name']}, api_versions_list=['2025-08-02', '2025-12-01-preview', '2026-06-01-preview']) + def begin_delete( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> LROPoller[None]: ... + + @overload + def create( + self, + resource_group_name: str, + workspace_name: str, + resource: Workspace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Workspace: ... + + @overload + def create( + self, + resource_group_name: str, + workspace_name: str, + resource: Workspace, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Workspace: ... + + @overload + def create( + self, + resource_group_name: str, + workspace_name: str, + resource: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Workspace: ... + + @overload + def generate_upload_url( + self, + resource_group_name: str, + workspace_name: str, + body: GenerateUploadUrlRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> UrlToken: ... + + @overload + def generate_upload_url( + self, + resource_group_name: str, + workspace_name: str, + body: GenerateUploadUrlRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> UrlToken: ... + + @overload + def generate_upload_url( + self, + resource_group_name: str, + workspace_name: str, + body: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> UrlToken: ... + + @distributed_trace + def get( + self, + resource_group_name: str, + workspace_name: str, + **kwargs: Any + ) -> Workspace: ... + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> ItemPaged[Workspace]: ... + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> ItemPaged[Workspace]: ... + + @overload + def update( + self, + resource_group_name: str, + workspace_name: str, + properties: WorkspaceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Workspace: ... + + @overload + def update( + self, + resource_group_name: str, + workspace_name: str, + properties: WorkspaceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Workspace: ... + + @overload + def update( + self, + resource_group_name: str, + workspace_name: str, + properties: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Workspace: ... + + +namespace azure.mgmt.iotfirmwaredefense.types + + class azure.mgmt.iotfirmwaredefense.types.Firmware(ProxyResource): + key "id": str + key "name": str + key "properties": ForwardRef('FirmwareProperties', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + name: str + properties: FirmwareProperties + systemData: SystemData + type: str + + + class azure.mgmt.iotfirmwaredefense.types.FirmwareProperties(TypedDict, total=False): + key "description": str + key "fileName": str + key "fileSize": int + key "model": str + key "provisioningState": Union[str, ProvisioningState] + key "status": Union[str, Status] + key "vendor": str + key "version": str + description: str + fileName: str + fileSize: int + model: str + provisioningState: Union[str, ProvisioningState] + status: Union[str, Status] + statusMessages: list[StatusMessage] + vendor: str + version: str + + + class azure.mgmt.iotfirmwaredefense.types.FirmwareUpdateDefinition(TypedDict, total=False): + key "properties": ForwardRef('FirmwareProperties', module='types') + properties: FirmwareProperties + + + class azure.mgmt.iotfirmwaredefense.types.GenerateUploadUrlRequest(TypedDict, total=False): + key "firmwareId": str + firmwareId: str + + + class azure.mgmt.iotfirmwaredefense.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.iotfirmwaredefense.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.iotfirmwaredefense.types.Sku(TypedDict, total=False): + key "capacity": int + key "family": str + key "name": Required[str] + key "size": str + key "tier": Union[str, SkuTier] + capacity: int + family: str + name: str + size: str + tier: Union[str, SkuTier] + + + class azure.mgmt.iotfirmwaredefense.types.StatusMessage(TypedDict, total=False): + key "errorCode": int + key "message": str + errorCode: int + message: str + + + class azure.mgmt.iotfirmwaredefense.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.iotfirmwaredefense.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.iotfirmwaredefense.types.Workspace(TrackedResource): + key "id": str + key "location": Required[str] + key "name": str + key "properties": ForwardRef('WorkspaceProperties', module='types') + key "sku": ForwardRef('Sku', module='types') + key "systemData": ForwardRef('SystemData', module='types') + key "type": str + id: str + location: str + name: str + properties: WorkspaceProperties + sku: Sku + systemData: SystemData + tags: dict[str, str] + type: str + + + class azure.mgmt.iotfirmwaredefense.types.WorkspaceProperties(TypedDict, total=False): + key "provisioningState": Union[str, ProvisioningState] + provisioningState: Union[str, ProvisioningState] + + + class azure.mgmt.iotfirmwaredefense.types.WorkspaceUpdate(TypedDict, total=False): + key "sku": ForwardRef('Sku', module='types') + sku: Sku + tags: dict[str, str] + + +``` \ No newline at end of file diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/api.metadata.yml b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/api.metadata.yml new file mode 100644 index 000000000000..287bb550c786 --- /dev/null +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/api.metadata.yml @@ -0,0 +1,3 @@ +apiMdSha256: 2c3f9c699b9679a6a1f627052cc281435576669a2300c1aebc96d2e3a4cf442a +parserVersion: 0.3.31 +pythonVersion: 3.13.15 diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/apiview-properties.json b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/apiview-properties.json index e8a143fd5b0a..4c030538b7fd 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/apiview-properties.json +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/apiview-properties.json @@ -20,7 +20,10 @@ "azure.mgmt.iotfirmwaredefense.models.CveResource": "Microsoft.IoTFirmwareDefense.CveResource", "azure.mgmt.iotfirmwaredefense.models.CveResult": "Microsoft.IoTFirmwareDefense.CveResult", "azure.mgmt.iotfirmwaredefense.models.CveSummary": "Microsoft.IoTFirmwareDefense.CveSummary", + "azure.mgmt.iotfirmwaredefense.models.CveSummaryResource": "Microsoft.IoTFirmwareDefense.CveSummaryResource", "azure.mgmt.iotfirmwaredefense.models.CvssScore": "Microsoft.IoTFirmwareDefense.CvssScore", + "azure.mgmt.iotfirmwaredefense.models.CweProperties": "Microsoft.IoTFirmwareDefense.CweProperties", + "azure.mgmt.iotfirmwaredefense.models.EpssProperties": "Microsoft.IoTFirmwareDefense.EpssProperties", "azure.mgmt.iotfirmwaredefense.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", "azure.mgmt.iotfirmwaredefense.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", "azure.mgmt.iotfirmwaredefense.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", @@ -28,19 +31,26 @@ "azure.mgmt.iotfirmwaredefense.models.FirmwareProperties": "Microsoft.IoTFirmwareDefense.FirmwareProperties", "azure.mgmt.iotfirmwaredefense.models.FirmwareSummary": "Microsoft.IoTFirmwareDefense.FirmwareSummary", "azure.mgmt.iotfirmwaredefense.models.FirmwareUpdateDefinition": "Microsoft.IoTFirmwareDefense.FirmwareUpdateDefinition", + "azure.mgmt.iotfirmwaredefense.models.FunctionCall": "Microsoft.IoTFirmwareDefense.FunctionCall", "azure.mgmt.iotfirmwaredefense.models.GenerateUploadUrlRequest": "Microsoft.IoTFirmwareDefense.GenerateUploadUrlRequest", + "azure.mgmt.iotfirmwaredefense.models.KevProperties": "Microsoft.IoTFirmwareDefense.KevProperties", "azure.mgmt.iotfirmwaredefense.models.Operation": "Azure.ResourceManager.CommonTypes.Operation", "azure.mgmt.iotfirmwaredefense.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay", "azure.mgmt.iotfirmwaredefense.models.PairedKey": "Microsoft.IoTFirmwareDefense.PairedKey", "azure.mgmt.iotfirmwaredefense.models.PasswordHash": "Microsoft.IoTFirmwareDefense.PasswordHash", "azure.mgmt.iotfirmwaredefense.models.PasswordHashResource": "Microsoft.IoTFirmwareDefense.PasswordHashResource", + "azure.mgmt.iotfirmwaredefense.models.PasswordHashSummaryResource": "Microsoft.IoTFirmwareDefense.PasswordHashSummaryResource", "azure.mgmt.iotfirmwaredefense.models.SbomComponent": "Microsoft.IoTFirmwareDefense.SbomComponent", "azure.mgmt.iotfirmwaredefense.models.SbomComponentResource": "Microsoft.IoTFirmwareDefense.SbomComponentResource", + "azure.mgmt.iotfirmwaredefense.models.SbomSummaryResource": "Microsoft.IoTFirmwareDefense.SbomSummaryResource", "azure.mgmt.iotfirmwaredefense.models.Sku": "Azure.ResourceManager.CommonTypes.Sku", "azure.mgmt.iotfirmwaredefense.models.StatusMessage": "Microsoft.IoTFirmwareDefense.StatusMessage", "azure.mgmt.iotfirmwaredefense.models.SummaryResource": "Microsoft.IoTFirmwareDefense.SummaryResource", "azure.mgmt.iotfirmwaredefense.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", "azure.mgmt.iotfirmwaredefense.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.iotfirmwaredefense.models.UnsafeFunctionCallsResource": "Microsoft.IoTFirmwareDefense.UnsafeFunctionCallsResource", + "azure.mgmt.iotfirmwaredefense.models.UnsafeFunctionCallsResult": "Microsoft.IoTFirmwareDefense.UnsafeFunctionCallsResult", + "azure.mgmt.iotfirmwaredefense.models.UnsafeFunctionCallsSummaryResource": "Microsoft.IoTFirmwareDefense.UnsafeFunctionCallsSummaryResource", "azure.mgmt.iotfirmwaredefense.models.UrlToken": "Microsoft.IoTFirmwareDefense.UrlToken", "azure.mgmt.iotfirmwaredefense.models.UsageMetric": "Microsoft.IoTFirmwareDefense.UsageMetric", "azure.mgmt.iotfirmwaredefense.models.UsageMetricProperties": "Microsoft.IoTFirmwareDefense.UsageMetricProperties", @@ -56,6 +66,8 @@ "azure.mgmt.iotfirmwaredefense.models.ExecutableClass": "Microsoft.IoTFirmwareDefense.ExecutableClass", "azure.mgmt.iotfirmwaredefense.models.CertificateUsage": "Microsoft.IoTFirmwareDefense.CertificateUsage", "azure.mgmt.iotfirmwaredefense.models.CryptoKeyType": "Microsoft.IoTFirmwareDefense.CryptoKeyType", + "azure.mgmt.iotfirmwaredefense.models.ExploitMaturityLevel": "Microsoft.IoTFirmwareDefense.ExploitMaturityLevel", + "azure.mgmt.iotfirmwaredefense.models.RansomwareCampaignUse": "Microsoft.IoTFirmwareDefense.RansomwareCampaignUse", "azure.mgmt.iotfirmwaredefense.models.SummaryType": "Microsoft.IoTFirmwareDefense.SummaryType", "azure.mgmt.iotfirmwaredefense.operations.Operations.list": "Azure.ResourceManager.Operations.list", "azure.mgmt.iotfirmwaredefense.aio.operations.Operations.list": "Azure.ResourceManager.Operations.list", @@ -102,6 +114,9 @@ "azure.mgmt.iotfirmwaredefense.operations.UsageMetricsOperations.get": "Microsoft.IoTFirmwareDefense.UsageMetrics.get", "azure.mgmt.iotfirmwaredefense.aio.operations.UsageMetricsOperations.get": "Microsoft.IoTFirmwareDefense.UsageMetrics.get", "azure.mgmt.iotfirmwaredefense.operations.UsageMetricsOperations.list_by_workspace": "Microsoft.IoTFirmwareDefense.UsageMetrics.listByWorkspace", - "azure.mgmt.iotfirmwaredefense.aio.operations.UsageMetricsOperations.list_by_workspace": "Microsoft.IoTFirmwareDefense.UsageMetrics.listByWorkspace" - } + "azure.mgmt.iotfirmwaredefense.aio.operations.UsageMetricsOperations.list_by_workspace": "Microsoft.IoTFirmwareDefense.UsageMetrics.listByWorkspace", + "azure.mgmt.iotfirmwaredefense.operations.UnsafeFunctionCallsOperations.list_by_firmware": "Microsoft.IoTFirmwareDefense.UnsafeFunctionCalls.listByFirmware", + "azure.mgmt.iotfirmwaredefense.aio.operations.UnsafeFunctionCallsOperations.list_by_firmware": "Microsoft.IoTFirmwareDefense.UnsafeFunctionCalls.listByFirmware" + }, + "CrossLanguageVersion": "f13592507223" } \ No newline at end of file diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/__init__.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/__init__.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/__init__.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/__init__.py index 8db66d3d0f0f..d55ccad1f573 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/__init__.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/__init__.py @@ -1 +1 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_client.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_client.py index 91cbcc11bed8..c01fa4978f8b 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_client.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_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 @@ -29,15 +30,22 @@ PasswordHashesOperations, SbomComponentsOperations, SummariesOperations, + UnsafeFunctionCallsOperations, UsageMetricsOperations, WorkspacesOperations, ) +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 IoTFirmwareDefenseMgmtClient: # pylint: disable=too-many-instance-attributes +class IoTFirmwareDefenseMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Firmware & IoT Security REST API. :ivar operations: Operations operations @@ -63,24 +71,38 @@ class IoTFirmwareDefenseMgmtClient: # pylint: disable=too-many-instance-attribu :vartype summaries: azure.mgmt.iotfirmwaredefense.operations.SummariesOperations :ivar usage_metrics: UsageMetricsOperations operations :vartype usage_metrics: azure.mgmt.iotfirmwaredefense.operations.UsageMetricsOperations + :ivar unsafe_function_calls: UnsafeFunctionCallsOperations operations + :vartype unsafe_function_calls: + azure.mgmt.iotfirmwaredefense.operations.UnsafeFunctionCallsOperations :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. :type subscription_id: str :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2025-08-02". - Note that overriding this default value may result in unsupported behavior. + :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-06-01-preview" 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. """ def __init__( - self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any + self, + credential: "TokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any ) -> None: _endpoint = "{endpoint}" - _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: base_url = _endpoints["resource_manager"] @@ -89,6 +111,7 @@ def __init__( credential=credential, subscription_id=subscription_id, base_url=cast(str, base_url), + cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs ) @@ -131,6 +154,9 @@ def __init__( self.sbom_components = SbomComponentsOperations(self._client, self._config, self._serialize, self._deserialize) self.summaries = SummariesOperations(self._client, self._config, self._serialize, self._deserialize) self.usage_metrics = UsageMetricsOperations(self._client, self._config, self._serialize, self._deserialize) + self.unsafe_function_calls = UnsafeFunctionCallsOperations( + 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/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_configuration.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_configuration.py index d3a75575dbaa..dd50cb575ff8 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_configuration.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy @@ -14,10 +15,11 @@ from ._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials import TokenCredential -class IoTFirmwareDefenseMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class IoTFirmwareDefenseMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long,docstring-keyword-should-match-keyword-only """Configuration for IoTFirmwareDefenseMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -29,8 +31,13 @@ class IoTFirmwareDefenseMgmtClientConfiguration: # pylint: disable=too-many-ins :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2025-08-02". - Note that overriding this default value may result in unsupported behavior. + :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-06-01-preview" 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 """ @@ -39,9 +46,10 @@ def __init__( credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2025-08-02") + api_version: str = kwargs.pop("api_version", "2026-06-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,6 +59,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-iotfirmwaredefense/{}".format(VERSION)) diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_patch.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_patch.py index 8bcb627aa475..ea765788358a 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_patch.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_patch.py @@ -7,9 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_utils/model_base.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_utils/model_base.py index c62e7e7784af..35d5fc024978 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_utils/model_base.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_utils/model_base.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -23,20 +23,26 @@ 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"] TZ_UTC = timezone.utc _T = typing.TypeVar("_T") +_NONE_TYPE = type(None) def _timedelta_as_isostr(td: timedelta) -> str: @@ -103,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": @@ -129,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) @@ -171,6 +208,21 @@ def default(self, o): # pylint: disable=too-many-return-statements r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" ) +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: """Deserialize ISO-8601 formatted string into Datetime object. @@ -202,7 +254,7 @@ def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: test_utc = date_obj.utctimetuple() if test_utc.tm_year > 9999 or test_utc.tm_year < 1: raise OverflowError("Hit max or min date") - return date_obj + return date_obj # type: ignore[no-any-return] def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: @@ -256,7 +308,7 @@ def _deserialize_time(attr: typing.Union[str, time]) -> time: """ if isinstance(attr, time): return attr - return isodate.parse_time(attr) + return isodate.parse_time(attr) # type: ignore[no-any-return] def _deserialize_bytes(attr): @@ -280,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 @@ -292,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, @@ -309,12 +373,20 @@ 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: return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore @@ -346,16 +418,46 @@ def _get_model(module_name: str, model_name: str): class _MyMutableMapping(MutableMapping[str, typing.Any]): - def __init__(self, data: typing.Dict[str, typing.Any]) -> None: + def __init__(self, data: dict[str, typing.Any]) -> None: self._data = data def __contains__(self, key: typing.Any) -> bool: return key in self._data def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized return self._data.__getitem__(key) def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass self._data.__setitem__(key, value) def __delitem__(self, key: str) -> None: @@ -372,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() @@ -396,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: @@ -426,24 +528,24 @@ def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.pop(key) return self._data.pop(key, default) - def popitem(self) -> typing.Tuple[str, typing.Any]: + 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) @@ -456,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: @@ -467,6 +570,8 @@ def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: return self._data.setdefault(key, default) def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data try: other_model = self.__class__(other) except Exception: @@ -483,6 +588,8 @@ def _is_model(obj: typing.Any) -> bool: def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) return [_serialize(x, format) for x in o] if isinstance(o, dict): return {k: _serialize(v, format) for k, v in o.items()} @@ -507,16 +614,14 @@ 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 return o -def _get_rest_field( - attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str -) -> typing.Optional["_RestField"]: +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: try: return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) except StopIteration: @@ -535,69 +640,253 @@ 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 # could not see _attr_to_rest_field directly because subclass inherits it from parent class - _calculated: typing.Set[str] = set() + _calculated: set[str] = set() 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) - 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()} @@ -614,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__) @@ -624,7 +1022,7 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order - attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") } annotations = { @@ -639,7 +1037,10 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) if not rf._rest_name_input: rf._rest_name_input = attr - cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + 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) @@ -668,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 @@ -681,7 +1082,7 @@ def _deserialize(cls, data, exist_discriminators): mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member return mapped_cls._deserialize(data, exist_discriminators) - def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: """Return a dict that can be turned into json using json.dump. :keyword bool exclude_readonly: Whether to remove the readonly properties. @@ -741,7 +1142,7 @@ def _deserialize_with_union(deserializers, obj): def _deserialize_dict( value_deserializer: typing.Optional[typing.Callable], module: typing.Optional[str], - obj: typing.Dict[typing.Any, typing.Any], + obj: dict[typing.Any, typing.Any], ): if obj is None: return obj @@ -751,7 +1152,7 @@ def _deserialize_dict( def _deserialize_multiple_sequence( - entry_deserializers: typing.List[typing.Optional[typing.Callable]], + entry_deserializers: list[typing.Optional[typing.Callable]], module: typing.Optional[str], obj, ): @@ -760,6 +1161,14 @@ def _deserialize_multiple_sequence( return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + def _deserialize_sequence( deserializer: typing.Optional[typing.Callable], module: typing.Optional[str], @@ -769,17 +1178,30 @@ def _deserialize_sequence( return obj if isinstance(obj, ET.Element): obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) -def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.Any]: +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: return sorted( types, key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), ) -def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-branches +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches annotation: typing.Any, module: typing.Optional[str], rf: typing.Optional["_RestField"] = None, @@ -819,16 +1241,18 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur # is it optional? try: - if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True if len(annotation.__args__) <= 2: # pyright: ignore if_obj_deserializer = _get_deserialize_callable_from_annotation( - next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore ) return functools.partial(_deserialize_with_optional, if_obj_deserializer) # the type is Optional[Union[...]], we need to remove the None type from the Union annotation_copy = copy.copy(annotation) - annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a != type(None)] # pyright: ignore + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) except AttributeError: pass @@ -844,7 +1268,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur return functools.partial(_deserialize_with_union, deserializers) try: - if annotation._name == "Dict": # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": value_deserializer = _get_deserialize_callable_from_annotation( annotation.__args__[1], module, rf # pyright: ignore ) @@ -857,7 +1284,10 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur except (AttributeError, IndexError): pass try: - if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: if len(annotation.__args__) > 1: # pyright: ignore entry_deserializers = [ _get_deserialize_callable_from_annotation(dt, module, rf) @@ -906,16 +1336,20 @@ def _deserialize_with_callable( return float(value.text) if value.text else None if deserializer is bool: return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None if deserializer is None: return value if deserializer in [int, float, bool]: return deserializer(value) if isinstance(deserializer, CaseInsensitiveEnumMeta): try: - return deserializer(value) + return deserializer(value.text if isinstance(value, ET.Element) else value) except ValueError: # for unknown value, return raw value - return value + return value.text if isinstance(value, ET.Element) else value if isinstance(deserializer, type) and issubclass(deserializer, Model): return deserializer._deserialize(value, []) return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) @@ -948,7 +1382,7 @@ def _failsafe_deserialize( ) -> typing.Any: try: return _deserialize(deserializer, response.json(), module, rf, format) - except DeserializationError: + except Exception: # pylint: disable=broad-except _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -961,13 +1395,14 @@ def _failsafe_deserialize_xml( ) -> typing.Any: try: return _deserialize_xml(deserializer, response.text()) - except DeserializationError: + except Exception: # pylint: disable=broad-except _LOGGER.warning( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) return None +# pylint: disable=too-many-instance-attributes class _RestField: def __init__( self, @@ -975,11 +1410,12 @@ def __init__( name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin is_discriminator: bool = False, - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ): self._type = type self._rest_name_input = name @@ -987,14 +1423,20 @@ def __init__( self._is_discriminator = is_discriminator self._visibility = visibility self._is_model = False + self._is_optional = False self._default = default 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: - return getattr(self._type, "args", [None])[0] + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result @property def _rest_name(self) -> str: @@ -1005,14 +1447,44 @@ def _rest_name(self) -> str: 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 - item = obj.get(self._rest_name) + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + 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: return item - return _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + # 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 + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + if value is None: # we want to wipe out entries if users set attr to None try: @@ -1037,11 +1509,12 @@ def rest_field( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, + visibility: typing.Optional[list[str]] = None, default: typing.Any = _UNSET, format: typing.Optional[str] = None, is_multipart_file_input: bool = False, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, + deserializer: typing.Optional[typing.Callable] = None, ) -> typing.Any: return _RestField( name=name, @@ -1051,6 +1524,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + deserializer=deserializer, ) @@ -1058,8 +1532,8 @@ def rest_discriminator( *, name: typing.Optional[str] = None, type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin - visibility: typing.Optional[typing.List[str]] = None, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, ) -> typing.Any: return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) @@ -1075,21 +1549,77 @@ 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, - parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, wrapped_element: typing.Optional[ET.Element] = None, -) -> typing.Union[ET.Element, typing.List[ET.Element]]: +) -> typing.Union[ET.Element, list[ET.Element]]: if _is_model(o): model_meta = getattr(o, "_xml", {}) # 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 = [] @@ -1111,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") @@ -1123,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)) @@ -1137,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( @@ -1144,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, }, ) @@ -1153,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, }, ) @@ -1169,10 +1700,11 @@ def _get_element( def _get_wrapped_element( v: typing.Any, exclude_readonly: bool, - meta: typing.Optional[typing.Dict[str, typing.Any]], + 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)) @@ -1180,7 +1712,7 @@ def _get_wrapped_element( _get_element(v, exclude_readonly, meta, wrapped_element) else: wrapped_element.text = _get_primitive_type_value(v) - return wrapped_element + return wrapped_element # type: ignore[no-any-return] def _get_primitive_type_value(v) -> str: @@ -1193,9 +1725,29 @@ def _get_primitive_type_value(v) -> str: return str(v) -def _create_xml_element(tag, prefix=None, ns=None): - if prefix and ns: +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: + _safe_register_namespace(prefix, ns) if ns: return ET.Element("{" + ns + "}" + tag) return ET.Element(tag) @@ -1206,13 +1758,15 @@ def _deserialize_xml( value: str, ) -> typing.Any: element = ET.fromstring(value) # nosec + if _is_model(deserializer): + return deserializer._deserialize(element, []) return _deserialize(deserializer, element) def _convert_element(e: ET.Element): # dict case if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: - dict_result: typing.Dict[str, typing.Any] = {} + dict_result: dict[str, typing.Any] = {} for child in e: if dict_result.get(child.tag) is not None: if isinstance(dict_result[child.tag], list): @@ -1225,7 +1779,7 @@ def _convert_element(e: ET.Element): return dict_result # array case if len(e) > 0: - array_result: typing.List[typing.Any] = [] + array_result: list[typing.Any] = [] for child in e: array_result.append(_convert_element(child)) return array_result diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_utils/serialization.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_utils/serialization.py index eb86ea23c965..ae08f9d89f74 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_utils/serialization.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_utils/serialization.py @@ -21,7 +21,6 @@ import sys import codecs from typing import ( - Dict, Any, cast, Optional, @@ -31,7 +30,6 @@ Mapping, Callable, MutableMapping, - List, ) try: @@ -41,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] @@ -229,12 +231,12 @@ class Model: serialization and deserialization. """ - _subtype_map: Dict[str, Dict[str, Any]] = {} - _attribute_map: Dict[str, Dict[str, Any]] = {} - _validation: Dict[str, Dict[str, Any]] = {} + _subtype_map: dict[str, dict[str, Any]] = {} + _attribute_map: dict[str, dict[str, Any]] = {} + _validation: dict[str, dict[str, Any]] = {} def __init__(self, **kwargs: Any) -> None: - self.additional_properties: Optional[Dict[str, Any]] = {} + self.additional_properties: Optional[dict[str, Any]] = {} for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) @@ -311,7 +313,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: def as_dict( self, keep_readonly: bool = True, - key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer, **kwargs: Any ) -> JSON: """Return a dict that can be serialized using json.dump. @@ -380,7 +382,7 @@ def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self: def from_dict( cls, data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None, content_type: Optional[str] = None, ) -> Self: """Parse a dict using given key extractor return a model. @@ -414,7 +416,7 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access return result @classmethod @@ -478,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"} @@ -518,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, @@ -528,7 +538,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: "[]": self.serialize_iter, "{}": self.serialize_dict, } - self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_transformer = full_restapi_key_transformer self.client_side_validation = True @@ -579,7 +589,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to if attr_name == "additional_properties" and attr_desc["key"] == "": if target_obj.additional_properties is not None: - serialized.update(target_obj.additional_properties) + serialized |= target_obj.additional_properties continue try: @@ -789,7 +799,7 @@ def serialize_data(self, data, data_type, **kwargs): # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -823,13 +833,20 @@ def serialize_basic(cls, data, data_type, **kwargs): :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @classmethod def serialize_unicode(cls, data): @@ -1100,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. @@ -1184,7 +1256,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen while "." in key: # Need the cast, as for some reasons "split" is typed as list[str | Any] - dict_keys = cast(List[str], _FLATTEN.split(key)) + dict_keys = cast(list[str], _FLATTEN.split(key)) if len(dict_keys) == 1: key = _decode_attribute_map_key(dict_keys[0]) break @@ -1372,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, @@ -1384,9 +1460,13 @@ 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 {} + self.dependencies: dict[str, type] = dict(classes) if classes else {} self.key_extractors = [rest_key_extractor, xml_key_extractor] # Additional properties only works if the "rest_key_extractor" is used to # extract the keys. Making it to work whatever the key extractor is too much @@ -1396,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. @@ -1406,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) @@ -1759,7 +1860,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises TypeError: if string format is not valid. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1785,7 +1886,11 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): @@ -1920,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/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_version.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_version.py index 8f2350dd3b0c..5e17bc520983 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_version.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "2.1.0b1" diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/_client.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/_client.py index 3d59c7fd10e0..697aea64dc67 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/_client.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/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 @@ -29,15 +30,22 @@ PasswordHashesOperations, SbomComponentsOperations, SummariesOperations, + UnsafeFunctionCallsOperations, UsageMetricsOperations, WorkspacesOperations, ) +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 IoTFirmwareDefenseMgmtClient: # pylint: disable=too-many-instance-attributes +class IoTFirmwareDefenseMgmtClient: # pylint: disable=too-many-instance-attributes,docstring-keyword-should-match-keyword-only """Firmware & IoT Security REST API. :ivar operations: Operations operations @@ -64,24 +72,38 @@ class IoTFirmwareDefenseMgmtClient: # pylint: disable=too-many-instance-attribu :vartype summaries: azure.mgmt.iotfirmwaredefense.aio.operations.SummariesOperations :ivar usage_metrics: UsageMetricsOperations operations :vartype usage_metrics: azure.mgmt.iotfirmwaredefense.aio.operations.UsageMetricsOperations + :ivar unsafe_function_calls: UnsafeFunctionCallsOperations operations + :vartype unsafe_function_calls: + azure.mgmt.iotfirmwaredefense.aio.operations.UnsafeFunctionCallsOperations :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. :type subscription_id: str :param base_url: Service host. Default value is None. :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2025-08-02". - Note that overriding this default value may result in unsupported behavior. + :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-06-01-preview" 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. """ def __init__( - self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + *, + cloud_setting: Optional["AzureClouds"] = None, + **kwargs: Any ) -> None: _endpoint = "{endpoint}" - _cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore + _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: base_url = _endpoints["resource_manager"] @@ -90,6 +112,7 @@ def __init__( credential=credential, subscription_id=subscription_id, base_url=cast(str, base_url), + cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs ) @@ -134,6 +157,9 @@ def __init__( self.sbom_components = SbomComponentsOperations(self._client, self._config, self._serialize, self._deserialize) self.summaries = SummariesOperations(self._client, self._config, self._serialize, self._deserialize) self.usage_metrics = UsageMetricsOperations(self._client, self._config, self._serialize, self._deserialize) + self.unsafe_function_calls = UnsafeFunctionCallsOperations( + self._client, self._config, self._serialize, self._deserialize + ) def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/_configuration.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/_configuration.py index ca79ca9e6fa6..85058544ede6 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/_configuration.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/_configuration.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,7 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, TYPE_CHECKING +from typing import Any, Optional, TYPE_CHECKING from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy @@ -14,10 +15,11 @@ from .._version import VERSION if TYPE_CHECKING: + from azure.core import AzureClouds from azure.core.credentials_async import AsyncTokenCredential -class IoTFirmwareDefenseMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long +class IoTFirmwareDefenseMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long,docstring-keyword-should-match-keyword-only """Configuration for IoTFirmwareDefenseMgmtClient. Note that all parameters used to create this instance are saved as instance @@ -29,8 +31,13 @@ class IoTFirmwareDefenseMgmtClientConfiguration: # pylint: disable=too-many-ins :type subscription_id: str :param base_url: Service host. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: The API version to use for this operation. Default value is "2025-08-02". - Note that overriding this default value may result in unsupported behavior. + :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-06-01-preview" 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 """ @@ -39,9 +46,10 @@ def __init__( credential: "AsyncTokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", + cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2025-08-02") + api_version: str = kwargs.pop("api_version", "2026-06-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -51,6 +59,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.base_url = base_url + self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-iotfirmwaredefense/{}".format(VERSION)) diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/_patch.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/_patch.py index 8bcb627aa475..ea765788358a 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/_patch.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/_patch.py @@ -7,9 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/operations/__init__.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/operations/__init__.py index 2339df4fdd09..731a3621abc4 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/operations/__init__.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/operations/__init__.py @@ -23,6 +23,7 @@ from ._operations import SbomComponentsOperations # type: ignore from ._operations import SummariesOperations # type: ignore from ._operations import UsageMetricsOperations # type: ignore +from ._operations import UnsafeFunctionCallsOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -40,6 +41,7 @@ "SbomComponentsOperations", "SummariesOperations", "UsageMetricsOperations", + "UnsafeFunctionCallsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/operations/_operations.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/operations/_operations.py index 378c0d53bfd2..0eb61aa24dcd 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/operations/_operations.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/operations/_operations.py @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -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 @@ -52,6 +52,7 @@ build_sbom_components_list_by_firmware_request, build_summaries_get_request, build_summaries_list_by_firmware_request, + build_unsafe_function_calls_list_by_firmware_request, build_usage_metrics_get_request, build_usage_metrics_list_by_workspace_request, build_workspaces_create_request, @@ -65,11 +66,11 @@ from .._configuration import IoTFirmwareDefenseMgmtClientConfiguration T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +List = list -class Operations: +class Operations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -136,7 +137,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( @@ -149,7 +153,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -165,7 +172,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -173,7 +183,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class FirmwaresOperations: +class FirmwaresOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -236,6 +246,7 @@ async def get( } _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 @@ -250,11 +261,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Firmware, response.json()) @@ -299,7 +313,7 @@ async def create( resource_group_name: str, workspace_name: str, firmware_id: str, - resource: JSON, + resource: _types.Firmware, *, content_type: str = "application/json", **kwargs: Any @@ -314,7 +328,7 @@ async def create( :param firmware_id: The id of the firmware. Required. :type firmware_id: str :param resource: Details of the firmware being created or updated. Required. - :type resource: JSON + :type resource: ~azure.mgmt.iotfirmwaredefense.types.Firmware :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -359,7 +373,7 @@ async def create( resource_group_name: str, workspace_name: str, firmware_id: str, - resource: Union[_models.Firmware, JSON, IO[bytes]], + resource: Union[_models.Firmware, _types.Firmware, IO[bytes]], **kwargs: Any ) -> _models.Firmware: """The operation to create a firmware. @@ -371,9 +385,10 @@ async def create( :type workspace_name: str :param firmware_id: The id of the firmware. Required. :type firmware_id: str - :param resource: Details of the firmware being created or updated. Is one of the following - types: Firmware, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.iotfirmwaredefense.models.Firmware or JSON or IO[bytes] + :param resource: Details of the firmware being created or updated. Is either a Firmware type or + a IO[bytes] type. Required. + :type resource: ~azure.mgmt.iotfirmwaredefense.models.Firmware or + ~azure.mgmt.iotfirmwaredefense.types.Firmware or IO[bytes] :return: Firmware. The Firmware is compatible with MutableMapping :rtype: ~azure.mgmt.iotfirmwaredefense.models.Firmware :raises ~azure.core.exceptions.HttpResponseError: @@ -415,6 +430,7 @@ async def create( } _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 @@ -429,11 +445,14 @@ async def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Firmware, response.json()) @@ -478,7 +497,7 @@ async def update( resource_group_name: str, workspace_name: str, firmware_id: str, - properties: JSON, + properties: _types.FirmwareUpdateDefinition, *, content_type: str = "application/json", **kwargs: Any @@ -493,7 +512,7 @@ async def update( :param firmware_id: The id of the firmware. Required. :type firmware_id: str :param properties: Details of the firmware being created or updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.iotfirmwaredefense.types.FirmwareUpdateDefinition :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -538,7 +557,7 @@ async def update( resource_group_name: str, workspace_name: str, firmware_id: str, - properties: Union[_models.FirmwareUpdateDefinition, JSON, IO[bytes]], + properties: Union[_models.FirmwareUpdateDefinition, _types.FirmwareUpdateDefinition, IO[bytes]], **kwargs: Any ) -> _models.Firmware: """The operation to update firmware. @@ -550,10 +569,10 @@ async def update( :type workspace_name: str :param firmware_id: The id of the firmware. Required. :type firmware_id: str - :param properties: Details of the firmware being created or updated. Is one of the following - types: FirmwareUpdateDefinition, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.iotfirmwaredefense.models.FirmwareUpdateDefinition or JSON or - IO[bytes] + :param properties: Details of the firmware being created or updated. Is either a + FirmwareUpdateDefinition type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.iotfirmwaredefense.models.FirmwareUpdateDefinition or + ~azure.mgmt.iotfirmwaredefense.types.FirmwareUpdateDefinition or IO[bytes] :return: Firmware. The Firmware is compatible with MutableMapping :rtype: ~azure.mgmt.iotfirmwaredefense.models.Firmware :raises ~azure.core.exceptions.HttpResponseError: @@ -595,6 +614,7 @@ async def update( } _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 @@ -609,11 +629,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Firmware, response.json()) @@ -673,7 +696,10 @@ async def delete(self, resource_group_name: str, workspace_name: str, firmware_i if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -736,7 +762,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( @@ -749,7 +778,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Firmware], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Firmware], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -765,7 +797,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -773,7 +808,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class WorkspacesOperations: +class WorkspacesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -831,6 +866,7 @@ async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any } _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 @@ -845,11 +881,14 @@ async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Workspace, response.json()) @@ -890,7 +929,7 @@ async def create( self, resource_group_name: str, workspace_name: str, - resource: JSON, + resource: _types.Workspace, *, content_type: str = "application/json", **kwargs: Any @@ -903,7 +942,7 @@ async def create( :param workspace_name: The name of the firmware analysis workspace. Required. :type workspace_name: str :param resource: Parameters when creating a firmware analysis workspace. Required. - :type resource: JSON + :type resource: ~azure.mgmt.iotfirmwaredefense.types.Workspace :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -944,7 +983,7 @@ async def create( self, resource_group_name: str, workspace_name: str, - resource: Union[_models.Workspace, JSON, IO[bytes]], + resource: Union[_models.Workspace, _types.Workspace, IO[bytes]], **kwargs: Any ) -> _models.Workspace: """The operation to create or update a firmware analysis workspace. @@ -954,9 +993,10 @@ async def create( :type resource_group_name: str :param workspace_name: The name of the firmware analysis workspace. Required. :type workspace_name: str - :param resource: Parameters when creating a firmware analysis workspace. Is one of the - following types: Workspace, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.iotfirmwaredefense.models.Workspace or JSON or IO[bytes] + :param resource: Parameters when creating a firmware analysis workspace. Is either a Workspace + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.iotfirmwaredefense.models.Workspace or + ~azure.mgmt.iotfirmwaredefense.types.Workspace or IO[bytes] :return: Workspace. The Workspace is compatible with MutableMapping :rtype: ~azure.mgmt.iotfirmwaredefense.models.Workspace :raises ~azure.core.exceptions.HttpResponseError: @@ -997,6 +1037,7 @@ async def create( } _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 @@ -1011,11 +1052,14 @@ async def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Workspace, response.json()) @@ -1056,7 +1100,7 @@ async def update( self, resource_group_name: str, workspace_name: str, - properties: JSON, + properties: _types.WorkspaceUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -1069,7 +1113,7 @@ async def update( :param workspace_name: The name of the firmware analysis workspace. Required. :type workspace_name: str :param properties: Parameters when updating a firmware analysis workspace. Required. - :type properties: JSON + :type properties: ~azure.mgmt.iotfirmwaredefense.types.WorkspaceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1110,7 +1154,7 @@ async def update( self, resource_group_name: str, workspace_name: str, - properties: Union[_models.WorkspaceUpdate, JSON, IO[bytes]], + properties: Union[_models.WorkspaceUpdate, _types.WorkspaceUpdate, IO[bytes]], **kwargs: Any ) -> _models.Workspace: """The operation to update a firmware analysis workspaces. @@ -1120,9 +1164,10 @@ async def update( :type resource_group_name: str :param workspace_name: The name of the firmware analysis workspace. Required. :type workspace_name: str - :param properties: Parameters when updating a firmware analysis workspace. Is one of the - following types: WorkspaceUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.iotfirmwaredefense.models.WorkspaceUpdate or JSON or IO[bytes] + :param properties: Parameters when updating a firmware analysis workspace. Is either a + WorkspaceUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.iotfirmwaredefense.models.WorkspaceUpdate or + ~azure.mgmt.iotfirmwaredefense.types.WorkspaceUpdate or IO[bytes] :return: Workspace. The Workspace is compatible with MutableMapping :rtype: ~azure.mgmt.iotfirmwaredefense.models.Workspace :raises ~azure.core.exceptions.HttpResponseError: @@ -1163,6 +1208,7 @@ async def update( } _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 @@ -1177,11 +1223,14 @@ async def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Workspace, response.json()) @@ -1193,7 +1242,7 @@ async def update( @api_version_validation( method_added_on="2025-08-02", params_added_on={"2025-08-02": ["api_version", "subscription_id", "resource_group_name", "workspace_name"]}, - api_versions_list=["2025-08-02"], + api_versions_list=["2025-08-02", "2025-12-01-preview", "2026-06-01-preview"], ) async def _delete_initial( self, resource_group_name: str, workspace_name: str, **kwargs: Any @@ -1224,6 +1273,7 @@ async def _delete_initial( } _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 @@ -1237,7 +1287,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1245,7 +1298,7 @@ async def _delete_initial( 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1256,7 +1309,7 @@ async def _delete_initial( @api_version_validation( method_added_on="2025-08-02", params_added_on={"2025-08-02": ["api_version", "subscription_id", "resource_group_name", "workspace_name"]}, - api_versions_list=["2025-08-02"], + api_versions_list=["2025-08-02", "2025-12-01-preview", "2026-06-01-preview"], ) async def begin_delete(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> AsyncLROPoller[None]: """The operation to delete a firmware analysis workspace. @@ -1367,7 +1420,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( @@ -1380,7 +1436,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Workspace], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Workspace], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1396,7 +1455,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1452,7 +1514,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( @@ -1465,7 +1530,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Workspace], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Workspace], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1481,7 +1549,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1520,7 +1591,7 @@ async def generate_upload_url( self, resource_group_name: str, workspace_name: str, - body: JSON, + body: _types.GenerateUploadUrlRequest, *, content_type: str = "application/json", **kwargs: Any @@ -1533,7 +1604,7 @@ async def generate_upload_url( :param workspace_name: The name of the firmware analysis workspace. Required. :type workspace_name: str :param body: Parameters when requesting a URL to upload firmware. Required. - :type body: JSON + :type body: ~azure.mgmt.iotfirmwaredefense.types.GenerateUploadUrlRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1574,7 +1645,7 @@ async def generate_upload_url( self, resource_group_name: str, workspace_name: str, - body: Union[_models.GenerateUploadUrlRequest, JSON, IO[bytes]], + body: Union[_models.GenerateUploadUrlRequest, _types.GenerateUploadUrlRequest, IO[bytes]], **kwargs: Any ) -> _models.UrlToken: """Generate a URL for uploading a firmware image. @@ -1584,9 +1655,10 @@ async def generate_upload_url( :type resource_group_name: str :param workspace_name: The name of the firmware analysis workspace. Required. :type workspace_name: str - :param body: Parameters when requesting a URL to upload firmware. Is one of the following - types: GenerateUploadUrlRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.iotfirmwaredefense.models.GenerateUploadUrlRequest or JSON or IO[bytes] + :param body: Parameters when requesting a URL to upload firmware. Is either a + GenerateUploadUrlRequest type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.iotfirmwaredefense.models.GenerateUploadUrlRequest or + ~azure.mgmt.iotfirmwaredefense.types.GenerateUploadUrlRequest or IO[bytes] :return: UrlToken. The UrlToken is compatible with MutableMapping :rtype: ~azure.mgmt.iotfirmwaredefense.models.UrlToken :raises ~azure.core.exceptions.HttpResponseError: @@ -1627,6 +1699,7 @@ async def generate_upload_url( } _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 @@ -1641,11 +1714,14 @@ async def generate_upload_url( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.UrlToken, response.json()) @@ -1655,7 +1731,7 @@ async def generate_upload_url( return deserialized # type: ignore -class BinaryHardeningOperations: +class BinaryHardeningOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1735,7 +1811,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( @@ -1748,7 +1827,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.BinaryHardeningResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.BinaryHardeningResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1764,7 +1846,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1772,7 +1857,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class CryptoCertificatesOperations: +class CryptoCertificatesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1852,7 +1937,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( @@ -1865,7 +1953,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.CryptoCertificateResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.CryptoCertificateResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1881,7 +1972,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1889,7 +1983,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class CryptoKeysOperations: +class CryptoKeysOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1969,7 +2063,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( @@ -1982,7 +2079,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.CryptoKeyResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.CryptoKeyResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1998,7 +2098,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2006,7 +2109,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class CvesOperations: +class CvesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2038,7 +2141,7 @@ def __init__(self, *args, **kwargs) -> None: "accept", ] }, - api_versions_list=["2025-08-02"], + api_versions_list=["2025-08-02", "2025-12-01-preview", "2026-06-01-preview"], ) def list_by_firmware( self, resource_group_name: str, workspace_name: str, firmware_id: str, **kwargs: Any @@ -2100,7 +2203,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( @@ -2113,7 +2219,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.CveResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.CveResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2129,7 +2238,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2137,7 +2249,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class PasswordHashesOperations: +class PasswordHashesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2217,7 +2329,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( @@ -2230,7 +2345,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.PasswordHashResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.PasswordHashResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2246,7 +2364,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2254,7 +2375,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class SbomComponentsOperations: +class SbomComponentsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2334,7 +2455,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( @@ -2347,7 +2471,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SbomComponentResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SbomComponentResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2363,7 +2490,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2371,7 +2501,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class SummariesOperations: +class SummariesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2410,7 +2540,8 @@ async def get( :type firmware_id: str :param summary_type: The Firmware analysis summary name describing the type of summary. Known values are: "Firmware", "CommonVulnerabilitiesAndExposures", "BinaryHardening", - "CryptoCertificate", and "CryptoKey". Required. + "CryptoCertificate", "CryptoKey", "CVE", "SBOM", "PasswordHash", and "UnsafeFunctionCalls". + Required. :type summary_type: str or ~azure.mgmt.iotfirmwaredefense.models.SummaryType :return: SummaryResource. The SummaryResource is compatible with MutableMapping :rtype: ~azure.mgmt.iotfirmwaredefense.models.SummaryResource @@ -2444,6 +2575,7 @@ async def get( } _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 @@ -2458,11 +2590,14 @@ async def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SummaryResource, response.json()) @@ -2533,7 +2668,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( @@ -2546,7 +2684,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SummaryResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SummaryResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2562,7 +2703,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2570,7 +2714,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) -class UsageMetricsOperations: +class UsageMetricsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2631,6 +2775,7 @@ async def get(self, resource_group_name: str, workspace_name: str, name: str, ** } _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 @@ -2645,11 +2790,14 @@ async def get(self, resource_group_name: str, workspace_name: str, name: str, ** except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.UsageMetric, response.json()) @@ -2716,7 +2864,150 @@ 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( + "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.UsageMetric], + 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 UnsafeFunctionCallsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.iotfirmwaredefense.aio.IoTFirmwareDefenseMgmtClient`'s + :attr:`unsafe_function_calls` 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: IoTFirmwareDefenseMgmtClientConfiguration = ( + 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-06-01-preview", + params_added_on={ + "2026-06-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "firmware_id", + "accept", + ] + }, + api_versions_list=["2026-06-01-preview"], + ) + def list_by_firmware( + self, resource_group_name: str, workspace_name: str, firmware_id: str, **kwargs: Any + ) -> AsyncItemPaged["_models.UnsafeFunctionCallsResource"]: + """Lists unsafe function call analysis results of a firmware. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The name of the firmware analysis workspace. Required. + :type workspace_name: str + :param firmware_id: The id of the firmware. Required. + :type firmware_id: str + :return: An iterator like instance of UnsafeFunctionCallsResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.iotfirmwaredefense.models.UnsafeFunctionCallsResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.UnsafeFunctionCallsResource]] = 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_unsafe_function_calls_list_by_firmware_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + firmware_id=firmware_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) + + 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( @@ -2729,7 +3020,10 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.UsageMetric], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.UnsafeFunctionCallsResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2745,7 +3039,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/operations/_patch.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/operations/_patch.py index 8bcb627aa475..ea765788358a 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/operations/_patch.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/aio/operations/_patch.py @@ -7,9 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/__init__.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/__init__.py index 59238efc75ca..4cdbaaf68307 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/__init__.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/__init__.py @@ -30,7 +30,10 @@ CveResource, CveResult, CveSummary, + CveSummaryResource, CvssScore, + CweProperties, + EpssProperties, ErrorAdditionalInfo, ErrorDetail, ErrorResponse, @@ -38,22 +41,29 @@ FirmwareProperties, FirmwareSummary, FirmwareUpdateDefinition, + FunctionCall, GenerateUploadUrlRequest, + KevProperties, Operation, OperationDisplay, PairedKey, PasswordHash, PasswordHashResource, + PasswordHashSummaryResource, ProxyResource, Resource, SbomComponent, SbomComponentResource, + SbomSummaryResource, Sku, StatusMessage, SummaryResource, SummaryResourceProperties, SystemData, TrackedResource, + UnsafeFunctionCallsResource, + UnsafeFunctionCallsResult, + UnsafeFunctionCallsSummaryResource, UrlToken, UsageMetric, UsageMetricProperties, @@ -68,8 +78,10 @@ CreatedByType, CryptoKeyType, ExecutableClass, + ExploitMaturityLevel, Origin, ProvisioningState, + RansomwareCampaignUse, SkuTier, Status, SummaryType, @@ -95,7 +107,10 @@ "CveResource", "CveResult", "CveSummary", + "CveSummaryResource", "CvssScore", + "CweProperties", + "EpssProperties", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", @@ -103,22 +118,29 @@ "FirmwareProperties", "FirmwareSummary", "FirmwareUpdateDefinition", + "FunctionCall", "GenerateUploadUrlRequest", + "KevProperties", "Operation", "OperationDisplay", "PairedKey", "PasswordHash", "PasswordHashResource", + "PasswordHashSummaryResource", "ProxyResource", "Resource", "SbomComponent", "SbomComponentResource", + "SbomSummaryResource", "Sku", "StatusMessage", "SummaryResource", "SummaryResourceProperties", "SystemData", "TrackedResource", + "UnsafeFunctionCallsResource", + "UnsafeFunctionCallsResult", + "UnsafeFunctionCallsSummaryResource", "UrlToken", "UsageMetric", "UsageMetricProperties", @@ -130,8 +152,10 @@ "CreatedByType", "CryptoKeyType", "ExecutableClass", + "ExploitMaturityLevel", "Origin", "ProvisioningState", + "RansomwareCampaignUse", "SkuTier", "Status", "SummaryType", diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/_enums.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/_enums.py index 1f9931eee1a3..fee406e69c5a 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/_enums.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/_enums.py @@ -23,39 +23,39 @@ class CertificateUsage(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Activities for which the cryptographic certificate can be used.""" DIGITAL_SIGNATURE = "digitalSignature" - """This certificate can be used to add a signature to a message""" + """This certificate can be used to add a signature to a message.""" NON_REPUDIATION = "nonRepudiation" """This certificates provides a non-repudiation service that protects against false denial of a - message""" + message.""" CONTENT_COMMITMENT = "contentCommitment" - """A synonym for NonRepudiation used in newer x509 certificates""" + """A synonym for NonRepudiation used in newer x509 certificates.""" KEY_ENCIPHERMENT = "keyEncipherment" - """This certificate can be used to encrypt a private or secret key""" + """This certificate can be used to encrypt a private or secret key.""" DATA_ENCIPHERMENT = "dataEncipherment" - """This certificate can be used to decrypt a private or secret key""" + """This certificate can be used to decrypt a private or secret key.""" KEY_AGREEMENT = "keyAgreement" """This certificate can be used to perform a key agreement, such as with a Diffie-Hellman key - exchange""" + exchange.""" KEY_CERT_SIGN = "keyCertSign" - """This certificate can be used to verify a other public keys""" + """This certificate can be used to verify a other public keys.""" CRL_SIGN = "crlSign" - """This certificate can be used to verify a certificate revocation list""" + """This certificate can be used to verify a certificate revocation list.""" ENCIPHER_ONLY = "encipherOnly" - """This certificate can be only be used to encrypt data""" + """This certificate can be only be used to encrypt data.""" DECIPHER_ONLY = "decipherOnly" - """This certificate can only be used to decrypt data""" + """This certificate can only be used to decrypt data.""" SERVER_AUTHENTICATION = "serverAuth" - """This certificate can be used to authenticate a server in a TLS/SSL connection""" + """This certificate can be used to authenticate a server in a TLS/SSL connection.""" CLIENT_AUTHENTICATION = "clientAuth" - """This certificate can be used to authenticate a client in a TLS/SSL connection""" + """This certificate can be used to authenticate a client in a TLS/SSL connection.""" CODE_SIGNING = "codeSigning" - """This certificate can be used to authenticate a code object""" + """This certificate can be used to authenticate a code object.""" EMAIL_PROTECTION = "emailProtection" - """This certificate can be used to authenticate an email address""" + """This certificate can be used to authenticate an email address.""" TIME_STAMPING = "timeStamping" - """This certificate binds the hash of an object to a time""" + """This certificate binds the hash of an object to a time.""" OCSP_SIGNING = "ocspSigning" - """This certificate can be used to sign OCSP responses""" + """This certificate can be used to sign OCSP responses.""" class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -89,6 +89,29 @@ class ExecutableClass(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The binary is 64-bit.""" +class ExploitMaturityLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """String to indicate the exploit maturity of a CVE for the given CVSS score.""" + + NOT_DEFINED = "NOT_DEFINED" + """Reliable threat intelligence is not available to determine Exploit Maturity characteristics. + This is the default value and is equivalent to Attacked (A) for the purposes of the calculation + of the score by assuming the worst case.""" + ATTACKED = "ATTACKED" + """Based on available threat intelligence either of the following must apply: attacks targeting + this vulnerability (attempted or successful) have been reported, or solutions to simplify + attempts to exploit the vulnerability are publicly or privately available.""" + PROOF_OF_CONCEPT = "PROOF_OF_CONCEPT" + """Based on available threat intelligence each of the following must apply: proof-of-concept + exploit code is publicly available, no knowledge of reported attempts to exploit this + vulnerability, and no knowledge of publicly available solutions used to simplify attempts to + exploit the vulnerability.""" + UNREPORTED = "UNREPORTED" + """Based on available threat intelligence each of the following must apply: no knowledge of + publicly available proof-of-concept exploit code, no knowledge of reported attempts to exploit + this vulnerability, and no knowledge of publicly available solutions used to simplify attempts + to exploit the vulnerability.""" + + 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". @@ -112,11 +135,22 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): CANCELED = "Canceled" """The request was canceled.""" PENDING = "Pending" - """The request is queued and awaiting execution""" + """The request is queued and awaiting execution.""" EXTRACTING = "Extracting" """The Firmware is currently being extracted.""" ANALYZING = "Analyzing" - """Analysis is being run on the firmware""" + """Analysis is being run on the firmware.""" + + +class RansomwareCampaignUse(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """String to indicate if a vulnerability is known to have been leveraged as part of a ransomware + campaign. + """ + + KNOWN = "Known" + """CISA knows the vulnerability to have been leveraged in a ransomware campaign.""" + UNKNOWN = "Unknown" + """CISA lacks confirmation the vulnerability has been utilized for ransomware.""" class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -138,28 +172,36 @@ class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The status of a firmware analysis job.""" PENDING = "Pending" - """The analysis job is queued""" + """The analysis job is queued.""" EXTRACTING = "Extracting" - """The firmware is currently being extracted""" + """The firmware is currently being extracted.""" ANALYZING = "Analyzing" - """Analysis is being run on the firmware""" + """Analysis is being run on the firmware.""" READY = "Ready" - """Analysis job results are ready""" + """Analysis job results are ready.""" ERROR = "Error" - """An error occurred while running firmware analysis""" + """An error occurred while running firmware analysis.""" class SummaryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Describes the type of summary.""" FIRMWARE = "Firmware" - """The summary contains information about the submitted firmware""" + """The summary contains information about the submitted firmware.""" COMMON_VULNERABILITIES_AND_EXPOSURES = "CommonVulnerabilitiesAndExposures" - """The summary contains information about the Common Vulnerabilities and Exposures analysis - results""" + """The summary contains information about the CVE (Common Vulnerabilities and Exposures) analysis + results (deprecated).""" BINARY_HARDENING = "BinaryHardening" - """The summary contains information about the binary hardening analysis results""" + """The summary contains information about the binary hardening analysis results.""" CRYPTO_CERTIFICATE = "CryptoCertificate" - """The summary contains information about the cryptographic certificate analysis results""" + """The summary contains information about the cryptographic certificate analysis results.""" CRYPTO_KEY = "CryptoKey" - """The summary contains information about the cryptographic key analysis results""" + """The summary contains information about the cryptographic key analysis results.""" + CVE = "CVE" + """The summary contains information about the CVE analysis results.""" + SBOM = "SBOM" + """The summary contains information about the SBOM (Software Bill of Materials) analysis results.""" + PASSWORD_HASH = "PasswordHash" + """The summary contains information about the password hash analysis results.""" + UNSAFE_FUNCTION_CALLS = "UnsafeFunctionCalls" + """The summary contains information about the unsafe function call analysis results.""" diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/_models.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/_models.py index bf343939e568..1f446eae4a73 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/_models.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/_models.py @@ -9,7 +9,7 @@ # pylint: disable=useless-super-delegation import datetime -from typing import Any, Dict, List, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload +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 SummaryType @@ -18,7 +18,7 @@ from .. import models as _models -class BinaryHardeningFeatures(_Model): +class BinaryHardeningFeatures(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Binary hardening features. :ivar no_execute: Flag indicating the binary's stack is set to NX (no-execute). @@ -119,7 +119,7 @@ class ProxyResource(Resource): """ -class BinaryHardeningResource(ProxyResource): +class BinaryHardeningResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """The object representing a firmware analysis binary hardening result resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -189,7 +189,7 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class BinaryHardeningResult(_Model): +class BinaryHardeningResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Binary hardening of a firmware. :ivar binary_hardening_id: ID for the binary hardening result. @@ -269,28 +269,30 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SummaryResourceProperties(_Model): +class SummaryResourceProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties of an analysis summary. You probably want to use the sub-classes and not this class directly. Known sub-classes are: - BinaryHardeningSummaryResource, CveSummary, CryptoCertificateSummaryResource, - CryptoKeySummaryResource, FirmwareSummary + BinaryHardeningSummaryResource, CveSummaryResource, CveSummary, + CryptoCertificateSummaryResource, CryptoKeySummaryResource, FirmwareSummary, + PasswordHashSummaryResource, SbomSummaryResource, UnsafeFunctionCallsSummaryResource :ivar summary_type: The type of summary. Required. Known values are: "Firmware", - "CommonVulnerabilitiesAndExposures", "BinaryHardening", "CryptoCertificate", and "CryptoKey". + "CommonVulnerabilitiesAndExposures", "BinaryHardening", "CryptoCertificate", "CryptoKey", + "CVE", "SBOM", "PasswordHash", and "UnsafeFunctionCalls". :vartype summary_type: str or ~azure.mgmt.iotfirmwaredefense.models.SummaryType :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", "Failed", "Canceled", "Pending", "Extracting", and "Analyzing". :vartype provisioning_state: str or ~azure.mgmt.iotfirmwaredefense.models.ProvisioningState """ - __mapping__: Dict[str, _Model] = {} + __mapping__: dict[str, _Model] = {} summary_type: str = rest_discriminator( name="summaryType", visibility=["read", "create", "update", "delete", "query"] ) """The type of summary. Required. Known values are: \"Firmware\", - \"CommonVulnerabilitiesAndExposures\", \"BinaryHardening\", \"CryptoCertificate\", and - \"CryptoKey\".""" + \"CommonVulnerabilitiesAndExposures\", \"BinaryHardening\", \"CryptoCertificate\", + \"CryptoKey\", \"CVE\", \"SBOM\", \"PasswordHash\", and \"UnsafeFunctionCalls\".""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) @@ -315,7 +317,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class BinaryHardeningSummaryResource(SummaryResourceProperties, discriminator="BinaryHardening"): +class BinaryHardeningSummaryResource( + SummaryResourceProperties, discriminator="BinaryHardening" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties for a binary hardening analysis summary. :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", @@ -337,7 +341,7 @@ class BinaryHardeningSummaryResource(SummaryResourceProperties, discriminator="B :ivar stripped_binary_count: Total number of analyzed files that have debug symbols stripped. :vartype stripped_binary_count: int :ivar summary_type: Describes the type of summary object. Required. The summary contains - information about the binary hardening analysis results + information about the binary hardening analysis results. :vartype summary_type: str or ~azure.mgmt.iotfirmwaredefense.models.BINARY_HARDENING """ @@ -367,7 +371,7 @@ class BinaryHardeningSummaryResource(SummaryResourceProperties, discriminator="B """Total number of analyzed files that have debug symbols stripped.""" summary_type: Literal[SummaryType.BINARY_HARDENING] = rest_discriminator(name="summaryType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Describes the type of summary object. Required. The summary contains information about the - binary hardening analysis results""" + binary hardening analysis results.""" @overload def __init__( @@ -389,10 +393,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, summary_type=SummaryType.BINARY_HARDENING, **kwargs) + super().__init__(*args, **kwargs) + self.summary_type = SummaryType.BINARY_HARDENING # type: ignore -class CryptoCertificate(_Model): +class CryptoCertificate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Crypto certificate properties. :ivar crypto_cert_id: ID for the certificate result. @@ -490,11 +495,11 @@ class CryptoCertificate(_Model): """Serial number of the certificate.""" fingerprint: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Fingerprint of the certificate.""" - certificate_usage: Optional[List[Union[str, "_models.CertificateUsage"]]] = rest_field( + certificate_usage: Optional[list[Union[str, "_models.CertificateUsage"]]] = rest_field( name="certificateUsage", visibility=["read", "create", "update", "delete", "query"] ) """List of functions the certificate can fulfill.""" - file_paths: Optional[List[str]] = rest_field(name="filePaths", visibility=["read"]) + file_paths: Optional[list[str]] = rest_field(name="filePaths", visibility=["read"]) """List of files where this certificate was found.""" paired_key: Optional["_models.PairedKey"] = rest_field( name="pairedKey", visibility=["read", "create", "update", "delete", "query"] @@ -540,7 +545,7 @@ def __init__( encoding: Optional[str] = None, serial_number: Optional[str] = None, fingerprint: Optional[str] = None, - certificate_usage: Optional[List[Union[str, "_models.CertificateUsage"]]] = None, + certificate_usage: Optional[list[Union[str, "_models.CertificateUsage"]]] = None, paired_key: Optional["_models.PairedKey"] = None, is_expired: Optional[bool] = None, is_self_signed: Optional[bool] = None, @@ -559,7 +564,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CryptoCertificateEntity(_Model): +class CryptoCertificateEntity(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Information on an entity (distinguished name) in a cryptographic certificate. :ivar common_name: Common name of the certificate entity. @@ -611,7 +616,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CryptoCertificateResource(ProxyResource): +class CryptoCertificateResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """The object representing a firmware analysis crypto certificate resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -694,7 +699,9 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class CryptoCertificateSummaryResource(SummaryResourceProperties, discriminator="CryptoCertificate"): +class CryptoCertificateSummaryResource( + SummaryResourceProperties, discriminator="CryptoCertificate" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties for cryptographic certificate summary. :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", @@ -717,7 +724,7 @@ class CryptoCertificateSummaryResource(SummaryResourceProperties, discriminator= for the key algorithm. :vartype short_key_size_count: int :ivar summary_type: Describes the type of summary. Required. The summary contains information - about the cryptographic certificate analysis results + about the cryptographic certificate analysis results. :vartype summary_type: str or ~azure.mgmt.iotfirmwaredefense.models.CRYPTO_CERTIFICATE """ @@ -751,7 +758,7 @@ class CryptoCertificateSummaryResource(SummaryResourceProperties, discriminator= """Total number of certificates found that have an insecure key size for the key algorithm.""" summary_type: Literal[SummaryType.CRYPTO_CERTIFICATE] = rest_discriminator(name="summaryType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Describes the type of summary. Required. The summary contains information about the - cryptographic certificate analysis results""" + cryptographic certificate analysis results.""" @overload def __init__( @@ -774,10 +781,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, summary_type=SummaryType.CRYPTO_CERTIFICATE, **kwargs) + super().__init__(*args, **kwargs) + self.summary_type = SummaryType.CRYPTO_CERTIFICATE # type: ignore -class CryptoKey(_Model): +class CryptoKey(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Crypto key properties. :ivar crypto_key_id: ID for the key result. @@ -818,9 +826,9 @@ class CryptoKey(_Model): name="keyAlgorithm", visibility=["read", "create", "update", "delete", "query"] ) """Key algorithm name.""" - usage: Optional[List[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + usage: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Functions the key can fulfill.""" - file_paths: Optional[List[str]] = rest_field(name="filePaths", visibility=["read"]) + file_paths: Optional[list[str]] = rest_field(name="filePaths", visibility=["read"]) """List of files where this key was found.""" paired_key: Optional["_models.PairedKey"] = rest_field( name="pairedKey", visibility=["read", "create", "update", "delete", "query"] @@ -845,7 +853,7 @@ def __init__( key_type: Optional[Union[str, "_models.CryptoKeyType"]] = None, crypto_key_size: Optional[int] = None, key_algorithm: Optional[str] = None, - usage: Optional[List[str]] = None, + usage: Optional[list[str]] = None, paired_key: Optional["_models.PairedKey"] = None, is_short_key_size: Optional[bool] = None, ) -> None: ... @@ -861,7 +869,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CryptoKeyResource(ProxyResource): +class CryptoKeyResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """The object representing a firmware analysis crypto key resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -930,7 +938,9 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class CryptoKeySummaryResource(SummaryResourceProperties, discriminator="CryptoKey"): +class CryptoKeySummaryResource( + SummaryResourceProperties, discriminator="CryptoKey" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties for cryptographic key summary. :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", @@ -949,7 +959,7 @@ class CryptoKeySummaryResource(SummaryResourceProperties, discriminator="CryptoK algorithm. :vartype short_key_size_count: int :ivar summary_type: Describes the type of summary. Required. The summary contains information - about the cryptographic key analysis results + about the cryptographic key analysis results. :vartype summary_type: str or ~azure.mgmt.iotfirmwaredefense.models.CRYPTO_KEY """ @@ -975,7 +985,7 @@ class CryptoKeySummaryResource(SummaryResourceProperties, discriminator="CryptoK """Total number of keys found that have an insecure key size for the algorithm.""" summary_type: Literal[SummaryType.CRYPTO_KEY] = rest_discriminator(name="summaryType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Describes the type of summary. Required. The summary contains information about the - cryptographic key analysis results""" + cryptographic key analysis results.""" @overload def __init__( @@ -996,10 +1006,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, summary_type=SummaryType.CRYPTO_KEY, **kwargs) + super().__init__(*args, **kwargs) + self.summary_type = SummaryType.CRYPTO_KEY # type: ignore -class CveComponent(_Model): +class CveComponent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Legacy component of a CVE result. :ivar component_id: ID of the SBOM component. @@ -1039,7 +1050,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CveLink(_Model): +class CveLink(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties of a reference link for a CVE. :ivar href: The destination of the reference link. @@ -1072,7 +1083,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CveResource(ProxyResource): +class CveResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """The object representing a firmware analysis CVE result resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1107,9 +1118,15 @@ class CveResource(ProxyResource): "cvss_version", "effective_cvss_score", "effective_cvss_version", + "effective_vector_string", + "effective_exploit_maturity", "cvss_scores", "links", "description", + "epss", + "cwes", + "kev", + "fixed_in_versions", "provisioning_state", ] @@ -1149,7 +1166,7 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class CveResult(_Model): +class CveResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Details of a CVE detected in firmware. :ivar cve_id: ID of the CVE result. @@ -1166,25 +1183,41 @@ class CveResult(_Model): :vartype cve_name: str :ivar component: Legacy property for what is now componentName. :vartype component: ~azure.mgmt.iotfirmwaredefense.models.CveComponent - :ivar cvss_score: Legacy property for the effective CVE score. + :ivar cvss_score: Legacy property for the effective CVE score (deprecated). :vartype cvss_score: str :ivar cvss_v2_score: Legacy property for the CVE CVSS version 2 score, if one existed. + (deprecated). :vartype cvss_v2_score: str :ivar cvss_v3_score: Legacy property for the CVE CVSS version 3 score, if one existed. + (deprecated). :vartype cvss_v3_score: str :ivar cvss_version: Legacy property for the what CVSS version score was stored in the cvssScore - property. + property (deprecated). :vartype cvss_version: str :ivar effective_cvss_score: The most recent CVSS score of the CVE. :vartype effective_cvss_score: float :ivar effective_cvss_version: The version of the effectiveCvssScore property. :vartype effective_cvss_version: int + :ivar effective_vector_string: The CVSS vector string for the effectiveCvssVersion. + :vartype effective_vector_string: str + :ivar effective_exploit_maturity: The CVSS exploit maturity value for the effectiveCvssVersion. + Known values are: "NOT_DEFINED", "ATTACKED", "PROOF_OF_CONCEPT", and "UNREPORTED". + :vartype effective_exploit_maturity: str or + ~azure.mgmt.iotfirmwaredefense.models.ExploitMaturityLevel :ivar cvss_scores: All known CVSS scores for the CVE. :vartype cvss_scores: list[~azure.mgmt.iotfirmwaredefense.models.CvssScore] :ivar links: The list of reference links for the CVE. :vartype links: list[~azure.mgmt.iotfirmwaredefense.models.CveLink] :ivar description: The CVE description. :vartype description: str + :ivar epss: EPSS (Exploit Prediction Scoring System) information related to this CVE. + :vartype epss: ~azure.mgmt.iotfirmwaredefense.models.EpssProperties + :ivar cwes: CWE (Common Weakness Enumeration) information related to this CVE. + :vartype cwes: list[~azure.mgmt.iotfirmwaredefense.models.CweProperties] + :ivar kev: KEV (Known Exploited Vulnerabilities) information related to this CVE. + :vartype kev: ~azure.mgmt.iotfirmwaredefense.models.KevProperties + :ivar fixed_in_versions: The component versions in which this weakness was fixed, if any. + :vartype fixed_in_versions: list[str] :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", "Failed", "Canceled", "Pending", "Extracting", and "Analyzing". :vartype provisioning_state: str or ~azure.mgmt.iotfirmwaredefense.models.ProvisioningState @@ -1211,19 +1244,20 @@ class CveResult(_Model): component: Optional["_models.CveComponent"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Legacy property for what is now componentName.""" cvss_score: Optional[str] = rest_field(name="cvssScore", visibility=["read", "create", "update", "delete", "query"]) - """Legacy property for the effective CVE score.""" + """Legacy property for the effective CVE score (deprecated).""" cvss_v2_score: Optional[str] = rest_field( name="cvssV2Score", visibility=["read", "create", "update", "delete", "query"] ) - """Legacy property for the CVE CVSS version 2 score, if one existed.""" + """Legacy property for the CVE CVSS version 2 score, if one existed. (deprecated).""" cvss_v3_score: Optional[str] = rest_field( name="cvssV3Score", visibility=["read", "create", "update", "delete", "query"] ) - """Legacy property for the CVE CVSS version 3 score, if one existed.""" + """Legacy property for the CVE CVSS version 3 score, if one existed. (deprecated).""" cvss_version: Optional[str] = rest_field( name="cvssVersion", visibility=["read", "create", "update", "delete", "query"] ) - """Legacy property for the what CVSS version score was stored in the cvssScore property.""" + """Legacy property for the what CVSS version score was stored in the cvssScore property + (deprecated).""" effective_cvss_score: Optional[float] = rest_field( name="effectiveCvssScore", visibility=["read", "create", "update", "delete", "query"] ) @@ -1232,14 +1266,35 @@ class CveResult(_Model): name="effectiveCvssVersion", visibility=["read", "create", "update", "delete", "query"] ) """The version of the effectiveCvssScore property.""" - cvss_scores: Optional[List["_models.CvssScore"]] = rest_field( + effective_vector_string: Optional[str] = rest_field( + name="effectiveVectorString", visibility=["read", "create", "update", "delete", "query"] + ) + """The CVSS vector string for the effectiveCvssVersion.""" + effective_exploit_maturity: Optional[Union[str, "_models.ExploitMaturityLevel"]] = rest_field( + name="effectiveExploitMaturity", visibility=["read", "create", "update", "delete", "query"] + ) + """The CVSS exploit maturity value for the effectiveCvssVersion. Known values are: + \"NOT_DEFINED\", \"ATTACKED\", \"PROOF_OF_CONCEPT\", and \"UNREPORTED\".""" + cvss_scores: Optional[list["_models.CvssScore"]] = rest_field( name="cvssScores", visibility=["read", "create", "update", "delete", "query"] ) """All known CVSS scores for the CVE.""" - links: Optional[List["_models.CveLink"]] = rest_field(visibility=["read"]) + links: Optional[list["_models.CveLink"]] = rest_field(visibility=["read"]) """The list of reference links for the CVE.""" description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The CVE description.""" + epss: Optional["_models.EpssProperties"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """EPSS (Exploit Prediction Scoring System) information related to this CVE.""" + cwes: Optional[list["_models.CweProperties"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """CWE (Common Weakness Enumeration) information related to this CVE.""" + kev: Optional["_models.KevProperties"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """KEV (Known Exploited Vulnerabilities) information related to this CVE.""" + fixed_in_versions: Optional[list[str]] = rest_field( + name="fixedInVersions", visibility=["read", "create", "update", "delete", "query"] + ) + """The component versions in which this weakness was fixed, if any.""" provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( name="provisioningState", visibility=["read"] ) @@ -1263,8 +1318,14 @@ def __init__( cvss_version: Optional[str] = None, effective_cvss_score: Optional[float] = None, effective_cvss_version: Optional[int] = None, - cvss_scores: Optional[List["_models.CvssScore"]] = None, + effective_vector_string: Optional[str] = None, + effective_exploit_maturity: Optional[Union[str, "_models.ExploitMaturityLevel"]] = None, + cvss_scores: Optional[list["_models.CvssScore"]] = None, description: Optional[str] = None, + epss: Optional["_models.EpssProperties"] = None, + cwes: Optional[list["_models.CweProperties"]] = None, + kev: Optional["_models.KevProperties"] = None, + fixed_in_versions: Optional[list[str]] = None, ) -> None: ... @overload @@ -1278,8 +1339,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class CveSummary(SummaryResourceProperties, discriminator="CommonVulnerabilitiesAndExposures"): - """Properties for a CVE analysis summary. +class CveSummary( + SummaryResourceProperties, discriminator="CommonVulnerabilitiesAndExposures" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties for a CVE (Common Vulnerabilities and Exposures) analysis summary (deprecated). :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", "Failed", "Canceled", "Pending", "Extracting", and "Analyzing". @@ -1295,7 +1358,7 @@ class CveSummary(SummaryResourceProperties, discriminator="CommonVulnerabilities :ivar unknown_cve_count: The total number of unknown severity CVEs detected. :vartype unknown_cve_count: int :ivar summary_type: Describes the type of summary object. Required. The summary contains - information about the Common Vulnerabilities and Exposures analysis results + information about the CVE (Common Vulnerabilities and Exposures) analysis results (deprecated). :vartype summary_type: str or ~azure.mgmt.iotfirmwaredefense.models.COMMON_VULNERABILITIES_AND_EXPOSURES """ @@ -1321,18 +1384,102 @@ class CveSummary(SummaryResourceProperties, discriminator="CommonVulnerabilities ) """The total number of unknown severity CVEs detected.""" summary_type: Literal[SummaryType.COMMON_VULNERABILITIES_AND_EXPOSURES] = rest_discriminator(name="summaryType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore - """Describes the type of summary object. Required. The summary contains information about the - Common Vulnerabilities and Exposures analysis results""" + """Describes the type of summary object. Required. The summary contains information about the CVE + (Common Vulnerabilities and Exposures) analysis results (deprecated).""" + + @overload + def __init__( + self, + *, + critical_cve_count: Optional[int] = None, + high_cve_count: Optional[int] = None, + medium_cve_count: Optional[int] = None, + low_cve_count: Optional[int] = None, + unknown_cve_count: 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) + self.summary_type = SummaryType.COMMON_VULNERABILITIES_AND_EXPOSURES # type: ignore + + +class CveSummaryResource( + SummaryResourceProperties, discriminator="CVE" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties for a CVE analysis summary. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Pending", "Extracting", and "Analyzing". + :vartype provisioning_state: str or ~azure.mgmt.iotfirmwaredefense.models.ProvisioningState + :ivar total_cve_count: Total number of CVEs found. + :vartype total_cve_count: int + :ivar critical_cve_count: The total number of critical severity CVEs detected. + :vartype critical_cve_count: int + :ivar high_cve_count: The total number of high severity CVEs detected. + :vartype high_cve_count: int + :ivar medium_cve_count: The total number of medium severity CVEs detected. + :vartype medium_cve_count: int + :ivar low_cve_count: The total number of low severity CVEs detected. + :vartype low_cve_count: int + :ivar unknown_cve_count: The total number of unknown severity CVEs detected. + :vartype unknown_cve_count: int + :ivar summary_type: Describes the type of summary object. Required. The summary contains + information about the CVE analysis results. + :vartype summary_type: str or ~azure.mgmt.iotfirmwaredefense.models.CVE + :ivar schema_version: Schema version of the CVE data for this firmware. + :vartype schema_version: str + """ + + total_cve_count: Optional[int] = rest_field( + name="totalCveCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Total number of CVEs found.""" + critical_cve_count: Optional[int] = rest_field( + name="criticalCveCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The total number of critical severity CVEs detected.""" + high_cve_count: Optional[int] = rest_field( + name="highCveCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The total number of high severity CVEs detected.""" + medium_cve_count: Optional[int] = rest_field( + name="mediumCveCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The total number of medium severity CVEs detected.""" + low_cve_count: Optional[int] = rest_field( + name="lowCveCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The total number of low severity CVEs detected.""" + unknown_cve_count: Optional[int] = rest_field( + name="unknownCveCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The total number of unknown severity CVEs detected.""" + summary_type: Literal[SummaryType.CVE] = rest_discriminator(name="summaryType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Describes the type of summary object. Required. The summary contains information about the CVE + analysis results.""" + schema_version: Optional[str] = rest_field( + name="schemaVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Schema version of the CVE data for this firmware.""" @overload def __init__( self, *, + total_cve_count: Optional[int] = None, critical_cve_count: Optional[int] = None, high_cve_count: Optional[int] = None, medium_cve_count: Optional[int] = None, low_cve_count: Optional[int] = None, unknown_cve_count: Optional[int] = None, + schema_version: Optional[str] = None, ) -> None: ... @overload @@ -1343,22 +1490,39 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, summary_type=SummaryType.COMMON_VULNERABILITIES_AND_EXPOSURES, **kwargs) + super().__init__(*args, **kwargs) + self.summary_type = SummaryType.CVE # type: ignore -class CvssScore(_Model): +class CvssScore(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Common Vulnerability Scoring System values. :ivar version: The version of the Common Vulnerability Scoring System (CVSS). Required. :vartype version: int :ivar score: The score of the CVE according to the CVSS specified. :vartype score: float + :ivar vector_string: The CVSS vector for the specified score. + :vartype vector_string: str + :ivar exploit_maturity: The likelihood of the vulnerability being attacked based on information + regarding the availability of exploitation code/processes and the state of exploitation + techniques. Known values are: "NOT_DEFINED", "ATTACKED", "PROOF_OF_CONCEPT", and "UNREPORTED". + :vartype exploit_maturity: str or ~azure.mgmt.iotfirmwaredefense.models.ExploitMaturityLevel """ version: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The version of the Common Vulnerability Scoring System (CVSS). Required.""" score: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The score of the CVE according to the CVSS specified.""" + vector_string: Optional[str] = rest_field( + name="vectorString", visibility=["read", "create", "update", "delete", "query"] + ) + """The CVSS vector for the specified score.""" + exploit_maturity: Optional[Union[str, "_models.ExploitMaturityLevel"]] = rest_field( + name="exploitMaturity", visibility=["read", "create", "update", "delete", "query"] + ) + """The likelihood of the vulnerability being attacked based on information regarding the + availability of exploitation code/processes and the state of exploitation techniques. Known + values are: \"NOT_DEFINED\", \"ATTACKED\", \"PROOF_OF_CONCEPT\", and \"UNREPORTED\".""" @overload def __init__( @@ -1366,6 +1530,79 @@ def __init__( *, version: int, score: Optional[float] = None, + vector_string: Optional[str] = None, + exploit_maturity: Optional[Union[str, "_models.ExploitMaturityLevel"]] = 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 CweProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """CWE (Common Weakness Enumeration) data related to a CVE. + + :ivar cwe_id: The id of the CWE. + :vartype cwe_id: str + :ivar cwe_name: The name of the CWE. + :vartype cwe_name: str + :ivar description: The description of the CWE. + :vartype description: str + """ + + cwe_id: Optional[str] = rest_field(name="cweId", visibility=["read", "create", "update", "delete", "query"]) + """The id of the CWE.""" + cwe_name: Optional[str] = rest_field(name="cweName", visibility=["read", "create", "update", "delete", "query"]) + """The name of the CWE.""" + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the CWE.""" + + @overload + def __init__( + self, + *, + cwe_id: Optional[str] = None, + cwe_name: Optional[str] = None, + description: 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 EpssProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """EPSS (Exploit Prediction Scoring System) data related to a CVE. + + :ivar score: The probability of observing exploitation activity in the next 30 days. + :vartype score: float + :ivar percentile: The rank ordering of probabilities from high to low. + :vartype percentile: float + """ + + score: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The probability of observing exploitation activity in the next 30 days.""" + percentile: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The rank ordering of probabilities from high to low.""" + + @overload + def __init__( + self, + *, + score: Optional[float] = None, + percentile: Optional[float] = None, ) -> None: ... @overload @@ -1415,15 +1652,15 @@ class ErrorDetail(_Model): """The error message.""" target: Optional[str] = rest_field(visibility=["read"]) """The error target.""" - details: Optional[List["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) """The error details.""" - additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = rest_field( + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( name="additionalInfo", visibility=["read"] ) """The error additional info.""" -class ErrorResponse(_Model): +class ErrorResponse(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Error response. :ivar error: The error object. @@ -1451,7 +1688,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Firmware(ProxyResource): +class Firmware(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Firmware definition. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -1522,7 +1759,7 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class FirmwareProperties(_Model): +class FirmwareProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Firmware properties. :ivar file_name: File name for a firmware that user uploaded. @@ -1564,7 +1801,7 @@ class FirmwareProperties(_Model): ) """The status of firmware scan. Known values are: \"Pending\", \"Extracting\", \"Analyzing\", \"Ready\", and \"Error\".""" - status_messages: Optional[List["_models.StatusMessage"]] = rest_field( + status_messages: Optional[list["_models.StatusMessage"]] = rest_field( name="statusMessages", visibility=["read", "create", "update", "delete", "query"] ) """A list of errors or other messages generated during firmware analysis.""" @@ -1585,7 +1822,7 @@ def __init__( description: Optional[str] = None, file_size: Optional[int] = None, status: Optional[Union[str, "_models.Status"]] = None, - status_messages: Optional[List["_models.StatusMessage"]] = None, + status_messages: Optional[list["_models.StatusMessage"]] = None, ) -> None: ... @overload @@ -1599,7 +1836,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class FirmwareSummary(SummaryResourceProperties, discriminator="Firmware"): +class FirmwareSummary( + SummaryResourceProperties, discriminator="Firmware" +): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties for high level summary of firmware analysis results. :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", @@ -1620,7 +1859,7 @@ class FirmwareSummary(SummaryResourceProperties, discriminator="Firmware"): :ivar root_file_systems: The number of root file systems found. :vartype root_file_systems: int :ivar summary_type: Describes the type of summary. Required. The summary contains information - about the submitted firmware + about the submitted firmware. :vartype summary_type: str or ~azure.mgmt.iotfirmwaredefense.models.FIRMWARE """ @@ -1652,7 +1891,7 @@ class FirmwareSummary(SummaryResourceProperties, discriminator="Firmware"): """The number of root file systems found.""" summary_type: Literal[SummaryType.FIRMWARE] = rest_discriminator(name="summaryType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore """Describes the type of summary. Required. The summary contains information about the submitted - firmware""" + firmware.""" @overload def __init__( @@ -1675,10 +1914,11 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: """ def __init__(self, *args: Any, **kwargs: Any) -> None: - super().__init__(*args, summary_type=SummaryType.FIRMWARE, **kwargs) + super().__init__(*args, **kwargs) + self.summary_type = SummaryType.FIRMWARE # type: ignore -class FirmwareUpdateDefinition(_Model): +class FirmwareUpdateDefinition(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Firmware definition. :ivar properties: The editable properties of a firmware. @@ -1738,7 +1978,40 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class GenerateUploadUrlRequest(_Model): +class FunctionCall(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Function call count for a specific function. + + :ivar function_name: The name of the function. Required. + :vartype function_name: str + :ivar count: The number of calls to this function within a single binary. Required. + :vartype count: int + """ + + function_name: str = rest_field(name="functionName", visibility=["read", "create", "update", "delete", "query"]) + """The name of the function. Required.""" + count: int = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The number of calls to this function within a single binary. Required.""" + + @overload + def __init__( + self, + *, + function_name: str, + count: int, + ) -> 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 GenerateUploadUrlRequest(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Properties for generating an upload URL. :ivar firmware_id: A unique ID for the firmware to be uploaded. @@ -1768,7 +2041,61 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class Operation(_Model): +class KevProperties(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """KEV (Known Exploited Vulnerabilities) data related to a CVE, published by CISA. + + :ivar known_ransomware_campaign_use: Indication if the vulnerability is known to have been + leveraged as part of a ransomware campaign. Known values are: "Known" and "Unknown". + :vartype known_ransomware_campaign_use: str or + ~azure.mgmt.iotfirmwaredefense.models.RansomwareCampaignUse + :ivar date_added: The date the vulnerability was added to the KEV catalog. + :vartype date_added: ~datetime.datetime + :ivar remediation_due_date: The date the required action is due. + :vartype remediation_due_date: ~datetime.datetime + :ivar required_action: The required action to address the vulnerability. + :vartype required_action: str + """ + + known_ransomware_campaign_use: Optional[Union[str, "_models.RansomwareCampaignUse"]] = rest_field( + name="knownRansomwareCampaignUse", visibility=["read", "create", "update", "delete", "query"] + ) + """Indication if the vulnerability is known to have been leveraged as part of a ransomware + campaign. Known values are: \"Known\" and \"Unknown\".""" + date_added: Optional[datetime.datetime] = rest_field( + name="dateAdded", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The date the vulnerability was added to the KEV catalog.""" + remediation_due_date: Optional[datetime.datetime] = rest_field( + name="remediationDueDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The date the required action is due.""" + required_action: Optional[str] = rest_field( + name="requiredAction", visibility=["read", "create", "update", "delete", "query"] + ) + """The required action to address the vulnerability.""" + + @overload + def __init__( + self, + *, + known_ransomware_campaign_use: Optional[Union[str, "_models.RansomwareCampaignUse"]] = None, + date_added: Optional[datetime.datetime] = None, + remediation_due_date: Optional[datetime.datetime] = None, + required_action: 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 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: @@ -1826,7 +2153,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class OperationDisplay(_Model): - """Localized display information for and operation. + """Localized display information for an operation. :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". @@ -1856,7 +2183,7 @@ class OperationDisplay(_Model): views.""" -class PairedKey(_Model): +class PairedKey(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Details of a matching paired key or certificate. :ivar paired_key_id: ID of the paired key or certificate. @@ -1891,7 +2218,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PasswordHash(_Model): +class PasswordHash(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Password hash properties. :ivar password_hash_id: ID for password hash. @@ -1959,7 +2286,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class PasswordHashResource(ProxyResource): +class PasswordHashResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """The object representing a firmware analysis password hash result resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -2029,7 +2356,49 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class SbomComponent(_Model): +class PasswordHashSummaryResource( + SummaryResourceProperties, discriminator="PasswordHash" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties for Password hash analysis summary. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Pending", "Extracting", and "Analyzing". + :vartype provisioning_state: str or ~azure.mgmt.iotfirmwaredefense.models.ProvisioningState + :ivar total_password_hash_count: Total number of password hashes found. + :vartype total_password_hash_count: int + :ivar summary_type: Describes the type of summary object. Required. The summary contains + information about the password hash analysis results. + :vartype summary_type: str or ~azure.mgmt.iotfirmwaredefense.models.PASSWORD_HASH + """ + + total_password_hash_count: Optional[int] = rest_field( + name="totalPasswordHashCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Total number of password hashes found.""" + summary_type: Literal[SummaryType.PASSWORD_HASH] = rest_discriminator(name="summaryType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Describes the type of summary object. Required. The summary contains information about the + password hash analysis results.""" + + @overload + def __init__( + self, + *, + total_password_hash_count: 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) + self.summary_type = SummaryType.PASSWORD_HASH # type: ignore + + +class SbomComponent(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """SBOM component of a firmware. :ivar component_id: ID for the component. @@ -2060,7 +2429,7 @@ class SbomComponent(_Model): """Version for the component.""" license: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """License for the component.""" - file_paths: Optional[List[str]] = rest_field( + file_paths: Optional[list[str]] = rest_field( name="filePaths", visibility=["read", "create", "update", "delete", "query"] ) """File paths related to the component. Note, relatedFiles should be used instead of this @@ -2079,7 +2448,7 @@ def __init__( component_name: Optional[str] = None, version: Optional[str] = None, license: Optional[str] = None, - file_paths: Optional[List[str]] = None, + file_paths: Optional[list[str]] = None, ) -> None: ... @overload @@ -2093,7 +2462,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SbomComponentResource(ProxyResource): +class SbomComponentResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """The object representing a firmware analysis SBOM component result resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -2154,7 +2523,49 @@ def __setattr__(self, key: str, value: Any) -> None: super().__setattr__(key, value) -class Sku(_Model): +class SbomSummaryResource( + SummaryResourceProperties, discriminator="SBOM" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties for SBOM analysis summary. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Pending", "Extracting", and "Analyzing". + :vartype provisioning_state: str or ~azure.mgmt.iotfirmwaredefense.models.ProvisioningState + :ivar total_component_count: Total number of SBOM components found. + :vartype total_component_count: int + :ivar summary_type: Describes the type of summary object. Required. The summary contains + information about the SBOM (Software Bill of Materials) analysis results. + :vartype summary_type: str or ~azure.mgmt.iotfirmwaredefense.models.SBOM + """ + + total_component_count: Optional[int] = rest_field( + name="totalComponentCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Total number of SBOM components found.""" + summary_type: Literal[SummaryType.SBOM] = rest_discriminator(name="summaryType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Describes the type of summary object. Required. The summary contains information about the SBOM + (Software Bill of Materials) analysis results.""" + + @overload + def __init__( + self, + *, + total_component_count: 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) + self.summary_type = SummaryType.SBOM # type: ignore + + +class Sku(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The resource model definition representing SKU. :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. Required. @@ -2214,7 +2625,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class StatusMessage(_Model): +class StatusMessage(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """Error and status message. :ivar error_code: The error code. @@ -2247,7 +2658,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -class SummaryResource(ProxyResource): +class SummaryResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """The object representing a firmware analysis summary resource. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -2288,7 +2699,7 @@ 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. @@ -2355,7 +2766,7 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) -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 - @@ -2375,7 +2786,7 @@ class TrackedResource(Resource): :vartype location: str """ - tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" location: str = rest_field(visibility=["read", "create"]) """The geo-location where the resource lives. Required.""" @@ -2385,7 +2796,172 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, 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 UnsafeFunctionCallsResource(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only + """The object representing a firmware analysis unsafe function calls result 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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.iotfirmwaredefense.models.SystemData + :ivar properties: The resource-specific properties for this resource. + :vartype properties: ~azure.mgmt.iotfirmwaredefense.models.UnsafeFunctionCallsResult + """ + + properties: Optional["_models.UnsafeFunctionCallsResult"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The resource-specific properties for this resource.""" + + @overload + def __init__( + self, + *, + properties: Optional["_models.UnsafeFunctionCallsResult"] = 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 UnsafeFunctionCallsResult(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only + """Unsafe function call analysis results for a binary. + + :ivar file_name: The name of the binary in the firmware. + :vartype file_name: str + :ivar file_path: The full path to the binary in the firmware. + :vartype file_path: str + :ivar unsafe_function_calls: List of unsafe function calls and their counts in the binary. + :vartype unsafe_function_calls: list[~azure.mgmt.iotfirmwaredefense.models.FunctionCall] + :ivar total_unsafe_call_count: Total unsafe function call count in the binary. + :vartype total_unsafe_call_count: int + :ivar total_network_call_count: Total number of network-related function calls in the binary. + :vartype total_network_call_count: int + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Pending", "Extracting", and "Analyzing". + :vartype provisioning_state: str or ~azure.mgmt.iotfirmwaredefense.models.ProvisioningState + """ + + file_name: Optional[str] = rest_field(name="fileName", visibility=["read", "create", "update", "delete", "query"]) + """The name of the binary in the firmware.""" + file_path: Optional[str] = rest_field(name="filePath", visibility=["read", "create", "update", "delete", "query"]) + """The full path to the binary in the firmware.""" + unsafe_function_calls: Optional[list["_models.FunctionCall"]] = rest_field( + name="unsafeFunctionCalls", visibility=["read", "create", "update", "delete", "query"] + ) + """List of unsafe function calls and their counts in the binary.""" + total_unsafe_call_count: Optional[int] = rest_field( + name="totalUnsafeCallCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Total unsafe function call count in the binary.""" + total_network_call_count: Optional[int] = rest_field( + name="totalNetworkCallCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Total number of network-related function calls in the binary.""" + 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\", + \"Pending\", \"Extracting\", and \"Analyzing\".""" + + @overload + def __init__( + self, + *, + file_name: Optional[str] = None, + file_path: Optional[str] = None, + unsafe_function_calls: Optional[list["_models.FunctionCall"]] = None, + total_unsafe_call_count: Optional[int] = None, + total_network_call_count: 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 UnsafeFunctionCallsSummaryResource( + SummaryResourceProperties, discriminator="UnsafeFunctionCalls" +): # pylint: disable=docstring-keyword-should-match-keyword-only + """Properties for unsafe function calls analysis summary. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Pending", "Extracting", and "Analyzing". + :vartype provisioning_state: str or ~azure.mgmt.iotfirmwaredefense.models.ProvisioningState + :ivar total_file_count: Total number of files analyzed for unsafe function calls. + :vartype total_file_count: int + :ivar total_unsafe_call_count: Total number of unsafe function calls found. + :vartype total_unsafe_call_count: int + :ivar total_network_call_count: Total number of network calls found. + :vartype total_network_call_count: int + :ivar unsafe_call_totals: Total unsafe function call counts per function across all binaries. + :vartype unsafe_call_totals: list[~azure.mgmt.iotfirmwaredefense.models.FunctionCall] + :ivar summary_type: Describes the type of summary object. Required. The summary contains + information about the unsafe function call analysis results. + :vartype summary_type: str or ~azure.mgmt.iotfirmwaredefense.models.UNSAFE_FUNCTION_CALLS + """ + + total_file_count: Optional[int] = rest_field( + name="totalFileCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Total number of files analyzed for unsafe function calls.""" + total_unsafe_call_count: Optional[int] = rest_field( + name="totalUnsafeCallCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Total number of unsafe function calls found.""" + total_network_call_count: Optional[int] = rest_field( + name="totalNetworkCallCount", visibility=["read", "create", "update", "delete", "query"] + ) + """Total number of network calls found.""" + unsafe_call_totals: Optional[list["_models.FunctionCall"]] = rest_field( + name="unsafeCallTotals", visibility=["read", "create", "update", "delete", "query"] + ) + """Total unsafe function call counts per function across all binaries.""" + summary_type: Literal[SummaryType.UNSAFE_FUNCTION_CALLS] = rest_discriminator(name="summaryType", visibility=["read", "create", "update", "delete", "query"]) # type: ignore + """Describes the type of summary object. Required. The summary contains information about the + unsafe function call analysis results.""" + + @overload + def __init__( + self, + *, + total_file_count: Optional[int] = None, + total_unsafe_call_count: Optional[int] = None, + total_network_call_count: Optional[int] = None, + unsafe_call_totals: Optional[list["_models.FunctionCall"]] = None, ) -> None: ... @overload @@ -2397,6 +2973,7 @@ def __init__(self, mapping: Mapping[str, Any]) -> None: def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + self.summary_type = SummaryType.UNSAFE_FUNCTION_CALLS # type: ignore class UrlToken(_Model): @@ -2410,7 +2987,7 @@ class UrlToken(_Model): """SAS URL for creating or accessing a blob file.""" -class UsageMetric(ProxyResource): +class UsageMetric(ProxyResource): # pylint: disable=docstring-keyword-should-match-keyword-only """The object representing how many firmwares the user has uploaded to the workspace. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -2495,7 +3072,7 @@ class UsageMetricProperties(_Model): \"Pending\", \"Extracting\", and \"Analyzing\".""" -class Workspace(TrackedResource): +class Workspace(TrackedResource): # pylint: disable=docstring-keyword-should-match-keyword-only """Firmware analysis workspace. :ivar id: Fully qualified resource ID for the resource. Ex - @@ -2533,7 +3110,7 @@ def __init__( self, *, location: str, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, properties: Optional["_models.WorkspaceProperties"] = None, sku: Optional["_models.Sku"] = None, ) -> None: ... @@ -2582,7 +3159,7 @@ class WorkspaceProperties(_Model): \"Pending\", \"Extracting\", and \"Analyzing\".""" -class WorkspaceUpdate(_Model): +class WorkspaceUpdate(_Model): # pylint: disable=docstring-keyword-should-match-keyword-only """The type used for update operations of the Workspace. :ivar sku: The SKU (Stock Keeping Unit) assigned to this resource. @@ -2593,7 +3170,7 @@ class WorkspaceUpdate(_Model): sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """The SKU (Stock Keeping Unit) assigned to this resource.""" - tags: Optional[Dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) """Resource tags.""" @overload @@ -2601,7 +3178,7 @@ def __init__( self, *, sku: Optional["_models.Sku"] = None, - tags: Optional[Dict[str, str]] = None, + tags: Optional[dict[str, str]] = None, ) -> None: ... @overload diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/_patch.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/_patch.py index 8bcb627aa475..ea765788358a 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/_patch.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/models/_patch.py @@ -7,9 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/operations/__init__.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/operations/__init__.py index 2339df4fdd09..731a3621abc4 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/operations/__init__.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/operations/__init__.py @@ -23,6 +23,7 @@ from ._operations import SbomComponentsOperations # type: ignore from ._operations import SummariesOperations # type: ignore from ._operations import UsageMetricsOperations # type: ignore +from ._operations import UnsafeFunctionCallsOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * @@ -40,6 +41,7 @@ "SbomComponentsOperations", "SummariesOperations", "UsageMetricsOperations", + "UnsafeFunctionCallsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/operations/_operations.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/operations/_operations.py index 673cfb9f684c..4e385534e7ca 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/operations/_operations.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/operations/_operations.py @@ -9,7 +9,7 @@ from collections.abc import MutableMapping from io import IOBase import json -from typing import Any, Callable, Dict, IO, Iterator, List, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -32,15 +32,15 @@ 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 IoTFirmwareDefenseMgmtClientConfiguration from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer from .._validation import api_version_validation T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] -JSON = MutableMapping[str, Any] +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +List = list _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False @@ -50,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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_firmwares_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,7 +101,7 @@ def build_firmwares_create_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,7 +133,7 @@ def build_firmwares_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -163,7 +163,7 @@ def build_firmwares_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTFirmwareDefense/workspaces/{workspaceName}/firmwares/{firmwareId}" path_format_arguments = { @@ -187,7 +187,7 @@ def build_firmwares_list_by_workspace_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -215,7 +215,7 @@ def build_workspaces_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -244,7 +244,7 @@ def build_workspaces_create_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -275,7 +275,7 @@ def build_workspaces_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -304,7 +304,7 @@ def build_workspaces_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) # Construct URL _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTFirmwareDefense/workspaces/{workspaceName}" path_format_arguments = { @@ -327,7 +327,7 @@ def build_workspaces_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -354,7 +354,7 @@ def build_workspaces_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -381,7 +381,7 @@ def build_workspaces_generate_upload_url_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -411,7 +411,7 @@ def build_binary_hardening_list_by_firmware_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -440,7 +440,7 @@ def build_crypto_certificates_list_by_firmware_request( # pylint: disable=name- _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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -469,7 +469,7 @@ def build_crypto_keys_list_by_firmware_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -498,7 +498,7 @@ def build_cves_list_by_firmware_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -527,7 +527,7 @@ def build_password_hashes_list_by_firmware_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -556,7 +556,7 @@ def build_sbom_components_list_by_firmware_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -590,7 +590,7 @@ def build_summaries_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -620,7 +620,7 @@ def build_summaries_list_by_firmware_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -649,7 +649,7 @@ def build_usage_metrics_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -678,7 +678,7 @@ def build_usage_metrics_list_by_workspace_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", "2025-08-02")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2026-06-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -700,7 +700,36 @@ def build_usage_metrics_list_by_workspace_request( # pylint: disable=name-too-l return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class Operations: +def build_unsafe_function_calls_list_by_firmware_request( # pylint: disable=name-too-long + resource_group_name: str, workspace_name: str, firmware_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-06-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTFirmwareDefense/workspaces/{workspaceName}/firmwares/{firmwareId}/unsafeFunctionCalls" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"), + "firmwareId": _SERIALIZER.url("firmware_id", firmware_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) + + +class Operations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -766,7 +795,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( @@ -779,7 +811,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Operation], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -795,7 +830,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -803,7 +841,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class FirmwaresOperations: +class FirmwaresOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -864,6 +902,7 @@ def get(self, resource_group_name: str, workspace_name: str, firmware_id: str, * } _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 @@ -878,11 +917,14 @@ def get(self, resource_group_name: str, workspace_name: str, firmware_id: str, * except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Firmware, response.json()) @@ -927,7 +969,7 @@ def create( resource_group_name: str, workspace_name: str, firmware_id: str, - resource: JSON, + resource: _types.Firmware, *, content_type: str = "application/json", **kwargs: Any @@ -942,7 +984,7 @@ def create( :param firmware_id: The id of the firmware. Required. :type firmware_id: str :param resource: Details of the firmware being created or updated. Required. - :type resource: JSON + :type resource: ~azure.mgmt.iotfirmwaredefense.types.Firmware :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -987,7 +1029,7 @@ def create( resource_group_name: str, workspace_name: str, firmware_id: str, - resource: Union[_models.Firmware, JSON, IO[bytes]], + resource: Union[_models.Firmware, _types.Firmware, IO[bytes]], **kwargs: Any ) -> _models.Firmware: """The operation to create a firmware. @@ -999,9 +1041,10 @@ def create( :type workspace_name: str :param firmware_id: The id of the firmware. Required. :type firmware_id: str - :param resource: Details of the firmware being created or updated. Is one of the following - types: Firmware, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.iotfirmwaredefense.models.Firmware or JSON or IO[bytes] + :param resource: Details of the firmware being created or updated. Is either a Firmware type or + a IO[bytes] type. Required. + :type resource: ~azure.mgmt.iotfirmwaredefense.models.Firmware or + ~azure.mgmt.iotfirmwaredefense.types.Firmware or IO[bytes] :return: Firmware. The Firmware is compatible with MutableMapping :rtype: ~azure.mgmt.iotfirmwaredefense.models.Firmware :raises ~azure.core.exceptions.HttpResponseError: @@ -1043,6 +1086,7 @@ def create( } _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 @@ -1057,11 +1101,14 @@ def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Firmware, response.json()) @@ -1106,7 +1153,7 @@ def update( resource_group_name: str, workspace_name: str, firmware_id: str, - properties: JSON, + properties: _types.FirmwareUpdateDefinition, *, content_type: str = "application/json", **kwargs: Any @@ -1121,7 +1168,7 @@ def update( :param firmware_id: The id of the firmware. Required. :type firmware_id: str :param properties: Details of the firmware being created or updated. Required. - :type properties: JSON + :type properties: ~azure.mgmt.iotfirmwaredefense.types.FirmwareUpdateDefinition :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1166,7 +1213,7 @@ def update( resource_group_name: str, workspace_name: str, firmware_id: str, - properties: Union[_models.FirmwareUpdateDefinition, JSON, IO[bytes]], + properties: Union[_models.FirmwareUpdateDefinition, _types.FirmwareUpdateDefinition, IO[bytes]], **kwargs: Any ) -> _models.Firmware: """The operation to update firmware. @@ -1178,10 +1225,10 @@ def update( :type workspace_name: str :param firmware_id: The id of the firmware. Required. :type firmware_id: str - :param properties: Details of the firmware being created or updated. Is one of the following - types: FirmwareUpdateDefinition, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.iotfirmwaredefense.models.FirmwareUpdateDefinition or JSON or - IO[bytes] + :param properties: Details of the firmware being created or updated. Is either a + FirmwareUpdateDefinition type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.iotfirmwaredefense.models.FirmwareUpdateDefinition or + ~azure.mgmt.iotfirmwaredefense.types.FirmwareUpdateDefinition or IO[bytes] :return: Firmware. The Firmware is compatible with MutableMapping :rtype: ~azure.mgmt.iotfirmwaredefense.models.Firmware :raises ~azure.core.exceptions.HttpResponseError: @@ -1223,6 +1270,7 @@ def update( } _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 @@ -1237,11 +1285,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Firmware, response.json()) @@ -1303,7 +1354,10 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -1366,7 +1420,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( @@ -1379,7 +1436,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Firmware], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Firmware], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1395,7 +1455,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1403,7 +1466,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class WorkspacesOperations: +class WorkspacesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -1461,6 +1524,7 @@ def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _ } _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 @@ -1475,11 +1539,14 @@ def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _ except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Workspace, response.json()) @@ -1520,7 +1587,7 @@ def create( self, resource_group_name: str, workspace_name: str, - resource: JSON, + resource: _types.Workspace, *, content_type: str = "application/json", **kwargs: Any @@ -1533,7 +1600,7 @@ def create( :param workspace_name: The name of the firmware analysis workspace. Required. :type workspace_name: str :param resource: Parameters when creating a firmware analysis workspace. Required. - :type resource: JSON + :type resource: ~azure.mgmt.iotfirmwaredefense.types.Workspace :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1574,7 +1641,7 @@ def create( self, resource_group_name: str, workspace_name: str, - resource: Union[_models.Workspace, JSON, IO[bytes]], + resource: Union[_models.Workspace, _types.Workspace, IO[bytes]], **kwargs: Any ) -> _models.Workspace: """The operation to create or update a firmware analysis workspace. @@ -1584,9 +1651,10 @@ def create( :type resource_group_name: str :param workspace_name: The name of the firmware analysis workspace. Required. :type workspace_name: str - :param resource: Parameters when creating a firmware analysis workspace. Is one of the - following types: Workspace, JSON, IO[bytes] Required. - :type resource: ~azure.mgmt.iotfirmwaredefense.models.Workspace or JSON or IO[bytes] + :param resource: Parameters when creating a firmware analysis workspace. Is either a Workspace + type or a IO[bytes] type. Required. + :type resource: ~azure.mgmt.iotfirmwaredefense.models.Workspace or + ~azure.mgmt.iotfirmwaredefense.types.Workspace or IO[bytes] :return: Workspace. The Workspace is compatible with MutableMapping :rtype: ~azure.mgmt.iotfirmwaredefense.models.Workspace :raises ~azure.core.exceptions.HttpResponseError: @@ -1627,6 +1695,7 @@ def create( } _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 @@ -1641,11 +1710,14 @@ def create( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Workspace, response.json()) @@ -1686,7 +1758,7 @@ def update( self, resource_group_name: str, workspace_name: str, - properties: JSON, + properties: _types.WorkspaceUpdate, *, content_type: str = "application/json", **kwargs: Any @@ -1699,7 +1771,7 @@ def update( :param workspace_name: The name of the firmware analysis workspace. Required. :type workspace_name: str :param properties: Parameters when updating a firmware analysis workspace. Required. - :type properties: JSON + :type properties: ~azure.mgmt.iotfirmwaredefense.types.WorkspaceUpdate :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -1740,7 +1812,7 @@ def update( self, resource_group_name: str, workspace_name: str, - properties: Union[_models.WorkspaceUpdate, JSON, IO[bytes]], + properties: Union[_models.WorkspaceUpdate, _types.WorkspaceUpdate, IO[bytes]], **kwargs: Any ) -> _models.Workspace: """The operation to update a firmware analysis workspaces. @@ -1750,9 +1822,10 @@ def update( :type resource_group_name: str :param workspace_name: The name of the firmware analysis workspace. Required. :type workspace_name: str - :param properties: Parameters when updating a firmware analysis workspace. Is one of the - following types: WorkspaceUpdate, JSON, IO[bytes] Required. - :type properties: ~azure.mgmt.iotfirmwaredefense.models.WorkspaceUpdate or JSON or IO[bytes] + :param properties: Parameters when updating a firmware analysis workspace. Is either a + WorkspaceUpdate type or a IO[bytes] type. Required. + :type properties: ~azure.mgmt.iotfirmwaredefense.models.WorkspaceUpdate or + ~azure.mgmt.iotfirmwaredefense.types.WorkspaceUpdate or IO[bytes] :return: Workspace. The Workspace is compatible with MutableMapping :rtype: ~azure.mgmt.iotfirmwaredefense.models.Workspace :raises ~azure.core.exceptions.HttpResponseError: @@ -1793,6 +1866,7 @@ def update( } _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 @@ -1807,11 +1881,14 @@ def update( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.Workspace, response.json()) @@ -1823,7 +1900,7 @@ def update( @api_version_validation( method_added_on="2025-08-02", params_added_on={"2025-08-02": ["api_version", "subscription_id", "resource_group_name", "workspace_name"]}, - api_versions_list=["2025-08-02"], + api_versions_list=["2025-08-02", "2025-12-01-preview", "2026-06-01-preview"], ) def _delete_initial(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { @@ -1852,6 +1929,7 @@ def _delete_initial(self, resource_group_name: str, workspace_name: str, **kwarg } _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 @@ -1865,7 +1943,10 @@ def _delete_initial(self, resource_group_name: str, workspace_name: str, **kwarg except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1873,7 +1954,7 @@ def _delete_initial(self, resource_group_name: str, workspace_name: str, **kwarg 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() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1884,7 +1965,7 @@ def _delete_initial(self, resource_group_name: str, workspace_name: str, **kwarg @api_version_validation( method_added_on="2025-08-02", params_added_on={"2025-08-02": ["api_version", "subscription_id", "resource_group_name", "workspace_name"]}, - api_versions_list=["2025-08-02"], + api_versions_list=["2025-08-02", "2025-12-01-preview", "2026-06-01-preview"], ) def begin_delete(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> LROPoller[None]: """The operation to delete a firmware analysis workspace. @@ -1994,7 +2075,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( @@ -2007,7 +2091,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Workspace], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Workspace], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2023,7 +2110,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2078,7 +2168,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( @@ -2091,7 +2184,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.Workspace], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.Workspace], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2107,7 +2203,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2146,7 +2245,7 @@ def generate_upload_url( self, resource_group_name: str, workspace_name: str, - body: JSON, + body: _types.GenerateUploadUrlRequest, *, content_type: str = "application/json", **kwargs: Any @@ -2159,7 +2258,7 @@ def generate_upload_url( :param workspace_name: The name of the firmware analysis workspace. Required. :type workspace_name: str :param body: Parameters when requesting a URL to upload firmware. Required. - :type body: JSON + :type body: ~azure.mgmt.iotfirmwaredefense.types.GenerateUploadUrlRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -2200,7 +2299,7 @@ def generate_upload_url( self, resource_group_name: str, workspace_name: str, - body: Union[_models.GenerateUploadUrlRequest, JSON, IO[bytes]], + body: Union[_models.GenerateUploadUrlRequest, _types.GenerateUploadUrlRequest, IO[bytes]], **kwargs: Any ) -> _models.UrlToken: """Generate a URL for uploading a firmware image. @@ -2210,9 +2309,10 @@ def generate_upload_url( :type resource_group_name: str :param workspace_name: The name of the firmware analysis workspace. Required. :type workspace_name: str - :param body: Parameters when requesting a URL to upload firmware. Is one of the following - types: GenerateUploadUrlRequest, JSON, IO[bytes] Required. - :type body: ~azure.mgmt.iotfirmwaredefense.models.GenerateUploadUrlRequest or JSON or IO[bytes] + :param body: Parameters when requesting a URL to upload firmware. Is either a + GenerateUploadUrlRequest type or a IO[bytes] type. Required. + :type body: ~azure.mgmt.iotfirmwaredefense.models.GenerateUploadUrlRequest or + ~azure.mgmt.iotfirmwaredefense.types.GenerateUploadUrlRequest or IO[bytes] :return: UrlToken. The UrlToken is compatible with MutableMapping :rtype: ~azure.mgmt.iotfirmwaredefense.models.UrlToken :raises ~azure.core.exceptions.HttpResponseError: @@ -2253,6 +2353,7 @@ def generate_upload_url( } _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 @@ -2267,11 +2368,14 @@ def generate_upload_url( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.UrlToken, response.json()) @@ -2281,7 +2385,7 @@ def generate_upload_url( return deserialized # type: ignore -class BinaryHardeningOperations: +class BinaryHardeningOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2361,7 +2465,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( @@ -2374,7 +2481,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.BinaryHardeningResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.BinaryHardeningResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2390,7 +2500,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2398,7 +2511,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class CryptoCertificatesOperations: +class CryptoCertificatesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2478,7 +2591,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( @@ -2491,7 +2607,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.CryptoCertificateResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.CryptoCertificateResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2507,7 +2626,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2515,7 +2637,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class CryptoKeysOperations: +class CryptoKeysOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2594,7 +2716,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( @@ -2607,7 +2732,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.CryptoKeyResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.CryptoKeyResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2623,7 +2751,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2631,7 +2762,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class CvesOperations: +class CvesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2663,7 +2794,7 @@ def __init__(self, *args, **kwargs) -> None: "accept", ] }, - api_versions_list=["2025-08-02"], + api_versions_list=["2025-08-02", "2025-12-01-preview", "2026-06-01-preview"], ) def list_by_firmware( self, resource_group_name: str, workspace_name: str, firmware_id: str, **kwargs: Any @@ -2724,7 +2855,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( @@ -2737,7 +2871,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.CveResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.CveResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2753,7 +2890,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2761,7 +2901,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class PasswordHashesOperations: +class PasswordHashesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2841,7 +2981,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( @@ -2854,7 +2997,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.PasswordHashResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.PasswordHashResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2870,7 +3016,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2878,7 +3027,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class SbomComponentsOperations: +class SbomComponentsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -2958,7 +3107,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( @@ -2971,7 +3123,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SbomComponentResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SbomComponentResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2987,7 +3142,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2995,7 +3153,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class SummariesOperations: +class SummariesOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3034,7 +3192,8 @@ def get( :type firmware_id: str :param summary_type: The Firmware analysis summary name describing the type of summary. Known values are: "Firmware", "CommonVulnerabilitiesAndExposures", "BinaryHardening", - "CryptoCertificate", and "CryptoKey". Required. + "CryptoCertificate", "CryptoKey", "CVE", "SBOM", "PasswordHash", and "UnsafeFunctionCalls". + Required. :type summary_type: str or ~azure.mgmt.iotfirmwaredefense.models.SummaryType :return: SummaryResource. The SummaryResource is compatible with MutableMapping :rtype: ~azure.mgmt.iotfirmwaredefense.models.SummaryResource @@ -3068,6 +3227,7 @@ def get( } _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 @@ -3082,11 +3242,14 @@ def get( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.SummaryResource, response.json()) @@ -3156,7 +3319,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( @@ -3169,7 +3335,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.SummaryResource], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.SummaryResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3185,7 +3354,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3193,7 +3365,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) -class UsageMetricsOperations: +class UsageMetricsOperations: # pylint: disable=docstring-missing-param """ .. warning:: **DO NOT** instantiate this class directly. @@ -3254,6 +3426,7 @@ def get(self, resource_group_name: str, workspace_name: str, name: str, **kwargs } _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 @@ -3268,11 +3441,14 @@ def get(self, resource_group_name: str, workspace_name: str, name: str, **kwargs except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = _failsafe_deserialize(_models.ErrorResponse, response) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if _stream: - deserialized = response.iter_bytes() + deserialized = response.iter_bytes() if _decompress else response.iter_raw() else: deserialized = _deserialize(_models.UsageMetric, response.json()) @@ -3338,7 +3514,150 @@ 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( + "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.UsageMetric], + 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 UnsafeFunctionCallsOperations: # pylint: disable=docstring-missing-param + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.iotfirmwaredefense.IoTFirmwareDefenseMgmtClient`'s + :attr:`unsafe_function_calls` 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: IoTFirmwareDefenseMgmtClientConfiguration = ( + 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-06-01-preview", + params_added_on={ + "2026-06-01-preview": [ + "api_version", + "subscription_id", + "resource_group_name", + "workspace_name", + "firmware_id", + "accept", + ] + }, + api_versions_list=["2026-06-01-preview"], + ) + def list_by_firmware( + self, resource_group_name: str, workspace_name: str, firmware_id: str, **kwargs: Any + ) -> ItemPaged["_models.UnsafeFunctionCallsResource"]: + """Lists unsafe function call analysis results of a firmware. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param workspace_name: The name of the firmware analysis workspace. Required. + :type workspace_name: str + :param firmware_id: The id of the firmware. Required. + :type firmware_id: str + :return: An iterator like instance of UnsafeFunctionCallsResource + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.iotfirmwaredefense.models.UnsafeFunctionCallsResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.UnsafeFunctionCallsResource]] = 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_unsafe_function_calls_list_by_firmware_request( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + firmware_id=firmware_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) + + 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( @@ -3351,7 +3670,10 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models.UsageMetric], deserialized.get("value", [])) + list_of_elem = _deserialize( + List[_models.UnsafeFunctionCallsResource], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3367,7 +3689,10 @@ 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) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/operations/_patch.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/operations/_patch.py index 8bcb627aa475..ea765788358a 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/operations/_patch.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/operations/_patch.py @@ -7,9 +7,8 @@ Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/types.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/types.py new file mode 100644 index 000000000000..dcb89cd9bfcb --- /dev/null +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/azure/mgmt/iotfirmwaredefense/types.py @@ -0,0 +1,321 @@ +# 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 typing import Any, TYPE_CHECKING, Union +from typing_extensions import Required, TypedDict + +if TYPE_CHECKING: + from .models import CreatedByType, ProvisioningState, SkuTier, Status + + +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 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 Firmware(ProxyResource): + """Firmware 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: "FirmwareProperties" + """ + + properties: "FirmwareProperties" + """The resource-specific properties for this resource.""" + + +class FirmwareProperties(TypedDict, total=False): + """Firmware properties. + + :ivar fileName: File name for a firmware that user uploaded. + :vartype fileName: str + :ivar vendor: Firmware vendor. + :vartype vendor: str + :ivar model: Firmware model. + :vartype model: str + :ivar version: Firmware version. + :vartype version: str + :ivar description: User-specified description of the firmware. + :vartype description: str + :ivar fileSize: File size of the uploaded firmware image. + :vartype fileSize: int + :ivar status: The status of firmware scan. Known values are: "Pending", "Extracting", + "Analyzing", "Ready", and "Error". + :vartype status: Union[str, "Status"] + :ivar statusMessages: A list of errors or other messages generated during firmware analysis. + :vartype statusMessages: list["StatusMessage"] + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Pending", "Extracting", and "Analyzing". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + fileName: str + """File name for a firmware that user uploaded.""" + vendor: str + """Firmware vendor.""" + model: str + """Firmware model.""" + version: str + """Firmware version.""" + description: str + """User-specified description of the firmware.""" + fileSize: int + """File size of the uploaded firmware image.""" + status: Union[str, "Status"] + """The status of firmware scan. Known values are: \"Pending\", \"Extracting\", \"Analyzing\", + \"Ready\", and \"Error\".""" + statusMessages: list["StatusMessage"] + """A list of errors or other messages generated during firmware analysis.""" + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Pending\", \"Extracting\", and \"Analyzing\".""" + + +class FirmwareUpdateDefinition(TypedDict, total=False): + """Firmware definition. + + :ivar properties: The editable properties of a firmware. + :vartype properties: "FirmwareProperties" + """ + + properties: "FirmwareProperties" + """The editable properties of a firmware.""" + + +class GenerateUploadUrlRequest(TypedDict, total=False): + """Properties for generating an upload URL. + + :ivar firmwareId: A unique ID for the firmware to be uploaded. + :vartype firmwareId: str + """ + + firmwareId: str + """A unique ID for the firmware to be uploaded.""" + + +class Sku(TypedDict, total=False): + """The resource model definition representing SKU. + + :ivar name: The name of the SKU. Ex - P3. It is typically a letter+number code. Required. + :vartype name: str + :ivar tier: This field is required to be implemented by the Resource Provider if the service + has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic", + "Standard", and "Premium". + :vartype tier: Union[str, "SkuTier"] + :ivar size: The SKU size. When the name field is the combination of tier and some other value, + this would be the standalone code. + :vartype size: str + :ivar family: If the service has different generations of hardware, for the same SKU, then that + can be captured here. + :vartype family: str + :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included. + If scale out/in is not possible for the resource this may be omitted. + :vartype capacity: int + """ + + name: Required[str] + """The name of the SKU. Ex - P3. It is typically a letter+number code. Required.""" + tier: Union[str, "SkuTier"] + """This field is required to be implemented by the Resource Provider if the service has more than + one tier, but is not required on a PUT. Known values are: \"Free\", \"Basic\", \"Standard\", + and \"Premium\".""" + size: str + """The SKU size. When the name field is the combination of tier and some other value, this would + be the standalone code.""" + family: str + """If the service has different generations of hardware, for the same SKU, then that can be + captured here.""" + capacity: int + """If the SKU supports scale out/in then the capacity integer should be included. If scale out/in + is not possible for the resource this may be omitted.""" + + +class StatusMessage(TypedDict, total=False): + """Error and status message. + + :ivar errorCode: The error code. + :vartype errorCode: int + :ivar message: The error or status message. + :vartype message: str + """ + + errorCode: int + """The error code.""" + message: str + """The error or status message.""" + + +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 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 Workspace(TrackedResource): + """Firmware analysis workspace. + + :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: "WorkspaceProperties" + :ivar sku: The SKU (Stock Keeping Unit) assigned to this resource. + :vartype sku: "Sku" + """ + + properties: "WorkspaceProperties" + """The resource-specific properties for this resource.""" + sku: "Sku" + """The SKU (Stock Keeping Unit) assigned to this resource.""" + + +class WorkspaceProperties(TypedDict, total=False): + """Workspace properties. + + :ivar provisioningState: Provisioning state of the resource. Known values are: "Succeeded", + "Failed", "Canceled", "Pending", "Extracting", and "Analyzing". + :vartype provisioningState: Union[str, "ProvisioningState"] + """ + + provisioningState: Union[str, "ProvisioningState"] + """Provisioning state of the resource. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Pending\", \"Extracting\", and \"Analyzing\".""" + + +class WorkspaceUpdate(TypedDict, total=False): + """The type used for update operations of the Workspace. + + :ivar sku: The SKU (Stock Keeping Unit) assigned to this resource. + :vartype sku: "Sku" + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + sku: "Sku" + """The SKU (Stock Keeping Unit) assigned to this resource.""" + tags: dict[str, str] + """Resource tags.""" diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/binary_hardening_list_by_firmware_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/binary_hardening_list_by_firmware_maximum_set_gen.py index ae3c57fba484..5180d10be962 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/binary_hardening_list_by_firmware_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/binary_hardening_list_by_firmware_maximum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/BinaryHardening_ListByFirmware_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/BinaryHardening_ListByFirmware_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/binary_hardening_list_by_firmware_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/binary_hardening_list_by_firmware_minimum_set_gen.py index bf18139c8e73..50266cd2270b 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/binary_hardening_list_by_firmware_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/binary_hardening_list_by_firmware_minimum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/BinaryHardening_ListByFirmware_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/BinaryHardening_ListByFirmware_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_certificates_list_by_firmware_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_certificates_list_by_firmware_maximum_set_gen.py index ad4beabfccb8..e4ae3f7fc5ca 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_certificates_list_by_firmware_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_certificates_list_by_firmware_maximum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/CryptoCertificates_ListByFirmware_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/CryptoCertificates_ListByFirmware_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_certificates_list_by_firmware_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_certificates_list_by_firmware_minimum_set_gen.py index b58f0eef6568..a09ef3725bb6 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_certificates_list_by_firmware_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_certificates_list_by_firmware_minimum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/CryptoCertificates_ListByFirmware_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/CryptoCertificates_ListByFirmware_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_keys_list_by_firmware_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_keys_list_by_firmware_maximum_set_gen.py index 322699d8de74..f9efbb392111 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_keys_list_by_firmware_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_keys_list_by_firmware_maximum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/CryptoKeys_ListByFirmware_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/CryptoKeys_ListByFirmware_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_keys_list_by_firmware_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_keys_list_by_firmware_minimum_set_gen.py index 091fce5c46f0..aaa87eb084f0 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_keys_list_by_firmware_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/crypto_keys_list_by_firmware_minimum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/CryptoKeys_ListByFirmware_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/CryptoKeys_ListByFirmware_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/cves_list_by_firmware_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/cves_list_by_firmware_maximum_set_gen.py index 7607fe5b976a..c4f8aba3b9c5 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/cves_list_by_firmware_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/cves_list_by_firmware_maximum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/Cves_ListByFirmware_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Cves_ListByFirmware_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/cves_list_by_firmware_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/cves_list_by_firmware_minimum_set_gen.py index 51d46ee7a020..9f4314ec4250 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/cves_list_by_firmware_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/cves_list_by_firmware_minimum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/Cves_ListByFirmware_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Cves_ListByFirmware_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_create_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_create_maximum_set_gen.py index 73d2e2d7fc01..cee1adb9bd1d 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_create_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_create_maximum_set_gen.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: 2025-08-02/Firmwares_Create_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Firmwares_Create_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_create_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_create_minimum_set_gen.py index f5fe3e16784d..c8df8ff13353 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_create_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_create_minimum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-08-02/Firmwares_Create_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Firmwares_Create_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_delete_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_delete_maximum_set_gen.py index d42154f94318..feca53369bf5 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_delete_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_delete_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: 2025-08-02/Firmwares_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Firmwares_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_delete_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_delete_minimum_set_gen.py index 5808b5ca9a4e..c277a7bf75b5 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_delete_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_delete_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: 2025-08-02/Firmwares_Delete_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Firmwares_Delete_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_get_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_get_maximum_set_gen.py index 1152a9139145..984b6c81ce52 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_get_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_get_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-08-02/Firmwares_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Firmwares_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_get_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_get_minimum_set_gen.py index 85cbd53327d2..43113b5d11bb 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_get_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_get_minimum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-08-02/Firmwares_Get_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Firmwares_Get_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_list_by_workspace_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_list_by_workspace_maximum_set_gen.py index 431e9b9bc0f7..9742c9702a37 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_list_by_workspace_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_list_by_workspace_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/Firmwares_ListByWorkspace_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Firmwares_ListByWorkspace_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_list_by_workspace_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_list_by_workspace_minimum_set_gen.py index d0242f12b140..374dd8b10307 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_list_by_workspace_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_list_by_workspace_minimum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/Firmwares_ListByWorkspace_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Firmwares_ListByWorkspace_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_update_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_update_maximum_set_gen.py index 814459e7d74b..ce4361ac9e9b 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_update_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_update_maximum_set_gen.py @@ -56,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: 2025-08-02/Firmwares_Update_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Firmwares_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_update_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_update_minimum_set_gen.py new file mode 100644 index 000000000000..3bd3d65ce041 --- /dev/null +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/firmwares_update_minimum_set_gen.py @@ -0,0 +1,56 @@ +# 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.iotfirmwaredefense import IoTFirmwareDefenseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-iotfirmwaredefense +# USAGE + python firmwares_update_minimum_set_gen.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 = IoTFirmwareDefenseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.firmwares.update( + resource_group_name="rgworkspaces-firmwares", + workspace_name="A7", + firmware_id="umrkdttp", + properties={ + "properties": { + "description": "str", + "fileName": "str", + "fileSize": 0, + "model": "str", + "provisioningState": "str", + "status": "str", + "statusMessages": [{"errorCode": 0, "message": "str"}], + "vendor": "str", + "version": "str", + } + }, + ) + print(response) + + +# x-ms-original-file: 2026-06-01-preview/Firmwares_Update_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/operations_list_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/operations_list_maximum_set_gen.py index 16fd0d01b159..b043eb8a2b07 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/operations_list_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/operations_list_maximum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/Operations_List_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Operations_List_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/operations_list_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/operations_list_minimum_set_gen.py index 1515410794d7..81a769a1a976 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/operations_list_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/operations_list_minimum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/Operations_List_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Operations_List_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/password_hashes_list_by_firmware_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/password_hashes_list_by_firmware_maximum_set_gen.py index 133e109aa58f..4c6e608ebe59 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/password_hashes_list_by_firmware_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/password_hashes_list_by_firmware_maximum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/PasswordHashes_ListByFirmware_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/PasswordHashes_ListByFirmware_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/password_hashes_list_by_firmware_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/password_hashes_list_by_firmware_minimum_set_gen.py index 27b383cd4528..7e0dcede7af5 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/password_hashes_list_by_firmware_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/password_hashes_list_by_firmware_minimum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/PasswordHashes_ListByFirmware_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/PasswordHashes_ListByFirmware_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/sbom_components_list_by_firmware_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/sbom_components_list_by_firmware_maximum_set_gen.py index 2c1a0550ca2b..2c1e61c5bcac 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/sbom_components_list_by_firmware_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/sbom_components_list_by_firmware_maximum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/SbomComponents_ListByFirmware_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/SbomComponents_ListByFirmware_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/sbom_components_list_by_firmware_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/sbom_components_list_by_firmware_minimum_set_gen.py index 16efeb1f05ec..90dc18821f4a 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/sbom_components_list_by_firmware_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/sbom_components_list_by_firmware_minimum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/SbomComponents_ListByFirmware_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/SbomComponents_ListByFirmware_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_get_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_get_maximum_set_gen.py index 13e2c6b639c4..b4b73e3be6ec 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_get_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_get_maximum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-08-02/Summaries_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Summaries_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_get_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_get_minimum_set_gen.py index 2aa9ac344999..00977547f1e7 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_get_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_get_minimum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: 2025-08-02/Summaries_Get_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Summaries_Get_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_list_by_firmware_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_list_by_firmware_maximum_set_gen.py index 4b6468efe4c6..1ab2230c798c 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_list_by_firmware_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_list_by_firmware_maximum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/Summaries_ListByFirmware_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Summaries_ListByFirmware_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_list_by_firmware_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_list_by_firmware_minimum_set_gen.py index 998ac7d1e8af..7f6a2d8ebf47 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_list_by_firmware_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/summaries_list_by_firmware_minimum_set_gen.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/Summaries_ListByFirmware_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Summaries_ListByFirmware_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/unsafe_function_calls_list_by_firmware_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/unsafe_function_calls_list_by_firmware_maximum_set_gen.py new file mode 100644 index 000000000000..4a556a488d82 --- /dev/null +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/unsafe_function_calls_list_by_firmware_maximum_set_gen.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.iotfirmwaredefense import IoTFirmwareDefenseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-iotfirmwaredefense +# USAGE + python unsafe_function_calls_list_by_firmware_maximum_set_gen.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 = IoTFirmwareDefenseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.unsafe_function_calls.list_by_firmware( + resource_group_name="rgiotfirmwaredefense", + workspace_name="exampleWorkspaceName", + firmware_id="00000000-0000-0000-0000-000000000000", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-06-01-preview/UnsafeFunctionCalls_ListByFirmware_MaximumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/unsafe_function_calls_list_by_firmware_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/unsafe_function_calls_list_by_firmware_minimum_set_gen.py new file mode 100644 index 000000000000..1462a9eb43f6 --- /dev/null +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/unsafe_function_calls_list_by_firmware_minimum_set_gen.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.iotfirmwaredefense import IoTFirmwareDefenseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-iotfirmwaredefense +# USAGE + python unsafe_function_calls_list_by_firmware_minimum_set_gen.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 = IoTFirmwareDefenseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.unsafe_function_calls.list_by_firmware( + resource_group_name="FirmwareAnalysisRG", + workspace_name="default", + firmware_id="00000000-0000-0000-0000-000000000000", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2026-06-01-preview/UnsafeFunctionCalls_ListByFirmware_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/usage_metrics_get_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/usage_metrics_get_maximum_set_gen.py index 01147b2bb55b..9dc0a75f26a1 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/usage_metrics_get_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/usage_metrics_get_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-08-02/UsageMetrics_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/UsageMetrics_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/usage_metrics_list_by_workspace_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/usage_metrics_list_by_workspace_maximum_set_gen.py index f3828f8cca70..12e196f79d92 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/usage_metrics_list_by_workspace_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/usage_metrics_list_by_workspace_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/UsageMetrics_ListByWorkspace_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/UsageMetrics_ListByWorkspace_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_create_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_create_maximum_set_gen.py index b0d4b652edeb..3eb901c530dc 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_create_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_create_maximum_set_gen.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: 2025-08-02/Workspaces_Create_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Workspaces_Create_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_create_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_create_minimum_set_gen.py index 74e0bd76fb18..f33ccf66ab54 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_create_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_create_minimum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-08-02/Workspaces_Create_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Workspaces_Create_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_delete_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_delete_maximum_set_gen.py index db0707241613..ff165fac5998 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_delete_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_delete_maximum_set_gen.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2025-08-02/Workspaces_Delete_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Workspaces_Delete_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_delete_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_delete_minimum_set_gen.py index 3582f3aea306..9986a7a366e6 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_delete_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_delete_minimum_set_gen.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: 2025-08-02/Workspaces_Delete_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Workspaces_Delete_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_generate_upload_url_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_generate_upload_url_maximum_set_gen.py index 13f5cceaccc7..563c6e41c1a0 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_generate_upload_url_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_generate_upload_url_maximum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-08-02/Workspaces_GenerateUploadUrl_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Workspaces_GenerateUploadUrl_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_generate_upload_url_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_generate_upload_url_minimum_set_gen.py index 6aeedf445a1e..331faae2015f 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_generate_upload_url_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_generate_upload_url_minimum_set_gen.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: 2025-08-02/Workspaces_GenerateUploadUrl_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Workspaces_GenerateUploadUrl_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_get_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_get_maximum_set_gen.py index 8613bc103c25..d6c798e382ec 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_get_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_get_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-08-02/Workspaces_Get_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Workspaces_Get_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_get_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_get_minimum_set_gen.py index 894530061fa3..7f9ae8b3a061 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_get_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_get_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: 2025-08-02/Workspaces_Get_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Workspaces_Get_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_resource_group_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_resource_group_maximum_set_gen.py index 38ad1d1b4cef..57fdd2a509df 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_resource_group_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_resource_group_maximum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/Workspaces_ListByResourceGroup_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Workspaces_ListByResourceGroup_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_resource_group_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_resource_group_minimum_set_gen.py index a9780e15ee7e..18911f4d7444 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_resource_group_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_resource_group_minimum_set_gen.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/Workspaces_ListByResourceGroup_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Workspaces_ListByResourceGroup_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_subscription_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_subscription_maximum_set_gen.py index b16ab11e3453..27385199df44 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_subscription_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_subscription_maximum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/Workspaces_ListBySubscription_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Workspaces_ListBySubscription_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_subscription_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_subscription_minimum_set_gen.py index 47c026d543a3..15401ce191c7 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_subscription_minimum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_list_by_subscription_minimum_set_gen.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: 2025-08-02/Workspaces_ListBySubscription_MinimumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Workspaces_ListBySubscription_MinimumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_update_maximum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_update_maximum_set_gen.py index 7e8f7599915d..a3e3a39376af 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_update_maximum_set_gen.py +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_update_maximum_set_gen.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: 2025-08-02/Workspaces_Update_MaximumSet_Gen.json +# x-ms-original-file: 2026-06-01-preview/Workspaces_Update_MaximumSet_Gen.json if __name__ == "__main__": main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_update_minimum_set_gen.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_update_minimum_set_gen.py new file mode 100644 index 000000000000..65833a9115fe --- /dev/null +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_samples/workspaces_update_minimum_set_gen.py @@ -0,0 +1,46 @@ +# 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.iotfirmwaredefense import IoTFirmwareDefenseMgmtClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-iotfirmwaredefense +# USAGE + python workspaces_update_minimum_set_gen.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 = IoTFirmwareDefenseMgmtClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.workspaces.update( + resource_group_name="rgworkspaces", + workspace_name="WorkspaceName", + properties={ + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + }, + ) + print(response) + + +# x-ms-original-file: 2026-06-01-preview/Workspaces_Update_MinimumSet_Gen.json +if __name__ == "__main__": + main() diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_tests/test_io_tfirmware_defense_mgmt_unsafe_function_calls_operations.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_tests/test_io_tfirmware_defense_mgmt_unsafe_function_calls_operations.py new file mode 100644 index 000000000000..35c80e4820c6 --- /dev/null +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_tests/test_io_tfirmware_defense_mgmt_unsafe_function_calls_operations.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.iotfirmwaredefense import IoTFirmwareDefenseMgmtClient + +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 TestIoTFirmwareDefenseMgmtUnsafeFunctionCallsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(IoTFirmwareDefenseMgmtClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_unsafe_function_calls_list_by_firmware(self, resource_group): + response = self.client.unsafe_function_calls.list_by_firmware( + resource_group_name=resource_group.name, + workspace_name="str", + firmware_id="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_tests/test_io_tfirmware_defense_mgmt_unsafe_function_calls_operations_async.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_tests/test_io_tfirmware_defense_mgmt_unsafe_function_calls_operations_async.py new file mode 100644 index 000000000000..de7ec4293240 --- /dev/null +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/generated_tests/test_io_tfirmware_defense_mgmt_unsafe_function_calls_operations_async.py @@ -0,0 +1,32 @@ +# 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.iotfirmwaredefense.aio import IoTFirmwareDefenseMgmtClient + +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 TestIoTFirmwareDefenseMgmtUnsafeFunctionCallsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(IoTFirmwareDefenseMgmtClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_unsafe_function_calls_list_by_firmware(self, resource_group): + response = self.client.unsafe_function_calls.list_by_firmware( + resource_group_name=resource_group.name, + workspace_name="str", + firmware_id="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/pyproject.toml b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/pyproject.toml index 63266cbdaa62..d2a481024157 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/pyproject.toml +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/pyproject.toml @@ -1,3 +1,72 @@ +[build-system] +requires = [ + "setuptools>=77.0.3", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "azure-mgmt-iotfirmwaredefense" +authors = [ + { name = "Microsoft Corporation", email = "azpysdkhelp@microsoft.com" }, +] +description = "Microsoft Azure Iotfirmwaredefense Management Client Library for Python" +license = "MIT" +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "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.10" +keywords = [ + "azure", + "azure sdk", +] +dependencies = [ + "isodate>=0.6.1", + "azure-mgmt-core>=1.6.0", + "typing-extensions>=4.6.0", +] +dynamic = [ + "version", + "readme", +] + +[project.urls] +repository = "https://github.com/Azure/azure-sdk-for-python" + +[tool.setuptools.dynamic.version] +attr = "azure.mgmt.iotfirmwaredefense._version.VERSION" + +[tool.setuptools.dynamic.readme] +file = [ + "README.md", + "CHANGELOG.md", +] +content-type = "text/markdown" + +[tool.setuptools.packages.find] +exclude = [ + "tests*", + "generated_tests*", + "samples*", + "generated_samples*", + "doc*", + "azure", + "azure.mgmt", +] + +[tool.setuptools.package-data] +pytyped = [ + "py.typed", +] + [tool.azure-sdk-build] breaking = false mypy = false @@ -10,9 +79,10 @@ package_name = "azure-mgmt-iotfirmwaredefense" package_nspkg = "azure-mgmt-nspkg" package_pprint_name = "Iotfirmwaredefense Management" package_doc_id = "" -is_stable = true +is_stable = false is_arm = true need_msrestazure = false need_azuremgmtcore = true sample_link = "" title = "IoTFirmwareDefenseMgmtClient" +exclude_folders = "" diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/setup.py b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/setup.py deleted file mode 100644 index 59f563f8b3aa..000000000000 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/setup.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python - -# ------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -------------------------------------------------------------------------- - -import re -import os.path -from io import open -from setuptools import find_packages, setup - -# Change the PACKAGE_NAME only to change folder and different name -PACKAGE_NAME = "azure-mgmt-iotfirmwaredefense" -PACKAGE_PPRINT_NAME = "Iotfirmwaredefense Management" - -# a-b-c => a/b/c -package_folder_path = PACKAGE_NAME.replace("-", "/") -# a-b-c => a.b.c -namespace_name = PACKAGE_NAME.replace("-", ".") - -# Version extraction inspired from 'requests' -with open( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py"), - "r", -) as fd: - version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) - -if not version: - raise RuntimeError("Cannot find version information") - -with open("README.md", encoding="utf-8") as f: - readme = f.read() -with open("CHANGELOG.md", encoding="utf-8") as f: - changelog = f.read() - -setup( - name=PACKAGE_NAME, - version=version, - description="Microsoft Azure {} Client Library for Python".format(PACKAGE_PPRINT_NAME), - long_description=readme + "\n\n" + changelog, - long_description_content_type="text/markdown", - license="MIT License", - author="Microsoft Corporation", - author_email="azpysdkhelp@microsoft.com", - url="https://github.com/Azure/azure-sdk-for-python", - keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product - classifiers=[ - "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", - "License :: OSI Approved :: MIT License", - ], - zip_safe=False, - packages=find_packages( - exclude=[ - "tests", - # Exclude packages that will be covered by PEP420 or nspkg - "azure", - "azure.mgmt", - ] - ), - include_package_data=True, - package_data={ - "pytyped": ["py.typed"], - }, - install_requires=[ - "isodate>=0.6.1", - "typing-extensions>=4.6.0", - "azure-common>=1.1", - "azure-mgmt-core>=1.6.0", - ], - python_requires=">=3.9", -) diff --git a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/tsp-location.yaml b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/tsp-location.yaml index 9ad36ef751a4..1ea7aef0631e 100644 --- a/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/tsp-location.yaml +++ b/sdk/iotfirmwaredefense/azure-mgmt-iotfirmwaredefense/tsp-location.yaml @@ -1,4 +1,4 @@ -directory: specification/fist/IotFirmwareDefense.Management -commit: 222af3670e36c5083cb0dc8a9c2677a8f77f8958 +directory: specification/fist/resource-manager/Microsoft.IoTFirmwareDefense/IoTFirmwareDefense +commit: 4362bdee9aba8de72a82c14063e3bd5f3e55c3bf repo: Azure/azure-rest-api-specs additionalDirectories: