Skip to content

Commit a3c5822

Browse files
[AutoRelease] t2-rdbms-2023-12-06-86582(can only be merged by SDK owner) (#33413)
* code and test * update version * Update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: ChenxiJiang333 <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent d8d0010 commit a3c5822

File tree

11 files changed

+76
-17
lines changed

11 files changed

+76
-17
lines changed

sdk/rdbms/azure-mgmt-rdbms/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release History
22

3+
## 10.2.0b13 (2023-12-18)
4+
5+
### Other Changes
6+
7+
- Fix for ServerThreatProtectionSettingsOperations.begin_create_or_update
8+
39
## 10.2.0b12 (2023-11-20)
410

511
### Features Added

sdk/rdbms/azure-mgmt-rdbms/_meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"commit": "11bbc2b1df2e915a2227a6a1a48a27b9e67c3311",
2+
"commit": "d402f685809d6d08be9c0b45065cadd7d78ab870",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.7",
55
"use": [

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# license information.
66
# --------------------------------------------------------------------------
77

8-
VERSION = "10.2.0b12"
8+
VERSION = "10.2.0b13"

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mariadb/_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 = "10.2.0b12"
9+
VERSION = "10.2.0b13"

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql/_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 = "10.2.0b12"
9+
VERSION = "10.2.0b13"

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/mysql_flexibleservers/_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 = "10.2.0b12"
9+
VERSION = "10.2.0b13"

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/_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 = "10.2.0b12"
9+
VERSION = "10.2.0b13"

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/_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 = "10.2.0b12"
9+
VERSION = "10.2.0b13"

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/aio/operations/_server_threat_protection_settings_operations.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ async def _create_or_update_initial(
235235
threat_protection_name: Union[str, _models.ThreatProtectionName],
236236
parameters: Union[_models.ServerThreatProtectionSettingsModel, IO],
237237
**kwargs: Any
238-
) -> _models.ServerThreatProtectionSettingsModel:
238+
) -> Optional[_models.ServerThreatProtectionSettingsModel]:
239239
error_map = {
240240
401: ClientAuthenticationError,
241241
404: ResourceNotFoundError,
@@ -249,7 +249,7 @@ async def _create_or_update_initial(
249249

250250
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
251251
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
252-
cls: ClsType[_models.ServerThreatProtectionSettingsModel] = kwargs.pop("cls", None)
252+
cls: ClsType[Optional[_models.ServerThreatProtectionSettingsModel]] = kwargs.pop("cls", None)
253253

254254
content_type = content_type or "application/json"
255255
_json = None
@@ -282,21 +282,26 @@ async def _create_or_update_initial(
282282

283283
response = pipeline_response.http_response
284284

285-
if response.status_code not in [200, 201]:
285+
if response.status_code not in [200, 201, 202]:
286286
map_error(status_code=response.status_code, response=response, error_map=error_map)
287287
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
288288
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
289289

290+
deserialized = None
291+
response_headers = {}
290292
if response.status_code == 200:
291293
deserialized = self._deserialize("ServerThreatProtectionSettingsModel", pipeline_response)
292294

293295
if response.status_code == 201:
294296
deserialized = self._deserialize("ServerThreatProtectionSettingsModel", pipeline_response)
295297

298+
if response.status_code == 202:
299+
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
300+
296301
if cls:
297-
return cls(pipeline_response, deserialized, {}) # type: ignore
302+
return cls(pipeline_response, deserialized, response_headers)
298303

299-
return deserialized # type: ignore
304+
return deserialized
300305

301306
_create_or_update_initial.metadata = {
302307
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{threatProtectionName}"

sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql_flexibleservers/operations/_server_threat_protection_settings_operations.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def _create_or_update_initial(
350350
threat_protection_name: Union[str, _models.ThreatProtectionName],
351351
parameters: Union[_models.ServerThreatProtectionSettingsModel, IO],
352352
**kwargs: Any
353-
) -> _models.ServerThreatProtectionSettingsModel:
353+
) -> Optional[_models.ServerThreatProtectionSettingsModel]:
354354
error_map = {
355355
401: ClientAuthenticationError,
356356
404: ResourceNotFoundError,
@@ -364,7 +364,7 @@ def _create_or_update_initial(
364364

365365
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
366366
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
367-
cls: ClsType[_models.ServerThreatProtectionSettingsModel] = kwargs.pop("cls", None)
367+
cls: ClsType[Optional[_models.ServerThreatProtectionSettingsModel]] = kwargs.pop("cls", None)
368368

369369
content_type = content_type or "application/json"
370370
_json = None
@@ -397,21 +397,26 @@ def _create_or_update_initial(
397397

398398
response = pipeline_response.http_response
399399

400-
if response.status_code not in [200, 201]:
400+
if response.status_code not in [200, 201, 202]:
401401
map_error(status_code=response.status_code, response=response, error_map=error_map)
402402
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
403403
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
404404

405+
deserialized = None
406+
response_headers = {}
405407
if response.status_code == 200:
406408
deserialized = self._deserialize("ServerThreatProtectionSettingsModel", pipeline_response)
407409

408410
if response.status_code == 201:
409411
deserialized = self._deserialize("ServerThreatProtectionSettingsModel", pipeline_response)
410412

413+
if response.status_code == 202:
414+
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
415+
411416
if cls:
412-
return cls(pipeline_response, deserialized, {}) # type: ignore
417+
return cls(pipeline_response, deserialized, response_headers)
413418

414-
return deserialized # type: ignore
419+
return deserialized
415420

416421
_create_or_update_initial.metadata = {
417422
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/advancedThreatProtectionSettings/{threatProtectionName}"

0 commit comments

Comments
 (0)