Skip to content

Commit

Permalink
CodeGen from PR 25293 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Release sql microsoft.sql 2023 02 01 preview (Azure#25293)

* Adds base for updating Microsoft.Sql from version preview/2022-11-01-preview to version 2023-02-01-preview

* Updates readme

* Updates API version in new specs and examples

* add mi refresh API (Azure#24093)

* add mi refresh API

* remove stray character

* add examples

* fix lro error

* fix lro error only in example

* fixing prettier issue

* Test commit - adding error schema

* Test2

* Test - changing error type

* Revert "Test - changing error type"

This reverts commit 84fff94ea9cefca5312d2f5c12e099f315e0c064.

* Reverting 3 test commits

* Test - adding commong error type reference

* fix type format errors

---------

Co-authored-by: Stefan Krivokapic <skrivokapic@microsoft.com>

* Adding changes from main to release branch. PRs 24175 and 24185 (Azure#24221)

* Enable multiple partner servers and failover of read-only endpoint for SQL DB Failover Group in version 2023-02-01-preview. (Azure#24132)

* Added the swagger spec and example json files for failvoer group API update in V2023-020-1

* Corrected the FailoverGroupGet.json example

* Updated the auto-generated FailoverGroups.json

Fixed FailoverGroups.json swagger arm-id attribute for databases field

* Added the missing headers field manually

* Fix FailoverGroups.json

---------

Co-authored-by: Sharan Singh <sharanlobana@gmail.com>

* Changes to Location Capabilities (Azure#24209)

* Loc cap changes

* removing changes not related to my changes in dsmain

* DAG API 2023-02-01 (Azure#24108)

* add new dag api version

* Update swagger

* Update swagger

* patch resource

* make replicationMode writable

* Add FreeLimitExhaustion Capability in 2023-02-01-preview API (Azure#24224)

* Add FreeLimitExhaustion Capability in 2023-02-01-preview API

* Change property from name to exhaustionBehaviorType

* generate swagger for LocationCapabilites (Azure#24290)

* inital commit for LTR Policy Immutability (Azure#24347)

* inital commit for immutable ltr backups (Azure#24349)

* Update Servers swagger files with adding property "IsIPv6Enabled" (Azure#24305)

* Update swagger files for Server API

* Add v5 tag for Servers

* Restore none for minimal TLS version

* Add auto rotation param to databases api (Azure#24339)

* Add auto rotation param to databases api

* add armid

* Adding IsFreemium and CreateTime to Get MI API (Azure#24239)

* Updated the examples for LTR Policies and LTR Backups (Azure#24821)

* Updated the examples for LTR Policies and LTR Backups

* Not sure why makeBackupsImmutable got deleted

* updating swagger files for enum name changes (Azure#24742)

* Carrying over minor changes for the 2023-02-01-preview release (Azure#25177)

* Carrying over minor changes for the 2023-02-01-preview release

* Reverting example files that didn't have DsMainDev side changes, and fixing prettier check

* Fixes for LTR examples with model validation and prettier check for ServerDelete

* Reverting LTR changes

* Adding arm-id to serversjson

* swagger changes for adding new parameter in dc telemetry (Azure#24834)

* testing push

* reverting push

* swagger files for DC add parameter change

* delete added file

* modified swagger files without Venkat's change

* modified swagger files

* changed modelAsString to true

* add example files

* add example files

* fix mismatch

* Removing Pattern from ManagedInstance to avoid incident  (Azure#25295)

* Carrying over minor changes for the 2023-02-01-preview release

* Reverting example files that didn't have DsMainDev side changes, and fixing prettier check

* Fixes for LTR examples with model validation and prettier check for ServerDelete

* Reverting LTR changes

* Adding arm-id to serversjson

* Removing the Pattern property from ManagedInstances.json as it should not be present and will cause issues in downstream client generation

---------

Co-authored-by: guptanitish-ms <68623376+guptanitish-ms@users.noreply.github.com>
Co-authored-by: Stefan Krivokapic <skrivokapic@microsoft.com>
Co-authored-by: lobashh <56324552+lobashh@users.noreply.github.com>
Co-authored-by: Sharan Singh <sharanlobana@gmail.com>
Co-authored-by: Aleksand4rZivanovic <60347245+Aleksand4rZivanovic@users.noreply.github.com>
Co-authored-by: a-lazarlazic <106240189+a-lazarlazic@users.noreply.github.com>
Co-authored-by: mykolian <34487118+mykolian@users.noreply.github.com>
Co-authored-by: Srna Nikolic <133877309+srnanikolicmdcs@users.noreply.github.com>
Co-authored-by: rebeccaxu-ms <104461363+rebeccaxu-ms@users.noreply.github.com>
Co-authored-by: LeiWang3 <84884417+LeiWang3@users.noreply.github.com>
Co-authored-by: viparek <78561564+viparek@users.noreply.github.com>
Co-authored-by: Nikola Mirkovic <135128634+nmirkovic-microsoft@users.noreply.github.com>
Co-authored-by: pmahanandire <104351468+pmahanandire@users.noreply.github.com>
Co-authored-by: nidhigupta <139312437+Nidhi-Gupta6198@users.noreply.github.com>
  • Loading branch information
15 people committed Aug 23, 2023
1 parent 11a6c8f commit 3e58068
Show file tree
Hide file tree
Showing 963 changed files with 27,154 additions and 23,429 deletions.
8 changes: 4 additions & 4 deletions sdk/sql/azure-mgmt-sql/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "4f77103cef1d89060d97aba0fb6a719d133cbd3c",
"commit": "c942bdc449fb746c3aae3a179639de903212b6d8",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.6",
"autorest": "3.9.7",
"use": [
"@autorest/python@6.6.0",
"@autorest/python@6.7.1",
"@autorest/modelerfour@4.26.2"
],
"autorest_command": "autorest specification/sql/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --tag=package-composite-v5 --use=@autorest/python@6.6.0 --use=@autorest/modelerfour@4.26.2 --version=3.9.6 --version-tolerant=False",
"autorest_command": "autorest specification/sql/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False",
"readme": "specification/sql/resource-manager/readme.md"
}
6 changes: 6 additions & 0 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,23 @@ class SqlManagementClientConfiguration(Configuration): # pylint: disable=too-ma
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The subscription ID that identifies an Azure subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(SqlManagementClientConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2023-02-01-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")

self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-sql/{}".format(VERSION))
self._configure(**kwargs)
Expand Down
26 changes: 18 additions & 8 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
_serialized.update(_new_attr) # type: ignore
_new_attr = _new_attr[k] # type: ignore
_serialized = _serialized[k]
except ValueError:
continue
except ValueError as err:
if isinstance(err, SerializationError):
raise

except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
Expand Down Expand Up @@ -741,6 +742,8 @@ def query(self, name, data, data_type, **kwargs):
:param data: The data to be serialized.
:param str data_type: The type to be serialized from.
:keyword bool skip_quote: Whether to skip quote the serialized result.
Defaults to False.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
Expand All @@ -749,10 +752,8 @@ def query(self, name, data, data_type, **kwargs):
# Treat the list aside, since we don't want to encode the div separator
if data_type.startswith("["):
internal_data_type = data_type[1:-1]
data = [self.serialize_data(d, internal_data_type, **kwargs) if d is not None else "" for d in data]
if not kwargs.get("skip_quote", False):
data = [quote(str(d), safe="") for d in data]
return str(self.serialize_iter(data, internal_data_type, **kwargs))
do_quote = not kwargs.get("skip_quote", False)
return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs))

# Not a list, regular serialization
output = self.serialize_data(data, data_type, **kwargs)
Expand Down Expand Up @@ -891,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
not be None or empty.
:param str div: If set, this str will be used to combine the elements
in the iterable into a combined string. Default is 'None'.
:keyword bool do_quote: Whether to quote the serialized result of each iterable element.
Defaults to False.
:rtype: list, str
"""
if isinstance(data, str):
Expand All @@ -903,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
for d in data:
try:
serialized.append(self.serialize_data(d, iter_type, **kwargs))
except ValueError:
except ValueError as err:
if isinstance(err, SerializationError):
raise
serialized.append(None)

if kwargs.get("do_quote", False):
serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]

if div:
serialized = ["" if s is None else str(s) for s in serialized]
serialized = div.join(serialized)
Expand Down Expand Up @@ -950,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs):
for key, value in attr.items():
try:
serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs)
except ValueError:
except ValueError as err:
if isinstance(err, SerializationError):
raise
serialized[self.serialize_unicode(key)] = None

if "xml" in serialization_ctxt:
Expand Down
Loading

0 comments on commit 3e58068

Please sign in to comment.