9
9
from copy import deepcopy
10
10
from typing import Any , TYPE_CHECKING
11
11
12
- from msrest import Deserializer , Serializer
13
-
14
12
from azure .core .rest import HttpRequest , HttpResponse
15
13
from azure .mgmt .core import ARMPipelineClient
16
14
17
15
from . import models
18
16
from ._configuration import CognitiveServicesManagementClientConfiguration
19
- from .operations import AccountsOperations , CognitiveServicesManagementClientOperationsMixin , CommitmentPlansOperations , CommitmentTiersOperations , DeletedAccountsOperations , DeploymentsOperations , Operations , PrivateEndpointConnectionsOperations , PrivateLinkResourcesOperations , ResourceSkusOperations
17
+ from ._serialization import Deserializer , Serializer
18
+ from .operations import (
19
+ AccountsOperations ,
20
+ CognitiveServicesManagementClientOperationsMixin ,
21
+ CommitmentPlansOperations ,
22
+ CommitmentTiersOperations ,
23
+ DeletedAccountsOperations ,
24
+ DeploymentsOperations ,
25
+ Operations ,
26
+ PrivateEndpointConnectionsOperations ,
27
+ PrivateLinkResourcesOperations ,
28
+ ResourceSkusOperations ,
29
+ )
20
30
21
31
if TYPE_CHECKING :
22
32
# pylint: disable=unused-import,ungrouped-imports
23
33
from azure .core .credentials import TokenCredential
24
34
25
- class CognitiveServicesManagementClient (CognitiveServicesManagementClientOperationsMixin ): # pylint: disable=too-many-instance-attributes
35
+
36
+ class CognitiveServicesManagementClient (
37
+ CognitiveServicesManagementClientOperationsMixin
38
+ ): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
26
39
"""Cognitive Services Management Client.
27
40
28
41
:ivar accounts: AccountsOperations operations
@@ -45,13 +58,13 @@ class CognitiveServicesManagementClient(CognitiveServicesManagementClientOperati
45
58
:vartype deployments: azure.mgmt.cognitiveservices.operations.DeploymentsOperations
46
59
:ivar commitment_plans: CommitmentPlansOperations operations
47
60
:vartype commitment_plans: azure.mgmt.cognitiveservices.operations.CommitmentPlansOperations
48
- :param credential: Credential needed for the client to connect to Azure.
61
+ :param credential: Credential needed for the client to connect to Azure. Required.
49
62
:type credential: ~azure.core.credentials.TokenCredential
50
- :param subscription_id: The ID of the target subscription.
63
+ :param subscription_id: The ID of the target subscription. Required.
51
64
:type subscription_id: str
52
65
:param base_url: Service URL. Default value is "https://management.azure.com".
53
66
:type base_url: str
54
- :keyword api_version: Api Version. Default value is "2022-03 -01". Note that overriding this
67
+ :keyword api_version: Api Version. Default value is "2022-10 -01". Note that overriding this
55
68
default value may result in unsupported behavior.
56
69
:paramtype api_version: str
57
70
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
@@ -65,29 +78,36 @@ def __init__(
65
78
base_url : str = "https://management.azure.com" ,
66
79
** kwargs : Any
67
80
) -> None :
68
- self ._config = CognitiveServicesManagementClientConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
81
+ self ._config = CognitiveServicesManagementClientConfiguration (
82
+ credential = credential , subscription_id = subscription_id , ** kwargs
83
+ )
69
84
self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
70
85
71
86
client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
72
87
self ._serialize = Serializer (client_models )
73
88
self ._deserialize = Deserializer (client_models )
74
89
self ._serialize .client_side_validation = False
75
90
self .accounts = AccountsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
76
- self .deleted_accounts = DeletedAccountsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
91
+ self .deleted_accounts = DeletedAccountsOperations (
92
+ self ._client , self ._config , self ._serialize , self ._deserialize
93
+ )
77
94
self .resource_skus = ResourceSkusOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
78
95
self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
79
- self .commitment_tiers = CommitmentTiersOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
80
- self .private_endpoint_connections = PrivateEndpointConnectionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
81
- self .private_link_resources = PrivateLinkResourcesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
96
+ self .commitment_tiers = CommitmentTiersOperations (
97
+ self ._client , self ._config , self ._serialize , self ._deserialize
98
+ )
99
+ self .private_endpoint_connections = PrivateEndpointConnectionsOperations (
100
+ self ._client , self ._config , self ._serialize , self ._deserialize
101
+ )
102
+ self .private_link_resources = PrivateLinkResourcesOperations (
103
+ self ._client , self ._config , self ._serialize , self ._deserialize
104
+ )
82
105
self .deployments = DeploymentsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
83
- self .commitment_plans = CommitmentPlansOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
84
-
106
+ self .commitment_plans = CommitmentPlansOperations (
107
+ self ._client , self ._config , self ._serialize , self ._deserialize
108
+ )
85
109
86
- def _send_request (
87
- self ,
88
- request : HttpRequest ,
89
- ** kwargs : Any
90
- ) -> HttpResponse :
110
+ def _send_request (self , request : HttpRequest , ** kwargs : Any ) -> HttpResponse :
91
111
"""Runs the network request through the client's chained policies.
92
112
93
113
>>> from azure.core.rest import HttpRequest
@@ -96,7 +116,7 @@ def _send_request(
96
116
>>> response = client._send_request(request)
97
117
<HttpResponse: 200 OK>
98
118
99
- For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
119
+ For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/ python/send_request
100
120
101
121
:param request: The network request you want to make. Required.
102
122
:type request: ~azure.core.rest.HttpRequest
0 commit comments