Skip to content

Commit 73fd19d

Browse files
author
SDKAuto
committed
CodeGen from PR 12388 in Azure/azure-rest-api-specs
[NetAppFiles] Anf 9085 update swagger rest api to 2020 11 01 (Azure#12388)
1 parent 05054a6 commit 73fd19d

32 files changed

+777
-222
lines changed

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(
4848

4949
self.credential = credential
5050
self.subscription_id = subscription_id
51-
self.api_version = "2020-08-01"
51+
self.api_version = "2020-11-01"
5252
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5353
kwargs.setdefault('sdk_moniker', 'mgmt-netapp/{}'.format(VERSION))
5454
self._configure(**kwargs)
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"chosen_version": "2020-11-01",
3+
"total_api_version_list": ["2020-11-01"],
4+
"client": {
5+
"name": "NetAppManagementClient",
6+
"filename": "_net_app_management_client",
7+
"description": "Microsoft NetApp Azure Resource Provider specification.",
8+
"base_url": "\u0027https://management.azure.com\u0027",
9+
"custom_base_url": null,
10+
"azure_arm": true,
11+
"has_lro_operations": true,
12+
"client_side_validation": true
13+
},
14+
"global_parameters": {
15+
"sync": {
16+
"credential": {
17+
"signature": "credential, # type: \"TokenCredential\"",
18+
"description": "Credential needed for the client to connect to Azure.",
19+
"docstring_type": "~azure.core.credentials.TokenCredential",
20+
"required": true
21+
},
22+
"subscription_id": {
23+
"signature": "subscription_id, # type: str",
24+
"description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
25+
"docstring_type": "str",
26+
"required": true
27+
}
28+
},
29+
"async": {
30+
"credential": {
31+
"signature": "credential, # type: \"AsyncTokenCredential\"",
32+
"description": "Credential needed for the client to connect to Azure.",
33+
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
34+
"required": true
35+
},
36+
"subscription_id": {
37+
"signature": "subscription_id, # type: str",
38+
"description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.",
39+
"docstring_type": "str",
40+
"required": true
41+
}
42+
},
43+
"constant": {
44+
},
45+
"call": "credential, subscription_id"
46+
},
47+
"config": {
48+
"credential": true,
49+
"credential_scopes": ["https://management.azure.com/.default"],
50+
"credential_default_policy_type": "BearerTokenCredentialPolicy",
51+
"credential_default_policy_type_has_async_version": true,
52+
"credential_key_header_name": null
53+
},
54+
"operation_groups": {
55+
"operations": "Operations",
56+
"net_app_resource": "NetAppResourceOperations",
57+
"accounts": "AccountsOperations",
58+
"pools": "PoolsOperations",
59+
"volumes": "VolumesOperations",
60+
"snapshots": "SnapshotsOperations",
61+
"snapshot_policies": "SnapshotPoliciesOperations",
62+
"account_backups": "AccountBackupsOperations",
63+
"backups": "BackupsOperations",
64+
"backup_policies": "BackupPoliciesOperations",
65+
"vaults": "VaultsOperations"
66+
},
67+
"operation_mixins": {
68+
},
69+
"sync_imports": "None",
70+
"async_imports": "None"
71+
}

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/_net_app_management_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def __init__(
8080

8181
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
8282
self._serialize = Serializer(client_models)
83-
self._serialize.client_side_validation = False
8483
self._deserialize = Deserializer(client_models)
8584

8685
self.operations = Operations(

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

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

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

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545

4646
self.credential = credential
4747
self.subscription_id = subscription_id
48-
self.api_version = "2020-08-01"
48+
self.api_version = "2020-11-01"
4949
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5050
kwargs.setdefault('sdk_moniker', 'mgmt-netapp/{}'.format(VERSION))
5151
self._configure(**kwargs)

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/_net_app_management_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ def __init__(
7777

7878
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
7979
self._serialize = Serializer(client_models)
80-
self._serialize.client_side_validation = False
8180
self._deserialize = Deserializer(client_models)
8281

8382
self.operations = Operations(

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_account_backups_operations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async def list(
6666
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
6767
}
6868
error_map.update(kwargs.pop('error_map', {}))
69-
api_version = "2020-08-01"
69+
api_version = "2020-11-01"
7070
accept = "application/json"
7171

7272
# Construct URL
@@ -129,7 +129,7 @@ async def get(
129129
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
130130
}
131131
error_map.update(kwargs.pop('error_map', {}))
132-
api_version = "2020-08-01"
132+
api_version = "2020-11-01"
133133
accept = "application/json"
134134

135135
# Construct URL
@@ -178,7 +178,7 @@ async def _delete_initial(
178178
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
179179
}
180180
error_map.update(kwargs.pop('error_map', {}))
181-
api_version = "2020-08-01"
181+
api_version = "2020-11-01"
182182

183183
# Construct URL
184184
url = self._delete_initial.metadata['url'] # type: ignore

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_accounts_operations.py

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def list(
6464
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
6565
}
6666
error_map.update(kwargs.pop('error_map', {}))
67-
api_version = "2020-08-01"
67+
api_version = "2020-11-01"
6868
accept = "application/json"
6969

7070
def prepare_request(next_link=None):
@@ -96,7 +96,7 @@ async def extract_data(pipeline_response):
9696
list_of_elem = deserialized.value
9797
if cls:
9898
list_of_elem = cls(list_of_elem)
99-
return None, AsyncList(list_of_elem)
99+
return deserialized.next_link or None, AsyncList(list_of_elem)
100100

101101
async def get_next(next_link=None):
102102
request = prepare_request(next_link)
@@ -139,7 +139,7 @@ async def get(
139139
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
140140
}
141141
error_map.update(kwargs.pop('error_map', {}))
142-
api_version = "2020-08-01"
142+
api_version = "2020-11-01"
143143
accept = "application/json"
144144

145145
# Construct URL
@@ -181,13 +181,13 @@ async def _create_or_update_initial(
181181
account_name: str,
182182
body: "_models.NetAppAccount",
183183
**kwargs
184-
) -> Optional["_models.NetAppAccount"]:
185-
cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetAppAccount"]]
184+
) -> "_models.NetAppAccount":
185+
cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccount"]
186186
error_map = {
187187
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
188188
}
189189
error_map.update(kwargs.pop('error_map', {}))
190-
api_version = "2020-08-01"
190+
api_version = "2020-11-01"
191191
content_type = kwargs.pop("content_type", "application/json")
192192
accept = "application/json"
193193

@@ -216,11 +216,10 @@ async def _create_or_update_initial(
216216
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
217217
response = pipeline_response.http_response
218218

219-
if response.status_code not in [200, 201, 202]:
219+
if response.status_code not in [200, 201]:
220220
map_error(status_code=response.status_code, response=response, error_map=error_map)
221221
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
222222

223-
deserialized = None
224223
if response.status_code == 200:
225224
deserialized = self._deserialize('NetAppAccount', pipeline_response)
226225

@@ -292,7 +291,7 @@ def get_long_running_output(pipeline_response):
292291
'accountName': self._serialize.url("account_name", account_name, 'str'),
293292
}
294293

295-
if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
294+
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs)
296295
elif polling is False: polling_method = AsyncNoPolling()
297296
else: polling_method = polling
298297
if cont_token:
@@ -317,7 +316,7 @@ async def _delete_initial(
317316
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
318317
}
319318
error_map.update(kwargs.pop('error_map', {}))
320-
api_version = "2020-08-01"
319+
api_version = "2020-11-01"
321320

322321
# Construct URL
323322
url = self._delete_initial.metadata['url'] # type: ignore
@@ -420,13 +419,13 @@ async def _update_initial(
420419
account_name: str,
421420
body: "_models.NetAppAccountPatch",
422421
**kwargs
423-
) -> Optional["_models.NetAppAccount"]:
424-
cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetAppAccount"]]
422+
) -> "_models.NetAppAccount":
423+
cls = kwargs.pop('cls', None) # type: ClsType["_models.NetAppAccount"]
425424
error_map = {
426425
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
427426
}
428427
error_map.update(kwargs.pop('error_map', {}))
429-
api_version = "2020-08-01"
428+
api_version = "2020-11-01"
430429
content_type = kwargs.pop("content_type", "application/json")
431430
accept = "application/json"
432431

@@ -455,15 +454,14 @@ async def _update_initial(
455454
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
456455
response = pipeline_response.http_response
457456

458-
if response.status_code not in [200, 201, 202]:
457+
if response.status_code not in [200, 202]:
459458
map_error(status_code=response.status_code, response=response, error_map=error_map)
460459
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
461460

462-
deserialized = None
463461
if response.status_code == 200:
464462
deserialized = self._deserialize('NetAppAccount', pipeline_response)
465463

466-
if response.status_code == 201:
464+
if response.status_code == 202:
467465
deserialized = self._deserialize('NetAppAccount', pipeline_response)
468466

469467
if cls:
@@ -531,7 +529,7 @@ def get_long_running_output(pipeline_response):
531529
'accountName': self._serialize.url("account_name", account_name, 'str'),
532530
}
533531

534-
if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs)
532+
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs)
535533
elif polling is False: polling_method = AsyncNoPolling()
536534
else: polling_method = polling
537535
if cont_token:

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backup_policies_operations.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def list(
6767
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
6868
}
6969
error_map.update(kwargs.pop('error_map', {}))
70-
api_version = "2020-08-01"
70+
api_version = "2020-11-01"
7171
accept = "application/json"
7272

7373
def prepare_request(next_link=None):
@@ -146,7 +146,7 @@ async def get(
146146
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
147147
}
148148
error_map.update(kwargs.pop('error_map', {}))
149-
api_version = "2020-08-01"
149+
api_version = "2020-11-01"
150150
accept = "application/json"
151151

152152
# Construct URL
@@ -196,7 +196,7 @@ async def _create_initial(
196196
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
197197
}
198198
error_map.update(kwargs.pop('error_map', {}))
199-
api_version = "2020-08-01"
199+
api_version = "2020-11-01"
200200
content_type = kwargs.pop("content_type", "application/json")
201201
accept = "application/json"
202202

@@ -351,7 +351,7 @@ async def update(
351351
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
352352
}
353353
error_map.update(kwargs.pop('error_map', {}))
354-
api_version = "2020-08-01"
354+
api_version = "2020-11-01"
355355
content_type = kwargs.pop("content_type", "application/json")
356356
accept = "application/json"
357357

@@ -381,11 +381,15 @@ async def update(
381381
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
382382
response = pipeline_response.http_response
383383

384-
if response.status_code not in [200]:
384+
if response.status_code not in [200, 202]:
385385
map_error(status_code=response.status_code, response=response, error_map=error_map)
386386
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
387387

388-
deserialized = self._deserialize('BackupPolicy', pipeline_response)
388+
if response.status_code == 200:
389+
deserialized = self._deserialize('BackupPolicy', pipeline_response)
390+
391+
if response.status_code == 202:
392+
deserialized = self._deserialize('BackupPolicy', pipeline_response)
389393

390394
if cls:
391395
return cls(pipeline_response, deserialized, {})
@@ -405,7 +409,7 @@ async def _delete_initial(
405409
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
406410
}
407411
error_map.update(kwargs.pop('error_map', {}))
408-
api_version = "2020-08-01"
412+
api_version = "2020-11-01"
409413

410414
# Construct URL
411415
url = self._delete_initial.metadata['url'] # type: ignore

sdk/netapp/azure-mgmt-netapp/azure/mgmt/netapp/aio/operations/_backups_operations.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def list(
7373
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
7474
}
7575
error_map.update(kwargs.pop('error_map', {}))
76-
api_version = "2020-08-01"
76+
api_version = "2020-11-01"
7777
accept = "application/json"
7878

7979
def prepare_request(next_link=None):
@@ -160,7 +160,7 @@ async def get(
160160
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
161161
}
162162
error_map.update(kwargs.pop('error_map', {}))
163-
api_version = "2020-08-01"
163+
api_version = "2020-11-01"
164164
accept = "application/json"
165165

166166
# Construct URL
@@ -214,7 +214,7 @@ async def _create_initial(
214214
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
215215
}
216216
error_map.update(kwargs.pop('error_map', {}))
217-
api_version = "2020-08-01"
217+
api_version = "2020-11-01"
218218
content_type = kwargs.pop("content_type", "application/json")
219219
accept = "application/json"
220220

@@ -387,7 +387,7 @@ async def update(
387387
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
388388
}
389389
error_map.update(kwargs.pop('error_map', {}))
390-
api_version = "2020-08-01"
390+
api_version = "2020-11-01"
391391
content_type = kwargs.pop("content_type", "application/json")
392392
accept = "application/json"
393393

@@ -448,7 +448,7 @@ async def _delete_initial(
448448
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
449449
}
450450
error_map.update(kwargs.pop('error_map', {}))
451-
api_version = "2020-08-01"
451+
api_version = "2020-11-01"
452452

453453
# Construct URL
454454
url = self._delete_initial.metadata['url'] # type: ignore

0 commit comments

Comments
 (0)