Skip to content

Commit bd161cc

Browse files
author
SDKAuto
committed
CodeGen from PR 11639 in Azure/azure-rest-api-specs
Merge b4b64803111a6a3c3e13503104b6c7b35b6f9ec7 into 7c8fd7f
1 parent c509c6b commit bd161cc

18 files changed

+680
-32
lines changed

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,33 @@
88
"base_url": "\u0027https://management.azure.com\u0027",
99
"custom_base_url": null,
1010
"azure_arm": true,
11-
"has_lro_operations": true
11+
"has_lro_operations": true,
12+
"client_side_validation": true
1213
},
1314
"global_parameters": {
14-
"sync_method": {
15+
"sync": {
1516
"credential": {
16-
"method_signature": "credential, # type: \"TokenCredential\"",
17+
"signature": "credential, # type: \"TokenCredential\"",
1718
"description": "Credential needed for the client to connect to Azure.",
1819
"docstring_type": "~azure.core.credentials.TokenCredential",
1920
"required": true
2021
},
2122
"subscription_id": {
22-
"method_signature": "subscription_id, # type: str",
23+
"signature": "subscription_id, # type: str",
2324
"description": "The Microsoft Azure subscription ID.",
2425
"docstring_type": "str",
2526
"required": true
2627
}
2728
},
28-
"async_method": {
29+
"async": {
2930
"credential": {
30-
"method_signature": "credential, # type: \"AsyncTokenCredential\"",
31+
"signature": "credential, # type: \"AsyncTokenCredential\"",
3132
"description": "Credential needed for the client to connect to Azure.",
3233
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
3334
"required": true
3435
},
3536
"subscription_id": {
36-
"method_signature": "subscription_id, # type: str",
37+
"signature": "subscription_id, # type: str",
3738
"description": "The Microsoft Azure subscription ID.",
3839
"docstring_type": "str",
3940
"required": true
@@ -51,6 +52,7 @@
5152
"credential_key_header_name": null
5253
},
5354
"operation_groups": {
55+
"marketplace_agreements": "MarketplaceAgreementsOperations",
5456
"api_keys": "ApiKeysOperations",
5557
"hosts": "HostsOperations",
5658
"linked_resources": "LinkedResourcesOperations",

sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/_microsoft_datadog_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from azure.core.credentials import TokenCredential
1919

2020
from ._configuration import MicrosoftDatadogClientConfiguration
21+
from .operations import MarketplaceAgreementsOperations
2122
from .operations import ApiKeysOperations
2223
from .operations import HostsOperations
2324
from .operations import LinkedResourcesOperations
@@ -33,6 +34,8 @@
3334
class MicrosoftDatadogClient(object):
3435
"""MicrosoftDatadogClient.
3536
37+
:ivar marketplace_agreements: MarketplaceAgreementsOperations operations
38+
:vartype marketplace_agreements: microsoft_datadog_client.operations.MarketplaceAgreementsOperations
3639
:ivar api_keys: ApiKeysOperations operations
3740
:vartype api_keys: microsoft_datadog_client.operations.ApiKeysOperations
3841
:ivar hosts: HostsOperations operations
@@ -76,6 +79,8 @@ def __init__(
7679
self._serialize = Serializer(client_models)
7780
self._deserialize = Deserializer(client_models)
7881

82+
self.marketplace_agreements = MarketplaceAgreementsOperations(
83+
self._client, self._config, self._serialize, self._deserialize)
7984
self.api_keys = ApiKeysOperations(
8085
self._client, self._config, self._serialize, self._deserialize)
8186
self.hosts = HostsOperations(

sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/_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.0b1"
9+
VERSION = "1.0.0"

sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/aio/_microsoft_datadog_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from azure.core.credentials_async import AsyncTokenCredential
1717

1818
from ._configuration import MicrosoftDatadogClientConfiguration
19+
from .operations import MarketplaceAgreementsOperations
1920
from .operations import ApiKeysOperations
2021
from .operations import HostsOperations
2122
from .operations import LinkedResourcesOperations
@@ -31,6 +32,8 @@
3132
class MicrosoftDatadogClient(object):
3233
"""MicrosoftDatadogClient.
3334
35+
:ivar marketplace_agreements: MarketplaceAgreementsOperations operations
36+
:vartype marketplace_agreements: microsoft_datadog_client.aio.operations.MarketplaceAgreementsOperations
3437
:ivar api_keys: ApiKeysOperations operations
3538
:vartype api_keys: microsoft_datadog_client.aio.operations.ApiKeysOperations
3639
:ivar hosts: HostsOperations operations
@@ -73,6 +76,8 @@ def __init__(
7376
self._serialize = Serializer(client_models)
7477
self._deserialize = Deserializer(client_models)
7578

79+
self.marketplace_agreements = MarketplaceAgreementsOperations(
80+
self._client, self._config, self._serialize, self._deserialize)
7681
self.api_keys = ApiKeysOperations(
7782
self._client, self._config, self._serialize, self._deserialize)
7883
self.hosts = HostsOperations(

sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/aio/operations/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9+
from ._marketplace_agreements_operations import MarketplaceAgreementsOperations
910
from ._api_keys_operations import ApiKeysOperations
1011
from ._hosts_operations import HostsOperations
1112
from ._linked_resources_operations import LinkedResourcesOperations
@@ -17,6 +18,7 @@
1718
from ._single_sign_on_configurations_operations import SingleSignOnConfigurationsOperations
1819

1920
__all__ = [
21+
'MarketplaceAgreementsOperations',
2022
'ApiKeysOperations',
2123
'HostsOperations',
2224
'LinkedResourcesOperations',
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
9+
import warnings
10+
11+
from azure.core.async_paging import AsyncItemPaged, AsyncList
12+
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
13+
from azure.core.pipeline import PipelineResponse
14+
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
15+
from azure.mgmt.core.exceptions import ARMErrorFormat
16+
17+
from ... import models
18+
19+
T = TypeVar('T')
20+
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
21+
22+
class MarketplaceAgreementsOperations:
23+
"""MarketplaceAgreementsOperations async operations.
24+
25+
You should not instantiate this class directly. Instead, you should create a Client instance that
26+
instantiates it for you and attaches it as an attribute.
27+
28+
:ivar models: Alias to model classes used in this operation group.
29+
:type models: ~microsoft_datadog_client.models
30+
:param client: Client for service requests.
31+
:param config: Configuration of service client.
32+
:param serializer: An object model serializer.
33+
:param deserializer: An object model deserializer.
34+
"""
35+
36+
models = models
37+
38+
def __init__(self, client, config, serializer, deserializer) -> None:
39+
self._client = client
40+
self._serialize = serializer
41+
self._deserialize = deserializer
42+
self._config = config
43+
44+
def list(
45+
self,
46+
**kwargs
47+
) -> AsyncIterable["models.DatadogAgreementResourceListResponse"]:
48+
"""List Datadog marketplace agreements in the subscription.
49+
50+
List Datadog marketplace agreements in the subscription.
51+
52+
:keyword callable cls: A custom type or function that will be passed the direct response
53+
:return: An iterator like instance of either DatadogAgreementResourceListResponse or the result of cls(response)
54+
:rtype: ~azure.core.async_paging.AsyncItemPaged[~microsoft_datadog_client.models.DatadogAgreementResourceListResponse]
55+
:raises: ~azure.core.exceptions.HttpResponseError
56+
"""
57+
cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogAgreementResourceListResponse"]
58+
error_map = {
59+
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
60+
}
61+
error_map.update(kwargs.pop('error_map', {}))
62+
accept = "application/json"
63+
64+
def prepare_request(next_link=None):
65+
# Construct headers
66+
header_parameters = {} # type: Dict[str, Any]
67+
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
68+
69+
if not next_link:
70+
# Construct URL
71+
url = self.list.metadata['url'] # type: ignore
72+
path_format_arguments = {
73+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
74+
}
75+
url = self._client.format_url(url, **path_format_arguments)
76+
# Construct parameters
77+
query_parameters = {} # type: Dict[str, Any]
78+
79+
request = self._client.get(url, query_parameters, header_parameters)
80+
else:
81+
url = next_link
82+
query_parameters = {} # type: Dict[str, Any]
83+
request = self._client.get(url, query_parameters, header_parameters)
84+
return request
85+
86+
async def extract_data(pipeline_response):
87+
deserialized = self._deserialize('DatadogAgreementResourceListResponse', pipeline_response)
88+
list_of_elem = deserialized.value
89+
if cls:
90+
list_of_elem = cls(list_of_elem)
91+
return deserialized.next_link or None, AsyncList(list_of_elem)
92+
93+
async def get_next(next_link=None):
94+
request = prepare_request(next_link)
95+
96+
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
97+
response = pipeline_response.http_response
98+
99+
if response.status_code not in [200]:
100+
error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response)
101+
map_error(status_code=response.status_code, response=response, error_map=error_map)
102+
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
103+
104+
return pipeline_response
105+
106+
return AsyncItemPaged(
107+
get_next, extract_data
108+
)
109+
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements'} # type: ignore
110+
111+
async def create(
112+
self,
113+
body: Optional["models.DatadogAgreementResource"] = None,
114+
**kwargs
115+
) -> "models.DatadogAgreementResource":
116+
"""Create Datadog marketplace agreement in the subscription.
117+
118+
Create Datadog marketplace agreement in the subscription.
119+
120+
:param body:
121+
:type body: ~microsoft_datadog_client.models.DatadogAgreementResource
122+
:keyword callable cls: A custom type or function that will be passed the direct response
123+
:return: DatadogAgreementResource, or the result of cls(response)
124+
:rtype: ~microsoft_datadog_client.models.DatadogAgreementResource
125+
:raises: ~azure.core.exceptions.HttpResponseError
126+
"""
127+
cls = kwargs.pop('cls', None) # type: ClsType["models.DatadogAgreementResource"]
128+
error_map = {
129+
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
130+
}
131+
error_map.update(kwargs.pop('error_map', {}))
132+
content_type = kwargs.pop("content_type", "application/json")
133+
accept = "application/json"
134+
135+
# Construct URL
136+
url = self.create.metadata['url'] # type: ignore
137+
path_format_arguments = {
138+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
139+
}
140+
url = self._client.format_url(url, **path_format_arguments)
141+
142+
# Construct parameters
143+
query_parameters = {} # type: Dict[str, Any]
144+
145+
# Construct headers
146+
header_parameters = {} # type: Dict[str, Any]
147+
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
148+
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
149+
150+
body_content_kwargs = {} # type: Dict[str, Any]
151+
if body is not None:
152+
body_content = self._serialize.body(body, 'DatadogAgreementResource')
153+
else:
154+
body_content = None
155+
body_content_kwargs['content'] = body_content
156+
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
157+
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
158+
response = pipeline_response.http_response
159+
160+
if response.status_code not in [200]:
161+
map_error(status_code=response.status_code, response=response, error_map=error_map)
162+
error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response)
163+
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
164+
165+
deserialized = self._deserialize('DatadogAgreementResource', pipeline_response)
166+
167+
if cls:
168+
return cls(pipeline_response, deserialized, {})
169+
170+
return deserialized
171+
create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default'} # type: ignore

sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/aio/operations/_monitors_operations.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,13 @@ def get_long_running_output(pipeline_response):
363363
return cls(pipeline_response, deserialized, {})
364364
return deserialized
365365

366-
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
366+
path_format_arguments = {
367+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
368+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
369+
'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'),
370+
}
371+
372+
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs)
367373
elif polling is False: polling_method = AsyncNoPolling()
368374
else: polling_method = polling
369375
if cont_token:
@@ -542,7 +548,13 @@ def get_long_running_output(pipeline_response):
542548
if cls:
543549
return cls(pipeline_response, None, {})
544550

545-
if polling is True: polling_method = AsyncARMPolling(lro_delay, **kwargs)
551+
path_format_arguments = {
552+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
553+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
554+
'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'),
555+
}
556+
557+
if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
546558
elif polling is False: polling_method = AsyncNoPolling()
547559
else: polling_method = polling
548560
if cont_token:

sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/aio/operations/_single_sign_on_configurations_operations.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ async def begin_create_or_update(
201201
:type resource_group_name: str
202202
:param monitor_name: Monitor resource name.
203203
:type monitor_name: str
204-
:param configuration_name:
204+
:param configuration_name: Configuration name.
205205
:type configuration_name: str
206206
:param body:
207207
:type body: ~microsoft_datadog_client.models.DatadogSingleSignOnResource
@@ -242,7 +242,14 @@ def get_long_running_output(pipeline_response):
242242
return cls(pipeline_response, deserialized, {})
243243
return deserialized
244244

245-
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
245+
path_format_arguments = {
246+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
247+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
248+
'monitorName': self._serialize.url("monitor_name", monitor_name, 'str'),
249+
'configurationName': self._serialize.url("configuration_name", configuration_name, 'str'),
250+
}
251+
252+
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs)
246253
elif polling is False: polling_method = AsyncNoPolling()
247254
else: polling_method = polling
248255
if cont_token:
@@ -272,7 +279,7 @@ async def get(
272279
:type resource_group_name: str
273280
:param monitor_name: Monitor resource name.
274281
:type monitor_name: str
275-
:param configuration_name:
282+
:param configuration_name: Configuration name.
276283
:type configuration_name: str
277284
:keyword callable cls: A custom type or function that will be passed the direct response
278285
:return: DatadogSingleSignOnResource, or the result of cls(response)

sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/aio/operations/_tag_rules_operations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ async def create_or_update(
136136
:type resource_group_name: str
137137
:param monitor_name: Monitor resource name.
138138
:type monitor_name: str
139-
:param rule_set_name:
139+
:param rule_set_name: Rule set name.
140140
:type rule_set_name: str
141141
:param body:
142142
:type body: ~microsoft_datadog_client.models.MonitoringTagRules
@@ -212,7 +212,7 @@ async def get(
212212
:type resource_group_name: str
213213
:param monitor_name: Monitor resource name.
214214
:type monitor_name: str
215-
:param rule_set_name:
215+
:param rule_set_name: Rule set name.
216216
:type rule_set_name: str
217217
:keyword callable cls: A custom type or function that will be passed the direct response
218218
:return: MonitoringTagRules, or the result of cls(response)

0 commit comments

Comments
 (0)