Skip to content

Commit f99392f

Browse files
author
SDKAuto
committed
CodeGen from PR 25378 in Azure/azure-rest-api-specs
Merge 658fb5c422a8caaffe413286e71c6a1a7722187d into 624dbc769880e5676ae8bb20d3c82ebd1783c64a
1 parent c69ff61 commit f99392f

File tree

61 files changed

+254
-167
lines changed

Some content is hidden

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

61 files changed

+254
-167
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "9975d3476c05bcc6bd9535ad3dfb564e6a168fa5",
2+
"commit": "e4f05ae0d0ec8fd2258803174f88602cd6ad31cb",
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/webpubsub/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/webpubsub/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/webpubsub/resource-manager/readme.md"
1111
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class WebPubSubManagementClientConfiguration(Configuration): # pylint: disable=
2929
:type credential: ~azure.core.credentials.TokenCredential
3030
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3131
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding
32+
:keyword api_version: Api Version. Default value is "2023-08-01-preview". Note that overriding
3333
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(WebPubSubManagementClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-06-01-preview")
39+
api_version: str = kwargs.pop("api_version", "2023-08-01-preview")
4040

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

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

sdk/webpubsub/azure-mgmt-webpubsub/azure/mgmt/webpubsub/_web_pub_sub_management_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class WebPubSubManagementClient: # pylint: disable=client-accepts-api-version-k
6969
:type subscription_id: str
7070
:param base_url: Service URL. Default value is "https://management.azure.com".
7171
:type base_url: str
72-
:keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding
72+
:keyword api_version: Api Version. Default value is "2023-08-01-preview". Note that overriding
7373
this default value may result in unsupported behavior.
7474
:paramtype api_version: str
7575
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class WebPubSubManagementClientConfiguration(Configuration): # pylint: disable=
2929
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
3030
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
3131
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding
32+
:keyword api_version: Api Version. Default value is "2023-08-01-preview". Note that overriding
3333
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(WebPubSubManagementClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-06-01-preview")
39+
api_version: str = kwargs.pop("api_version", "2023-08-01-preview")
4040

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

sdk/webpubsub/azure-mgmt-webpubsub/azure/mgmt/webpubsub/aio/_web_pub_sub_management_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class WebPubSubManagementClient: # pylint: disable=client-accepts-api-version-k
6969
:type subscription_id: str
7070
:param base_url: Service URL. Default value is "https://management.azure.com".
7171
:type base_url: str
72-
:keyword api_version: Api Version. Default value is "2023-06-01-preview". Note that overriding
72+
:keyword api_version: Api Version. Default value is "2023-08-01-preview". Note that overriding
7373
this default value may result in unsupported behavior.
7474
:paramtype api_version: str
7575
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no

sdk/webpubsub/azure-mgmt-webpubsub/azure/mgmt/webpubsub/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from ._models_py3 import EventListenerEndpoint
2121
from ._models_py3 import EventListenerFilter
2222
from ._models_py3 import EventNameFilter
23+
from ._models_py3 import IPRule
2324
from ._models_py3 import LiveTraceCategory
2425
from ._models_py3 import LiveTraceConfiguration
2526
from ._models_py3 import LogSpecification
@@ -106,6 +107,7 @@
106107
"EventListenerEndpoint",
107108
"EventListenerFilter",
108109
"EventNameFilter",
110+
"IPRule",
109111
"LiveTraceCategory",
110112
"LiveTraceConfiguration",
111113
"LogSpecification",

sdk/webpubsub/azure-mgmt-webpubsub/azure/mgmt/webpubsub/models/_models_py3.py

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,34 @@ def __init__(
707707
self.user_event_pattern = user_event_pattern
708708

709709

710+
class IPRule(_serialization.Model):
711+
"""An IP rule.
712+
713+
:ivar value: An IP or CIDR or ServiceTag.
714+
:vartype value: str
715+
:ivar action: Azure Networking ACL Action. Known values are: "Allow" and "Deny".
716+
:vartype action: str or ~azure.mgmt.webpubsub.models.ACLAction
717+
"""
718+
719+
_attribute_map = {
720+
"value": {"key": "value", "type": "str"},
721+
"action": {"key": "action", "type": "str"},
722+
}
723+
724+
def __init__(
725+
self, *, value: Optional[str] = None, action: Optional[Union[str, "_models.ACLAction"]] = None, **kwargs: Any
726+
) -> None:
727+
"""
728+
:keyword value: An IP or CIDR or ServiceTag.
729+
:paramtype value: str
730+
:keyword action: Azure Networking ACL Action. Known values are: "Allow" and "Deny".
731+
:paramtype action: str or ~azure.mgmt.webpubsub.models.ACLAction
732+
"""
733+
super().__init__(**kwargs)
734+
self.value = value
735+
self.action = action
736+
737+
710738
class LiveTraceCategory(_serialization.Model):
711739
"""Live trace category configuration of a Microsoft.SignalRService resource.
712740
@@ -1669,6 +1697,14 @@ class Replica(TrackedResource):
16691697
:ivar provisioning_state: Provisioning state of the resource. Known values are: "Unknown",
16701698
"Succeeded", "Failed", "Canceled", "Running", "Creating", "Updating", "Deleting", and "Moving".
16711699
:vartype provisioning_state: str or ~azure.mgmt.webpubsub.models.ProvisioningState
1700+
:ivar region_endpoint_enabled: Enable or disable the regional endpoint. Default to "Enabled".
1701+
When it's Disabled, new connections will not be routed to this endpoint, however existing
1702+
connections will not be affected.
1703+
:vartype region_endpoint_enabled: str
1704+
:ivar resource_stopped: Stop or start the resource. Default to "false".
1705+
When it's true, the data plane of the resource is shutdown.
1706+
When it's false, the data plane of the resource is started.
1707+
:vartype resource_stopped: str
16721708
"""
16731709

16741710
_validation = {
@@ -1689,6 +1725,8 @@ class Replica(TrackedResource):
16891725
"location": {"key": "location", "type": "str"},
16901726
"sku": {"key": "sku", "type": "ResourceSku"},
16911727
"provisioning_state": {"key": "properties.provisioningState", "type": "str"},
1728+
"region_endpoint_enabled": {"key": "properties.regionEndpointEnabled", "type": "str"},
1729+
"resource_stopped": {"key": "properties.resourceStopped", "type": "str"},
16921730
}
16931731

16941732
def __init__(
@@ -1697,6 +1735,8 @@ def __init__(
16971735
location: str,
16981736
tags: Optional[Dict[str, str]] = None,
16991737
sku: Optional["_models.ResourceSku"] = None,
1738+
region_endpoint_enabled: str = "Enabled",
1739+
resource_stopped: str = "false",
17001740
**kwargs: Any
17011741
) -> None:
17021742
"""
@@ -1706,10 +1746,21 @@ def __init__(
17061746
:paramtype location: str
17071747
:keyword sku: The billing information of the resource.
17081748
:paramtype sku: ~azure.mgmt.webpubsub.models.ResourceSku
1749+
:keyword region_endpoint_enabled: Enable or disable the regional endpoint. Default to
1750+
"Enabled".
1751+
When it's Disabled, new connections will not be routed to this endpoint, however existing
1752+
connections will not be affected.
1753+
:paramtype region_endpoint_enabled: str
1754+
:keyword resource_stopped: Stop or start the resource. Default to "false".
1755+
When it's true, the data plane of the resource is shutdown.
1756+
When it's false, the data plane of the resource is started.
1757+
:paramtype resource_stopped: str
17091758
"""
17101759
super().__init__(tags=tags, location=location, **kwargs)
17111760
self.sku = sku
17121761
self.provisioning_state = None
1762+
self.region_endpoint_enabled = region_endpoint_enabled
1763+
self.resource_stopped = resource_stopped
17131764

17141765

17151766
class ReplicaList(_serialization.Model):
@@ -2655,12 +2706,19 @@ class WebPubSubNetworkACLs(_serialization.Model):
26552706
:vartype public_network: ~azure.mgmt.webpubsub.models.NetworkACL
26562707
:ivar private_endpoints: ACLs for requests from private endpoints.
26572708
:vartype private_endpoints: list[~azure.mgmt.webpubsub.models.PrivateEndpointACL]
2709+
:ivar ip_rules: IP rules for filtering public traffic.
2710+
:vartype ip_rules: list[~azure.mgmt.webpubsub.models.IPRule]
26582711
"""
26592712

2713+
_validation = {
2714+
"ip_rules": {"max_items": 30, "min_items": 0},
2715+
}
2716+
26602717
_attribute_map = {
26612718
"default_action": {"key": "defaultAction", "type": "str"},
26622719
"public_network": {"key": "publicNetwork", "type": "NetworkACL"},
26632720
"private_endpoints": {"key": "privateEndpoints", "type": "[PrivateEndpointACL]"},
2721+
"ip_rules": {"key": "ipRules", "type": "[IPRule]"},
26642722
}
26652723

26662724
def __init__(
@@ -2669,6 +2727,7 @@ def __init__(
26692727
default_action: Optional[Union[str, "_models.ACLAction"]] = None,
26702728
public_network: Optional["_models.NetworkACL"] = None,
26712729
private_endpoints: Optional[List["_models.PrivateEndpointACL"]] = None,
2730+
ip_rules: Optional[List["_models.IPRule"]] = None,
26722731
**kwargs: Any
26732732
) -> None:
26742733
"""
@@ -2678,11 +2737,14 @@ def __init__(
26782737
:paramtype public_network: ~azure.mgmt.webpubsub.models.NetworkACL
26792738
:keyword private_endpoints: ACLs for requests from private endpoints.
26802739
:paramtype private_endpoints: list[~azure.mgmt.webpubsub.models.PrivateEndpointACL]
2740+
:keyword ip_rules: IP rules for filtering public traffic.
2741+
:paramtype ip_rules: list[~azure.mgmt.webpubsub.models.IPRule]
26812742
"""
26822743
super().__init__(**kwargs)
26832744
self.default_action = default_action
26842745
self.public_network = public_network
26852746
self.private_endpoints = private_endpoints
2747+
self.ip_rules = ip_rules
26862748

26872749

26882750
class WebPubSubResource(TrackedResource): # pylint: disable=too-many-instance-attributes
@@ -2760,6 +2822,16 @@ class WebPubSubResource(TrackedResource): # pylint: disable=too-many-instance-a
27602822
Enable or disable aad auth
27612823
When set as true, connection with AuthType=aad won't work.
27622824
:vartype disable_aad_auth: bool
2825+
:ivar region_endpoint_enabled: Enable or disable the regional endpoint. Default to "Enabled".
2826+
When it's Disabled, new connections will not be routed to this endpoint, however existing
2827+
connections will not be affected.
2828+
This property is replica specific. Disable the regional endpoint without replica is not
2829+
allowed.
2830+
:vartype region_endpoint_enabled: str
2831+
:ivar resource_stopped: Stop or start the resource. Default to "false".
2832+
When it's true, the data plane of the resource is shutdown.
2833+
When it's false, the data plane of the resource is started.
2834+
:vartype resource_stopped: str
27632835
"""
27642836

27652837
_validation = {
@@ -2814,6 +2886,8 @@ class WebPubSubResource(TrackedResource): # pylint: disable=too-many-instance-a
28142886
"public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"},
28152887
"disable_local_auth": {"key": "properties.disableLocalAuth", "type": "bool"},
28162888
"disable_aad_auth": {"key": "properties.disableAadAuth", "type": "bool"},
2889+
"region_endpoint_enabled": {"key": "properties.regionEndpointEnabled", "type": "str"},
2890+
"resource_stopped": {"key": "properties.resourceStopped", "type": "str"},
28172891
}
28182892

28192893
def __init__( # pylint: disable=too-many-locals
@@ -2831,6 +2905,8 @@ def __init__( # pylint: disable=too-many-locals
28312905
public_network_access: str = "Enabled",
28322906
disable_local_auth: bool = False,
28332907
disable_aad_auth: bool = False,
2908+
region_endpoint_enabled: str = "Enabled",
2909+
resource_stopped: str = "false",
28342910
**kwargs: Any
28352911
) -> None:
28362912
"""
@@ -2867,6 +2943,17 @@ def __init__( # pylint: disable=too-many-locals
28672943
Enable or disable aad auth
28682944
When set as true, connection with AuthType=aad won't work.
28692945
:paramtype disable_aad_auth: bool
2946+
:keyword region_endpoint_enabled: Enable or disable the regional endpoint. Default to
2947+
"Enabled".
2948+
When it's Disabled, new connections will not be routed to this endpoint, however existing
2949+
connections will not be affected.
2950+
This property is replica specific. Disable the regional endpoint without replica is not
2951+
allowed.
2952+
:paramtype region_endpoint_enabled: str
2953+
:keyword resource_stopped: Stop or start the resource. Default to "false".
2954+
When it's true, the data plane of the resource is shutdown.
2955+
When it's false, the data plane of the resource is started.
2956+
:paramtype resource_stopped: str
28702957
"""
28712958
super().__init__(tags=tags, location=location, **kwargs)
28722959
self.sku = sku
@@ -2888,6 +2975,8 @@ def __init__( # pylint: disable=too-many-locals
28882975
self.public_network_access = public_network_access
28892976
self.disable_local_auth = disable_local_auth
28902977
self.disable_aad_auth = disable_aad_auth
2978+
self.region_endpoint_enabled = region_endpoint_enabled
2979+
self.resource_stopped = resource_stopped
28912980

28922981

28932982
class WebPubSubResourceList(_serialization.Model):

0 commit comments

Comments
 (0)