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 NginxManagementClientConfiguration
1720from ._serialization import Deserializer , Serializer
18- from .operations import CertificatesOperations , ConfigurationsOperations , DeploymentsOperations , Operations
21+ from .operations import (
22+ ApiKeysOperations ,
23+ CertificatesOperations ,
24+ ConfigurationsOperations ,
25+ DeploymentsOperations ,
26+ Operations ,
27+ )
1928
2029if TYPE_CHECKING :
21- # pylint: disable=unused-import,ungrouped-imports
2230 from azure .core .credentials import TokenCredential
2331
2432
25- class NginxManagementClient : # pylint: disable=client-accepts-api-version-keyword
33+ class NginxManagementClient :
2634 """NginxManagementClient.
2735
36+ :ivar api_keys: ApiKeysOperations operations
37+ :vartype api_keys: azure.mgmt.nginx.operations.ApiKeysOperations
2838 :ivar certificates: CertificatesOperations operations
2939 :vartype certificates: azure.mgmt.nginx.operations.CertificatesOperations
3040 :ivar configurations: ConfigurationsOperations operations
@@ -35,11 +45,11 @@ class NginxManagementClient: # pylint: disable=client-accepts-api-version-keywo
3545 :vartype operations: azure.mgmt.nginx.operations.Operations
3646 :param credential: Credential needed for the client to connect to Azure. Required.
3747 :type credential: ~azure.core.credentials.TokenCredential
38- :param subscription_id: The ID of the target subscription. Required.
48+ :param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3949 :type subscription_id: str
4050 :param base_url: Service URL. Default value is "https://management.azure.com".
4151 :type base_url: str
42- :keyword api_version: Api Version. Default value is "2024-01 -01-preview". Note that overriding
52+ :keyword api_version: Api Version. Default value is "2024-11 -01-preview". Note that overriding
4353 this default value may result in unsupported behavior.
4454 :paramtype api_version: str
4555 :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -56,18 +66,37 @@ def __init__(
5666 self ._config = NginxManagementClientConfiguration (
5767 credential = credential , subscription_id = subscription_id , ** kwargs
5868 )
59- self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
69+ _policies = kwargs .pop ("policies" , None )
70+ if _policies is None :
71+ _policies = [
72+ policies .RequestIdPolicy (** kwargs ),
73+ self ._config .headers_policy ,
74+ self ._config .user_agent_policy ,
75+ self ._config .proxy_policy ,
76+ policies .ContentDecodePolicy (** kwargs ),
77+ ARMAutoResourceProviderRegistrationPolicy (),
78+ self ._config .redirect_policy ,
79+ self ._config .retry_policy ,
80+ self ._config .authentication_policy ,
81+ self ._config .custom_hook_policy ,
82+ self ._config .logging_policy ,
83+ policies .DistributedTracingPolicy (** kwargs ),
84+ policies .SensitiveHeaderCleanupPolicy (** kwargs ) if self ._config .redirect_policy else None ,
85+ self ._config .http_logging_policy ,
86+ ]
87+ self ._client : ARMPipelineClient = ARMPipelineClient (base_url = base_url , policies = _policies , ** kwargs )
6088
6189 client_models = {k : v for k , v in _models .__dict__ .items () if isinstance (v , type )}
6290 self ._serialize = Serializer (client_models )
6391 self ._deserialize = Deserializer (client_models )
6492 self ._serialize .client_side_validation = False
93+ self .api_keys = ApiKeysOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
6594 self .certificates = CertificatesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
6695 self .configurations = ConfigurationsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
6796 self .deployments = DeploymentsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
6897 self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
6998
70- def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
99+ def _send_request (self , request : HttpRequest , * , stream : bool = False , * *kwargs : Any ) -> HttpResponse :
71100 """Runs the network request through the client's chained policies.
72101
73102 >>> from azure.core.rest import HttpRequest
@@ -87,12 +116,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
87116
88117 request_copy = deepcopy (request )
89118 request_copy .url = self ._client .format_url (request_copy .url )
90- return self ._client .send_request (request_copy , ** kwargs )
119+ return self ._client .send_request (request_copy , stream = stream , ** kwargs ) # type: ignore
91120
92121 def close (self ) -> None :
93122 self ._client .close ()
94123
95- def __enter__ (self ) -> "NginxManagementClient" :
124+ def __enter__ (self ) -> Self :
96125 self ._client .__enter__ ()
97126 return self
98127
0 commit comments