Skip to content

Commit c487d35

Browse files
author
SDKAuto
committed
CodeGen from PR 25219 in Azure/azure-rest-api-specs
Merge 0a6d8fa2d06e786f86d8e138f0f3413fe522ec99 into 2735b620aeb695c106fecd9bf28d719aa0b75b43
1 parent 0f93fad commit c487d35

27 files changed

+172
-300
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "de93ae3897babd397a59d3c9dcb894855d0db1c3",
2+
"commit": "4d0de992bd7359a53502aff4fddf297e26f86916",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.9.7",
55
"use": [
6-
"@autorest/python@6.6.0",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.7.1",
7+
"@autorest/modelerfour@4.26.2"
88
],
9-
"autorest_command": "autorest specification/azure-kusto/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 --use=@autorest/python@6.6.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/azure-kusto/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",
1010
"readme": "specification/azure-kusto/resource-manager/readme.md"
1111
}

sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_serialization.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,9 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
662662
_serialized.update(_new_attr) # type: ignore
663663
_new_attr = _new_attr[k] # type: ignore
664664
_serialized = _serialized[k]
665-
except ValueError:
666-
continue
665+
except ValueError as err:
666+
if isinstance(err, SerializationError):
667+
raise
667668

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

757758
# Not a list, regular serialization
758759
output = self.serialize_data(data, data_type, **kwargs)
@@ -891,6 +892,8 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
891892
not be None or empty.
892893
:param str div: If set, this str will be used to combine the elements
893894
in the iterable into a combined string. Default is 'None'.
895+
:keyword bool do_quote: Whether to quote the serialized result of each iterable element.
896+
Defaults to False.
894897
:rtype: list, str
895898
"""
896899
if isinstance(data, str):
@@ -903,9 +906,14 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
903906
for d in data:
904907
try:
905908
serialized.append(self.serialize_data(d, iter_type, **kwargs))
906-
except ValueError:
909+
except ValueError as err:
910+
if isinstance(err, SerializationError):
911+
raise
907912
serialized.append(None)
908913

914+
if kwargs.get("do_quote", False):
915+
serialized = ["" if s is None else quote(str(s), safe="") for s in serialized]
916+
909917
if div:
910918
serialized = ["" if s is None else str(s) for s in serialized]
911919
serialized = div.join(serialized)
@@ -950,7 +958,9 @@ def serialize_dict(self, attr, dict_type, **kwargs):
950958
for key, value in attr.items():
951959
try:
952960
serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs)
953-
except ValueError:
961+
except ValueError as err:
962+
if isinstance(err, SerializationError):
963+
raise
954964
serialized[self.serialize_unicode(key)] = None
955965

956966
if "xml" in serialization_ctxt:

sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_vendor.py

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

8-
from typing import List, cast
9-
108
from azure.core.pipeline.transport import HttpRequest
119

1210

@@ -16,15 +14,3 @@ def _convert_request(request, files=None):
1614
if files:
1715
request.set_formdata_body(files)
1816
return request
19-
20-
21-
def _format_url_section(template, **kwargs):
22-
components = template.split("/")
23-
while components:
24-
try:
25-
return template.format(**kwargs)
26-
except KeyError as key:
27-
# Need the cast, as for some reasons "split" is typed as list[str | Any]
28-
formatted_components = cast(List[str], template.split("/"))
29-
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
30-
template = "/".join(components)

sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/_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 = "3.2.0"
9+
VERSION = "2.0.0b1"

sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_attached_database_configurations_operations.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,7 @@ def get_long_running_output(pipeline_response):
606606
return deserialized
607607

608608
if polling is True:
609-
polling_method: AsyncPollingMethod = cast(
610-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
611-
)
609+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
612610
elif polling is False:
613611
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
614612
else:
@@ -733,9 +731,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
733731
return cls(pipeline_response, None, {})
734732

735733
if polling is True:
736-
polling_method: AsyncPollingMethod = cast(
737-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
738-
)
734+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
739735
elif polling is False:
740736
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
741737
else:

sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_cluster_principal_assignments_operations.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,7 @@ def get_long_running_output(pipeline_response):
497497
return deserialized
498498

499499
if polling is True:
500-
polling_method: AsyncPollingMethod = cast(
501-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
502-
)
500+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
503501
elif polling is False:
504502
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
505503
else:
@@ -623,9 +621,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
623621
return cls(pipeline_response, None, {})
624622

625623
if polling is True:
626-
polling_method: AsyncPollingMethod = cast(
627-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
628-
)
624+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
629625
elif polling is False:
630626
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
631627
else:

sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_clusters_operations.py

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,7 @@ def get_long_running_output(pipeline_response):
385385
return deserialized
386386

387387
if polling is True:
388-
polling_method: AsyncPollingMethod = cast(
389-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
390-
)
388+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
391389
elif polling is False:
392390
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
393391
else:
@@ -643,9 +641,7 @@ def get_long_running_output(pipeline_response):
643641
return deserialized
644642

645643
if polling is True:
646-
polling_method: AsyncPollingMethod = cast(
647-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
648-
)
644+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
649645
elif polling is False:
650646
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
651647
else:
@@ -763,9 +759,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
763759
return cls(pipeline_response, None, {})
764760

765761
if polling is True:
766-
polling_method: AsyncPollingMethod = cast(
767-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
768-
)
762+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
769763
elif polling is False:
770764
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
771765
else:
@@ -883,9 +877,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
883877
return cls(pipeline_response, None, {})
884878

885879
if polling is True:
886-
polling_method: AsyncPollingMethod = cast(
887-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
888-
)
880+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
889881
elif polling is False:
890882
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
891883
else:
@@ -1003,9 +995,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
1003995
return cls(pipeline_response, None, {})
1004996

1005997
if polling is True:
1006-
polling_method: AsyncPollingMethod = cast(
1007-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
1008-
)
998+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
1009999
elif polling is False:
10101000
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
10111001
else:
@@ -1224,9 +1214,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
12241214
return cls(pipeline_response, None, {})
12251215

12261216
if polling is True:
1227-
polling_method: AsyncPollingMethod = cast(
1228-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
1229-
)
1217+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
12301218
elif polling is False:
12311219
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
12321220
else:
@@ -1540,9 +1528,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
15401528
return cls(pipeline_response, None, {})
15411529

15421530
if polling is True:
1543-
polling_method: AsyncPollingMethod = cast(
1544-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
1545-
)
1531+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
15461532
elif polling is False:
15471533
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
15481534
else:
@@ -1673,9 +1659,7 @@ def get_long_running_output(pipeline_response):
16731659
return deserialized
16741660

16751661
if polling is True:
1676-
polling_method: AsyncPollingMethod = cast(
1677-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
1678-
)
1662+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
16791663
elif polling is False:
16801664
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
16811665
else:
@@ -2543,9 +2527,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
25432527
return cls(pipeline_response, None, {})
25442528

25452529
if polling is True:
2546-
polling_method: AsyncPollingMethod = cast(
2547-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
2548-
)
2530+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
25492531
elif polling is False:
25502532
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
25512533
else:
@@ -2764,9 +2746,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
27642746
return cls(pipeline_response, None, {})
27652747

27662748
if polling is True:
2767-
polling_method: AsyncPollingMethod = cast(
2768-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
2769-
)
2749+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
27702750
elif polling is False:
27712751
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
27722752
else:

sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_data_connections_operations.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,7 @@ def get_long_running_output(pipeline_response):
388388
return deserialized
389389

390390
if polling is True:
391-
polling_method: AsyncPollingMethod = cast(
392-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
393-
)
391+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
394392
elif polling is False:
395393
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
396394
else:
@@ -874,9 +872,7 @@ def get_long_running_output(pipeline_response):
874872
return deserialized
875873

876874
if polling is True:
877-
polling_method: AsyncPollingMethod = cast(
878-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
879-
)
875+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
880876
elif polling is False:
881877
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
882878
else:
@@ -1138,9 +1134,7 @@ def get_long_running_output(pipeline_response):
11381134
return deserialized
11391135

11401136
if polling is True:
1141-
polling_method: AsyncPollingMethod = cast(
1142-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
1143-
)
1137+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
11441138
elif polling is False:
11451139
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
11461140
else:
@@ -1268,9 +1262,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
12681262
return cls(pipeline_response, None, {})
12691263

12701264
if polling is True:
1271-
polling_method: AsyncPollingMethod = cast(
1272-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
1273-
)
1265+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
12741266
elif polling is False:
12751267
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
12761268
else:

sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_database_principal_assignments_operations.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,7 @@ def get_long_running_output(pipeline_response):
530530
return deserialized
531531

532532
if polling is True:
533-
polling_method: AsyncPollingMethod = cast(
534-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
535-
)
533+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
536534
elif polling is False:
537535
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
538536
else:
@@ -670,9 +668,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
670668
return cls(pipeline_response, None, {})
671669

672670
if polling is True:
673-
polling_method: AsyncPollingMethod = cast(
674-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
675-
)
671+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
676672
elif polling is False:
677673
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
678674
else:

sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_databases_operations.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,7 @@ def get_long_running_output(pipeline_response):
629629
return deserialized
630630

631631
if polling is True:
632-
polling_method: AsyncPollingMethod = cast(
633-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
634-
)
632+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
635633
elif polling is False:
636634
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
637635
else:
@@ -899,9 +897,7 @@ def get_long_running_output(pipeline_response):
899897
return deserialized
900898

901899
if polling is True:
902-
polling_method: AsyncPollingMethod = cast(
903-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
904-
)
900+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
905901
elif polling is False:
906902
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
907903
else:
@@ -1025,9 +1021,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-
10251021
return cls(pipeline_response, None, {})
10261022

10271023
if polling is True:
1028-
polling_method: AsyncPollingMethod = cast(
1029-
AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
1030-
)
1024+
polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs))
10311025
elif polling is False:
10321026
polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
10331027
else:

0 commit comments

Comments
 (0)