88
99from copy import deepcopy
1010from typing import Any , TYPE_CHECKING
11+ from typing_extensions import Self
1112
13+ from azure .core .pipeline import policies
1214from azure .core .rest import HttpRequest , HttpResponse
1315from azure .mgmt .core import ARMPipelineClient
16+ from azure .mgmt .core .policies import ARMAutoResourceProviderRegistrationPolicy
1417
1518from . import models as _models
1619from ._configuration import IoTFirmwareDefenseMgmtClientConfiguration
2528 PasswordHashesOperations ,
2629 SbomComponentsOperations ,
2730 SummariesOperations ,
31+ UsageMetricsOperations ,
2832 WorkspacesOperations ,
2933)
3034
3135if TYPE_CHECKING :
32- # pylint: disable=unused-import,ungrouped-imports
3336 from azure .core .credentials import TokenCredential
3437
3538
36- class IoTFirmwareDefenseMgmtClient : # pylint: disable=client-accepts-api-version-keyword, too-many-instance-attributes
39+ class IoTFirmwareDefenseMgmtClient : # pylint: disable=too-many-instance-attributes
3740 """Firmware & IoT Security REST API.
3841
42+ :ivar operations: Operations operations
43+ :vartype operations: azure.mgmt.iotfirmwaredefense.operations.Operations
44+ :ivar workspaces: WorkspacesOperations operations
45+ :vartype workspaces: azure.mgmt.iotfirmwaredefense.operations.WorkspacesOperations
46+ :ivar firmwares: FirmwaresOperations operations
47+ :vartype firmwares: azure.mgmt.iotfirmwaredefense.operations.FirmwaresOperations
3948 :ivar binary_hardening: BinaryHardeningOperations operations
4049 :vartype binary_hardening: azure.mgmt.iotfirmwaredefense.operations.BinaryHardeningOperations
50+ :ivar cves: CvesOperations operations
51+ :vartype cves: azure.mgmt.iotfirmwaredefense.operations.CvesOperations
4152 :ivar crypto_certificates: CryptoCertificatesOperations operations
4253 :vartype crypto_certificates:
4354 azure.mgmt.iotfirmwaredefense.operations.CryptoCertificatesOperations
4455 :ivar crypto_keys: CryptoKeysOperations operations
4556 :vartype crypto_keys: azure.mgmt.iotfirmwaredefense.operations.CryptoKeysOperations
46- :ivar cves: CvesOperations operations
47- :vartype cves: azure.mgmt.iotfirmwaredefense.operations.CvesOperations
48- :ivar firmwares: FirmwaresOperations operations
49- :vartype firmwares: azure.mgmt.iotfirmwaredefense.operations.FirmwaresOperations
50- :ivar operations: Operations operations
51- :vartype operations: azure.mgmt.iotfirmwaredefense.operations.Operations
5257 :ivar password_hashes: PasswordHashesOperations operations
5358 :vartype password_hashes: azure.mgmt.iotfirmwaredefense.operations.PasswordHashesOperations
5459 :ivar sbom_components: SbomComponentsOperations operations
5560 :vartype sbom_components: azure.mgmt.iotfirmwaredefense.operations.SbomComponentsOperations
5661 :ivar summaries: SummariesOperations operations
5762 :vartype summaries: azure.mgmt.iotfirmwaredefense.operations.SummariesOperations
58- :ivar workspaces: WorkspacesOperations operations
59- :vartype workspaces : azure.mgmt.iotfirmwaredefense.operations.WorkspacesOperations
63+ :ivar usage_metrics: UsageMetricsOperations operations
64+ :vartype usage_metrics : azure.mgmt.iotfirmwaredefense.operations.UsageMetricsOperations
6065 :param credential: Credential needed for the client to connect to Azure. Required.
6166 :type credential: ~azure.core.credentials.TokenCredential
6267 :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
6368 :type subscription_id: str
6469 :param base_url: Service URL. Default value is "https://management.azure.com".
6570 :type base_url: str
66- :keyword api_version: Api Version. Default value is "2024- 01-10 ". Note that overriding this
67- default value may result in unsupported behavior.
71+ :keyword api_version: Api Version. Default value is "2025-04- 01-preview ". Note that overriding
72+ this default value may result in unsupported behavior.
6873 :paramtype api_version: str
6974 """
7075
@@ -78,28 +83,47 @@ def __init__(
7883 self ._config = IoTFirmwareDefenseMgmtClientConfiguration (
7984 credential = credential , subscription_id = subscription_id , ** kwargs
8085 )
81- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
86+ _policies = kwargs .pop ("policies" , None )
87+ if _policies is None :
88+ _policies = [
89+ policies .RequestIdPolicy (** kwargs ),
90+ self ._config .headers_policy ,
91+ self ._config .user_agent_policy ,
92+ self ._config .proxy_policy ,
93+ policies .ContentDecodePolicy (** kwargs ),
94+ ARMAutoResourceProviderRegistrationPolicy (),
95+ self ._config .redirect_policy ,
96+ self ._config .retry_policy ,
97+ self ._config .authentication_policy ,
98+ self ._config .custom_hook_policy ,
99+ self ._config .logging_policy ,
100+ policies .DistributedTracingPolicy (** kwargs ),
101+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
102+ self ._config .http_logging_policy ,
103+ ]
104+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
82105
83106 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
84107 self ._serialize = Serializer (client_models )
85108 self ._deserialize = Deserializer (client_models )
86109 self ._serialize .client_side_validation = False
110+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
111+ self .workspaces = WorkspacesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
112+ self .firmwares = FirmwaresOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
87113 self .binary_hardening = BinaryHardeningOperations (
88114 self ._client , self ._config , self ._serialize , self ._deserialize
89115 )
116+ self .cves = CvesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
90117 self .crypto_certificates = CryptoCertificatesOperations (
91118 self ._client , self ._config , self ._serialize , self ._deserialize
92119 )
93120 self .crypto_keys = CryptoKeysOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
94- self .cves = CvesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
95- self .firmwares = FirmwaresOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
96- self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
97121 self .password_hashes = PasswordHashesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
98122 self .sbom_components = SbomComponentsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
99123 self .summaries = SummariesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
100- self .workspaces = WorkspacesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
124+ self .usage_metrics = UsageMetricsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
101125
102- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
126+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
103127 """Runs the network request through the client's chained policies.
104128
105129 >>> from azure.core.rest import HttpRequest
@@ -119,12 +143,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
119143
120144 request_copy = deepcopy (request )
121145 request_copy .url = self ._client .format_url (request_copy .url )
122- return self ._client .send_request (request_copy , ** kwargs )
146+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
123147
124148 def close (self ) -> None :
125149 self ._client .close ()
126150
127- def __enter__ (self ) -> "IoTFirmwareDefenseMgmtClient" :
151+ def __enter__ (self ) -> Self :
128152 self ._client .__enter__ ()
129153 return self
130154
0 commit comments