Skip to content

Commit 19709c8

Browse files
author
SDKAuto
committed
CodeGen from PR 26250 in Azure/azure-rest-api-specs
Merge f8c977b960c60d50f16696fdeec9bf357aca6e8e into 63cef7fe4236d694d40267a2b767829a026e587f
1 parent 25b6533 commit 19709c8

File tree

97 files changed

+7874
-227
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+7874
-227
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "4b7481587132ce0bde5f0a6d6ab590129f7b7179",
2+
"commit": "0a97658f987d82aa9ec82db9b178fb5687deac73",
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/cognitiveservices/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/cognitiveservices/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/cognitiveservices/resource-manager/readme.md"
1111
}

sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_cognitive_services_management_client.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,15 @@
2222
CommitmentTiersOperations,
2323
DeletedAccountsOperations,
2424
DeploymentsOperations,
25+
EncryptionScopesOperations,
2526
ModelsOperations,
2627
Operations,
2728
PrivateEndpointConnectionsOperations,
2829
PrivateLinkResourcesOperations,
30+
RaiBlocklistItemsOperations,
31+
RaiBlocklistsOperations,
32+
RaiContentFiltersOperations,
33+
RaiPoliciesOperations,
2934
ResourceSkusOperations,
3035
UsagesOperations,
3136
)
@@ -64,14 +69,26 @@ class CognitiveServicesManagementClient(
6469
:vartype deployments: azure.mgmt.cognitiveservices.operations.DeploymentsOperations
6570
:ivar commitment_plans: CommitmentPlansOperations operations
6671
:vartype commitment_plans: azure.mgmt.cognitiveservices.operations.CommitmentPlansOperations
72+
:ivar encryption_scopes: EncryptionScopesOperations operations
73+
:vartype encryption_scopes: azure.mgmt.cognitiveservices.operations.EncryptionScopesOperations
74+
:ivar rai_policies: RaiPoliciesOperations operations
75+
:vartype rai_policies: azure.mgmt.cognitiveservices.operations.RaiPoliciesOperations
76+
:ivar rai_blocklists: RaiBlocklistsOperations operations
77+
:vartype rai_blocklists: azure.mgmt.cognitiveservices.operations.RaiBlocklistsOperations
78+
:ivar rai_blocklist_items: RaiBlocklistItemsOperations operations
79+
:vartype rai_blocklist_items:
80+
azure.mgmt.cognitiveservices.operations.RaiBlocklistItemsOperations
81+
:ivar rai_content_filters: RaiContentFiltersOperations operations
82+
:vartype rai_content_filters:
83+
azure.mgmt.cognitiveservices.operations.RaiContentFiltersOperations
6784
:param credential: Credential needed for the client to connect to Azure. Required.
6885
:type credential: ~azure.core.credentials.TokenCredential
6986
:param subscription_id: The ID of the target subscription. Required.
7087
:type subscription_id: str
7188
:param base_url: Service URL. Default value is "https://management.azure.com".
7289
:type base_url: str
73-
:keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this
74-
default value may result in unsupported behavior.
90+
:keyword api_version: Api Version. Default value is "2023-10-01-preview". Note that overriding
91+
this default value may result in unsupported behavior.
7592
:paramtype api_version: str
7693
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
7794
Retry-After header is present.
@@ -114,6 +131,17 @@ def __init__(
114131
self.commitment_plans = CommitmentPlansOperations(
115132
self._client, self._config, self._serialize, self._deserialize
116133
)
134+
self.encryption_scopes = EncryptionScopesOperations(
135+
self._client, self._config, self._serialize, self._deserialize
136+
)
137+
self.rai_policies = RaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize)
138+
self.rai_blocklists = RaiBlocklistsOperations(self._client, self._config, self._serialize, self._deserialize)
139+
self.rai_blocklist_items = RaiBlocklistItemsOperations(
140+
self._client, self._config, self._serialize, self._deserialize
141+
)
142+
self.rai_content_filters = RaiContentFiltersOperations(
143+
self._client, self._config, self._serialize, self._deserialize
144+
)
117145

118146
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
119147
"""Runs the network request through the client's chained policies.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class CognitiveServicesManagementClientConfiguration(Configuration): # pylint:
2929
:type credential: ~azure.core.credentials.TokenCredential
3030
:param subscription_id: The ID of the target subscription. Required.
3131
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this
33-
default value may result in unsupported behavior.
32+
:keyword api_version: Api Version. Default value is "2023-10-01-preview". Note that overriding
33+
this default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
"""
3636

3737
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
3838
super(CognitiveServicesManagementClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-05-01")
39+
api_version: str = kwargs.pop("api_version", "2023-10-01-preview")
4040

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

sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_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/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_vendor.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# --------------------------------------------------------------------------
77

88
from abc import ABC
9-
from typing import List, TYPE_CHECKING, cast
9+
from typing import TYPE_CHECKING
1010

1111
from azure.core.pipeline.transport import HttpRequest
1212

@@ -27,18 +27,6 @@ def _convert_request(request, files=None):
2727
return request
2828

2929

30-
def _format_url_section(template, **kwargs):
31-
components = template.split("/")
32-
while components:
33-
try:
34-
return template.format(**kwargs)
35-
except KeyError as key:
36-
# Need the cast, as for some reasons "split" is typed as list[str | Any]
37-
formatted_components = cast(List[str], template.split("/"))
38-
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
39-
template = "/".join(components)
40-
41-
4230
class CognitiveServicesManagementClientMixinABC(ABC):
4331
"""DO NOT use this class. It is for internal typing use only."""
4432

sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/_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 = "13.5.0"
9+
VERSION = "11.0.0b1"

sdk/cognitiveservices/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/aio/_cognitive_services_management_client.py

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,15 @@
2222
CommitmentTiersOperations,
2323
DeletedAccountsOperations,
2424
DeploymentsOperations,
25+
EncryptionScopesOperations,
2526
ModelsOperations,
2627
Operations,
2728
PrivateEndpointConnectionsOperations,
2829
PrivateLinkResourcesOperations,
30+
RaiBlocklistItemsOperations,
31+
RaiBlocklistsOperations,
32+
RaiContentFiltersOperations,
33+
RaiPoliciesOperations,
2934
ResourceSkusOperations,
3035
UsagesOperations,
3136
)
@@ -67,14 +72,27 @@ class CognitiveServicesManagementClient(
6772
:ivar commitment_plans: CommitmentPlansOperations operations
6873
:vartype commitment_plans:
6974
azure.mgmt.cognitiveservices.aio.operations.CommitmentPlansOperations
75+
:ivar encryption_scopes: EncryptionScopesOperations operations
76+
:vartype encryption_scopes:
77+
azure.mgmt.cognitiveservices.aio.operations.EncryptionScopesOperations
78+
:ivar rai_policies: RaiPoliciesOperations operations
79+
:vartype rai_policies: azure.mgmt.cognitiveservices.aio.operations.RaiPoliciesOperations
80+
:ivar rai_blocklists: RaiBlocklistsOperations operations
81+
:vartype rai_blocklists: azure.mgmt.cognitiveservices.aio.operations.RaiBlocklistsOperations
82+
:ivar rai_blocklist_items: RaiBlocklistItemsOperations operations
83+
:vartype rai_blocklist_items:
84+
azure.mgmt.cognitiveservices.aio.operations.RaiBlocklistItemsOperations
85+
:ivar rai_content_filters: RaiContentFiltersOperations operations
86+
:vartype rai_content_filters:
87+
azure.mgmt.cognitiveservices.aio.operations.RaiContentFiltersOperations
7088
:param credential: Credential needed for the client to connect to Azure. Required.
7189
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
7290
:param subscription_id: The ID of the target subscription. Required.
7391
:type subscription_id: str
7492
:param base_url: Service URL. Default value is "https://management.azure.com".
7593
:type base_url: str
76-
:keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this
77-
default value may result in unsupported behavior.
94+
:keyword api_version: Api Version. Default value is "2023-10-01-preview". Note that overriding
95+
this default value may result in unsupported behavior.
7896
:paramtype api_version: str
7997
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
8098
Retry-After header is present.
@@ -117,6 +135,17 @@ def __init__(
117135
self.commitment_plans = CommitmentPlansOperations(
118136
self._client, self._config, self._serialize, self._deserialize
119137
)
138+
self.encryption_scopes = EncryptionScopesOperations(
139+
self._client, self._config, self._serialize, self._deserialize
140+
)
141+
self.rai_policies = RaiPoliciesOperations(self._client, self._config, self._serialize, self._deserialize)
142+
self.rai_blocklists = RaiBlocklistsOperations(self._client, self._config, self._serialize, self._deserialize)
143+
self.rai_blocklist_items = RaiBlocklistItemsOperations(
144+
self._client, self._config, self._serialize, self._deserialize
145+
)
146+
self.rai_content_filters = RaiContentFiltersOperations(
147+
self._client, self._config, self._serialize, self._deserialize
148+
)
120149

121150
def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
122151
"""Runs the network request through the client's chained policies.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class CognitiveServicesManagementClientConfiguration(Configuration): # pylint:
2929
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
3030
:param subscription_id: The ID of the target subscription. Required.
3131
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-05-01". Note that overriding this
33-
default value may result in unsupported behavior.
32+
:keyword api_version: Api Version. Default value is "2023-10-01-preview". Note that overriding
33+
this default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
"""
3636

3737
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
3838
super(CognitiveServicesManagementClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-05-01")
39+
api_version: str = kwargs.pop("api_version", "2023-10-01-preview")
4040

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

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
from ._private_link_resources_operations import PrivateLinkResourcesOperations
1919
from ._deployments_operations import DeploymentsOperations
2020
from ._commitment_plans_operations import CommitmentPlansOperations
21+
from ._encryption_scopes_operations import EncryptionScopesOperations
22+
from ._rai_policies_operations import RaiPoliciesOperations
23+
from ._rai_blocklists_operations import RaiBlocklistsOperations
24+
from ._rai_blocklist_items_operations import RaiBlocklistItemsOperations
25+
from ._rai_content_filters_operations import RaiContentFiltersOperations
2126

2227
from ._patch import __all__ as _patch_all
2328
from ._patch import * # pylint: disable=unused-wildcard-import
@@ -36,6 +41,11 @@
3641
"PrivateLinkResourcesOperations",
3742
"DeploymentsOperations",
3843
"CommitmentPlansOperations",
44+
"EncryptionScopesOperations",
45+
"RaiPoliciesOperations",
46+
"RaiBlocklistsOperations",
47+
"RaiBlocklistItemsOperations",
48+
"RaiContentFiltersOperations",
3949
]
4050
__all__.extend([p for p in _patch_all if p not in __all__])
4151
_patch_sdk()

0 commit comments

Comments
 (0)