Skip to content

Commit 5a29734

Browse files
author
SDKAuto
committed
CodeGen from PR 14090 in Azure/azure-rest-api-specs
Merge 97abfdacd1f7d4d1622cd0e0721a6f042e6620b8 into 88d9023
1 parent d0363ee commit 5a29734

14 files changed

+238
-118
lines changed

sdk/confluent/azure-mgmt-confluent/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include _meta.json
12
recursive-include tests *.py *.yaml
23
include *.md
34
include azure/__init__.py
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"autorest": "3.3.0",
3+
"use": "@autorest/[email protected]",
4+
"commit": "b02ab2cc7b8d6c42249ccb97221baf8228e6dbbd",
5+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
6+
"autorest_command": "autorest specification/confluent/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --version=3.3.0",
7+
"readme": "specification/confluent/resource-manager/readme.md"
8+
}

sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_confluent_management_client.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from typing import Any, Optional
1717

1818
from azure.core.credentials import TokenCredential
19+
from azure.core.pipeline.transport import HttpRequest, HttpResponse
1920

2021
from ._configuration import ConfluentManagementClientConfiguration
2122
from .operations import MarketplaceAgreementsOperations
@@ -56,6 +57,7 @@ def __init__(
5657

5758
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
5859
self._serialize = Serializer(client_models)
60+
self._serialize.client_side_validation = False
5961
self._deserialize = Deserializer(client_models)
6062

6163
self.marketplace_agreements = MarketplaceAgreementsOperations(
@@ -65,6 +67,24 @@ def __init__(
6567
self.organization = OrganizationOperations(
6668
self._client, self._config, self._serialize, self._deserialize)
6769

70+
def _send_request(self, http_request, **kwargs):
71+
# type: (HttpRequest, Any) -> HttpResponse
72+
"""Runs the network request through the client's chained policies.
73+
74+
:param http_request: The network request you want to make. Required.
75+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
76+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
77+
:return: The response of your network call. Does not do error handling on your response.
78+
:rtype: ~azure.core.pipeline.transport.HttpResponse
79+
"""
80+
path_format_arguments = {
81+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
82+
}
83+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
84+
stream = kwargs.pop("stream", True)
85+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
86+
return pipeline_response.http_response
87+
6888
def close(self):
6989
# type: () -> None
7090
self._client.close()

sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_metadata.json

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"custom_base_url": null,
1010
"azure_arm": true,
1111
"has_lro_operations": true,
12-
"client_side_validation": true
12+
"client_side_validation": false,
13+
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ConfluentManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
14+
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ConfluentManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
1315
},
1416
"global_parameters": {
1517
"sync": {
@@ -28,36 +30,76 @@
2830
},
2931
"async": {
3032
"credential": {
31-
"signature": "credential, # type: \"AsyncTokenCredential\"",
33+
"signature": "credential: \"AsyncTokenCredential\",",
3234
"description": "Credential needed for the client to connect to Azure.",
3335
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
3436
"required": true
3537
},
3638
"subscription_id": {
37-
"signature": "subscription_id, # type: str",
39+
"signature": "subscription_id: str,",
3840
"description": "Microsoft Azure subscription id.",
3941
"docstring_type": "str",
4042
"required": true
4143
}
4244
},
4345
"constant": {
4446
},
45-
"call": "credential, subscription_id"
47+
"call": "credential, subscription_id",
48+
"service_client_specific": {
49+
"sync": {
50+
"api_version": {
51+
"signature": "api_version=None, # type: Optional[str]",
52+
"description": "API version to use if no profile is provided, or if missing in profile.",
53+
"docstring_type": "str",
54+
"required": false
55+
},
56+
"base_url": {
57+
"signature": "base_url=None, # type: Optional[str]",
58+
"description": "Service URL",
59+
"docstring_type": "str",
60+
"required": false
61+
},
62+
"profile": {
63+
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
64+
"description": "A profile definition, from KnownProfiles to dict.",
65+
"docstring_type": "azure.profiles.KnownProfiles",
66+
"required": false
67+
}
68+
},
69+
"async": {
70+
"api_version": {
71+
"signature": "api_version: Optional[str] = None,",
72+
"description": "API version to use if no profile is provided, or if missing in profile.",
73+
"docstring_type": "str",
74+
"required": false
75+
},
76+
"base_url": {
77+
"signature": "base_url: Optional[str] = None,",
78+
"description": "Service URL",
79+
"docstring_type": "str",
80+
"required": false
81+
},
82+
"profile": {
83+
"signature": "profile: KnownProfiles = KnownProfiles.default,",
84+
"description": "A profile definition, from KnownProfiles to dict.",
85+
"docstring_type": "azure.profiles.KnownProfiles",
86+
"required": false
87+
}
88+
}
89+
}
4690
},
4791
"config": {
4892
"credential": true,
4993
"credential_scopes": ["https://management.azure.com/.default"],
5094
"credential_default_policy_type": "BearerTokenCredentialPolicy",
5195
"credential_default_policy_type_has_async_version": true,
52-
"credential_key_header_name": null
96+
"credential_key_header_name": null,
97+
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
98+
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
5399
},
54100
"operation_groups": {
55101
"marketplace_agreements": "MarketplaceAgreementsOperations",
56102
"organization_operations": "OrganizationOperationsOperations",
57103
"organization": "OrganizationOperations"
58-
},
59-
"operation_mixins": {
60-
},
61-
"sync_imports": "None",
62-
"async_imports": "None"
104+
}
63105
}

sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "1.0.0"
9+
VERSION = "1.0.0b1"

sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/_confluent_management_client.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from typing import Any, Optional, TYPE_CHECKING
1010

11+
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
1112
from azure.mgmt.core import AsyncARMPipelineClient
1213
from msrest import Deserializer, Serializer
1314

@@ -53,6 +54,7 @@ def __init__(
5354

5455
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
5556
self._serialize = Serializer(client_models)
57+
self._serialize.client_side_validation = False
5658
self._deserialize = Deserializer(client_models)
5759

5860
self.marketplace_agreements = MarketplaceAgreementsOperations(
@@ -62,6 +64,23 @@ def __init__(
6264
self.organization = OrganizationOperations(
6365
self._client, self._config, self._serialize, self._deserialize)
6466

67+
async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
68+
"""Runs the network request through the client's chained policies.
69+
70+
:param http_request: The network request you want to make. Required.
71+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
72+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
73+
:return: The response of your network call. Does not do error handling on your response.
74+
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
75+
"""
76+
path_format_arguments = {
77+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
78+
}
79+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
80+
stream = kwargs.pop("stream", True)
81+
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
82+
return pipeline_response.http_response
83+
6584
async def close(self) -> None:
6685
await self._client.close()
6786

sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_marketplace_agreements_operations.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def list(
5959
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
6060
}
6161
error_map.update(kwargs.pop('error_map', {}))
62+
api_version = "2020-03-01"
6263
accept = "application/json"
6364

6465
def prepare_request(next_link=None):
@@ -75,6 +76,7 @@ def prepare_request(next_link=None):
7576
url = self._client.format_url(url, **path_format_arguments)
7677
# Construct parameters
7778
query_parameters = {} # type: Dict[str, Any]
79+
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
7880

7981
request = self._client.get(url, query_parameters, header_parameters)
8082
else:
@@ -97,7 +99,7 @@ async def get_next(next_link=None):
9799
response = pipeline_response.http_response
98100

99101
if response.status_code not in [200]:
100-
error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response)
102+
error = self._deserialize.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response)
101103
map_error(status_code=response.status_code, response=response, error_map=error_map)
102104
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
103105

@@ -129,6 +131,7 @@ async def create(
129131
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
130132
}
131133
error_map.update(kwargs.pop('error_map', {}))
134+
api_version = "2020-03-01"
132135
content_type = kwargs.pop("content_type", "application/json")
133136
accept = "application/json"
134137

@@ -141,6 +144,7 @@ async def create(
141144

142145
# Construct parameters
143146
query_parameters = {} # type: Dict[str, Any]
147+
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
144148

145149
# Construct headers
146150
header_parameters = {} # type: Dict[str, Any]
@@ -159,7 +163,7 @@ async def create(
159163

160164
if response.status_code not in [200]:
161165
map_error(status_code=response.status_code, response=response, error_map=error_map)
162-
error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response)
166+
error = self._deserialize.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response)
163167
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
164168

165169
deserialized = self._deserialize('ConfluentAgreementResource', pipeline_response)

sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_organization_operations.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async def get_next(next_link=None):
101101
response = pipeline_response.http_response
102102

103103
if response.status_code not in [200]:
104-
error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response)
104+
error = self._deserialize.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response)
105105
map_error(status_code=response.status_code, response=response, error_map=error_map)
106106
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
107107

@@ -174,7 +174,7 @@ async def get_next(next_link=None):
174174
response = pipeline_response.http_response
175175

176176
if response.status_code not in [200]:
177-
error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response)
177+
error = self._deserialize.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response)
178178
map_error(status_code=response.status_code, response=response, error_map=error_map)
179179
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
180180

@@ -235,7 +235,7 @@ async def get(
235235

236236
if response.status_code not in [200]:
237237
map_error(status_code=response.status_code, response=response, error_map=error_map)
238-
error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response)
238+
error = self._deserialize.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response)
239239
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
240240

241241
deserialized = self._deserialize('OrganizationResource', pipeline_response)
@@ -292,7 +292,7 @@ async def _create_initial(
292292

293293
if response.status_code not in [200, 201]:
294294
map_error(status_code=response.status_code, response=response, error_map=error_map)
295-
error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response)
295+
error = self._deserialize.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response)
296296
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
297297

298298
if response.status_code == 200:
@@ -326,8 +326,8 @@ async def begin_create(
326326
:type body: ~azure.mgmt.confluent.models.OrganizationResource
327327
:keyword callable cls: A custom type or function that will be passed the direct response
328328
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
329-
:keyword polling: True for ARMPolling, False for no polling, or a
330-
polling object for personal polling strategy
329+
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
330+
False for no polling, or your own initialized polling object for a personal polling strategy.
331331
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
332332
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
333333
:return: An instance of AsyncLROPoller that returns either OrganizationResource or the result of cls(response)
@@ -441,7 +441,7 @@ async def update(
441441

442442
if response.status_code not in [200]:
443443
map_error(status_code=response.status_code, response=response, error_map=error_map)
444-
error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response)
444+
error = self._deserialize.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response)
445445
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
446446

447447
deserialized = self._deserialize('OrganizationResource', pipeline_response)
@@ -489,7 +489,7 @@ async def _delete_initial(
489489

490490
if response.status_code not in [200, 202, 204]:
491491
map_error(status_code=response.status_code, response=response, error_map=error_map)
492-
error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response)
492+
error = self._deserialize.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response)
493493
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
494494

495495
if cls:
@@ -513,8 +513,8 @@ async def begin_delete(
513513
:type organization_name: str
514514
:keyword callable cls: A custom type or function that will be passed the direct response
515515
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
516-
:keyword polling: True for ARMPolling, False for no polling, or a
517-
polling object for personal polling strategy
516+
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
517+
False for no polling, or your own initialized polling object for a personal polling strategy.
518518
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
519519
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
520520
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)

sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_organization_operations_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ async def get_next(next_link=None):
9595
response = pipeline_response.http_response
9696

9797
if response.status_code not in [200]:
98-
error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response)
98+
error = self._deserialize.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response)
9999
map_error(status_code=response.status_code, response=response, error_map=error_map)
100100
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
101101

0 commit comments

Comments
 (0)