Skip to content

Commit 74d002c

Browse files
author
SDKAuto
committed
CodeGen from PR 13146 in Azure/azure-rest-api-specs
[Datadog] Swagger correctness (#13146)
1 parent aff4664 commit 74d002c

13 files changed

+1143
-128
lines changed

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

+10-13
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,13 +52,9 @@
5152
"credential_key_header_name": null
5253
},
5354
"operation_groups": {
54-
"api_keys": "ApiKeysOperations",
55-
"hosts": "HostsOperations",
56-
"linked_resources": "LinkedResourcesOperations",
57-
"monitored_resources": "MonitoredResourcesOperations",
58-
"operations": "Operations",
55+
"marketplace_agreements": "MarketplaceAgreementsOperations",
5956
"monitors": "MonitorsOperations",
60-
"refresh_set_password": "RefreshSetPasswordOperations",
57+
"operations": "Operations",
6158
"tag_rules": "TagRulesOperations",
6259
"single_sign_on_configurations": "SingleSignOnConfigurationsOperations"
6360
},

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

+4-30
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,8 @@
1919

2020
from ._configuration import MicrosoftDatadogClientConfiguration
2121
from .operations import MarketplaceAgreementsOperations
22-
from .operations import ApiKeysOperations
23-
from .operations import HostsOperations
24-
from .operations import LinkedResourcesOperations
25-
from .operations import MonitoredResourcesOperations
26-
from .operations import Operations
2722
from .operations import MonitorsOperations
28-
from .operations import RefreshSetPasswordOperations
23+
from .operations import Operations
2924
from .operations import TagRulesOperations
3025
from .operations import SingleSignOnConfigurationsOperations
3126
from . import models
@@ -36,20 +31,10 @@ class MicrosoftDatadogClient(object):
3631
3732
:ivar marketplace_agreements: MarketplaceAgreementsOperations operations
3833
:vartype marketplace_agreements: microsoft_datadog_client.operations.MarketplaceAgreementsOperations
39-
:ivar api_keys: ApiKeysOperations operations
40-
:vartype api_keys: microsoft_datadog_client.operations.ApiKeysOperations
41-
:ivar hosts: HostsOperations operations
42-
:vartype hosts: microsoft_datadog_client.operations.HostsOperations
43-
:ivar linked_resources: LinkedResourcesOperations operations
44-
:vartype linked_resources: microsoft_datadog_client.operations.LinkedResourcesOperations
45-
:ivar monitored_resources: MonitoredResourcesOperations operations
46-
:vartype monitored_resources: microsoft_datadog_client.operations.MonitoredResourcesOperations
47-
:ivar operations: Operations operations
48-
:vartype operations: microsoft_datadog_client.operations.Operations
4934
:ivar monitors: MonitorsOperations operations
5035
:vartype monitors: microsoft_datadog_client.operations.MonitorsOperations
51-
:ivar refresh_set_password: RefreshSetPasswordOperations operations
52-
:vartype refresh_set_password: microsoft_datadog_client.operations.RefreshSetPasswordOperations
36+
:ivar operations: Operations operations
37+
:vartype operations: microsoft_datadog_client.operations.Operations
5338
:ivar tag_rules: TagRulesOperations operations
5439
:vartype tag_rules: microsoft_datadog_client.operations.TagRulesOperations
5540
:ivar single_sign_on_configurations: SingleSignOnConfigurationsOperations operations
@@ -77,24 +62,13 @@ def __init__(
7762

7863
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
7964
self._serialize = Serializer(client_models)
80-
self._serialize.client_side_validation = False
8165
self._deserialize = Deserializer(client_models)
8266

8367
self.marketplace_agreements = MarketplaceAgreementsOperations(
8468
self._client, self._config, self._serialize, self._deserialize)
85-
self.api_keys = ApiKeysOperations(
86-
self._client, self._config, self._serialize, self._deserialize)
87-
self.hosts = HostsOperations(
88-
self._client, self._config, self._serialize, self._deserialize)
89-
self.linked_resources = LinkedResourcesOperations(
90-
self._client, self._config, self._serialize, self._deserialize)
91-
self.monitored_resources = MonitoredResourcesOperations(
92-
self._client, self._config, self._serialize, self._deserialize)
93-
self.operations = Operations(
94-
self._client, self._config, self._serialize, self._deserialize)
9569
self.monitors = MonitorsOperations(
9670
self._client, self._config, self._serialize, self._deserialize)
97-
self.refresh_set_password = RefreshSetPasswordOperations(
71+
self.operations = Operations(
9872
self._client, self._config, self._serialize, self._deserialize)
9973
self.tag_rules = TagRulesOperations(
10074
self._client, self._config, self._serialize, self._deserialize)

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

+1-1
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.0b2"
9+
VERSION = "1.0.0"

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

+4-30
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,8 @@
1717

1818
from ._configuration import MicrosoftDatadogClientConfiguration
1919
from .operations import MarketplaceAgreementsOperations
20-
from .operations import ApiKeysOperations
21-
from .operations import HostsOperations
22-
from .operations import LinkedResourcesOperations
23-
from .operations import MonitoredResourcesOperations
24-
from .operations import Operations
2520
from .operations import MonitorsOperations
26-
from .operations import RefreshSetPasswordOperations
21+
from .operations import Operations
2722
from .operations import TagRulesOperations
2823
from .operations import SingleSignOnConfigurationsOperations
2924
from .. import models
@@ -34,20 +29,10 @@ class MicrosoftDatadogClient(object):
3429
3530
:ivar marketplace_agreements: MarketplaceAgreementsOperations operations
3631
:vartype marketplace_agreements: microsoft_datadog_client.aio.operations.MarketplaceAgreementsOperations
37-
:ivar api_keys: ApiKeysOperations operations
38-
:vartype api_keys: microsoft_datadog_client.aio.operations.ApiKeysOperations
39-
:ivar hosts: HostsOperations operations
40-
:vartype hosts: microsoft_datadog_client.aio.operations.HostsOperations
41-
:ivar linked_resources: LinkedResourcesOperations operations
42-
:vartype linked_resources: microsoft_datadog_client.aio.operations.LinkedResourcesOperations
43-
:ivar monitored_resources: MonitoredResourcesOperations operations
44-
:vartype monitored_resources: microsoft_datadog_client.aio.operations.MonitoredResourcesOperations
45-
:ivar operations: Operations operations
46-
:vartype operations: microsoft_datadog_client.aio.operations.Operations
4732
:ivar monitors: MonitorsOperations operations
4833
:vartype monitors: microsoft_datadog_client.aio.operations.MonitorsOperations
49-
:ivar refresh_set_password: RefreshSetPasswordOperations operations
50-
:vartype refresh_set_password: microsoft_datadog_client.aio.operations.RefreshSetPasswordOperations
34+
:ivar operations: Operations operations
35+
:vartype operations: microsoft_datadog_client.aio.operations.Operations
5136
:ivar tag_rules: TagRulesOperations operations
5237
:vartype tag_rules: microsoft_datadog_client.aio.operations.TagRulesOperations
5338
:ivar single_sign_on_configurations: SingleSignOnConfigurationsOperations operations
@@ -74,24 +59,13 @@ def __init__(
7459

7560
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
7661
self._serialize = Serializer(client_models)
77-
self._serialize.client_side_validation = False
7862
self._deserialize = Deserializer(client_models)
7963

8064
self.marketplace_agreements = MarketplaceAgreementsOperations(
8165
self._client, self._config, self._serialize, self._deserialize)
82-
self.api_keys = ApiKeysOperations(
83-
self._client, self._config, self._serialize, self._deserialize)
84-
self.hosts = HostsOperations(
85-
self._client, self._config, self._serialize, self._deserialize)
86-
self.linked_resources = LinkedResourcesOperations(
87-
self._client, self._config, self._serialize, self._deserialize)
88-
self.monitored_resources = MonitoredResourcesOperations(
89-
self._client, self._config, self._serialize, self._deserialize)
90-
self.operations = Operations(
91-
self._client, self._config, self._serialize, self._deserialize)
9266
self.monitors = MonitorsOperations(
9367
self._client, self._config, self._serialize, self._deserialize)
94-
self.refresh_set_password = RefreshSetPasswordOperations(
68+
self.operations = Operations(
9569
self._client, self._config, self._serialize, self._deserialize)
9670
self.tag_rules = TagRulesOperations(
9771
self._client, self._config, self._serialize, self._deserialize)

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

+2-12
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,15 @@
77
# --------------------------------------------------------------------------
88

99
from ._marketplace_agreements_operations import MarketplaceAgreementsOperations
10-
from ._api_keys_operations import ApiKeysOperations
11-
from ._hosts_operations import HostsOperations
12-
from ._linked_resources_operations import LinkedResourcesOperations
13-
from ._monitored_resources_operations import MonitoredResourcesOperations
14-
from ._operations import Operations
1510
from ._monitors_operations import MonitorsOperations
16-
from ._refresh_set_password_operations import RefreshSetPasswordOperations
11+
from ._operations import Operations
1712
from ._tag_rules_operations import TagRulesOperations
1813
from ._single_sign_on_configurations_operations import SingleSignOnConfigurationsOperations
1914

2015
__all__ = [
2116
'MarketplaceAgreementsOperations',
22-
'ApiKeysOperations',
23-
'HostsOperations',
24-
'LinkedResourcesOperations',
25-
'MonitoredResourcesOperations',
26-
'Operations',
2717
'MonitorsOperations',
28-
'RefreshSetPasswordOperations',
18+
'Operations',
2919
'TagRulesOperations',
3020
'SingleSignOnConfigurationsOperations',
3121
]

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

+7-3
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-02-01-preview"
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:
@@ -108,7 +110,7 @@ async def get_next(next_link=None):
108110
)
109111
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements'} # type: ignore
110112

111-
async def create(
113+
async def create_or_update(
112114
self,
113115
body: Optional["_models.DatadogAgreementResource"] = None,
114116
**kwargs
@@ -129,18 +131,20 @@ async def create(
129131
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
130132
}
131133
error_map.update(kwargs.pop('error_map', {}))
134+
api_version = "2020-02-01-preview"
132135
content_type = kwargs.pop("content_type", "application/json")
133136
accept = "application/json"
134137

135138
# Construct URL
136-
url = self.create.metadata['url'] # type: ignore
139+
url = self.create_or_update.metadata['url'] # type: ignore
137140
path_format_arguments = {
138141
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
139142
}
140143
url = self._client.format_url(url, **path_format_arguments)
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]
@@ -168,4 +172,4 @@ async def create(
168172
return cls(pipeline_response, deserialized, {})
169173

170174
return deserialized
171-
create.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default'} # type: ignore
175+
create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Datadog/agreements/default'} # type: ignore

0 commit comments

Comments
 (0)