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 PaloAltoNetworksNgfwMgmtClientConfiguration
2629 LocalRulesOperations ,
2730 LocalRulestacksOperations ,
2831 Operations ,
32+ PaloAltoNetworksCloudngfwOperations ,
2933 PostRulesOperations ,
3034 PreRulesOperations ,
3135 PrefixListGlobalRulestackOperations ,
3236 PrefixListLocalRulestackOperations ,
3337)
3438
3539if TYPE_CHECKING :
36- # pylint: disable=unused-import,ungrouped-imports
3740 from azure .core .credentials import TokenCredential
3841
3942
40- class PaloAltoNetworksNgfwMgmtClient : # pylint: disable=client-accepts-api-version-keyword, too-many-instance-attributes
43+ class PaloAltoNetworksNgfwMgmtClient : # pylint: disable=too-many-instance-attributes
4144 """PaloAltoNetworksNgfwMgmtClient.
4245
4346 :ivar global_rulestack: GlobalRulestackOperations operations
@@ -58,6 +61,9 @@ class PaloAltoNetworksNgfwMgmtClient: # pylint: disable=client-accepts-api-vers
5861 :vartype pre_rules: azure.mgmt.paloaltonetworksngfw.operations.PreRulesOperations
5962 :ivar operations: Operations operations
6063 :vartype operations: azure.mgmt.paloaltonetworksngfw.operations.Operations
64+ :ivar palo_alto_networks_cloudngfw: PaloAltoNetworksCloudngfwOperations operations
65+ :vartype palo_alto_networks_cloudngfw:
66+ azure.mgmt.paloaltonetworksngfw.operations.PaloAltoNetworksCloudngfwOperations
6167 :ivar firewalls: FirewallsOperations operations
6268 :vartype firewalls: azure.mgmt.paloaltonetworksngfw.operations.FirewallsOperations
6369 :ivar local_rulestacks: LocalRulestacksOperations operations
@@ -81,8 +87,8 @@ class PaloAltoNetworksNgfwMgmtClient: # pylint: disable=client-accepts-api-vers
8187 :type subscription_id: str
8288 :param base_url: Service URL. Default value is "https://management.azure.com".
8389 :type base_url: str
84- :keyword api_version: Api Version. Default value is "2023-09-01 ". Note that overriding this
85- default value may result in unsupported behavior.
90+ :keyword api_version: Api Version. Default value is "2025-02-06-preview ". Note that overriding
91+ this default value may result in unsupported behavior.
8692 :paramtype api_version: str
8793 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
8894 Retry-After header is present.
@@ -98,7 +104,25 @@ def __init__(
98104 self ._config = PaloAltoNetworksNgfwMgmtClientConfiguration (
99105 credential = credential , subscription_id = subscription_id , ** kwargs
100106 )
101- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
107+ _policies = kwargs .pop ("policies" , None )
108+ if _policies is None :
109+ _policies = [
110+ policies .RequestIdPolicy (** kwargs ),
111+ self ._config .headers_policy ,
112+ self ._config .user_agent_policy ,
113+ self ._config .proxy_policy ,
114+ policies .ContentDecodePolicy (** kwargs ),
115+ ARMAutoResourceProviderRegistrationPolicy (),
116+ self ._config .redirect_policy ,
117+ self ._config .retry_policy ,
118+ self ._config .authentication_policy ,
119+ self ._config .custom_hook_policy ,
120+ self ._config .logging_policy ,
121+ policies .DistributedTracingPolicy (** kwargs ),
122+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
123+ self ._config .http_logging_policy ,
124+ ]
125+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
102126
103127 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
104128 self ._serialize = Serializer (client_models )
@@ -119,6 +143,9 @@ def __init__(
119143 )
120144 self .pre_rules = PreRulesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
121145 self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
146+ self .palo_alto_networks_cloudngfw = PaloAltoNetworksCloudngfwOperations (
147+ self ._client , self ._config , self ._serialize , self ._deserialize
148+ )
122149 self .firewalls = FirewallsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
123150 self .local_rulestacks = LocalRulestacksOperations (
124151 self ._client , self ._config , self ._serialize , self ._deserialize
@@ -135,7 +162,7 @@ def __init__(
135162 self ._client , self ._config , self ._serialize , self ._deserialize
136163 )
137164
138- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
165+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
139166 """Runs the network request through the client's chained policies.
140167
141168 >>> from azure.core.rest import HttpRequest
@@ -155,12 +182,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
155182
156183 request_copy = deepcopy (request )
157184 request_copy .url = self ._client .format_url (request_copy .url )
158- return self ._client .send_request (request_copy , ** kwargs )
185+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
159186
160187 def close (self ) -> None :
161188 self ._client .close ()
162189
163- def __enter__ (self ) -> "PaloAltoNetworksNgfwMgmtClient" :
190+ def __enter__ (self ) -> Self :
164191 self ._client .__enter__ ()
165192 return self
166193
0 commit comments