diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_management_client_async.py b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_management_client_async.py
index 490d84d456db..9ccb33683ab7 100644
--- a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_management_client_async.py
+++ b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_management_client_async.py
@@ -10,7 +10,6 @@
from datetime import timedelta
from azure.core.async_paging import AsyncItemPaged
-from azure.servicebus.aio.management._utils import extract_data_template, get_next_template
from azure.core.exceptions import ResourceNotFoundError
from azure.core.pipeline import AsyncPipeline
from azure.core.pipeline.policies import HttpLoggingPolicy, DistributedTracingPolicy, ContentDecodePolicy, \
@@ -39,6 +38,8 @@
from ...management._xml_workaround_policy import ServiceBusXMLWorkaroundPolicy
from ...management._handle_response_error import _handle_response_error
from ...management._model_workaround import avoid_timedelta_overflow
+from ._utils import extract_data_template, extract_rule_data_template, get_next_template
+from ...management._utils import deserialize_rule_key_values, serialize_rule_key_values
if TYPE_CHECKING:
@@ -692,6 +693,7 @@ async def get_rule(
"Rule('Topic: {}, Subscription: {}, Rule {}') does not exist".format(
subscription_name, topic_name, rule_name))
rule_description = RuleDescription._from_internal_entity(rule_name, entry.content.rule_description)
+ deserialize_rule_key_values(entry_ele, rule_description) # to remove after #3535 is released.
return rule_description
async def create_rule(
@@ -724,6 +726,7 @@ async def create_rule(
)
)
request_body = create_entity_body.serialize(is_xml=True)
+ serialize_rule_key_values(request_body, rule)
with _handle_response_error():
entry_ele = await self._impl.rule.put(
topic_name,
@@ -731,7 +734,8 @@ async def create_rule(
rule_name,
request_body, api_version=constants.API_VERSION, **kwargs)
entry = RuleDescriptionEntry.deserialize(entry_ele)
- result = entry.content.rule_description
+ result = RuleDescription._from_internal_entity(rule_name, entry.content.rule_description)
+ deserialize_rule_key_values(entry_ele, result) # to remove after #3535 is released.
return result
async def update_rule(
@@ -767,6 +771,7 @@ async def update_rule(
)
)
request_body = create_entity_body.serialize(is_xml=True)
+ serialize_rule_key_values(request_body, rule)
with _handle_response_error():
await self._impl.rule.put(
topic_name,
@@ -824,12 +829,17 @@ def list_rules(
except AttributeError:
subscription_name = subscription
- def entry_to_rule(entry):
+ def entry_to_rule(ele, entry):
+ """
+ `ele` will be removed after #3535 is released.
+ """
rule = entry.content.rule_description
- return RuleDescription._from_internal_entity(entry.title, rule)
+ rule_description = RuleDescription._from_internal_entity(entry.title, rule)
+ deserialize_rule_key_values(ele, rule_description) # to remove after #3535 is released.
+ return rule_description
extract_data = functools.partial(
- extract_data_template, RuleDescriptionFeed, entry_to_rule
+ extract_rule_data_template, RuleDescriptionFeed, entry_to_rule
)
get_next = functools.partial(
get_next_template, functools.partial(self._impl.list_rules, topic_name, subscription_name), **kwargs
diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_utils.py b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_utils.py
index 035661df3e2e..a5a20021c302 100644
--- a/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_utils.py
+++ b/sdk/servicebus/azure-servicebus/azure/servicebus/aio/management/_utils.py
@@ -89,6 +89,29 @@ async def extract_data_template(feed_class, convert, feed_element):
return next_link, iter(list_of_qd) # when next_page is None, AsyncPagedItem will stop fetch next page data.
+async def extract_rule_data_template(feed_class, convert, feed_element):
+ """Special version of function extrat_data_template for Rule.
+
+ Pass both the XML entry element and the rule instance to function `convert`. Rule needs to extract
+ KeyValue from XML Element and set to Rule model instance manually. The autorest/msrest serialization/deserialization
+ doesn't work for this special part.
+ After autorest is enhanced, this method can be removed.
+ Refer to autorest issue https://github.com/Azure/autorest/issues/3535
+ """
+ deserialized = feed_class.deserialize(feed_element)
+ next_link = None
+ if deserialized.link and len(deserialized.link) == 2:
+ next_link = deserialized.link[1].href
+ if deserialized.entry:
+ list_of_entities = [
+ convert(*x) if convert else x for x in zip(feed_element.findall(
+ constants.ATOM_ENTRY_TAG), deserialized.entry)
+ ]
+ else:
+ list_of_entities = []
+ return next_link, iter(list_of_entities)
+
+
async def get_next_template(list_func, *args, start_index=0, max_page_size=100, **kwargs):
"""Call list_func to get the XML data and deserialize it to XML ElementTree.
diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_constants.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_constants.py
index 8762bd46eca9..275a584282da 100644
--- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_constants.py
+++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_constants.py
@@ -3,16 +3,37 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
+# Generated API parameters
API_VERSION_PARAM_NAME = "api-version"
API_VERSION = "2017-04"
-ENTRY_TAG = "{http://www.w3.org/2005/Atom}entry"
-CONTENT_TAG = "{http://www.w3.org/2005/Atom}content"
-QUEUE_DESCRIPTION_TAG = "{http://schemas.microsoft.com/netservices/2010/10/servicebus/connect}QueueDescription"
-COUNT_DETAILS_TAG = "{http://schemas.microsoft.com/netservices/2010/10/servicebus/connect}CountDetails"
-TITLE_TAG = "{http://www.w3.org/2005/Atom}title"
-
ENTITY_TYPE_QUEUES = "queues"
ENTITY_TYPE_TOPICS = "topics"
-
LIST_OP_SKIP = "$skip"
LIST_OP_TOP = "$top"
+
+# XML namespace and tags
+XML_SCHEMA_NAMESPACE = "http://www.w3.org/2001/XMLSchema"
+XML_SCHEMA_INSTANCE_NAMESPACE = "http://www.w3.org/2001/XMLSchema-instance"
+ATOM_ENTRY_TAG = "{http://www.w3.org/2005/Atom}entry"
+ATOM_CONTENT_TAG = "{http://www.w3.org/2005/Atom}content"
+
+# ServiceBus XML namespace
+SB_XML_NAMESPACE = "http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"
+
+# Rule XML tags
+RULE_KEY_VALUE = "KeyValueOfstringanyType"
+RULE_KEY = "Key"
+RULE_VALUE = "Value"
+RULE_VALUE_TYPE = "type"
+RULE_VALUE_TYPE_XML_PREFIX = "d6p1"
+RULE_SQL_COMPATIBILITY_LEVEL = "20"
+RULE_DESCRIPTION_TAG = "{http://schemas.microsoft.com/netservices/2010/10/servicebus/connect}RuleDescription"
+RULE_FILTER_TAG = "{http://schemas.microsoft.com/netservices/2010/10/servicebus/connect}Filter"
+RULE_FILTER_COR_PROPERTIES_TAG = "{http://schemas.microsoft.com/netservices/2010/10/servicebus/connect}Properties"
+RULE_PARAMETERS_TAG = "{http://schemas.microsoft.com/netservices/2010/10/servicebus/connect}Parameters"
+RULE_ACTION_TAG = "{http://schemas.microsoft.com/netservices/2010/10/servicebus/connect}Action"
+RULE_KEY_VALUE_TAG = "{{{}}}{}".format(SB_XML_NAMESPACE, RULE_KEY_VALUE)
+RULE_KEY_TAG = "{{{}}}{}".format(SB_XML_NAMESPACE, RULE_KEY)
+RULE_VALUE_TAG = "{{{}}}{}".format(SB_XML_NAMESPACE, RULE_VALUE)
+RULE_VALUE_TYPE_TAG = "{{{}}}{}".format(XML_SCHEMA_INSTANCE_NAMESPACE, RULE_VALUE_TYPE)
+INT32_MAX_VALUE = 2147483647 # int32 max value used to tell if a Python int is an int32 or long in other languages
diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/models/_models.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/models/_models.py
index e3077351e58e..bc5a8b1d5438 100644
--- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/models/_models.py
+++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/models/_models.py
@@ -13,11 +13,11 @@
class AuthorizationRule(msrest.serialization.Model):
"""Authorization rule of an entity.
- :param type:
+ :param type: The authorization type.
:type type: str
- :param claim_type:
+ :param claim_type: The claim type.
:type claim_type: str
- :param claim_value:
+ :param claim_value: The claim value.
:type claim_value: str
:param rights: Access rights of the entity. Values are 'Send', 'Listen', or 'Manage'.
:type rights: list[str]
@@ -35,14 +35,14 @@ class AuthorizationRule(msrest.serialization.Model):
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'i', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
- 'claim_type': {'key': 'ClaimType', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'claim_value': {'key': 'ClaimValue', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'rights': {'key': 'Rights', 'type': '[str]', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'AccessRights', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'created_time': {'key': 'CreatedTime', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'modified_time': {'key': 'ModifiedTime', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'key_name': {'key': 'KeyName', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'primary_key': {'key': 'PrimaryKey', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'secondary_key': {'key': 'SecondaryKey', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'claim_type': {'key': 'claimType', 'type': 'str', 'xml': {'name': 'ClaimType', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'claim_value': {'key': 'claimValue', 'type': 'str', 'xml': {'name': 'ClaimValue', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'rights': {'key': 'rights', 'type': '[str]', 'xml': {'name': 'Rights', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'AccessRights', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'created_time': {'key': 'createdTime', 'type': 'iso-8601', 'xml': {'name': 'CreatedTime', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601', 'xml': {'name': 'ModifiedTime', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'key_name': {'key': 'keyName', 'type': 'str', 'xml': {'name': 'KeyName', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'primary_key': {'key': 'primaryKey', 'type': 'str', 'xml': {'name': 'PrimaryKey', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'secondary_key': {'key': 'secondaryKey', 'type': 'str', 'xml': {'name': 'SecondaryKey', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'AuthorizationRule', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -68,18 +68,24 @@ class RuleFilter(msrest.serialization.Model):
"""RuleFilter.
You probably want to use the sub-classes and not this class directly. Known
- sub-classes are: CorrelationFilter, FalseFilter, SqlFilter, TrueFilter.
+ sub-classes are: CorrelationFilter, SqlFilter.
- :param type: Constant filled by server.
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
:type type: str
"""
+ _validation = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
}
_subtype_map = {
- 'type': {'CorrelationFilter': 'CorrelationFilter', 'FalseFilter': 'FalseFilter', 'SqlFilter': 'SqlFilter', 'TrueFilter': 'TrueFilter'}
+ 'type': {'CorrelationFilter': 'CorrelationFilter', 'SqlFilter': 'SqlFilter'}
}
_xml_map = {
'name': 'Filter', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -96,7 +102,9 @@ def __init__(
class CorrelationFilter(RuleFilter):
"""CorrelationFilter.
- :param type: Constant filled by server.
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
:type type: str
:param correlation_id:
:type correlation_id: str
@@ -118,17 +126,21 @@ class CorrelationFilter(RuleFilter):
:type properties: list[~azure.servicebus.management._generated.models.KeyValue]
"""
+ _validation = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
- 'correlation_id': {'key': 'CorrelationId', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'message_id': {'key': 'MessageId', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'to': {'key': 'To', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'reply_to': {'key': 'ReplyTo', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'label': {'key': 'Label', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'session_id': {'key': 'SessionId', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'reply_to_session_id': {'key': 'ReplyToSessionId', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'content_type': {'key': 'ContentType', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'properties': {'key': 'Properties', 'type': '[KeyValue]', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'KeyValueOfstringanyType', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'correlation_id': {'key': 'correlationId', 'type': 'str', 'xml': {'name': 'CorrelationId', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'message_id': {'key': 'messageId', 'type': 'str', 'xml': {'name': 'MessageId', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'to': {'key': 'to', 'type': 'str', 'xml': {'name': 'To', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'reply_to': {'key': 'replyTo', 'type': 'str', 'xml': {'name': 'ReplyTo', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'label': {'key': 'label', 'type': 'str', 'xml': {'name': 'Label', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'session_id': {'key': 'sessionId', 'type': 'str', 'xml': {'name': 'SessionId', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'reply_to_session_id': {'key': 'replyToSessionId', 'type': 'str', 'xml': {'name': 'ReplyToSessionId', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'content_type': {'key': 'contentType', 'type': 'str', 'xml': {'name': 'ContentType', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'properties': {'key': 'properties', 'type': '[KeyValue]', 'xml': {'name': 'Properties', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'KeyValueOfstringanyType', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
def __init__(
@@ -181,7 +193,7 @@ class CreateQueueBodyContent(msrest.serialization.Model):
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True}},
- 'queue_description': {'key': 'QueueDescription', 'type': 'QueueDescription'},
+ 'queue_description': {'key': 'queueDescription', 'type': 'QueueDescription'},
}
_xml_map = {
'ns': 'http://www.w3.org/2005/Atom'
@@ -197,7 +209,7 @@ def __init__(
class CreateRuleBody(msrest.serialization.Model):
- """The request body for creating a topic.
+ """The request body for creating a rule.
:param content: RuleDescription for the new Rule.
:type content: ~azure.servicebus.management._generated.models.CreateRuleBodyContent
@@ -229,7 +241,7 @@ class CreateRuleBodyContent(msrest.serialization.Model):
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True}},
- 'rule_description': {'key': 'RuleDescription', 'type': 'RuleDescription'},
+ 'rule_description': {'key': 'ruleDescription', 'type': 'RuleDescription'},
}
_xml_map = {
'ns': 'http://www.w3.org/2005/Atom'
@@ -245,9 +257,9 @@ def __init__(
class CreateSubscriptionBody(msrest.serialization.Model):
- """The request body for creating a topic.
+ """The request body for creating a subscription.
- :param content: TopicDescription for the new topic.
+ :param content: SubscriptionDescription for the new subscription.
:type content: ~azure.servicebus.management._generated.models.CreateSubscriptionBodyContent
"""
@@ -267,18 +279,18 @@ def __init__(
class CreateSubscriptionBodyContent(msrest.serialization.Model):
- """TopicDescription for the new topic.
+ """SubscriptionDescription for the new subscription.
:param type: MIME type of content.
:type type: str
- :param subscription_description: Topic information to create.
+ :param subscription_description: Subscription information to create.
:type subscription_description:
~azure.servicebus.management._generated.models.SubscriptionDescription
"""
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True}},
- 'subscription_description': {'key': 'SubscriptionDescription', 'type': 'SubscriptionDescription'},
+ 'subscription_description': {'key': 'subscriptionDescription', 'type': 'SubscriptionDescription'},
}
_xml_map = {
'ns': 'http://www.w3.org/2005/Atom'
@@ -326,7 +338,7 @@ class CreateTopicBodyContent(msrest.serialization.Model):
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True}},
- 'topic_description': {'key': 'TopicDescription', 'type': 'TopicDescription'},
+ 'topic_description': {'key': 'topicDescription', 'type': 'TopicDescription'},
}
_xml_map = {
'ns': 'http://www.w3.org/2005/Atom'
@@ -347,10 +359,16 @@ class RuleAction(msrest.serialization.Model):
You probably want to use the sub-classes and not this class directly. Known
sub-classes are: EmptyRuleAction, SqlRuleAction.
- :param type: Constant filled by server.
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
:type type: str
"""
+ _validation = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
}
@@ -373,10 +391,16 @@ def __init__(
class EmptyRuleAction(RuleAction):
"""EmptyRuleAction.
- :param type: Constant filled by server.
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
:type type: str
"""
+ _validation = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
}
@@ -389,18 +413,81 @@ def __init__(
self.type = 'EmptyRuleAction'
-class FalseFilter(RuleFilter):
+class SqlFilter(RuleFilter):
+ """SqlFilter.
+
+ You probably want to use the sub-classes and not this class directly. Known
+ sub-classes are: FalseFilter, TrueFilter.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
+ :type type: str
+ :param sql_expression:
+ :type sql_expression: str
+ :param compatibility_level:
+ :type compatibility_level: str
+ :param parameters:
+ :type parameters: list[~azure.servicebus.management._generated.models.KeyValue]
+ :param requires_preprocessing:
+ :type requires_preprocessing: bool
+ """
+
+ _validation = {
+ 'type': {'required': True},
+ }
+
+ _attribute_map = {
+ 'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
+ 'sql_expression': {'key': 'sqlExpression', 'type': 'str', 'xml': {'name': 'SqlExpression', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'str', 'xml': {'name': 'CompatibilityLevel', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'parameters': {'key': 'parameters', 'type': '[KeyValue]', 'xml': {'name': 'Parameters', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'KeyValueOfstringanyType', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool', 'xml': {'name': 'RequiresPreprocessing', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ }
+
+ _subtype_map = {
+ 'type': {'FalseFilter': 'FalseFilter', 'TrueFilter': 'TrueFilter'}
+ }
+
+ def __init__(
+ self,
+ **kwargs
+ ):
+ super(SqlFilter, self).__init__(**kwargs)
+ self.type = 'SqlFilter'
+ self.sql_expression = kwargs.get('sql_expression', None)
+ self.compatibility_level = kwargs.get('compatibility_level', "20")
+ self.parameters = kwargs.get('parameters', None)
+ self.requires_preprocessing = kwargs.get('requires_preprocessing', None)
+
+
+class FalseFilter(SqlFilter):
"""FalseFilter.
- :param type: Constant filled by server.
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
:type type: str
:param sql_expression:
:type sql_expression: str
+ :param compatibility_level:
+ :type compatibility_level: str
+ :param parameters:
+ :type parameters: list[~azure.servicebus.management._generated.models.KeyValue]
+ :param requires_preprocessing:
+ :type requires_preprocessing: bool
"""
+ _validation = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
- 'sql_expression': {'key': 'SqlExpression', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'sql_expression': {'key': 'sqlExpression', 'type': 'str', 'xml': {'name': 'SqlExpression', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'str', 'xml': {'name': 'CompatibilityLevel', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'parameters': {'key': 'parameters', 'type': '[KeyValue]', 'xml': {'name': 'Parameters', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'KeyValueOfstringanyType', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool', 'xml': {'name': 'RequiresPreprocessing', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
def __init__(
@@ -409,11 +496,10 @@ def __init__(
):
super(FalseFilter, self).__init__(**kwargs)
self.type = 'FalseFilter'
- self.sql_expression = kwargs.get('sql_expression', "1 != 1")
class KeyValue(msrest.serialization.Model):
- """KeyValue.
+ """Key Values of custom properties.
:param key:
:type key: str
@@ -422,8 +508,8 @@ class KeyValue(msrest.serialization.Model):
"""
_attribute_map = {
- 'key': {'key': 'Key', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'value': {'key': 'Value', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'key': {'key': 'key', 'type': 'str', 'xml': {'name': 'Key', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'value': {'key': 'value', 'type': 'str', 'xml': {'name': 'Value', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'KeyValueOfstringanyType', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -455,11 +541,11 @@ class MessageCountDetails(msrest.serialization.Model):
"""
_attribute_map = {
- 'active_message_count': {'key': 'ActiveMessageCount', 'type': 'int', 'xml': {'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
- 'dead_letter_message_count': {'key': 'DeadLetterMessageCount', 'type': 'int', 'xml': {'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
- 'scheduled_message_count': {'key': 'ScheduledMessageCount', 'type': 'int', 'xml': {'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
- 'transfer_dead_letter_message_count': {'key': 'TransferDeadLetterMessageCount', 'type': 'int', 'xml': {'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
- 'transfer_message_count': {'key': 'TransferMessageCount', 'type': 'int', 'xml': {'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
+ 'active_message_count': {'key': 'activeMessageCount', 'type': 'int', 'xml': {'name': 'ActiveMessageCount', 'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
+ 'dead_letter_message_count': {'key': 'deadLetterMessageCount', 'type': 'int', 'xml': {'name': 'DeadLetterMessageCount', 'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
+ 'scheduled_message_count': {'key': 'scheduledMessageCount', 'type': 'int', 'xml': {'name': 'ScheduledMessageCount', 'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
+ 'transfer_dead_letter_message_count': {'key': 'transferDeadLetterMessageCount', 'type': 'int', 'xml': {'name': 'TransferDeadLetterMessageCount', 'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
+ 'transfer_message_count': {'key': 'transferMessageCount', 'type': 'int', 'xml': {'name': 'TransferMessageCount', 'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
}
_xml_map = {
'name': 'CountDetails', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -499,13 +585,13 @@ class NamespaceProperties(msrest.serialization.Model):
"""
_attribute_map = {
- 'alias': {'key': 'Alias', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'created_time': {'key': 'CreatedTime', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'messaging_sku': {'key': 'MessagingSku', 'type': 'str', 'xml': {'name': 'MessagingSKU', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'messaging_units': {'key': 'MessagingUnits', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'modified_time': {'key': 'ModifiedTime', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'name': {'key': 'Name', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'namespace_type': {'key': 'NamespaceType', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'alias': {'key': 'alias', 'type': 'str', 'xml': {'name': 'Alias', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'created_time': {'key': 'createdTime', 'type': 'iso-8601', 'xml': {'name': 'CreatedTime', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'messaging_sku': {'key': 'messagingSku', 'type': 'str', 'xml': {'name': 'MessagingSKU', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'messaging_units': {'key': 'messagingUnits', 'type': 'int', 'xml': {'name': 'MessagingUnits', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601', 'xml': {'name': 'ModifiedTime', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'name': {'key': 'name', 'type': 'str', 'xml': {'name': 'Name', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'namespace_type': {'key': 'namespaceType', 'type': 'str', 'xml': {'name': 'NamespaceType', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'NamespaceInfo', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -602,7 +688,7 @@ class QueueDescription(msrest.serialization.Model):
:type lock_duration: ~datetime.timedelta
:param max_size_in_megabytes: The maximum size of the queue in megabytes, which is the size of
memory allocated for the queue.
- :type max_size_in_megabytes: int
+ :type max_size_in_megabytes: long
:param requires_duplicate_detection: A value indicating if this queue requires duplicate
detection.
:type requires_duplicate_detection: bool
@@ -646,7 +732,7 @@ class QueueDescription(msrest.serialization.Model):
:type user_metadata: str
:param created_at: The exact time the queue was created.
:type created_at: ~datetime.datetime
- :param updated_at: The exact time a message was updated in the queue.
+ :param updated_at: The exact time the entity description was last updated.
:type updated_at: ~datetime.datetime
:param accessed_at: Last time a message was sent, or the last time there was a receive request
to this queue.
@@ -674,32 +760,32 @@ class QueueDescription(msrest.serialization.Model):
"""
_attribute_map = {
- 'lock_duration': {'key': 'LockDuration', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'max_size_in_megabytes': {'key': 'MaxSizeInMegabytes', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'requires_duplicate_detection': {'key': 'RequiresDuplicateDetection', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'requires_session': {'key': 'RequiresSession', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'default_message_time_to_live': {'key': 'DefaultMessageTimeToLive', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'dead_lettering_on_message_expiration': {'key': 'DeadLetteringOnMessageExpiration', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'duplicate_detection_history_time_window': {'key': 'DuplicateDetectionHistoryTimeWindow', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'max_delivery_count': {'key': 'MaxDeliveryCount', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_batched_operations': {'key': 'EnableBatchedOperations', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'size_in_bytes': {'key': 'SizeInBytes', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'message_count': {'key': 'MessageCount', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'is_anonymous_accessible': {'key': 'IsAnonymousAccessible', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'authorization_rules': {'key': 'AuthorizationRules', 'type': '[AuthorizationRule]', 'xml': {'name': 'AuthorizationRules', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'AuthorizationRule', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'status': {'key': 'Status', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'forward_to': {'key': 'ForwardTo', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'user_metadata': {'key': 'UserMetadata', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'created_at': {'key': 'CreatedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'updated_at': {'key': 'UpdatedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'accessed_at': {'key': 'AccessedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'support_ordering': {'key': 'SupportOrdering', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'message_count_details': {'key': 'MessageCountDetails', 'type': 'MessageCountDetails'},
- 'auto_delete_on_idle': {'key': 'AutoDeleteOnIdle', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_partitioning': {'key': 'EnablePartitioning', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'entity_availability_status': {'key': 'EntityAvailabilityStatus', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_express': {'key': 'EnableExpress', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'forward_dead_lettered_messages_to': {'key': 'ForwardDeadLetteredMessagesTo', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'lock_duration': {'key': 'lockDuration', 'type': 'duration', 'xml': {'name': 'LockDuration', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'max_size_in_megabytes': {'key': 'maxSizeInMegabytes', 'type': 'long', 'xml': {'name': 'MaxSizeInMegabytes', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_duplicate_detection': {'key': 'requiresDuplicateDetection', 'type': 'bool', 'xml': {'name': 'RequiresDuplicateDetection', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_session': {'key': 'requiresSession', 'type': 'bool', 'xml': {'name': 'RequiresSession', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'default_message_time_to_live': {'key': 'defaultMessageTimeToLive', 'type': 'duration', 'xml': {'name': 'DefaultMessageTimeToLive', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'dead_lettering_on_message_expiration': {'key': 'deadLetteringOnMessageExpiration', 'type': 'bool', 'xml': {'name': 'DeadLetteringOnMessageExpiration', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'duplicate_detection_history_time_window': {'key': 'duplicateDetectionHistoryTimeWindow', 'type': 'duration', 'xml': {'name': 'DuplicateDetectionHistoryTimeWindow', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'max_delivery_count': {'key': 'maxDeliveryCount', 'type': 'int', 'xml': {'name': 'MaxDeliveryCount', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_batched_operations': {'key': 'enableBatchedOperations', 'type': 'bool', 'xml': {'name': 'EnableBatchedOperations', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'size_in_bytes': {'key': 'sizeInBytes', 'type': 'int', 'xml': {'name': 'SizeInBytes', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'message_count': {'key': 'messageCount', 'type': 'int', 'xml': {'name': 'MessageCount', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'is_anonymous_accessible': {'key': 'isAnonymousAccessible', 'type': 'bool', 'xml': {'name': 'IsAnonymousAccessible', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'authorization_rules': {'key': 'authorizationRules', 'type': '[AuthorizationRule]', 'xml': {'name': 'AuthorizationRules', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'AuthorizationRule', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'status': {'key': 'status', 'type': 'str', 'xml': {'name': 'Status', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'forward_to': {'key': 'forwardTo', 'type': 'str', 'xml': {'name': 'ForwardTo', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'user_metadata': {'key': 'userMetadata', 'type': 'str', 'xml': {'name': 'UserMetadata', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'created_at': {'key': 'createdAt', 'type': 'iso-8601', 'xml': {'name': 'CreatedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'updated_at': {'key': 'updatedAt', 'type': 'iso-8601', 'xml': {'name': 'UpdatedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'accessed_at': {'key': 'accessedAt', 'type': 'iso-8601', 'xml': {'name': 'AccessedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'support_ordering': {'key': 'supportOrdering', 'type': 'bool', 'xml': {'name': 'SupportOrdering', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'message_count_details': {'key': 'messageCountDetails', 'type': 'MessageCountDetails'},
+ 'auto_delete_on_idle': {'key': 'autoDeleteOnIdle', 'type': 'duration', 'xml': {'name': 'AutoDeleteOnIdle', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_partitioning': {'key': 'enablePartitioning', 'type': 'bool', 'xml': {'name': 'EnablePartitioning', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'entity_availability_status': {'key': 'entityAvailabilityStatus', 'type': 'str', 'xml': {'name': 'EntityAvailabilityStatus', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_express': {'key': 'enableExpress', 'type': 'bool', 'xml': {'name': 'EnableExpress', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'forward_dead_lettered_messages_to': {'key': 'forwardDeadLetteredMessagesTo', 'type': 'str', 'xml': {'name': 'ForwardDeadLetteredMessagesTo', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'QueueDescription', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -863,7 +949,7 @@ class ResponseAuthor(msrest.serialization.Model):
'name': {'key': 'name', 'type': 'str', 'xml': {'ns': 'http://www.w3.org/2005/Atom'}},
}
_xml_map = {
- 'ns': 'http://www.w3.org/2005/Atom'
+ 'name': 'author', 'ns': 'http://www.w3.org/2005/Atom'
}
def __init__(
@@ -914,13 +1000,13 @@ class RuleDescription(msrest.serialization.Model):
"""
_attribute_map = {
- 'filter': {'key': 'Filter', 'type': 'RuleFilter'},
- 'action': {'key': 'Action', 'type': 'RuleAction'},
- 'created_at': {'key': 'CreatedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'name': {'key': 'Name', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'filter': {'key': 'filter', 'type': 'RuleFilter'},
+ 'action': {'key': 'action', 'type': 'RuleAction'},
+ 'created_at': {'key': 'createdAt', 'type': 'iso-8601', 'xml': {'name': 'CreatedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'name': {'key': 'name', 'type': 'str', 'xml': {'name': 'Name', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
- 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
+ 'name': 'RuleDescription', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
}
def __init__(
@@ -979,7 +1065,7 @@ def __init__(
class RuleDescriptionEntryContent(msrest.serialization.Model):
"""The RuleDescription.
- :param type: Type of content in queue response.
+ :param type: Type of content in rule response.
:type type: str
:param rule_description:
:type rule_description: ~azure.servicebus.management._generated.models.RuleDescription
@@ -1050,8 +1136,8 @@ class ServiceBusManagementError(msrest.serialization.Model):
"""
_attribute_map = {
- 'code': {'key': 'Code', 'type': 'int'},
- 'detail': {'key': 'Detail', 'type': 'str'},
+ 'code': {'key': 'code', 'type': 'int', 'xml': {'name': 'Code'}},
+ 'detail': {'key': 'detail', 'type': 'str', 'xml': {'name': 'Detail'}},
}
def __init__(
@@ -1063,41 +1149,33 @@ def __init__(
self.detail = kwargs.get('detail', None)
-class SqlFilter(RuleFilter):
- """SqlFilter.
-
- :param type: Constant filled by server.
- :type type: str
- :param sql_expression:
- :type sql_expression: str
- """
-
- _attribute_map = {
- 'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
- 'sql_expression': {'key': 'SqlExpression', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- }
-
- def __init__(
- self,
- **kwargs
- ):
- super(SqlFilter, self).__init__(**kwargs)
- self.type = 'SqlFilter'
- self.sql_expression = kwargs.get('sql_expression', None)
-
-
class SqlRuleAction(RuleAction):
"""SqlRuleAction.
- :param type: Constant filled by server.
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
:type type: str
:param sql_expression:
:type sql_expression: str
+ :param compatibility_level:
+ :type compatibility_level: str
+ :param parameters:
+ :type parameters: list[~azure.servicebus.management._generated.models.KeyValue]
+ :param requires_preprocessing:
+ :type requires_preprocessing: bool
"""
+ _validation = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
- 'sql_expression': {'key': 'SqlExpression', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'sql_expression': {'key': 'sqlExpression', 'type': 'str', 'xml': {'name': 'SqlExpression', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'str', 'xml': {'name': 'CompatibilityLevel', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'parameters': {'key': 'parameters', 'type': '[KeyValue]', 'xml': {'name': 'Parameters', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'KeyValueOfstringanyType', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool', 'xml': {'name': 'RequiresPreprocessing', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
def __init__(
@@ -1107,6 +1185,9 @@ def __init__(
super(SqlRuleAction, self).__init__(**kwargs)
self.type = 'SqlRuleAction'
self.sql_expression = kwargs.get('sql_expression', None)
+ self.compatibility_level = kwargs.get('compatibility_level', "20")
+ self.parameters = kwargs.get('parameters', None)
+ self.requires_preprocessing = kwargs.get('requires_preprocessing', None)
class SubscriptionDescription(msrest.serialization.Model):
@@ -1116,8 +1197,8 @@ class SubscriptionDescription(msrest.serialization.Model):
that the message is locked for other receivers. The maximum value for LockDuration is 5
minutes; the default value is 1 minute.
:type lock_duration: ~datetime.timedelta
- :param requires_session: A value that indicates whether the queue supports the concept of
- sessions.
+ :param requires_session: A value that indicates whether the subscription supports the concept
+ of sessions.
:type requires_session: bool
:param default_message_time_to_live: ISO 8601 default message timespan to live value. This is
the duration after which the message expires, starting from when the message is sent to Service
@@ -1168,24 +1249,24 @@ class SubscriptionDescription(msrest.serialization.Model):
"""
_attribute_map = {
- 'lock_duration': {'key': 'LockDuration', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'requires_session': {'key': 'RequiresSession', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'default_message_time_to_live': {'key': 'DefaultMessageTimeToLive', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'dead_lettering_on_message_expiration': {'key': 'DeadLetteringOnMessageExpiration', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'dead_lettering_on_filter_evaluation_exceptions': {'key': 'DeadLetteringOnFilterEvaluationExceptions', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'message_count': {'key': 'MessageCount', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'max_delivery_count': {'key': 'MaxDeliveryCount', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_batched_operations': {'key': 'EnableBatchedOperations', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'status': {'key': 'Status', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'forward_to': {'key': 'ForwardTo', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'created_at': {'key': 'CreatedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'updated_at': {'key': 'UpdatedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'accessed_at': {'key': 'AccessedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'message_count_details': {'key': 'MessageCountDetails', 'type': 'MessageCountDetails'},
- 'user_metadata': {'key': 'UserMetadata', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'forward_dead_lettered_messages_to': {'key': 'ForwardDeadLetteredMessagesTo', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'auto_delete_on_idle': {'key': 'AutoDeleteOnIdle', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'entity_availability_status': {'key': 'EntityAvailabilityStatus', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'lock_duration': {'key': 'lockDuration', 'type': 'duration', 'xml': {'name': 'LockDuration', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_session': {'key': 'requiresSession', 'type': 'bool', 'xml': {'name': 'RequiresSession', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'default_message_time_to_live': {'key': 'defaultMessageTimeToLive', 'type': 'duration', 'xml': {'name': 'DefaultMessageTimeToLive', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'dead_lettering_on_message_expiration': {'key': 'deadLetteringOnMessageExpiration', 'type': 'bool', 'xml': {'name': 'DeadLetteringOnMessageExpiration', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'dead_lettering_on_filter_evaluation_exceptions': {'key': 'deadLetteringOnFilterEvaluationExceptions', 'type': 'bool', 'xml': {'name': 'DeadLetteringOnFilterEvaluationExceptions', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'message_count': {'key': 'messageCount', 'type': 'int', 'xml': {'name': 'MessageCount', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'max_delivery_count': {'key': 'maxDeliveryCount', 'type': 'int', 'xml': {'name': 'MaxDeliveryCount', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_batched_operations': {'key': 'enableBatchedOperations', 'type': 'bool', 'xml': {'name': 'EnableBatchedOperations', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'status': {'key': 'status', 'type': 'str', 'xml': {'name': 'Status', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'forward_to': {'key': 'forwardTo', 'type': 'str', 'xml': {'name': 'ForwardTo', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'created_at': {'key': 'createdAt', 'type': 'iso-8601', 'xml': {'name': 'CreatedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'updated_at': {'key': 'updatedAt', 'type': 'iso-8601', 'xml': {'name': 'UpdatedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'accessed_at': {'key': 'accessedAt', 'type': 'iso-8601', 'xml': {'name': 'AccessedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'message_count_details': {'key': 'messageCountDetails', 'type': 'MessageCountDetails'},
+ 'user_metadata': {'key': 'userMetadata', 'type': 'str', 'xml': {'name': 'UserMetadata', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'forward_dead_lettered_messages_to': {'key': 'forwardDeadLetteredMessagesTo', 'type': 'str', 'xml': {'name': 'ForwardDeadLetteredMessagesTo', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'auto_delete_on_idle': {'key': 'autoDeleteOnIdle', 'type': 'duration', 'xml': {'name': 'AutoDeleteOnIdle', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'entity_availability_status': {'key': 'entityAvailabilityStatus', 'type': 'str', 'xml': {'name': 'EntityAvailabilityStatus', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'SubscriptionDescription', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -1262,7 +1343,7 @@ def __init__(
class SubscriptionDescriptionEntryContent(msrest.serialization.Model):
"""The SubscriptionDescription.
- :param type: Type of content in queue response.
+ :param type: Type of content in subscription response.
:type type: str
:param subscription_description: Description of a Service Bus subscription resource.
:type subscription_description:
@@ -1383,35 +1464,35 @@ class TopicDescription(msrest.serialization.Model):
subscription is to be partitioned.
:type enable_subscription_partitioning: bool
:param enable_express: A value that indicates whether Express Entities are enabled. An express
- queue holds a message in memory temporarily before writing it to persistent storage.
+ topic holds a message in memory temporarily before writing it to persistent storage.
:type enable_express: bool
:param user_metadata: Metadata associated with the topic.
:type user_metadata: str
"""
_attribute_map = {
- 'default_message_time_to_live': {'key': 'DefaultMessageTimeToLive', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'max_size_in_megabytes': {'key': 'MaxSizeInMegabytes', 'type': 'long', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'requires_duplicate_detection': {'key': 'RequiresDuplicateDetection', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'duplicate_detection_history_time_window': {'key': 'DuplicateDetectionHistoryTimeWindow', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_batched_operations': {'key': 'EnableBatchedOperations', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'size_in_bytes': {'key': 'SizeInBytes', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'filtering_messages_before_publishing': {'key': 'FilteringMessagesBeforePublishing', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'is_anonymous_accessible': {'key': 'IsAnonymousAccessible', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'authorization_rules': {'key': 'AuthorizationRules', 'type': '[AuthorizationRule]', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'AuthorizationRule', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'status': {'key': 'Status', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'created_at': {'key': 'CreatedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'updated_at': {'key': 'UpdatedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'accessed_at': {'key': 'AccessedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'support_ordering': {'key': 'SupportOrdering', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'message_count_details': {'key': 'MessageCountDetails', 'type': 'MessageCountDetails'},
- 'subscription_count': {'key': 'SubscriptionCount', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'auto_delete_on_idle': {'key': 'AutoDeleteOnIdle', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_partitioning': {'key': 'EnablePartitioning', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'entity_availability_status': {'key': 'EntityAvailabilityStatus', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_subscription_partitioning': {'key': 'EnableSubscriptionPartitioning', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_express': {'key': 'EnableExpress', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'user_metadata': {'key': 'UserMetadata', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'default_message_time_to_live': {'key': 'defaultMessageTimeToLive', 'type': 'duration', 'xml': {'name': 'DefaultMessageTimeToLive', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'max_size_in_megabytes': {'key': 'maxSizeInMegabytes', 'type': 'long', 'xml': {'name': 'MaxSizeInMegabytes', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_duplicate_detection': {'key': 'requiresDuplicateDetection', 'type': 'bool', 'xml': {'name': 'RequiresDuplicateDetection', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'duplicate_detection_history_time_window': {'key': 'duplicateDetectionHistoryTimeWindow', 'type': 'duration', 'xml': {'name': 'DuplicateDetectionHistoryTimeWindow', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_batched_operations': {'key': 'enableBatchedOperations', 'type': 'bool', 'xml': {'name': 'EnableBatchedOperations', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'size_in_bytes': {'key': 'sizeInBytes', 'type': 'int', 'xml': {'name': 'SizeInBytes', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'filtering_messages_before_publishing': {'key': 'filteringMessagesBeforePublishing', 'type': 'bool', 'xml': {'name': 'FilteringMessagesBeforePublishing', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'is_anonymous_accessible': {'key': 'isAnonymousAccessible', 'type': 'bool', 'xml': {'name': 'IsAnonymousAccessible', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'authorization_rules': {'key': 'authorizationRules', 'type': '[AuthorizationRule]', 'xml': {'name': 'AuthorizationRules', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'AuthorizationRule', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'status': {'key': 'status', 'type': 'str', 'xml': {'name': 'Status', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'created_at': {'key': 'createdAt', 'type': 'iso-8601', 'xml': {'name': 'CreatedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'updated_at': {'key': 'updatedAt', 'type': 'iso-8601', 'xml': {'name': 'UpdatedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'accessed_at': {'key': 'accessedAt', 'type': 'iso-8601', 'xml': {'name': 'AccessedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'support_ordering': {'key': 'supportOrdering', 'type': 'bool', 'xml': {'name': 'SupportOrdering', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'message_count_details': {'key': 'messageCountDetails', 'type': 'MessageCountDetails'},
+ 'subscription_count': {'key': 'subscriptionCount', 'type': 'int', 'xml': {'name': 'SubscriptionCount', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'auto_delete_on_idle': {'key': 'autoDeleteOnIdle', 'type': 'duration', 'xml': {'name': 'AutoDeleteOnIdle', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_partitioning': {'key': 'enablePartitioning', 'type': 'bool', 'xml': {'name': 'EnablePartitioning', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'entity_availability_status': {'key': 'entityAvailabilityStatus', 'type': 'str', 'xml': {'name': 'EntityAvailabilityStatus', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_subscription_partitioning': {'key': 'enableSubscriptionPartitioning', 'type': 'bool', 'xml': {'name': 'EnableSubscriptionPartitioning', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_express': {'key': 'enableExpress', 'type': 'bool', 'xml': {'name': 'EnableExpress', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'user_metadata': {'key': 'userMetadata', 'type': 'str', 'xml': {'name': 'UserMetadata', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'TopicDescription', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -1499,7 +1580,7 @@ def __init__(
class TopicDescriptionEntryContent(msrest.serialization.Model):
"""The TopicDescription.
- :param type: Type of content in queue response.
+ :param type: Type of content in topic response.
:type type: str
:param topic_description: Description of a Service Bus topic resource.
:type topic_description: ~azure.servicebus.management._generated.models.TopicDescription
@@ -1560,18 +1641,33 @@ def __init__(
self.entry = kwargs.get('entry', None)
-class TrueFilter(RuleFilter):
+class TrueFilter(SqlFilter):
"""TrueFilter.
- :param type: Constant filled by server.
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
:type type: str
:param sql_expression:
:type sql_expression: str
+ :param compatibility_level:
+ :type compatibility_level: str
+ :param parameters:
+ :type parameters: list[~azure.servicebus.management._generated.models.KeyValue]
+ :param requires_preprocessing:
+ :type requires_preprocessing: bool
"""
+ _validation = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
- 'sql_expression': {'key': 'SqlExpression', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'sql_expression': {'key': 'sqlExpression', 'type': 'str', 'xml': {'name': 'SqlExpression', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'str', 'xml': {'name': 'CompatibilityLevel', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'parameters': {'key': 'parameters', 'type': '[KeyValue]', 'xml': {'name': 'Parameters', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'KeyValueOfstringanyType', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool', 'xml': {'name': 'RequiresPreprocessing', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
def __init__(
@@ -1580,4 +1676,3 @@ def __init__(
):
super(TrueFilter, self).__init__(**kwargs)
self.type = 'TrueFilter'
- self.sql_expression = kwargs.get('sql_expression', "1 = 1")
diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/models/_models_py3.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/models/_models_py3.py
index f2fce56d1769..656f86cc8284 100644
--- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/models/_models_py3.py
+++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/models/_models_py3.py
@@ -18,11 +18,11 @@
class AuthorizationRule(msrest.serialization.Model):
"""Authorization rule of an entity.
- :param type:
+ :param type: The authorization type.
:type type: str
- :param claim_type:
+ :param claim_type: The claim type.
:type claim_type: str
- :param claim_value:
+ :param claim_value: The claim value.
:type claim_value: str
:param rights: Access rights of the entity. Values are 'Send', 'Listen', or 'Manage'.
:type rights: list[str]
@@ -40,14 +40,14 @@ class AuthorizationRule(msrest.serialization.Model):
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'i', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
- 'claim_type': {'key': 'ClaimType', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'claim_value': {'key': 'ClaimValue', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'rights': {'key': 'Rights', 'type': '[str]', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'AccessRights', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'created_time': {'key': 'CreatedTime', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'modified_time': {'key': 'ModifiedTime', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'key_name': {'key': 'KeyName', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'primary_key': {'key': 'PrimaryKey', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'secondary_key': {'key': 'SecondaryKey', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'claim_type': {'key': 'claimType', 'type': 'str', 'xml': {'name': 'ClaimType', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'claim_value': {'key': 'claimValue', 'type': 'str', 'xml': {'name': 'ClaimValue', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'rights': {'key': 'rights', 'type': '[str]', 'xml': {'name': 'Rights', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'AccessRights', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'created_time': {'key': 'createdTime', 'type': 'iso-8601', 'xml': {'name': 'CreatedTime', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601', 'xml': {'name': 'ModifiedTime', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'key_name': {'key': 'keyName', 'type': 'str', 'xml': {'name': 'KeyName', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'primary_key': {'key': 'primaryKey', 'type': 'str', 'xml': {'name': 'PrimaryKey', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'secondary_key': {'key': 'secondaryKey', 'type': 'str', 'xml': {'name': 'SecondaryKey', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'AuthorizationRule', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -83,18 +83,24 @@ class RuleFilter(msrest.serialization.Model):
"""RuleFilter.
You probably want to use the sub-classes and not this class directly. Known
- sub-classes are: CorrelationFilter, FalseFilter, SqlFilter, TrueFilter.
+ sub-classes are: CorrelationFilter, SqlFilter.
- :param type: Constant filled by server.
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
:type type: str
"""
+ _validation = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
}
_subtype_map = {
- 'type': {'CorrelationFilter': 'CorrelationFilter', 'FalseFilter': 'FalseFilter', 'SqlFilter': 'SqlFilter', 'TrueFilter': 'TrueFilter'}
+ 'type': {'CorrelationFilter': 'CorrelationFilter', 'SqlFilter': 'SqlFilter'}
}
_xml_map = {
'name': 'Filter', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -111,7 +117,9 @@ def __init__(
class CorrelationFilter(RuleFilter):
"""CorrelationFilter.
- :param type: Constant filled by server.
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
:type type: str
:param correlation_id:
:type correlation_id: str
@@ -133,17 +141,21 @@ class CorrelationFilter(RuleFilter):
:type properties: list[~azure.servicebus.management._generated.models.KeyValue]
"""
+ _validation = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
- 'correlation_id': {'key': 'CorrelationId', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'message_id': {'key': 'MessageId', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'to': {'key': 'To', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'reply_to': {'key': 'ReplyTo', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'label': {'key': 'Label', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'session_id': {'key': 'SessionId', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'reply_to_session_id': {'key': 'ReplyToSessionId', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'content_type': {'key': 'ContentType', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'properties': {'key': 'Properties', 'type': '[KeyValue]', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'KeyValueOfstringanyType', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'correlation_id': {'key': 'correlationId', 'type': 'str', 'xml': {'name': 'CorrelationId', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'message_id': {'key': 'messageId', 'type': 'str', 'xml': {'name': 'MessageId', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'to': {'key': 'to', 'type': 'str', 'xml': {'name': 'To', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'reply_to': {'key': 'replyTo', 'type': 'str', 'xml': {'name': 'ReplyTo', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'label': {'key': 'label', 'type': 'str', 'xml': {'name': 'Label', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'session_id': {'key': 'sessionId', 'type': 'str', 'xml': {'name': 'SessionId', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'reply_to_session_id': {'key': 'replyToSessionId', 'type': 'str', 'xml': {'name': 'ReplyToSessionId', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'content_type': {'key': 'contentType', 'type': 'str', 'xml': {'name': 'ContentType', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'properties': {'key': 'properties', 'type': '[KeyValue]', 'xml': {'name': 'Properties', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'KeyValueOfstringanyType', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
def __init__(
@@ -208,7 +220,7 @@ class CreateQueueBodyContent(msrest.serialization.Model):
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True}},
- 'queue_description': {'key': 'QueueDescription', 'type': 'QueueDescription'},
+ 'queue_description': {'key': 'queueDescription', 'type': 'QueueDescription'},
}
_xml_map = {
'ns': 'http://www.w3.org/2005/Atom'
@@ -227,7 +239,7 @@ def __init__(
class CreateRuleBody(msrest.serialization.Model):
- """The request body for creating a topic.
+ """The request body for creating a rule.
:param content: RuleDescription for the new Rule.
:type content: ~azure.servicebus.management._generated.models.CreateRuleBodyContent
@@ -261,7 +273,7 @@ class CreateRuleBodyContent(msrest.serialization.Model):
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True}},
- 'rule_description': {'key': 'RuleDescription', 'type': 'RuleDescription'},
+ 'rule_description': {'key': 'ruleDescription', 'type': 'RuleDescription'},
}
_xml_map = {
'ns': 'http://www.w3.org/2005/Atom'
@@ -280,9 +292,9 @@ def __init__(
class CreateSubscriptionBody(msrest.serialization.Model):
- """The request body for creating a topic.
+ """The request body for creating a subscription.
- :param content: TopicDescription for the new topic.
+ :param content: SubscriptionDescription for the new subscription.
:type content: ~azure.servicebus.management._generated.models.CreateSubscriptionBodyContent
"""
@@ -304,18 +316,18 @@ def __init__(
class CreateSubscriptionBodyContent(msrest.serialization.Model):
- """TopicDescription for the new topic.
+ """SubscriptionDescription for the new subscription.
:param type: MIME type of content.
:type type: str
- :param subscription_description: Topic information to create.
+ :param subscription_description: Subscription information to create.
:type subscription_description:
~azure.servicebus.management._generated.models.SubscriptionDescription
"""
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True}},
- 'subscription_description': {'key': 'SubscriptionDescription', 'type': 'SubscriptionDescription'},
+ 'subscription_description': {'key': 'subscriptionDescription', 'type': 'SubscriptionDescription'},
}
_xml_map = {
'ns': 'http://www.w3.org/2005/Atom'
@@ -368,7 +380,7 @@ class CreateTopicBodyContent(msrest.serialization.Model):
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True}},
- 'topic_description': {'key': 'TopicDescription', 'type': 'TopicDescription'},
+ 'topic_description': {'key': 'topicDescription', 'type': 'TopicDescription'},
}
_xml_map = {
'ns': 'http://www.w3.org/2005/Atom'
@@ -392,10 +404,16 @@ class RuleAction(msrest.serialization.Model):
You probably want to use the sub-classes and not this class directly. Known
sub-classes are: EmptyRuleAction, SqlRuleAction.
- :param type: Constant filled by server.
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
:type type: str
"""
+ _validation = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
}
@@ -418,10 +436,16 @@ def __init__(
class EmptyRuleAction(RuleAction):
"""EmptyRuleAction.
- :param type: Constant filled by server.
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
:type type: str
"""
+ _validation = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
}
@@ -434,33 +458,103 @@ def __init__(
self.type: str = 'EmptyRuleAction'
-class FalseFilter(RuleFilter):
+class SqlFilter(RuleFilter):
+ """SqlFilter.
+
+ You probably want to use the sub-classes and not this class directly. Known
+ sub-classes are: FalseFilter, TrueFilter.
+
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
+ :type type: str
+ :param sql_expression:
+ :type sql_expression: str
+ :param compatibility_level:
+ :type compatibility_level: str
+ :param parameters:
+ :type parameters: list[~azure.servicebus.management._generated.models.KeyValue]
+ :param requires_preprocessing:
+ :type requires_preprocessing: bool
+ """
+
+ _validation = {
+ 'type': {'required': True},
+ }
+
+ _attribute_map = {
+ 'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
+ 'sql_expression': {'key': 'sqlExpression', 'type': 'str', 'xml': {'name': 'SqlExpression', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'str', 'xml': {'name': 'CompatibilityLevel', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'parameters': {'key': 'parameters', 'type': '[KeyValue]', 'xml': {'name': 'Parameters', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'KeyValueOfstringanyType', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool', 'xml': {'name': 'RequiresPreprocessing', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ }
+
+ _subtype_map = {
+ 'type': {'FalseFilter': 'FalseFilter', 'TrueFilter': 'TrueFilter'}
+ }
+
+ def __init__(
+ self,
+ *,
+ sql_expression: Optional[str] = None,
+ compatibility_level: Optional[str] = "20",
+ parameters: Optional[List["KeyValue"]] = None,
+ requires_preprocessing: Optional[bool] = None,
+ **kwargs
+ ):
+ super(SqlFilter, self).__init__(**kwargs)
+ self.type: str = 'SqlFilter'
+ self.sql_expression = sql_expression
+ self.compatibility_level = compatibility_level
+ self.parameters = parameters
+ self.requires_preprocessing = requires_preprocessing
+
+
+class FalseFilter(SqlFilter):
"""FalseFilter.
- :param type: Constant filled by server.
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
:type type: str
:param sql_expression:
:type sql_expression: str
+ :param compatibility_level:
+ :type compatibility_level: str
+ :param parameters:
+ :type parameters: list[~azure.servicebus.management._generated.models.KeyValue]
+ :param requires_preprocessing:
+ :type requires_preprocessing: bool
"""
+ _validation = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
- 'sql_expression': {'key': 'SqlExpression', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'sql_expression': {'key': 'sqlExpression', 'type': 'str', 'xml': {'name': 'SqlExpression', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'str', 'xml': {'name': 'CompatibilityLevel', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'parameters': {'key': 'parameters', 'type': '[KeyValue]', 'xml': {'name': 'Parameters', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'KeyValueOfstringanyType', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool', 'xml': {'name': 'RequiresPreprocessing', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
def __init__(
self,
*,
- sql_expression: Optional[str] = "1 != 1",
+ sql_expression: Optional[str] = None,
+ compatibility_level: Optional[str] = "20",
+ parameters: Optional[List["KeyValue"]] = None,
+ requires_preprocessing: Optional[bool] = None,
**kwargs
):
- super(FalseFilter, self).__init__(**kwargs)
+ super(FalseFilter, self).__init__(sql_expression=sql_expression, compatibility_level=compatibility_level, parameters=parameters, requires_preprocessing=requires_preprocessing, **kwargs)
self.type: str = 'FalseFilter'
- self.sql_expression = sql_expression
class KeyValue(msrest.serialization.Model):
- """KeyValue.
+ """Key Values of custom properties.
:param key:
:type key: str
@@ -469,8 +563,8 @@ class KeyValue(msrest.serialization.Model):
"""
_attribute_map = {
- 'key': {'key': 'Key', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'value': {'key': 'Value', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'key': {'key': 'key', 'type': 'str', 'xml': {'name': 'Key', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'value': {'key': 'value', 'type': 'str', 'xml': {'name': 'Value', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'KeyValueOfstringanyType', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -505,11 +599,11 @@ class MessageCountDetails(msrest.serialization.Model):
"""
_attribute_map = {
- 'active_message_count': {'key': 'ActiveMessageCount', 'type': 'int', 'xml': {'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
- 'dead_letter_message_count': {'key': 'DeadLetterMessageCount', 'type': 'int', 'xml': {'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
- 'scheduled_message_count': {'key': 'ScheduledMessageCount', 'type': 'int', 'xml': {'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
- 'transfer_dead_letter_message_count': {'key': 'TransferDeadLetterMessageCount', 'type': 'int', 'xml': {'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
- 'transfer_message_count': {'key': 'TransferMessageCount', 'type': 'int', 'xml': {'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
+ 'active_message_count': {'key': 'activeMessageCount', 'type': 'int', 'xml': {'name': 'ActiveMessageCount', 'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
+ 'dead_letter_message_count': {'key': 'deadLetterMessageCount', 'type': 'int', 'xml': {'name': 'DeadLetterMessageCount', 'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
+ 'scheduled_message_count': {'key': 'scheduledMessageCount', 'type': 'int', 'xml': {'name': 'ScheduledMessageCount', 'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
+ 'transfer_dead_letter_message_count': {'key': 'transferDeadLetterMessageCount', 'type': 'int', 'xml': {'name': 'TransferDeadLetterMessageCount', 'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
+ 'transfer_message_count': {'key': 'transferMessageCount', 'type': 'int', 'xml': {'name': 'TransferMessageCount', 'prefix': 'd2p1', 'ns': 'http://schemas.microsoft.com/netservices/2011/06/servicebus'}},
}
_xml_map = {
'name': 'CountDetails', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -555,13 +649,13 @@ class NamespaceProperties(msrest.serialization.Model):
"""
_attribute_map = {
- 'alias': {'key': 'Alias', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'created_time': {'key': 'CreatedTime', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'messaging_sku': {'key': 'MessagingSku', 'type': 'str', 'xml': {'name': 'MessagingSKU', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'messaging_units': {'key': 'MessagingUnits', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'modified_time': {'key': 'ModifiedTime', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'name': {'key': 'Name', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'namespace_type': {'key': 'NamespaceType', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'alias': {'key': 'alias', 'type': 'str', 'xml': {'name': 'Alias', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'created_time': {'key': 'createdTime', 'type': 'iso-8601', 'xml': {'name': 'CreatedTime', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'messaging_sku': {'key': 'messagingSku', 'type': 'str', 'xml': {'name': 'MessagingSKU', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'messaging_units': {'key': 'messagingUnits', 'type': 'int', 'xml': {'name': 'MessagingUnits', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'modified_time': {'key': 'modifiedTime', 'type': 'iso-8601', 'xml': {'name': 'ModifiedTime', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'name': {'key': 'name', 'type': 'str', 'xml': {'name': 'Name', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'namespace_type': {'key': 'namespaceType', 'type': 'str', 'xml': {'name': 'NamespaceType', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'NamespaceInfo', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -676,7 +770,7 @@ class QueueDescription(msrest.serialization.Model):
:type lock_duration: ~datetime.timedelta
:param max_size_in_megabytes: The maximum size of the queue in megabytes, which is the size of
memory allocated for the queue.
- :type max_size_in_megabytes: int
+ :type max_size_in_megabytes: long
:param requires_duplicate_detection: A value indicating if this queue requires duplicate
detection.
:type requires_duplicate_detection: bool
@@ -720,7 +814,7 @@ class QueueDescription(msrest.serialization.Model):
:type user_metadata: str
:param created_at: The exact time the queue was created.
:type created_at: ~datetime.datetime
- :param updated_at: The exact time a message was updated in the queue.
+ :param updated_at: The exact time the entity description was last updated.
:type updated_at: ~datetime.datetime
:param accessed_at: Last time a message was sent, or the last time there was a receive request
to this queue.
@@ -748,32 +842,32 @@ class QueueDescription(msrest.serialization.Model):
"""
_attribute_map = {
- 'lock_duration': {'key': 'LockDuration', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'max_size_in_megabytes': {'key': 'MaxSizeInMegabytes', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'requires_duplicate_detection': {'key': 'RequiresDuplicateDetection', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'requires_session': {'key': 'RequiresSession', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'default_message_time_to_live': {'key': 'DefaultMessageTimeToLive', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'dead_lettering_on_message_expiration': {'key': 'DeadLetteringOnMessageExpiration', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'duplicate_detection_history_time_window': {'key': 'DuplicateDetectionHistoryTimeWindow', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'max_delivery_count': {'key': 'MaxDeliveryCount', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_batched_operations': {'key': 'EnableBatchedOperations', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'size_in_bytes': {'key': 'SizeInBytes', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'message_count': {'key': 'MessageCount', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'is_anonymous_accessible': {'key': 'IsAnonymousAccessible', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'authorization_rules': {'key': 'AuthorizationRules', 'type': '[AuthorizationRule]', 'xml': {'name': 'AuthorizationRules', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'AuthorizationRule', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'status': {'key': 'Status', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'forward_to': {'key': 'ForwardTo', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'user_metadata': {'key': 'UserMetadata', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'created_at': {'key': 'CreatedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'updated_at': {'key': 'UpdatedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'accessed_at': {'key': 'AccessedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'support_ordering': {'key': 'SupportOrdering', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'message_count_details': {'key': 'MessageCountDetails', 'type': 'MessageCountDetails'},
- 'auto_delete_on_idle': {'key': 'AutoDeleteOnIdle', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_partitioning': {'key': 'EnablePartitioning', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'entity_availability_status': {'key': 'EntityAvailabilityStatus', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_express': {'key': 'EnableExpress', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'forward_dead_lettered_messages_to': {'key': 'ForwardDeadLetteredMessagesTo', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'lock_duration': {'key': 'lockDuration', 'type': 'duration', 'xml': {'name': 'LockDuration', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'max_size_in_megabytes': {'key': 'maxSizeInMegabytes', 'type': 'long', 'xml': {'name': 'MaxSizeInMegabytes', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_duplicate_detection': {'key': 'requiresDuplicateDetection', 'type': 'bool', 'xml': {'name': 'RequiresDuplicateDetection', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_session': {'key': 'requiresSession', 'type': 'bool', 'xml': {'name': 'RequiresSession', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'default_message_time_to_live': {'key': 'defaultMessageTimeToLive', 'type': 'duration', 'xml': {'name': 'DefaultMessageTimeToLive', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'dead_lettering_on_message_expiration': {'key': 'deadLetteringOnMessageExpiration', 'type': 'bool', 'xml': {'name': 'DeadLetteringOnMessageExpiration', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'duplicate_detection_history_time_window': {'key': 'duplicateDetectionHistoryTimeWindow', 'type': 'duration', 'xml': {'name': 'DuplicateDetectionHistoryTimeWindow', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'max_delivery_count': {'key': 'maxDeliveryCount', 'type': 'int', 'xml': {'name': 'MaxDeliveryCount', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_batched_operations': {'key': 'enableBatchedOperations', 'type': 'bool', 'xml': {'name': 'EnableBatchedOperations', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'size_in_bytes': {'key': 'sizeInBytes', 'type': 'int', 'xml': {'name': 'SizeInBytes', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'message_count': {'key': 'messageCount', 'type': 'int', 'xml': {'name': 'MessageCount', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'is_anonymous_accessible': {'key': 'isAnonymousAccessible', 'type': 'bool', 'xml': {'name': 'IsAnonymousAccessible', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'authorization_rules': {'key': 'authorizationRules', 'type': '[AuthorizationRule]', 'xml': {'name': 'AuthorizationRules', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'AuthorizationRule', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'status': {'key': 'status', 'type': 'str', 'xml': {'name': 'Status', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'forward_to': {'key': 'forwardTo', 'type': 'str', 'xml': {'name': 'ForwardTo', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'user_metadata': {'key': 'userMetadata', 'type': 'str', 'xml': {'name': 'UserMetadata', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'created_at': {'key': 'createdAt', 'type': 'iso-8601', 'xml': {'name': 'CreatedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'updated_at': {'key': 'updatedAt', 'type': 'iso-8601', 'xml': {'name': 'UpdatedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'accessed_at': {'key': 'accessedAt', 'type': 'iso-8601', 'xml': {'name': 'AccessedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'support_ordering': {'key': 'supportOrdering', 'type': 'bool', 'xml': {'name': 'SupportOrdering', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'message_count_details': {'key': 'messageCountDetails', 'type': 'MessageCountDetails'},
+ 'auto_delete_on_idle': {'key': 'autoDeleteOnIdle', 'type': 'duration', 'xml': {'name': 'AutoDeleteOnIdle', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_partitioning': {'key': 'enablePartitioning', 'type': 'bool', 'xml': {'name': 'EnablePartitioning', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'entity_availability_status': {'key': 'entityAvailabilityStatus', 'type': 'str', 'xml': {'name': 'EntityAvailabilityStatus', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_express': {'key': 'enableExpress', 'type': 'bool', 'xml': {'name': 'EnableExpress', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'forward_dead_lettered_messages_to': {'key': 'forwardDeadLetteredMessagesTo', 'type': 'str', 'xml': {'name': 'ForwardDeadLetteredMessagesTo', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'QueueDescription', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -982,7 +1076,7 @@ class ResponseAuthor(msrest.serialization.Model):
'name': {'key': 'name', 'type': 'str', 'xml': {'ns': 'http://www.w3.org/2005/Atom'}},
}
_xml_map = {
- 'ns': 'http://www.w3.org/2005/Atom'
+ 'name': 'author', 'ns': 'http://www.w3.org/2005/Atom'
}
def __init__(
@@ -1038,13 +1132,13 @@ class RuleDescription(msrest.serialization.Model):
"""
_attribute_map = {
- 'filter': {'key': 'Filter', 'type': 'RuleFilter'},
- 'action': {'key': 'Action', 'type': 'RuleAction'},
- 'created_at': {'key': 'CreatedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'name': {'key': 'Name', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'filter': {'key': 'filter', 'type': 'RuleFilter'},
+ 'action': {'key': 'action', 'type': 'RuleAction'},
+ 'created_at': {'key': 'createdAt', 'type': 'iso-8601', 'xml': {'name': 'CreatedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'name': {'key': 'name', 'type': 'str', 'xml': {'name': 'Name', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
- 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
+ 'name': 'RuleDescription', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
}
def __init__(
@@ -1115,7 +1209,7 @@ def __init__(
class RuleDescriptionEntryContent(msrest.serialization.Model):
"""The RuleDescription.
- :param type: Type of content in queue response.
+ :param type: Type of content in rule response.
:type type: str
:param rule_description:
:type rule_description: ~azure.servicebus.management._generated.models.RuleDescription
@@ -1195,8 +1289,8 @@ class ServiceBusManagementError(msrest.serialization.Model):
"""
_attribute_map = {
- 'code': {'key': 'Code', 'type': 'int'},
- 'detail': {'key': 'Detail', 'type': 'str'},
+ 'code': {'key': 'code', 'type': 'int', 'xml': {'name': 'Code'}},
+ 'detail': {'key': 'detail', 'type': 'str', 'xml': {'name': 'Detail'}},
}
def __init__(
@@ -1211,54 +1305,50 @@ def __init__(
self.detail = detail
-class SqlFilter(RuleFilter):
- """SqlFilter.
-
- :param type: Constant filled by server.
- :type type: str
- :param sql_expression:
- :type sql_expression: str
- """
-
- _attribute_map = {
- 'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
- 'sql_expression': {'key': 'SqlExpression', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- }
-
- def __init__(
- self,
- *,
- sql_expression: Optional[str] = None,
- **kwargs
- ):
- super(SqlFilter, self).__init__(**kwargs)
- self.type: str = 'SqlFilter'
- self.sql_expression = sql_expression
-
-
class SqlRuleAction(RuleAction):
"""SqlRuleAction.
- :param type: Constant filled by server.
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
:type type: str
:param sql_expression:
:type sql_expression: str
+ :param compatibility_level:
+ :type compatibility_level: str
+ :param parameters:
+ :type parameters: list[~azure.servicebus.management._generated.models.KeyValue]
+ :param requires_preprocessing:
+ :type requires_preprocessing: bool
"""
+ _validation = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
- 'sql_expression': {'key': 'SqlExpression', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'sql_expression': {'key': 'sqlExpression', 'type': 'str', 'xml': {'name': 'SqlExpression', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'str', 'xml': {'name': 'CompatibilityLevel', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'parameters': {'key': 'parameters', 'type': '[KeyValue]', 'xml': {'name': 'Parameters', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'KeyValueOfstringanyType', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool', 'xml': {'name': 'RequiresPreprocessing', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
def __init__(
self,
*,
sql_expression: Optional[str] = None,
+ compatibility_level: Optional[str] = "20",
+ parameters: Optional[List["KeyValue"]] = None,
+ requires_preprocessing: Optional[bool] = None,
**kwargs
):
super(SqlRuleAction, self).__init__(**kwargs)
self.type: str = 'SqlRuleAction'
self.sql_expression = sql_expression
+ self.compatibility_level = compatibility_level
+ self.parameters = parameters
+ self.requires_preprocessing = requires_preprocessing
class SubscriptionDescription(msrest.serialization.Model):
@@ -1268,8 +1358,8 @@ class SubscriptionDescription(msrest.serialization.Model):
that the message is locked for other receivers. The maximum value for LockDuration is 5
minutes; the default value is 1 minute.
:type lock_duration: ~datetime.timedelta
- :param requires_session: A value that indicates whether the queue supports the concept of
- sessions.
+ :param requires_session: A value that indicates whether the subscription supports the concept
+ of sessions.
:type requires_session: bool
:param default_message_time_to_live: ISO 8601 default message timespan to live value. This is
the duration after which the message expires, starting from when the message is sent to Service
@@ -1320,24 +1410,24 @@ class SubscriptionDescription(msrest.serialization.Model):
"""
_attribute_map = {
- 'lock_duration': {'key': 'LockDuration', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'requires_session': {'key': 'RequiresSession', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'default_message_time_to_live': {'key': 'DefaultMessageTimeToLive', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'dead_lettering_on_message_expiration': {'key': 'DeadLetteringOnMessageExpiration', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'dead_lettering_on_filter_evaluation_exceptions': {'key': 'DeadLetteringOnFilterEvaluationExceptions', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'message_count': {'key': 'MessageCount', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'max_delivery_count': {'key': 'MaxDeliveryCount', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_batched_operations': {'key': 'EnableBatchedOperations', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'status': {'key': 'Status', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'forward_to': {'key': 'ForwardTo', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'created_at': {'key': 'CreatedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'updated_at': {'key': 'UpdatedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'accessed_at': {'key': 'AccessedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'message_count_details': {'key': 'MessageCountDetails', 'type': 'MessageCountDetails'},
- 'user_metadata': {'key': 'UserMetadata', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'forward_dead_lettered_messages_to': {'key': 'ForwardDeadLetteredMessagesTo', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'auto_delete_on_idle': {'key': 'AutoDeleteOnIdle', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'entity_availability_status': {'key': 'EntityAvailabilityStatus', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'lock_duration': {'key': 'lockDuration', 'type': 'duration', 'xml': {'name': 'LockDuration', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_session': {'key': 'requiresSession', 'type': 'bool', 'xml': {'name': 'RequiresSession', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'default_message_time_to_live': {'key': 'defaultMessageTimeToLive', 'type': 'duration', 'xml': {'name': 'DefaultMessageTimeToLive', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'dead_lettering_on_message_expiration': {'key': 'deadLetteringOnMessageExpiration', 'type': 'bool', 'xml': {'name': 'DeadLetteringOnMessageExpiration', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'dead_lettering_on_filter_evaluation_exceptions': {'key': 'deadLetteringOnFilterEvaluationExceptions', 'type': 'bool', 'xml': {'name': 'DeadLetteringOnFilterEvaluationExceptions', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'message_count': {'key': 'messageCount', 'type': 'int', 'xml': {'name': 'MessageCount', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'max_delivery_count': {'key': 'maxDeliveryCount', 'type': 'int', 'xml': {'name': 'MaxDeliveryCount', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_batched_operations': {'key': 'enableBatchedOperations', 'type': 'bool', 'xml': {'name': 'EnableBatchedOperations', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'status': {'key': 'status', 'type': 'str', 'xml': {'name': 'Status', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'forward_to': {'key': 'forwardTo', 'type': 'str', 'xml': {'name': 'ForwardTo', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'created_at': {'key': 'createdAt', 'type': 'iso-8601', 'xml': {'name': 'CreatedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'updated_at': {'key': 'updatedAt', 'type': 'iso-8601', 'xml': {'name': 'UpdatedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'accessed_at': {'key': 'accessedAt', 'type': 'iso-8601', 'xml': {'name': 'AccessedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'message_count_details': {'key': 'messageCountDetails', 'type': 'MessageCountDetails'},
+ 'user_metadata': {'key': 'userMetadata', 'type': 'str', 'xml': {'name': 'UserMetadata', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'forward_dead_lettered_messages_to': {'key': 'forwardDeadLetteredMessagesTo', 'type': 'str', 'xml': {'name': 'ForwardDeadLetteredMessagesTo', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'auto_delete_on_idle': {'key': 'autoDeleteOnIdle', 'type': 'duration', 'xml': {'name': 'AutoDeleteOnIdle', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'entity_availability_status': {'key': 'entityAvailabilityStatus', 'type': 'str', 'xml': {'name': 'EntityAvailabilityStatus', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'SubscriptionDescription', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -1440,7 +1530,7 @@ def __init__(
class SubscriptionDescriptionEntryContent(msrest.serialization.Model):
"""The SubscriptionDescription.
- :param type: Type of content in queue response.
+ :param type: Type of content in subscription response.
:type type: str
:param subscription_description: Description of a Service Bus subscription resource.
:type subscription_description:
@@ -1570,35 +1660,35 @@ class TopicDescription(msrest.serialization.Model):
subscription is to be partitioned.
:type enable_subscription_partitioning: bool
:param enable_express: A value that indicates whether Express Entities are enabled. An express
- queue holds a message in memory temporarily before writing it to persistent storage.
+ topic holds a message in memory temporarily before writing it to persistent storage.
:type enable_express: bool
:param user_metadata: Metadata associated with the topic.
:type user_metadata: str
"""
_attribute_map = {
- 'default_message_time_to_live': {'key': 'DefaultMessageTimeToLive', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'max_size_in_megabytes': {'key': 'MaxSizeInMegabytes', 'type': 'long', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'requires_duplicate_detection': {'key': 'RequiresDuplicateDetection', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'duplicate_detection_history_time_window': {'key': 'DuplicateDetectionHistoryTimeWindow', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_batched_operations': {'key': 'EnableBatchedOperations', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'size_in_bytes': {'key': 'SizeInBytes', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'filtering_messages_before_publishing': {'key': 'FilteringMessagesBeforePublishing', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'is_anonymous_accessible': {'key': 'IsAnonymousAccessible', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'authorization_rules': {'key': 'AuthorizationRules', 'type': '[AuthorizationRule]', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'AuthorizationRule', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'status': {'key': 'Status', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'created_at': {'key': 'CreatedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'updated_at': {'key': 'UpdatedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'accessed_at': {'key': 'AccessedAt', 'type': 'iso-8601', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'support_ordering': {'key': 'SupportOrdering', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'message_count_details': {'key': 'MessageCountDetails', 'type': 'MessageCountDetails'},
- 'subscription_count': {'key': 'SubscriptionCount', 'type': 'int', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'auto_delete_on_idle': {'key': 'AutoDeleteOnIdle', 'type': 'duration', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_partitioning': {'key': 'EnablePartitioning', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'entity_availability_status': {'key': 'EntityAvailabilityStatus', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_subscription_partitioning': {'key': 'EnableSubscriptionPartitioning', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'enable_express': {'key': 'EnableExpress', 'type': 'bool', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
- 'user_metadata': {'key': 'UserMetadata', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'default_message_time_to_live': {'key': 'defaultMessageTimeToLive', 'type': 'duration', 'xml': {'name': 'DefaultMessageTimeToLive', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'max_size_in_megabytes': {'key': 'maxSizeInMegabytes', 'type': 'long', 'xml': {'name': 'MaxSizeInMegabytes', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_duplicate_detection': {'key': 'requiresDuplicateDetection', 'type': 'bool', 'xml': {'name': 'RequiresDuplicateDetection', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'duplicate_detection_history_time_window': {'key': 'duplicateDetectionHistoryTimeWindow', 'type': 'duration', 'xml': {'name': 'DuplicateDetectionHistoryTimeWindow', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_batched_operations': {'key': 'enableBatchedOperations', 'type': 'bool', 'xml': {'name': 'EnableBatchedOperations', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'size_in_bytes': {'key': 'sizeInBytes', 'type': 'int', 'xml': {'name': 'SizeInBytes', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'filtering_messages_before_publishing': {'key': 'filteringMessagesBeforePublishing', 'type': 'bool', 'xml': {'name': 'FilteringMessagesBeforePublishing', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'is_anonymous_accessible': {'key': 'isAnonymousAccessible', 'type': 'bool', 'xml': {'name': 'IsAnonymousAccessible', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'authorization_rules': {'key': 'authorizationRules', 'type': '[AuthorizationRule]', 'xml': {'name': 'AuthorizationRules', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'AuthorizationRule', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'status': {'key': 'status', 'type': 'str', 'xml': {'name': 'Status', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'created_at': {'key': 'createdAt', 'type': 'iso-8601', 'xml': {'name': 'CreatedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'updated_at': {'key': 'updatedAt', 'type': 'iso-8601', 'xml': {'name': 'UpdatedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'accessed_at': {'key': 'accessedAt', 'type': 'iso-8601', 'xml': {'name': 'AccessedAt', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'support_ordering': {'key': 'supportOrdering', 'type': 'bool', 'xml': {'name': 'SupportOrdering', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'message_count_details': {'key': 'messageCountDetails', 'type': 'MessageCountDetails'},
+ 'subscription_count': {'key': 'subscriptionCount', 'type': 'int', 'xml': {'name': 'SubscriptionCount', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'auto_delete_on_idle': {'key': 'autoDeleteOnIdle', 'type': 'duration', 'xml': {'name': 'AutoDeleteOnIdle', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_partitioning': {'key': 'enablePartitioning', 'type': 'bool', 'xml': {'name': 'EnablePartitioning', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'entity_availability_status': {'key': 'entityAvailabilityStatus', 'type': 'str', 'xml': {'name': 'EntityAvailabilityStatus', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_subscription_partitioning': {'key': 'enableSubscriptionPartitioning', 'type': 'bool', 'xml': {'name': 'EnableSubscriptionPartitioning', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'enable_express': {'key': 'enableExpress', 'type': 'bool', 'xml': {'name': 'EnableExpress', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'user_metadata': {'key': 'userMetadata', 'type': 'str', 'xml': {'name': 'UserMetadata', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
_xml_map = {
'name': 'TopicDescription', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'
@@ -1718,7 +1808,7 @@ def __init__(
class TopicDescriptionEntryContent(msrest.serialization.Model):
"""The TopicDescription.
- :param type: Type of content in queue response.
+ :param type: Type of content in topic response.
:type type: str
:param topic_description: Description of a Service Bus topic resource.
:type topic_description: ~azure.servicebus.management._generated.models.TopicDescription
@@ -1788,26 +1878,43 @@ def __init__(
self.entry = entry
-class TrueFilter(RuleFilter):
+class TrueFilter(SqlFilter):
"""TrueFilter.
- :param type: Constant filled by server.
+ All required parameters must be populated in order to send to Azure.
+
+ :param type: Required. Constant filled by server.
:type type: str
:param sql_expression:
:type sql_expression: str
+ :param compatibility_level:
+ :type compatibility_level: str
+ :param parameters:
+ :type parameters: list[~azure.servicebus.management._generated.models.KeyValue]
+ :param requires_preprocessing:
+ :type requires_preprocessing: bool
"""
+ _validation = {
+ 'type': {'required': True},
+ }
+
_attribute_map = {
'type': {'key': 'type', 'type': 'str', 'xml': {'attr': True, 'prefix': 'xsi', 'ns': 'http://www.w3.org/2001/XMLSchema-instance'}},
- 'sql_expression': {'key': 'SqlExpression', 'type': 'str', 'xml': {'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'sql_expression': {'key': 'sqlExpression', 'type': 'str', 'xml': {'name': 'SqlExpression', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'compatibility_level': {'key': 'compatibilityLevel', 'type': 'str', 'xml': {'name': 'CompatibilityLevel', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'parameters': {'key': 'parameters', 'type': '[KeyValue]', 'xml': {'name': 'Parameters', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect', 'wrapped': True, 'itemsName': 'KeyValueOfstringanyType', 'itemsNs': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
+ 'requires_preprocessing': {'key': 'requiresPreprocessing', 'type': 'bool', 'xml': {'name': 'RequiresPreprocessing', 'ns': 'http://schemas.microsoft.com/netservices/2010/10/servicebus/connect'}},
}
def __init__(
self,
*,
- sql_expression: Optional[str] = "1 = 1",
+ sql_expression: Optional[str] = None,
+ compatibility_level: Optional[str] = "20",
+ parameters: Optional[List["KeyValue"]] = None,
+ requires_preprocessing: Optional[bool] = None,
**kwargs
):
- super(TrueFilter, self).__init__(**kwargs)
+ super(TrueFilter, self).__init__(sql_expression=sql_expression, compatibility_level=compatibility_level, parameters=parameters, requires_preprocessing=requires_preprocessing, **kwargs)
self.type: str = 'TrueFilter'
- self.sql_expression = sql_expression
diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/models/_service_bus_management_client_enums.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/models/_service_bus_management_client_enums.py
index faeb59e91e48..e021a09eb502 100644
--- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/models/_service_bus_management_client_enums.py
+++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_generated/models/_service_bus_management_client_enums.py
@@ -9,7 +9,7 @@
from enum import Enum
class AccessRights(str, Enum):
- """Access rights of the entity
+ """Access rights of an authorization
"""
manage = "Manage"
diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py
index a90c993b16b3..ff74e6d94779 100644
--- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py
+++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_management_client.py
@@ -21,9 +21,10 @@
TopicDescriptionFeed, CreateSubscriptionBody, CreateSubscriptionBodyContent, CreateRuleBody, \
CreateRuleBodyContent, CreateQueueBody, CreateQueueBodyContent, \
QueueDescription as InternalQueueDescription, TopicDescription as InternalTopicDescription, \
- SubscriptionDescription as InternalSubscriptionDescription, RuleDescription as InternalRuleDescription, \
+ SubscriptionDescription as InternalSubscriptionDescription, \
NamespaceProperties
-from ._utils import extract_data_template, get_next_template
+from ._utils import extract_data_template, get_next_template, deserialize_rule_key_values, serialize_rule_key_values, \
+ extract_rule_data_template
from ._xml_workaround_policy import ServiceBusXMLWorkaroundPolicy
from .._common.constants import JWT_TOKEN_SCOPE
@@ -683,6 +684,7 @@ def get_rule(self, topic, subscription, rule_name, **kwargs):
"Rule('Topic: {}, Subscription: {}, Rule {}') does not exist".format(
subscription_name, topic_name, rule_name))
rule_description = RuleDescription._from_internal_entity(rule_name, entry.content.rule_description)
+ deserialize_rule_key_values(entry_ele, rule_description) # to remove after #3535 is released.
return rule_description
def create_rule(self, topic, subscription, rule, **kwargs):
@@ -713,6 +715,7 @@ def create_rule(self, topic, subscription, rule, **kwargs):
)
)
request_body = create_entity_body.serialize(is_xml=True)
+ serialize_rule_key_values(request_body, rule)
with _handle_response_error():
entry_ele = self._impl.rule.put(
topic_name,
@@ -720,7 +723,8 @@ def create_rule(self, topic, subscription, rule, **kwargs):
rule_name,
request_body, api_version=constants.API_VERSION, **kwargs)
entry = RuleDescriptionEntry.deserialize(entry_ele)
- result = entry.content.rule_description
+ result = RuleDescription._from_internal_entity(rule_name, entry.content.rule_description)
+ deserialize_rule_key_values(entry_ele, result) # to remove after #3535 is released.
return result
def update_rule(self, topic, subscription, rule, **kwargs):
@@ -755,6 +759,7 @@ def update_rule(self, topic, subscription, rule, **kwargs):
)
)
request_body = create_entity_body.serialize(is_xml=True)
+ serialize_rule_key_values(request_body, rule)
with _handle_response_error():
self._impl.rule.put(
topic_name,
@@ -809,12 +814,17 @@ def list_rules(self, topic, subscription, **kwargs):
except AttributeError:
subscription_name = subscription
- def entry_to_rule(entry):
+ def entry_to_rule(ele, entry):
+ """
+ `ele` will be removed after https://github.com/Azure/autorest/issues/3535 is released.
+ """
rule = entry.content.rule_description
- return RuleDescription._from_internal_entity(entry.title, rule)
+ rule_description = RuleDescription._from_internal_entity(entry.title, rule)
+ deserialize_rule_key_values(ele, rule_description) # to remove after #3535 is released.
+ return rule_description
extract_data = functools.partial(
- extract_data_template, RuleDescriptionFeed, entry_to_rule
+ extract_rule_data_template, RuleDescriptionFeed, entry_to_rule
)
get_next = functools.partial(
get_next_template, functools.partial(self._impl.list_rules, topic_name, subscription_name), **kwargs
diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_model_workaround.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_model_workaround.py
index 238ba907408f..1ca22b040990 100644
--- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_model_workaround.py
+++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_model_workaround.py
@@ -75,7 +75,13 @@
CreateRuleBodyContent: ("type", "rule_description"),
CreateSubscriptionBodyContent: ("type", "subscription_description"),
CreateTopicBodyContent: ("type", "topic_description"),
- FalseFilter: ("type", "sql_expression"),
+ FalseFilter: (
+ "type",
+ "sql_expression",
+ "compatibility_level",
+ "parameters",
+ "requires_preprocessing",
+ ),
KeyValue: ("key", "value"),
MessageCountDetails: (
"active_message_count",
@@ -141,8 +147,20 @@
RuleDescriptionEntryContent: ("type", "rule_description"),
RuleDescriptionFeed: ("id", "title", "updated", "link", "entry"),
ServiceBusManagementError: ("code", "detail"),
- SqlFilter: ("type", "sql_expression"),
- SqlRuleAction: ("type", "sql_expression"),
+ SqlFilter: (
+ "type",
+ "sql_expression",
+ "compatibility_level",
+ "parameters",
+ "requires_preprocessing",
+ ),
+ SqlRuleAction: (
+ "type",
+ "sql_expression",
+ "compatibility_level",
+ "parameters",
+ "requires_preprocessing",
+ ),
SubscriptionDescription: (
"lock_duration",
"requires_session",
@@ -209,9 +227,14 @@
),
TopicDescriptionEntryContent: ("type", "topic_description"),
TopicDescriptionFeed: ("id", "title", "updated", "link", "entry"),
- TrueFilter: ("type", "sql_expression"),
+ TrueFilter: (
+ "type",
+ "sql_expression",
+ "compatibility_level",
+ "parameters",
+ "requires_preprocessing",
+ ),
} # type: Dict[Type[Model], Tuple[str, ...]]
-
### End of code generated by the script.
diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_models.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_models.py
index 1f8b8afa6287..687cefee36f1 100644
--- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_models.py
+++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_models.py
@@ -5,7 +5,8 @@
# pylint:disable=protected-access
from collections import OrderedDict
from copy import deepcopy
-from typing import Type, Dict
+from datetime import datetime, timedelta
+from typing import Type, Dict, Any, Union, Optional
from msrest.serialization import Model
from ._generated.models import QueueDescription as InternalQueueDescription, \
@@ -19,6 +20,7 @@
KeyValue
from ._model_workaround import adjust_attribute_map
+from ._constants import RULE_SQL_COMPATIBILITY_LEVEL
adjust_attribute_map()
@@ -96,8 +98,9 @@ def __init__(
name,
**kwargs
):
+ # type: (str, Any) -> None
self.name = name
- self._internal_qd = None
+ self._internal_qd = None # type: Optional[InternalQueueDescription]
self.authorization_rules = kwargs.get('authorization_rules', None)
self.auto_delete_on_idle = kwargs.get('auto_delete_on_idle', None)
@@ -204,8 +207,9 @@ def __init__(
name,
**kwargs
):
+ # type: (str, Any) -> None
self.name = name
- self._internal_qr = None
+ self._internal_qr = None # type: Optional[InternalQueueDescription]
self.accessed_at = kwargs.get('accessed_at', None)
self.created_at = kwargs.get('created_at', None)
@@ -290,8 +294,9 @@ def __init__(
name,
**kwargs
):
+ # type: (str, Any) -> None
self.name = name
- self._internal_td = None
+ self._internal_td = None # type: Optional[InternalTopicDescription]
self.default_message_time_to_live = kwargs.get('default_message_time_to_live', None)
self.max_size_in_megabytes = kwargs.get('max_size_in_megabytes', None)
@@ -380,8 +385,9 @@ def __init__(
name,
**kwargs
):
+ # type: (str, Any) -> None
self.name = name
- self._internal_td = None
+ self._internal_td = None # type: Optional[InternalTopicDescription]
self.created_at = kwargs.get('created_at', None)
self.updated_at = kwargs.get('updated_at', None)
self.accessed_at = kwargs.get('accessed_at', None)
@@ -452,8 +458,9 @@ class SubscriptionDescription(object): # pylint:disable=too-many-instance-attri
~azure.servicebus.management._generated.models.EntityAvailabilityStatus
"""
def __init__(self, name, **kwargs):
+ # type: (str, Any) -> None
self.name = name
- self._internal_sd = None
+ self._internal_sd = None # type: Optional[InternalSubscriptionDescription]
self.lock_duration = kwargs.get('lock_duration', None)
self.requires_session = kwargs.get('requires_session', None)
@@ -532,7 +539,8 @@ class SubscriptionRuntimeInfo(object):
"""
def __init__(self, name, **kwargs):
- self._internal_sd = None
+ # type: (str, Any) -> None
+ self._internal_sd = None # type: Optional[InternalSubscriptionDescription]
self.name = name
self.message_count = kwargs.get('message_count', None)
@@ -570,12 +578,13 @@ class RuleDescription(object):
"""
def __init__(self, name, **kwargs):
+ # type: (str, Any) -> None
self.filter = kwargs.get('filter', None)
self.action = kwargs.get('action', None)
self.created_at = kwargs.get('created_at', None)
self.name = name
- self._internal_rule = None
+ self._internal_rule = None # type: Optional[InternalRuleDescription]
@classmethod
def _from_internal_entity(cls, name, internal_rule):
@@ -588,7 +597,6 @@ def _from_internal_entity(cls, name, internal_rule):
rule.action = RULE_CLASS_MAPPING[type(internal_rule.action)]._from_internal_entity(internal_rule.action) \
if internal_rule.action and isinstance(internal_rule.action, tuple(RULE_CLASS_MAPPING.keys())) else None
rule.created_at = internal_rule.created_at
- rule.name = internal_rule.name
return rule
@@ -596,7 +604,7 @@ def _to_internal_entity(self):
# type: () -> InternalRuleDescription
if not self._internal_rule:
self._internal_rule = InternalRuleDescription()
- self._internal_rule.filter = self.filter._to_internal_entity() if self.filter else TRUE_FILTER
+ self._internal_rule.filter = self.filter._to_internal_entity() if self.filter else TRUE_FILTER # type: ignore
self._internal_rule.action = self.action._to_internal_entity() if self.action else EMPTY_RULE_ACTION
self._internal_rule.created_at = self.created_at
self._internal_rule.name = self.name
@@ -605,7 +613,29 @@ def _to_internal_entity(self):
class CorrelationRuleFilter(object):
+ """Represents the correlation filter expression.
+
+ :param correlation_id: Identifier of the correlation.
+ :type correlation_id: str
+ :param message_id: Identifier of the message.
+ :type message_id: str
+ :param to: Address to send to.
+ :type to: str
+ :param reply_to: Address of the queue to reply to.
+ :type reply_to: str
+ :param label: Application specific label.
+ :type label: str
+ :param session_id: Session identifier.
+ :type session_id: str
+ :param reply_to_session_id: Session identifier to reply to.
+ :type reply_to_session_id: str
+ :param content_type: Content type of the message.
+ :type content_type: str
+ :param properties: dictionary object for custom filters
+ :type properties: dict[str, Union[str, int, float, bool, datetime, timedelta]]
+ """
def __init__(self, **kwargs):
+ # type: (Any) -> None
self.correlation_id = kwargs.get('correlation_id', None)
self.message_id = kwargs.get('message_id', None)
self.to = kwargs.get('to', None)
@@ -635,6 +665,7 @@ def _from_internal_entity(cls, internal_correlation_filter):
return correlation_filter
def _to_internal_entity(self):
+ # type: () -> InternalCorrelationFilter
internal_entity = InternalCorrelationFilter()
internal_entity.correlation_id = self.correlation_id
@@ -652,49 +683,106 @@ def _to_internal_entity(self):
class SqlRuleFilter(object):
- def __init__(self, sql_expression=None):
+ """Represents a filter which is a composition of an expression and an action
+ that is executed in the pub/sub pipeline.
+
+ :param sql_expression: The SQL expression. e.g. MyProperty='ABC'
+ :type sql_expression: str
+ :param parameters: Sets the value of the sql expression parameters if any.
+ :type parameters: dict[str, Union[str, int, float, bool, datetime, timedelta]]
+ :param requires_preprocessing: Value that indicates whether the rule
+ filter requires preprocessing. Default value: True .
+ :type requires_preprocessing: bool
+ """
+ def __init__(self, sql_expression=None, parameters=None, requires_preprocessing=True):
+ # type: (Optional[str], Optional[Dict[str, Union[str, int, float, bool, datetime, timedelta]]], bool) -> None
self.sql_expression = sql_expression
+ self.parameters = parameters
+ self.requires_preprocessing = requires_preprocessing
@classmethod
def _from_internal_entity(cls, internal_sql_rule_filter):
sql_rule_filter = cls()
sql_rule_filter.sql_expression = internal_sql_rule_filter.sql_expression
+ sql_rule_filter.parameters = OrderedDict((kv.key, kv.value) for kv in internal_sql_rule_filter.parameters) \
+ if internal_sql_rule_filter.parameters else OrderedDict()
+ sql_rule_filter.requires_preprocessing = internal_sql_rule_filter.requires_preprocessing
return sql_rule_filter
def _to_internal_entity(self):
+ # type: () -> InternalSqlFilter
internal_entity = InternalSqlFilter(sql_expression=self.sql_expression)
+ internal_entity.parameters = [
+ KeyValue(key=key, value=value) for key, value in self.parameters.items() # type: ignore
+ ] if self.parameters else None
+ internal_entity.compatibility_level = RULE_SQL_COMPATIBILITY_LEVEL
+ internal_entity.requires_preprocessing = self.requires_preprocessing
return internal_entity
class TrueRuleFilter(SqlRuleFilter):
+ """A sql filter with a sql expression that is always True
+ """
def __init__(self):
- super(TrueRuleFilter, self).__init__("1=1")
+ super(TrueRuleFilter, self).__init__("1=1", None, True)
def _to_internal_entity(self):
internal_entity = InternalTrueFilter()
+ internal_entity.sql_expression = self.sql_expression
+ internal_entity.requires_preprocessing = True
+ internal_entity.compatibility_level = RULE_SQL_COMPATIBILITY_LEVEL
+
return internal_entity
class FalseRuleFilter(SqlRuleFilter):
+ """A sql filter with a sql expression that is always True
+ """
def __init__(self):
- super(FalseRuleFilter, self).__init__("1>1")
+ super(FalseRuleFilter, self).__init__("1>1", None, True)
def _to_internal_entity(self):
internal_entity = InternalFalseFilter()
+ internal_entity.sql_expression = self.sql_expression
+ internal_entity.requires_preprocessing = True
+ internal_entity.compatibility_level = RULE_SQL_COMPATIBILITY_LEVEL
return internal_entity
class SqlRuleAction(object):
- def __init__(self, sql_expression=None):
+ """Represents set of actions written in SQL language-based syntax that is
+ performed against a ServiceBus.Messaging.BrokeredMessage .
+
+ :param sql_expression: SQL expression. e.g. MyProperty='ABC'
+ :type sql_expression: str
+ :param parameters: Sets the value of the sql expression parameters if any.
+ :type parameters: dict[str, Union[str, int, float, bool, datetime, timedelta]]
+ :param requires_preprocessing: Value that indicates whether the rule
+ action requires preprocessing. Default value: True .
+ :type requires_preprocessing: bool
+ """
+ def __init__(self, sql_expression=None, parameters=None, requires_preprocessing=True):
+ # type: (Optional[str], Optional[Dict[str, Union[str, int, float, bool, datetime, timedelta]]], bool) -> None
self.sql_expression = sql_expression
+ self.parameters = parameters
+ self.requires_preprocessing = requires_preprocessing
@classmethod
def _from_internal_entity(cls, internal_sql_rule_action):
- sql_rule_filter = cls(internal_sql_rule_action.sql_expression)
- return sql_rule_filter
+ sql_rule_action = cls()
+ sql_rule_action.sql_expression = internal_sql_rule_action.sql_expression
+ sql_rule_action.parameters = OrderedDict((kv.key, kv.value) for kv in internal_sql_rule_action.parameters) \
+ if internal_sql_rule_action.parameters else OrderedDict()
+ sql_rule_action.requires_preprocessing = internal_sql_rule_action.requires_preprocessing
+ return sql_rule_action
def _to_internal_entity(self):
- return InternalSqlRuleAction(sql_expression=self.sql_expression)
+ internal_entity = InternalSqlRuleAction(sql_expression=self.sql_expression)
+ internal_entity.parameters = [KeyValue(key=key, value=value) for key, value in self.parameters.items()] \
+ if self.parameters else None
+ internal_entity.compatibility_level = RULE_SQL_COMPATIBILITY_LEVEL
+ internal_entity.requires_preprocessing = self.requires_preprocessing
+ return internal_entity
RULE_CLASS_MAPPING = {
diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_utils.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_utils.py
index ead42fe7042f..8e233434f711 100644
--- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_utils.py
+++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_utils.py
@@ -2,8 +2,11 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
-from typing import cast, Union
-from xml.etree.ElementTree import ElementTree
+from datetime import datetime, timedelta
+from typing import cast
+from xml.etree.ElementTree import ElementTree, SubElement, QName
+import isodate
+import six
# Refer to the async version of this module under ..\aio\management\_utils.py for detailed explanation.
@@ -16,16 +19,45 @@
from ._handle_response_error import _handle_response_error
+def extract_rule_data_template(feed_class, convert, feed_element):
+ """Special version of function extrat_data_template for Rule.
+
+ Pass both the XML entry element and the rule instance to function `convert`. Rule needs to extract
+ KeyValue from XML Element and set to Rule model instance manually. The autorest/msrest serialization/deserialization
+ doesn't work for this special part.
+ After autorest is enhanced, this method can be removed.
+ Refer to autorest issue https://github.com/Azure/autorest/issues/3535
+ """
+ deserialized = feed_class.deserialize(feed_element)
+ next_link = None
+ if deserialized.link and len(deserialized.link) == 2:
+ next_link = deserialized.link[1].href
+ if deserialized.entry:
+ list_of_entities = [
+ convert(*x) if convert else x for x in zip(
+ feed_element.findall(constants.ATOM_ENTRY_TAG), deserialized.entry)
+ ]
+ else:
+ list_of_entities = []
+ return next_link, iter(list_of_entities)
+
+
def extract_data_template(feed_class, convert, feed_element):
deserialized = feed_class.deserialize(feed_element)
- list_of_qd = [convert(x) if convert else x for x in deserialized.entry]
+ list_of_entities = [convert(x) if convert else x for x in deserialized.entry]
next_link = None
if deserialized.link and len(deserialized.link) == 2:
next_link = deserialized.link[1].href
- return next_link, iter(list_of_qd)
+ return next_link, iter(list_of_entities)
def get_next_template(list_func, *args, **kwargs):
+ """Call list_func to get the XML data and deserialize it to XML ElementTree.
+
+ azure.core.async_paging.AsyncItemPaged will call `extract_data_template` and use the returned
+ XML ElementTree to call a partial function created from `extrat_data_template`.
+
+ """
start_index = kwargs.pop("start_index", 0)
max_page_size = kwargs.pop("max_page_size", 100)
api_version = constants.API_VERSION
@@ -44,3 +76,168 @@ def get_next_template(list_func, *args, **kwargs):
)
)
return feed_element
+
+
+def deserialize_value(value, value_type):
+ if value_type in ("int", "long"):
+ value = int(value)
+ elif value_type == "boolean":
+ value = value.lower() == "true"
+ elif value_type == "double":
+ value = float(value)
+ elif value_type == "dateTime":
+ value = isodate.parse_datetime(value)
+ elif value_type == "duration":
+ value = isodate.parse_duration(value)
+ # Note: If value ever includes a month or year, will return an isodate type, and should be reassessed
+ return value
+
+
+def serialize_value_type(value):
+ if isinstance(value, float):
+ return "double", str(value)
+ if isinstance(value, bool): # Attention: bool is subclass of int. So put bool ahead of int
+ return "boolean", str(value).lower()
+ if isinstance(value, six.string_types):
+ return "string", value
+ if isinstance(value, six.integer_types):
+ return "int" if value <= constants.INT32_MAX_VALUE else "long", str(value)
+ if isinstance(value, datetime):
+ return "dateTime", isodate.datetime_isoformat(value)
+ if isinstance(value, timedelta):
+ return "duration", isodate.duration_isoformat(value)
+ raise ValueError("value {} of type {} is not supported for the key value".format(value, type(value)))
+
+
+def deserialize_key_values(xml_parent, key_values):
+ """deserialize xml Element and replace the values in dict key_values with correct data types.
+
+ The deserialized XML is like:
+
+
+ key_string
+ str1
+
+
+ key_int
+ 2
+
+ ...
+
+ After autorest is enhanced, this method can be removed.
+ Refer to autorest issue https://github.com/Azure/autorest/issues/3535
+
+ :param xml_parent: The parent xml Element that contains some children of .
+ :param key_values: The dict that contains the key values. The value could have wrong data types.
+ :return: This method returns `None`. It will update each value of key_values to correct value type.
+ """
+ key_values_ele = xml_parent.findall(constants.RULE_KEY_VALUE_TAG)
+ for key_value_ele in key_values_ele:
+ key_ele = key_value_ele.find(constants.RULE_KEY_TAG)
+ value_ele = key_value_ele.find(constants.RULE_VALUE_TAG)
+ key = key_ele.text
+ value = value_ele.text
+ value_type = value_ele.attrib[constants.RULE_VALUE_TYPE_TAG]
+ value_type = value_type.split(":")[1]
+ value = deserialize_value(value, value_type)
+ key_values[key] = value
+
+
+def deserialize_rule_key_values(entry_ele, rule_description):
+ """Deserialize a rule's filter and action that have key values from xml.
+
+ CorrelationRuleFilter.properties, SqlRuleFilter.parameters and SqlRuleAction.parameters may contain
+ data (dict is not empty).
+
+ After autorest is enhanced, this method can be removed.
+ Refer to autorest issue https://github.com/Azure/autorest/issues/3535
+ """
+ content = entry_ele.find(constants.ATOM_CONTENT_TAG)
+ if content:
+ correlation_filter_properties_ele = content\
+ .find(constants.RULE_DESCRIPTION_TAG) \
+ .find(constants.RULE_FILTER_TAG) \
+ .find(constants.RULE_FILTER_COR_PROPERTIES_TAG)
+ if correlation_filter_properties_ele:
+ deserialize_key_values(correlation_filter_properties_ele, rule_description.filter.properties)
+ sql_filter_parameters_ele = content\
+ .find(constants.RULE_DESCRIPTION_TAG) \
+ .find(constants.RULE_FILTER_TAG) \
+ .find(constants.RULE_PARAMETERS_TAG)
+ if sql_filter_parameters_ele:
+ deserialize_key_values(sql_filter_parameters_ele, rule_description.filter.parameters)
+ sql_action_parameters_ele = content\
+ .find(constants.RULE_DESCRIPTION_TAG) \
+ .find(constants.RULE_ACTION_TAG) \
+ .find(constants.RULE_PARAMETERS_TAG)
+ if sql_action_parameters_ele:
+ deserialize_key_values(sql_action_parameters_ele, rule_description.action.parameters)
+
+
+def serialize_key_values(xml_parent, key_values):
+ """serialize a dict to xml Element and put it under xml_parent
+
+ The serialized XML is like:
+
+
+ key_string
+ str1
+
+
+ key_int
+ 2
+
+ ...
+
+ :param xml_parent: The parent xml Element for the serialized xml.
+ :param key_values: The dict that contains the key values.
+ :return: `xml_parent` is mutated. The returned value is `None`.
+
+ After autorest is enhanced, this method can be removed.
+ Refer to autorest issue https://github.com/Azure/autorest/issues/3535
+ """
+ xml_parent.clear()
+ if key_values:
+ for key, value in key_values.items():
+ value_type, value_in_str = serialize_value_type(value)
+ key_value_ele = SubElement(xml_parent, QName(constants.SB_XML_NAMESPACE, constants.RULE_KEY_VALUE))
+ key_ele = SubElement(key_value_ele, QName(constants.SB_XML_NAMESPACE, constants.RULE_KEY))
+ key_ele.text = key
+ type_qname = QName(constants.XML_SCHEMA_INSTANCE_NAMESPACE, "type")
+ value_ele = SubElement(
+ key_value_ele, QName(constants.SB_XML_NAMESPACE, constants.RULE_VALUE),
+ {type_qname: constants.RULE_VALUE_TYPE_XML_PREFIX + ":" + value_type}
+ )
+ value_ele.text = value_in_str
+ value_ele.attrib["xmlns:"+constants.RULE_VALUE_TYPE_XML_PREFIX] = constants.XML_SCHEMA_NAMESPACE
+
+
+def serialize_rule_key_values(entry_ele, rule_descripiton):
+ """Serialize a rule's filter and action that have key values into xml.
+
+ CorrelationRuleFilter.properties, SqlRuleFilter.parameters and SqlRuleAction.parameters may contain
+ data (dict is not empty). Serialize them to XML.
+
+ After autorest is enhanced, this method can be removed.
+ Refer to autorest issue https://github.com/Azure/autorest/issues/3535
+ """
+ content = entry_ele.find(constants.ATOM_CONTENT_TAG)
+ if content:
+ correlation_filter_parameters_ele = content\
+ .find(constants.RULE_DESCRIPTION_TAG) \
+ .find(constants.RULE_FILTER_TAG) \
+ .find(constants.RULE_FILTER_COR_PROPERTIES_TAG)
+ if correlation_filter_parameters_ele:
+ serialize_key_values(correlation_filter_parameters_ele, rule_descripiton.filter.properties)
+ sql_filter_parameters_ele = content\
+ .find(constants.RULE_DESCRIPTION_TAG) \
+ .find(constants.RULE_FILTER_TAG) \
+ .find(constants.RULE_PARAMETERS_TAG)
+ if sql_filter_parameters_ele:
+ serialize_key_values(sql_filter_parameters_ele, rule_descripiton.filter.parameters)
+ sql_action_parameters_ele = content\
+ .find(constants.RULE_DESCRIPTION_TAG) \
+ .find(constants.RULE_ACTION_TAG) \
+ .find(constants.RULE_PARAMETERS_TAG)
+ if sql_action_parameters_ele:
+ serialize_key_values(sql_action_parameters_ele, rule_descripiton.action.parameters)
diff --git a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_xml_workaround_policy.py b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_xml_workaround_policy.py
index ed45887e8247..277db51df0eb 100644
--- a/sdk/servicebus/azure-servicebus/azure/servicebus/management/_xml_workaround_policy.py
+++ b/sdk/servicebus/azure-servicebus/azure/servicebus/management/_xml_workaround_policy.py
@@ -20,22 +20,6 @@ class ServiceBusXMLWorkaroundPolicy(SansIOHTTPPolicy):
1
...
-
- Another problem is Swagger specification doesn't allow an XML tag to have both a value and attributes.
- For instance value1 can't be defined in swagger.
- So here we add it.
-
-
- 1
- ...
-
-
- key1
- value1
-
-
-
-
"""
def on_request(self, request):
# type: (PipelineRequest) -> None
@@ -50,10 +34,6 @@ def on_request(self, request):
if b'' in request_body:
- request_body = request_body.replace(
- b'',
- b'')
request.http_request.body = request_body
request.http_request.data = request_body
request.http_request.headers["Content-Length"] = str(len(request_body))
diff --git a/sdk/servicebus/azure-servicebus/setup.py b/sdk/servicebus/azure-servicebus/setup.py
index edc32a00f41f..1cecc3406a3c 100644
--- a/sdk/servicebus/azure-servicebus/setup.py
+++ b/sdk/servicebus/azure-servicebus/setup.py
@@ -82,7 +82,9 @@
'msrestazure>=0.4.32,<2.0.0',
'azure-common~=1.1',
'msrest>=0.6.17,<2.0.0',
- 'azure-core<2.0.0,>=1.6.0'
+ 'azure-core<2.0.0,>=1.6.0',
+ "isodate>=0.6.0",
+ "six>=1.6",
],
extras_require={
":python_version<'3.0'": ['azure-nspkg', 'futures'],
diff --git a/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/recordings/test_mgmt_rules_async.test_async_mgmt_rule_create.yaml b/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/recordings/test_mgmt_rules_async.test_async_mgmt_rule_create.yaml
index 1ae5e27da0e4..340889052687 100644
--- a/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/recordings/test_mgmt_rules_async.test_async_mgmt_rule_create.yaml
+++ b/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/recordings/test_mgmt_rules_async.test_async_mgmt_rule_create.yaml
@@ -5,22 +5,22 @@ interactions:
Accept:
- application/xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: GET
uri: https://servicebustestsbname.servicebus.windows.net/$Resources/topics?$skip=0&$top=100&api-version=2017-04
response:
body:
- string: Topicshttps://servicebustest5levlyksxm.servicebus.windows.net/$Resources/topics?$skip=0&$top=100&api-version=2017-042020-07-02T06:05:01Z
+ string: Topicshttps://servicebustestviy6yieihi.servicebus.windows.net/$Resources/topics?$skip=0&$top=100&api-version=2017-042020-07-17T02:29:56Z
headers:
content-type: application/atom+xml;type=feed;charset=utf-8
- date: Thu, 02 Jul 2020 06:05:01 GMT
+ date: Fri, 17 Jul 2020 02:29:56 GMT
server: Microsoft-HTTPAPI/2.0
transfer-encoding: chunked
status:
code: 200
message: OK
- url: https://servicebustest5levlyksxm.servicebus.windows.net/$Resources/topics?$skip=0&$top=100&api-version=2017-04
+ url: https://servicebustestviy6yieihi.servicebus.windows.net/$Resources/topics?$skip=0&$top=100&api-version=2017-04
- request:
body: '
@@ -34,26 +34,26 @@ interactions:
Content-Type:
- application/atom+xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: PUT
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf?api-version=2017-04
response:
body:
- string: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf?api-version=2017-04topic_testaddf2020-07-02T06:05:02Z2020-07-02T06:05:02Zservicebustest5levlyksxmhttps://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf?api-version=2017-04topic_testaddf2020-07-17T02:29:56Z2020-07-17T02:29:57Zservicebustestviy6yieihiP10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T06:05:02.167Z2020-07-02T06:05:02.203ZtrueP10675199DT2H48M5.4775807SfalseAvailablefalsefalse
+ xmlns:i="http://www.w3.org/2001/XMLSchema-instance">P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-17T02:29:56.967Z2020-07-17T02:29:57.04ZtrueP10675199DT2H48M5.4775807SfalseAvailablefalsefalse
headers:
content-type: application/atom+xml;type=entry;charset=utf-8
- date: Thu, 02 Jul 2020 06:05:02 GMT
+ date: Fri, 17 Jul 2020 02:29:56 GMT
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
transfer-encoding: chunked
status:
code: 201
message: Created
- url: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf?api-version=2017-04
+ url: https://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf?api-version=2017-04
- request:
body: '
@@ -67,231 +67,255 @@ interactions:
Content-Type:
- application/atom+xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: PUT
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk?api-version=2017-04
response:
body:
- string: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk?api-version=2017-04sub_testkkk2020-07-02T06:05:02Z2020-07-02T06:05:02Zhttps://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk?api-version=2017-04sub_testkkk2020-07-17T02:29:57Z2020-07-17T02:29:57ZPT1MfalseP10675199DT2H48M5.4775807Sfalsetrue010trueActive2020-07-02T06:05:02.6809266Z2020-07-02T06:05:02.6809266Z0001-01-01T00:00:00P10675199DT2H48M5.4775807SAvailable
+ xmlns:i="http://www.w3.org/2001/XMLSchema-instance">PT1MfalseP10675199DT2H48M5.4775807Sfalsetrue010trueActive2020-07-17T02:29:57.5311135Z2020-07-17T02:29:57.5311135Z0001-01-01T00:00:00P10675199DT2H48M5.4775807SAvailable
headers:
content-type: application/atom+xml;type=entry;charset=utf-8
- date: Thu, 02 Jul 2020 06:05:02 GMT
- etag: '637292667022030000'
+ date: Fri, 17 Jul 2020 02:29:57 GMT
+ etag: '637305497970400000'
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
transfer-encoding: chunked
status:
code: 201
message: Created
- url: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk?api-version=2017-04
+ url: https://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk?api-version=2017-04
- request:
body: '
testcidSET Priority = ''low''test_rule_1'
+ xsi:type="CorrelationFilter">testcidkey_stringstr1key_int2key_long2147483650key_boolfalsekey_datetime2020-07-05T11:12:13key_durationP1DT2H3MSET Priority = @param20@param2020-07-05T11:12:13test_rule_1'
headers:
Accept:
- application/xml
Content-Length:
- - '518'
+ - '1765'
Content-Type:
- application/atom+xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: PUT
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?api-version=2017-04
response:
body:
- string: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?api-version=2017-04test_rule_12020-07-02T06:05:02Z2020-07-02T06:05:02Zhttps://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?api-version=2017-04test_rule_12020-07-17T02:29:57Z2020-07-17T02:29:57ZtestcidSET Priority = 'low'202020-07-02T06:05:02.9777986Ztest_rule_1
+ xmlns:i="http://www.w3.org/2001/XMLSchema-instance">testcidkey_stringstr1key_int2key_long2147483650key_boolfalsekey_datetime2020-07-05T11:12:13key_durationP1DT2H3MSET Priority = @param20@param2020-07-05T11:12:132020-07-17T02:29:57.7811732Ztest_rule_1
headers:
content-type: application/atom+xml;type=entry;charset=utf-8
- date: Thu, 02 Jul 2020 06:05:02 GMT
- etag: '637292667022030000'
+ date: Fri, 17 Jul 2020 02:29:57 GMT
+ etag: '637305497970400000'
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
transfer-encoding: chunked
status:
code: 201
message: Created
- url: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?api-version=2017-04
+ url: https://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?api-version=2017-04
- request:
body: null
headers:
Accept:
- application/xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: GET
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?enrich=false&api-version=2017-04
response:
body:
- string: sb://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?enrich=false&api-version=2017-04test_rule_12020-07-02T06:05:02Z2020-07-02T06:05:02Zsb://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?enrich=false&api-version=2017-04test_rule_12020-07-17T02:29:57Z2020-07-17T02:29:57ZtestcidSET Priority = 'low'202020-07-02T06:05:02.9848695Ztest_rule_1
+ xmlns:i="http://www.w3.org/2001/XMLSchema-instance">testcidkey_stringstr1key_int2key_long2147483650key_boolfalsekey_datetime2020-07-05T11:12:13key_durationP1DT2H3MSET Priority = @param20@param2020-07-05T11:12:132020-07-17T02:29:57.7591895Ztest_rule_1
headers:
content-type: application/atom+xml;type=entry;charset=utf-8
- date: Thu, 02 Jul 2020 06:05:02 GMT
- etag: '637292667022030000'
+ date: Fri, 17 Jul 2020 02:29:57 GMT
+ etag: '637305497970400000'
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
transfer-encoding: chunked
status:
code: 200
message: OK
- url: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?enrich=false&api-version=2017-04
+ url: https://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?enrich=false&api-version=2017-04
- request:
body: '
Priority = ''low''Priority = @param120@param1str1test_rule_2'
headers:
Accept:
- application/xml
Content-Length:
- - '463'
+ - '690'
Content-Type:
- application/atom+xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: PUT
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?api-version=2017-04
response:
body:
- string: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?api-version=2017-04test_rule_22020-07-02T06:05:03Z2020-07-02T06:05:03Zhttps://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?api-version=2017-04test_rule_22020-07-17T02:29:57Z2020-07-17T02:29:57ZPriority
- = 'low'202020-07-02T06:05:03.087174Ztest_rule_2
+ = @param120@param1str12020-07-17T02:29:57.9998237Ztest_rule_2
headers:
content-type: application/atom+xml;type=entry;charset=utf-8
- date: Thu, 02 Jul 2020 06:05:02 GMT
- etag: '637292667022030000'
+ date: Fri, 17 Jul 2020 02:29:57 GMT
+ etag: '637305497970400000'
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
transfer-encoding: chunked
status:
code: 201
message: Created
- url: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?api-version=2017-04
+ url: https://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?api-version=2017-04
- request:
body: null
headers:
Accept:
- application/xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: GET
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?enrich=false&api-version=2017-04
response:
body:
- string: sb://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?enrich=false&api-version=2017-04test_rule_22020-07-02T06:05:03Z2020-07-02T06:05:03Zsb://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?enrich=false&api-version=2017-04test_rule_22020-07-17T02:29:57Z2020-07-17T02:29:57ZPriority
- = 'low'202020-07-02T06:05:03.0942588Ztest_rule_2
+ = @param120@param1str12020-07-17T02:29:57.9779356Ztest_rule_2
headers:
content-type: application/atom+xml;type=entry;charset=utf-8
- date: Thu, 02 Jul 2020 06:05:02 GMT
- etag: '637292667022030000'
+ date: Fri, 17 Jul 2020 02:29:57 GMT
+ etag: '637305497970400000'
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
transfer-encoding: chunked
status:
code: 200
message: OK
- url: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?enrich=false&api-version=2017-04
+ url: https://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?enrich=false&api-version=2017-04
- request:
body: '
1 = 1test_rule_3'
+ xsi:type="TrueFilter">1=120truetest_rule_3'
headers:
Accept:
- application/xml
Content-Length:
- - '453'
+ - '545'
Content-Type:
- application/atom+xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: PUT
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?api-version=2017-04
response:
body:
- string: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?api-version=2017-04test_rule_32020-07-02T06:05:03Z2020-07-02T06:05:03Zhttps://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?api-version=2017-04test_rule_32020-07-17T02:29:58Z2020-07-17T02:29:58Z1=1202020-07-02T06:05:03.2277809Ztest_rule_3
+ i:type="EmptyRuleAction"/>2020-07-17T02:29:58.2189657Ztest_rule_3
headers:
content-type: application/atom+xml;type=entry;charset=utf-8
- date: Thu, 02 Jul 2020 06:05:02 GMT
- etag: '637292667022030000'
+ date: Fri, 17 Jul 2020 02:29:57 GMT
+ etag: '637305497970400000'
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
transfer-encoding: chunked
status:
code: 201
message: Created
- url: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?api-version=2017-04
+ url: https://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?api-version=2017-04
- request:
body: null
headers:
Accept:
- application/xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: GET
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?enrich=false&api-version=2017-04
response:
body:
- string: sb://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?enrich=false&api-version=2017-04test_rule_32020-07-02T06:05:03Z2020-07-02T06:05:03Zsb://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?enrich=false&api-version=2017-04test_rule_32020-07-17T02:29:58Z2020-07-17T02:29:58Z1=1202020-07-02T06:05:03.2348363Ztest_rule_3
+ i:type="EmptyRuleAction"/>2020-07-17T02:29:58.2138767Ztest_rule_3
headers:
content-type: application/atom+xml;type=entry;charset=utf-8
- date: Thu, 02 Jul 2020 06:05:02 GMT
- etag: '637292667022030000'
+ date: Fri, 17 Jul 2020 02:29:57 GMT
+ etag: '637305497970400000'
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
transfer-encoding: chunked
status:
code: 200
message: OK
- url: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?enrich=false&api-version=2017-04
+ url: https://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?enrich=false&api-version=2017-04
- request:
body: null
headers:
Accept:
- application/xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: DELETE
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?api-version=2017-04
response:
@@ -299,21 +323,21 @@ interactions:
string: ''
headers:
content-length: '0'
- date: Thu, 02 Jul 2020 06:05:02 GMT
- etag: '637292667022030000'
+ date: Fri, 17 Jul 2020 02:29:58 GMT
+ etag: '637305497970400000'
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
status:
code: 200
message: OK
- url: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?api-version=2017-04
+ url: https://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?api-version=2017-04
- request:
body: null
headers:
Accept:
- application/xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: DELETE
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?api-version=2017-04
response:
@@ -321,21 +345,21 @@ interactions:
string: ''
headers:
content-length: '0'
- date: Thu, 02 Jul 2020 06:05:03 GMT
- etag: '637292667022030000'
+ date: Fri, 17 Jul 2020 02:29:58 GMT
+ etag: '637305497970400000'
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
status:
code: 200
message: OK
- url: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?api-version=2017-04
+ url: https://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?api-version=2017-04
- request:
body: null
headers:
Accept:
- application/xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: DELETE
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?api-version=2017-04
response:
@@ -343,21 +367,21 @@ interactions:
string: ''
headers:
content-length: '0'
- date: Thu, 02 Jul 2020 06:05:03 GMT
- etag: '637292667022030000'
+ date: Fri, 17 Jul 2020 02:29:58 GMT
+ etag: '637305497970400000'
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
status:
code: 200
message: OK
- url: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?api-version=2017-04
+ url: https://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?api-version=2017-04
- request:
body: null
headers:
Accept:
- application/xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: DELETE
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk?api-version=2017-04
response:
@@ -365,21 +389,21 @@ interactions:
string: ''
headers:
content-length: '0'
- date: Thu, 02 Jul 2020 06:05:03 GMT
- etag: '637292667022030000'
+ date: Fri, 17 Jul 2020 02:29:58 GMT
+ etag: '637305497970400000'
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
status:
code: 200
message: OK
- url: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk?api-version=2017-04
+ url: https://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk?api-version=2017-04
- request:
body: null
headers:
Accept:
- application/xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: DELETE
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf?api-version=2017-04
response:
@@ -387,12 +411,12 @@ interactions:
string: ''
headers:
content-length: '0'
- date: Thu, 02 Jul 2020 06:05:03 GMT
- etag: '637292667022030000'
+ date: Fri, 17 Jul 2020 02:29:58 GMT
+ etag: '637305497970400000'
server: Microsoft-HTTPAPI/2.0
strict-transport-security: max-age=31536000
status:
code: 200
message: OK
- url: https://servicebustest5levlyksxm.servicebus.windows.net/topic_testaddf?api-version=2017-04
+ url: https://servicebustestviy6yieihi.servicebus.windows.net/topic_testaddf?api-version=2017-04
version: 1
diff --git a/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_rules_async.py b/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_rules_async.py
index 82a300513fe8..b01eed309925 100644
--- a/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_rules_async.py
+++ b/sdk/servicebus/azure-servicebus/tests/async_tests/mgmt_tests/test_mgmt_rules_async.py
@@ -4,11 +4,14 @@
# license information.
#--------------------------------------------------------------------------
import logging
+from datetime import datetime, timedelta
+
import pytest
import msrest
from azure.servicebus.aio.management import ServiceBusManagementClient
from azure.servicebus.management import RuleDescription, CorrelationRuleFilter, SqlRuleFilter, TrueRuleFilter, SqlRuleAction
+from azure.servicebus.management._constants import INT32_MAX_VALUE
from utilities import get_logger
from azure.core.exceptions import HttpResponseError, ResourceExistsError
@@ -34,11 +37,22 @@ async def test_async_mgmt_rule_create(self, servicebus_namespace_connection_stri
rule_name_2 = 'test_rule_2'
rule_name_3 = 'test_rule_3'
- correlation_fitler = CorrelationRuleFilter(correlation_id='testcid')
- sql_rule_action = SqlRuleAction(sql_expression="SET Priority = 'low'")
+ correlation_fitler = CorrelationRuleFilter(correlation_id='testcid', properties={
+ "key_string": "str1",
+ "key_int": 2,
+ "key_long": INT32_MAX_VALUE + 3,
+ "key_bool": False,
+ "key_datetime": datetime(2020, 7, 5, 11, 12, 13),
+ "key_duration": timedelta(days=1, hours=2, minutes=3)
+ })
+ sql_rule_action = SqlRuleAction(sql_expression="SET Priority = @param", parameters={
+ "@param": datetime(2020, 7, 5, 11, 12, 13),
+ })
rule_1 = RuleDescription(name=rule_name_1, filter=correlation_fitler, action=sql_rule_action)
- sql_filter = SqlRuleFilter("Priority = 'low'")
+ sql_filter = SqlRuleFilter("Priority = @param1", parameters={
+ "@param1": "str1",
+ })
rule_2 = RuleDescription(name=rule_name_2, filter=sql_filter)
bool_filter = TrueRuleFilter()
@@ -50,14 +64,23 @@ async def test_async_mgmt_rule_create(self, servicebus_namespace_connection_stri
await mgmt_service.create_rule(topic_name, subscription_name, rule_1)
rule_desc = await mgmt_service.get_rule(topic_name, subscription_name, rule_name_1)
+ rule_properties = rule_desc.filter.properties
assert type(rule_desc.filter) == CorrelationRuleFilter
assert rule_desc.filter.correlation_id == 'testcid'
- assert rule_desc.action.sql_expression == "SET Priority = 'low'"
+ assert rule_desc.action.sql_expression == "SET Priority = @param"
+ assert rule_desc.action.parameters["@param"] == datetime(2020, 7, 5, 11, 12, 13)
+ assert rule_properties["key_string"] == "str1"
+ assert rule_properties["key_int"] == 2
+ assert rule_properties["key_long"] == INT32_MAX_VALUE + 3
+ assert rule_properties["key_bool"] is False
+ assert rule_properties["key_datetime"] == datetime(2020, 7, 5, 11, 12, 13)
+ assert rule_properties["key_duration"] == timedelta(days=1, hours=2, minutes=3)
await mgmt_service.create_rule(topic_name, subscription_name, rule_2)
rule_desc = await mgmt_service.get_rule(topic_name, subscription_name, rule_name_2)
assert type(rule_desc.filter) == SqlRuleFilter
- assert rule_desc.filter.sql_expression == "Priority = 'low'"
+ assert rule_desc.filter.sql_expression == "Priority = @param1"
+ assert rule_desc.filter.parameters["@param1"] == "str1"
await mgmt_service.create_rule(topic_name, subscription_name, rule_3)
rule_desc = await mgmt_service.get_rule(topic_name, subscription_name, rule_name_3)
diff --git a/sdk/servicebus/azure-servicebus/tests/mgmt_tests/recordings/test_mgmt_rules.test_mgmt_rule_create.yaml b/sdk/servicebus/azure-servicebus/tests/mgmt_tests/recordings/test_mgmt_rules.test_mgmt_rule_create.yaml
index 3e700ec52c06..0ddb9fb730ca 100644
--- a/sdk/servicebus/azure-servicebus/tests/mgmt_tests/recordings/test_mgmt_rules.test_mgmt_rule_create.yaml
+++ b/sdk/servicebus/azure-servicebus/tests/mgmt_tests/recordings/test_mgmt_rules.test_mgmt_rule_create.yaml
@@ -9,18 +9,18 @@ interactions:
Connection:
- keep-alive
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: GET
uri: https://servicebustestsbname.servicebus.windows.net/$Resources/topics?$skip=0&$top=100&api-version=2017-04
response:
body:
- string: Topicshttps://servicebustestshi5frbomp.servicebus.windows.net/$Resources/topics?$skip=0&$top=100&api-version=2017-042020-07-02T05:58:36Z
+ string: Topicshttps://servicebustestzca2g5qsmq.servicebus.windows.net/$Resources/topics?$skip=0&$top=100&api-version=2017-042020-07-17T02:22:21Z
headers:
content-type:
- application/atom+xml;type=feed;charset=utf-8
date:
- - Thu, 02 Jul 2020 05:58:36 GMT
+ - Fri, 17 Jul 2020 02:22:20 GMT
server:
- Microsoft-HTTPAPI/2.0
transfer-encoding:
@@ -45,21 +45,21 @@ interactions:
Content-Type:
- application/atom+xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: PUT
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf?api-version=2017-04
response:
body:
- string: https://servicebustestshi5frbomp.servicebus.windows.net/topic_testaddf?api-version=2017-04topic_testaddf2020-07-02T05:58:37Z2020-07-02T05:58:37Zservicebustestshi5frbomphttps://servicebustestzca2g5qsmq.servicebus.windows.net/topic_testaddf?api-version=2017-04topic_testaddf2020-07-17T02:22:21Z2020-07-17T02:22:22Zservicebustestzca2g5qsmqP10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-02T05:58:37.417Z2020-07-02T05:58:37.447ZtrueP10675199DT2H48M5.4775807SfalseAvailablefalsefalse
+ xmlns:i="http://www.w3.org/2001/XMLSchema-instance">P10675199DT2H48M5.4775807S1024falsePT10Mtrue0falsefalseActive2020-07-17T02:22:21.953Z2020-07-17T02:22:22.04ZtrueP10675199DT2H48M5.4775807SfalseAvailablefalsefalse
headers:
content-type:
- application/atom+xml;type=entry;charset=utf-8
date:
- - Thu, 02 Jul 2020 05:58:37 GMT
+ - Fri, 17 Jul 2020 02:22:21 GMT
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
@@ -86,23 +86,23 @@ interactions:
Content-Type:
- application/atom+xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: PUT
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk?api-version=2017-04
response:
body:
- string: https://servicebustestshi5frbomp.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk?api-version=2017-04sub_testkkk2020-07-02T05:58:37Z2020-07-02T05:58:37Zhttps://servicebustestzca2g5qsmq.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk?api-version=2017-04sub_testkkk2020-07-17T02:22:22Z2020-07-17T02:22:22ZPT1MfalseP10675199DT2H48M5.4775807Sfalsetrue010trueActive2020-07-02T05:58:37.9708001Z2020-07-02T05:58:37.9708001Z0001-01-01T00:00:00P10675199DT2H48M5.4775807SAvailable
+ xmlns:i="http://www.w3.org/2001/XMLSchema-instance">PT1MfalseP10675199DT2H48M5.4775807Sfalsetrue010trueActive2020-07-17T02:22:22.6633698Z2020-07-17T02:22:22.6633698Z0001-01-01T00:00:00P10675199DT2H48M5.4775807SAvailable
headers:
content-type:
- application/atom+xml;type=entry;charset=utf-8
date:
- - Thu, 02 Jul 2020 05:58:37 GMT
+ - Fri, 17 Jul 2020 02:22:22 GMT
etag:
- - '637292663174470000'
+ - '637305493420400000'
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
@@ -117,8 +117,15 @@ interactions:
testcidSET Priority = ''low''test_rule_1'
+ xsi:type="CorrelationFilter">testcidkey_stringstr1key_int2key_long2147483650key_boolfalsekey_datetime2020-07-05T11:12:13key_durationP1DT2H3MSET Priority = @param20@param2020-07-05T11:12:13test_rule_1'
headers:
Accept:
- application/xml
@@ -127,28 +134,35 @@ interactions:
Connection:
- keep-alive
Content-Length:
- - '518'
+ - '1765'
Content-Type:
- application/atom+xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: PUT
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?api-version=2017-04
response:
body:
- string: https://servicebustestshi5frbomp.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?api-version=2017-04test_rule_12020-07-02T05:58:38Z2020-07-02T05:58:38Zhttps://servicebustestzca2g5qsmq.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?api-version=2017-04test_rule_12020-07-17T02:22:23Z2020-07-17T02:22:23ZtestcidSET Priority = 'low'202020-07-02T05:58:38.1426348Ztest_rule_1
+ xmlns:i="http://www.w3.org/2001/XMLSchema-instance">testcidkey_stringstr1key_int2key_long2147483650key_boolfalsekey_datetime2020-07-05T11:12:13key_durationP1DT2H3MSET Priority = @param20@param2020-07-05T11:12:132020-07-17T02:22:23.0245154Ztest_rule_1
headers:
content-type:
- application/atom+xml;type=entry;charset=utf-8
date:
- - Thu, 02 Jul 2020 05:58:38 GMT
+ - Fri, 17 Jul 2020 02:22:22 GMT
etag:
- - '637292663174470000'
+ - '637305493420400000'
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
@@ -168,24 +182,31 @@ interactions:
Connection:
- keep-alive
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: GET
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?enrich=false&api-version=2017-04
response:
body:
- string: sb://servicebustestshi5frbomp.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?enrich=false&api-version=2017-04test_rule_12020-07-02T05:58:38Z2020-07-02T05:58:38Zsb://servicebustestzca2g5qsmq.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?enrich=false&api-version=2017-04test_rule_12020-07-17T02:22:23Z2020-07-17T02:22:23ZtestcidSET Priority = 'low'202020-07-02T05:58:38.1487771Ztest_rule_1
+ xmlns:i="http://www.w3.org/2001/XMLSchema-instance">testcidkey_stringstr1key_int2key_long2147483650key_boolfalsekey_datetime2020-07-05T11:12:13key_durationP1DT2H3MSET Priority = @param20@param2020-07-05T11:12:132020-07-17T02:22:23.0289508Ztest_rule_1
headers:
content-type:
- application/atom+xml;type=entry;charset=utf-8
date:
- - Thu, 02 Jul 2020 05:58:38 GMT
+ - Fri, 17 Jul 2020 02:22:22 GMT
etag:
- - '637292663174470000'
+ - '637305493420400000'
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
@@ -200,7 +221,8 @@ interactions:
Priority = ''low''Priority = @param120@param1str1test_rule_2'
headers:
Accept:
@@ -210,29 +232,30 @@ interactions:
Connection:
- keep-alive
Content-Length:
- - '463'
+ - '690'
Content-Type:
- application/atom+xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: PUT
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?api-version=2017-04
response:
body:
- string: https://servicebustestshi5frbomp.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?api-version=2017-04test_rule_22020-07-02T05:58:38Z2020-07-02T05:58:38Zhttps://servicebustestzca2g5qsmq.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?api-version=2017-04test_rule_22020-07-17T02:22:23Z2020-07-17T02:22:23ZPriority
- = 'low'202020-07-02T05:58:38.3926736Ztest_rule_2
+ = @param120@param1str12020-07-17T02:22:23.2276052Ztest_rule_2
headers:
content-type:
- application/atom+xml;type=entry;charset=utf-8
date:
- - Thu, 02 Jul 2020 05:58:38 GMT
+ - Fri, 17 Jul 2020 02:22:22 GMT
etag:
- - '637292663174470000'
+ - '637305493420400000'
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
@@ -252,25 +275,26 @@ interactions:
Connection:
- keep-alive
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: GET
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?enrich=false&api-version=2017-04
response:
body:
- string: sb://servicebustestshi5frbomp.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?enrich=false&api-version=2017-04test_rule_22020-07-02T05:58:38Z2020-07-02T05:58:38Zsb://servicebustestzca2g5qsmq.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?enrich=false&api-version=2017-04test_rule_22020-07-17T02:22:23Z2020-07-17T02:22:23ZPriority
- = 'low'202020-07-02T05:58:38.3837741Ztest_rule_2
+ = @param120@param1str12020-07-17T02:22:23.2476778Ztest_rule_2
headers:
content-type:
- application/atom+xml;type=entry;charset=utf-8
date:
- - Thu, 02 Jul 2020 05:58:38 GMT
+ - Fri, 17 Jul 2020 02:22:22 GMT
etag:
- - '637292663174470000'
+ - '637305493420400000'
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
@@ -285,8 +309,8 @@ interactions:
1 = 1test_rule_3'
+ xsi:type="TrueFilter">1=120truetest_rule_3'
headers:
Accept:
- application/xml
@@ -295,28 +319,28 @@ interactions:
Connection:
- keep-alive
Content-Length:
- - '453'
+ - '545'
Content-Type:
- application/atom+xml
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: PUT
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?api-version=2017-04
response:
body:
- string: https://servicebustestshi5frbomp.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?api-version=2017-04test_rule_32020-07-02T05:58:38Z2020-07-02T05:58:38Zhttps://servicebustestzca2g5qsmq.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?api-version=2017-04test_rule_32020-07-17T02:22:23Z2020-07-17T02:22:23Z1=1202020-07-02T05:58:38.7832611Ztest_rule_3
+ i:type="EmptyRuleAction"/>2020-07-17T02:22:23.4776391Ztest_rule_3
headers:
content-type:
- application/atom+xml;type=entry;charset=utf-8
date:
- - Thu, 02 Jul 2020 05:58:38 GMT
+ - Fri, 17 Jul 2020 02:22:22 GMT
etag:
- - '637292663174470000'
+ - '637305493420400000'
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
@@ -336,24 +360,24 @@ interactions:
Connection:
- keep-alive
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: GET
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?enrich=false&api-version=2017-04
response:
body:
- string: sb://servicebustestshi5frbomp.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?enrich=false&api-version=2017-04test_rule_32020-07-02T05:58:38Z2020-07-02T05:58:38Zsb://servicebustestzca2g5qsmq.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?enrich=false&api-version=2017-04test_rule_32020-07-17T02:22:23Z2020-07-17T02:22:23Z1=1202020-07-02T05:58:38.7744248Ztest_rule_3
+ i:type="EmptyRuleAction"/>2020-07-17T02:22:23.4820344Ztest_rule_3
headers:
content-type:
- application/atom+xml;type=entry;charset=utf-8
date:
- - Thu, 02 Jul 2020 05:58:38 GMT
+ - Fri, 17 Jul 2020 02:22:23 GMT
etag:
- - '637292663174470000'
+ - '637305493420400000'
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
@@ -375,7 +399,7 @@ interactions:
Content-Length:
- '0'
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: DELETE
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_1?api-version=2017-04
response:
@@ -385,9 +409,9 @@ interactions:
content-length:
- '0'
date:
- - Thu, 02 Jul 2020 05:58:38 GMT
+ - Fri, 17 Jul 2020 02:22:23 GMT
etag:
- - '637292663174470000'
+ - '637305493420400000'
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
@@ -407,7 +431,7 @@ interactions:
Content-Length:
- '0'
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: DELETE
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_2?api-version=2017-04
response:
@@ -417,9 +441,9 @@ interactions:
content-length:
- '0'
date:
- - Thu, 02 Jul 2020 05:58:38 GMT
+ - Fri, 17 Jul 2020 02:22:23 GMT
etag:
- - '637292663174470000'
+ - '637305493420400000'
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
@@ -439,7 +463,7 @@ interactions:
Content-Length:
- '0'
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: DELETE
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk/rules/test_rule_3?api-version=2017-04
response:
@@ -449,9 +473,9 @@ interactions:
content-length:
- '0'
date:
- - Thu, 02 Jul 2020 05:58:39 GMT
+ - Fri, 17 Jul 2020 02:22:23 GMT
etag:
- - '637292663174470000'
+ - '637305493420400000'
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
@@ -471,7 +495,7 @@ interactions:
Content-Length:
- '0'
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: DELETE
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf/subscriptions/sub_testkkk?api-version=2017-04
response:
@@ -481,9 +505,9 @@ interactions:
content-length:
- '0'
date:
- - Thu, 02 Jul 2020 05:58:39 GMT
+ - Fri, 17 Jul 2020 02:22:23 GMT
etag:
- - '637292663174470000'
+ - '637305493420400000'
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
@@ -503,7 +527,7 @@ interactions:
Content-Length:
- '0'
User-Agent:
- - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.18362-SP0)
+ - azsdk-python-servicebusmanagementclient/2017-04 Python/3.7.7 (Windows-10-10.0.20161-SP0)
method: DELETE
uri: https://servicebustestsbname.servicebus.windows.net/topic_testaddf?api-version=2017-04
response:
@@ -513,9 +537,9 @@ interactions:
content-length:
- '0'
date:
- - Thu, 02 Jul 2020 05:58:39 GMT
+ - Fri, 17 Jul 2020 02:22:24 GMT
etag:
- - '637292663174470000'
+ - '637305493420400000'
server:
- Microsoft-HTTPAPI/2.0
strict-transport-security:
diff --git a/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_rules.py b/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_rules.py
index 2c982cdfa768..9acc0e3f894e 100644
--- a/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_rules.py
+++ b/sdk/servicebus/azure-servicebus/tests/mgmt_tests/test_mgmt_rules.py
@@ -5,9 +5,11 @@
#--------------------------------------------------------------------------
import logging
import pytest
+from datetime import datetime, timedelta
import msrest
from azure.servicebus.management import ServiceBusManagementClient, RuleDescription, CorrelationRuleFilter, SqlRuleFilter, TrueRuleFilter, FalseRuleFilter, SqlRuleAction
+from azure.servicebus.management._constants import INT32_MAX_VALUE
from utilities import get_logger
from azure.core.exceptions import HttpResponseError, ResourceExistsError
@@ -33,11 +35,22 @@ def test_mgmt_rule_create(self, servicebus_namespace_connection_string, **kwargs
rule_name_2 = 'test_rule_2'
rule_name_3 = 'test_rule_3'
- correlation_fitler = CorrelationRuleFilter(correlation_id='testcid')
- sql_rule_action = SqlRuleAction(sql_expression="SET Priority = 'low'")
+ correlation_fitler = CorrelationRuleFilter(correlation_id='testcid', properties={
+ "key_string": "str1",
+ "key_int": 2,
+ "key_long": INT32_MAX_VALUE + 3,
+ "key_bool": False,
+ "key_datetime": datetime(2020, 7, 5, 11, 12, 13),
+ "key_duration": timedelta(days=1, hours=2, minutes=3)
+ })
+ sql_rule_action = SqlRuleAction(sql_expression="SET Priority = @param", parameters={
+ "@param": datetime(2020, 7, 5, 11, 12, 13),
+ })
rule_1 = RuleDescription(name=rule_name_1, filter=correlation_fitler, action=sql_rule_action)
- sql_filter = SqlRuleFilter("Priority = 'low'")
+ sql_filter = SqlRuleFilter("Priority = @param1", parameters={
+ "@param1": "str1",
+ })
rule_2 = RuleDescription(name=rule_name_2, filter=sql_filter)
bool_filter = TrueRuleFilter()
@@ -49,25 +62,51 @@ def test_mgmt_rule_create(self, servicebus_namespace_connection_string, **kwargs
mgmt_service.create_rule(topic_name, subscription_name, rule_1)
rule_desc = mgmt_service.get_rule(topic_name, subscription_name, rule_name_1)
+ rule_properties = rule_desc.filter.properties
assert type(rule_desc.filter) == CorrelationRuleFilter
assert rule_desc.filter.correlation_id == 'testcid'
- assert rule_desc.action.sql_expression == "SET Priority = 'low'"
+ assert rule_desc.action.sql_expression == "SET Priority = @param"
+ assert rule_desc.action.parameters["@param"] == datetime(2020, 7, 5, 11, 12, 13)
+ assert rule_properties["key_string"] == "str1"
+ assert rule_properties["key_int"] == 2
+ assert rule_properties["key_long"] == INT32_MAX_VALUE + 3
+ assert rule_properties["key_bool"] is False
+ assert rule_properties["key_datetime"] == datetime(2020, 7, 5, 11, 12, 13)
+ assert rule_properties["key_duration"] == timedelta(days=1, hours=2, minutes=3)
+
mgmt_service.create_rule(topic_name, subscription_name, rule_2)
rule_desc = mgmt_service.get_rule(topic_name, subscription_name, rule_name_2)
assert type(rule_desc.filter) == SqlRuleFilter
- assert rule_desc.filter.sql_expression == "Priority = 'low'"
+ assert rule_desc.filter.sql_expression == "Priority = @param1"
+ assert rule_desc.filter.parameters["@param1"] == "str1"
mgmt_service.create_rule(topic_name, subscription_name, rule_3)
rule_desc = mgmt_service.get_rule(topic_name, subscription_name, rule_name_3)
assert type(rule_desc.filter) == TrueRuleFilter
finally:
- mgmt_service.delete_rule(topic_name, subscription_name, rule_name_1)
- mgmt_service.delete_rule(topic_name, subscription_name, rule_name_2)
- mgmt_service.delete_rule(topic_name, subscription_name, rule_name_3)
- mgmt_service.delete_subscription(topic_name, subscription_name)
- mgmt_service.delete_topic(topic_name)
+ try:
+ mgmt_service.delete_rule(topic_name, subscription_name, rule_name_1)
+ except:
+ pass
+ try:
+ mgmt_service.delete_rule(topic_name, subscription_name, rule_name_2)
+ except:
+ pass
+ try:
+ mgmt_service.delete_rule(topic_name, subscription_name, rule_name_3)
+ except:
+ pass
+ try:
+ mgmt_service.delete_subscription(topic_name, subscription_name)
+ except:
+ pass
+ try:
+ mgmt_service.delete_topic(topic_name)
+ except:
+ pass
+
@CachedResourceGroupPreparer(name_prefix='servicebustest')
@CachedServiceBusNamespacePreparer(name_prefix='servicebustest')
diff --git a/shared_requirements.txt b/shared_requirements.txt
index 6ac62568c117..4cd5ee9f14d4 100644
--- a/shared_requirements.txt
+++ b/shared_requirements.txt
@@ -109,6 +109,7 @@ aiohttp>=3.0
aiodns>=2.0
python-dateutil>=2.8.0
six>=1.6
+isodate>=0.6.0
#override azure azure-keyvault~=1.0
#override azure-mgmt-core azure-core<2.0.0,>=1.7.0
#override azure-appconfiguration azure-core<2.0.0,>=1.0.0