azure.servicebus.management package¶
-
class
azure.servicebus.management.
ServiceBusManagementClient
(fully_qualified_namespace: str, credential: Union[TokenCredential, ServiceBusSharedKeyCredential], **kwargs: Dict[str, Any])[source]¶ Use this client to create, update, list, and delete resources of a ServiceBus namespace.
- Parameters
fully_qualified_namespace (str) – The fully qualified host name for the Service Bus namespace.
credential (Union[TokenCredential, azure.servicebus.ServiceBusSharedKeyCredential]) – To authenticate to manage the entities of the ServiceBus namespace.
-
create_queue
(queue: Union[str, azure.servicebus.management._models.QueueDescription], **kwargs: Any) → azure.servicebus.management._models.QueueDescription[source]¶ Create a queue.
- Parameters
queue (Union[str, QueueDescription]) – The queue name or a QueueDescription instance. When it’s a str, it will be the name of the created queue. Other properties of the created queue will have default values as defined by the service. Use a QueueDescription if you want to set queue properties other than the queue name.
- Return type
-
create_rule
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: Union[str, azure.servicebus.management._models.SubscriptionDescription], rule: azure.servicebus.management._models.RuleDescription, **kwargs: Any) → azure.servicebus.management._models.RuleDescription[source]¶ Create a rule for a topic subscription.
- Parameters
TopicDescription] topic (Union[str,) – The topic that will own the to-be-created subscription rule.
SubscriptionDescription] subscription (Union[str,) – The subscription that will own the to-be-created rule.
rule (azure.servicebus.management.RuleDescription) – The rule to be created.
- Return type
-
create_subscription
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: Union[str, azure.servicebus.management._models.SubscriptionDescription], **kwargs: Any) → azure.servicebus.management._models.SubscriptionDescription[source]¶ Create a topic subscription.
- Parameters
- SubscriptionDescription instance. When it’s a str, it will be the name of the created subscription.
Other properties of the created subscription will have default values as defined by the service.
- Return type
-
create_topic
(topic: Union[str, azure.servicebus.management._models.TopicDescription], **kwargs: Any) → azure.servicebus.management._models.TopicDescription[source]¶ Create a topic.
- Parameters
TopicDescription] topic (Union[str,) – The topic name or a TopicDescription instance. When it’s a str, it will be the name of the created topic. Other properties of the created topic will have default values as defined by the service. Use a TopicDescription if you want to set queue properties other than the queue name.
- Return type
-
delete_queue
(queue: Union[str, azure.servicebus.management._models.QueueDescription], **kwargs: Any) → None[source]¶ Delete a queue.
-
delete_rule
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: Union[str, azure.servicebus.management._models.SubscriptionDescription], rule: Union[str, azure.servicebus.management._models.RuleDescription], **kwargs: Any) → None[source]¶ Delete a topic subscription rule.
-
delete_subscription
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: Union[str, azure.servicebus.management._models.SubscriptionDescription], **kwargs: Any) → None[source]¶ Delete a topic subscription.
-
delete_topic
(topic: Union[str, azure.servicebus.management._models.TopicDescription], **kwargs: Any) → None[source]¶ Delete a topic.
-
classmethod
from_connection_string
(conn_str: str, **kwargs: Any) → azure.servicebus.management._management_client.ServiceBusManagementClient[source]¶ Create a client from connection string.
- Parameters
conn_str (str) – The connection string of the Service Bus Namespace.
- Return type
-
get_namespace_properties
(**kwargs: Any) → azure.servicebus.management._generated.models._models_py3.NamespaceProperties[source]¶ Get the namespace properties
- Return type
-
get_queue
(queue_name: str, **kwargs: Any) → azure.servicebus.management._models.QueueDescription[source]¶ Get the properties of a queue.
- Parameters
queue_name (str) – The name of the queue.
- Return type
-
get_queue_runtime_info
(queue_name: str, **kwargs: Any) → azure.servicebus.management._models.QueueRuntimeInfo[source]¶ Get the runtime information of a queue.
- Parameters
queue_name (str) – The name of the queue.
- Return type
-
get_rule
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: Union[str, azure.servicebus.management._models.SubscriptionDescription], rule_name: str, **kwargs: Any) → azure.servicebus.management._models.RuleDescription[source]¶ Get the properties of a topic subscription rule.
- Parameters
- Return type
-
get_subscription
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription_name: str, **kwargs: Any) → azure.servicebus.management._models.SubscriptionDescription[source]¶ Get the properties of a topic subscription.
- Parameters
- Return type
-
get_subscription_runtime_info
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription_name: str, **kwargs: Any) → azure.servicebus.management._models.SubscriptionRuntimeInfo[source]¶ Get a topic subscription runtime info.
- Parameters
- Return type
-
get_topic
(topic_name: str, **kwargs: Any) → azure.servicebus.management._models.TopicDescription[source]¶ Get the properties of a topic.
- Parameters
topic_name (str) – The name of the topic.
- Return type
-
get_topic_runtime_info
(topic_name: str, **kwargs: Any) → azure.servicebus.management._models.TopicRuntimeInfo[source]¶ Get a the runtime information of a topic.
- Parameters
topic_name (str) – The name of the topic.
- Return type
-
list_queues
(**kwargs: Any) → azure.core.paging.ItemPaged[azure.servicebus.management._models.QueueDescription][source]¶ List the queues of a ServiceBus namespace.
- Returns
An iterable (auto-paging) response of QueueDescription.
- Return type
-
list_queues_runtime_info
(**kwargs: Any) → azure.core.paging.ItemPaged[azure.servicebus.management._models.QueueRuntimeInfo][source]¶ List the runtime information of the queues in a ServiceBus namespace.
- Returns
An iterable (auto-paging) response of QueueRuntimeInfo.
- Return type
-
list_rules
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: Union[str, azure.servicebus.management._models.SubscriptionDescription], **kwargs: Any) → azure.core.paging.ItemPaged[azure.servicebus.management._models.RuleDescription][source]¶ List the rules of a topic subscription.
- Parameters
- Returns
An iterable (auto-paging) response of RuleDescription.
- Return type
-
list_subscriptions
(topic: Union[str, azure.servicebus.management._models.TopicDescription], **kwargs: Any) → azure.core.paging.ItemPaged[azure.servicebus.management._models.SubscriptionDescription][source]¶ List the subscriptions of a ServiceBus Topic.
- Parameters
TopicDescription] topic (Union[str,) – The topic that owns the subscription.
- Returns
An iterable (auto-paging) response of SubscriptionDescription.
- Return type
-
list_subscriptions_runtime_info
(topic: Union[str, azure.servicebus.management._models.TopicDescription], **kwargs: Any) → azure.core.paging.ItemPaged[azure.servicebus.management._models.SubscriptionRuntimeInfo][source]¶ List the subscriptions runtime information of a ServiceBus Topic.
- Parameters
TopicDescription] topic (Union[str,) – The topic that owns the subscription.
- Returns
An iterable (auto-paging) response of SubscriptionRuntimeInfo.
- Return type
-
list_topics
(**kwargs: Any) → azure.core.paging.ItemPaged[azure.servicebus.management._models.TopicDescription][source]¶ List the topics of a ServiceBus namespace.
- Returns
An iterable (auto-paging) response of TopicDescription.
- Return type
-
list_topics_runtime_info
(**kwargs: Any) → azure.core.paging.ItemPaged[azure.servicebus.management._models.TopicRuntimeInfo][source]¶ List the topics runtime information of a ServiceBus namespace.
- Returns
An iterable (auto-paging) response of TopicRuntimeInfo.
- Return type
-
update_queue
(queue: azure.servicebus.management._models.QueueDescription, **kwargs: Any) → None[source]¶ Update a queue.
Before calling this method, you should use get_queue to get a QueueDescription instance, then use the keyword arguments to update the properties you want to update. Only a portion of properties can be updated. Refer to https://docs.microsoft.com/en-us/rest/api/servicebus/update-queue.
- Parameters
queue (QueueDescription) – The queue to be updated.
- Keyword Arguments
default_message_time_to_live (timedelta) – The value you want to update to.
lock_duration (timedelta) – The value you want to update to.
dead_lettering_on_message_expiration (bool) – The value you want to update to.
duplicate_detection_history_time_window (timedelta) – The value you want to update to.
max_delivery_count (int) – The value you want to update to.
- Return type
-
update_rule
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: Union[str, azure.servicebus.management._models.SubscriptionDescription], rule: azure.servicebus.management._models.RuleDescription, **kwargs: Any) → None[source]¶ Update a rule.
Before calling this method, you should use get_rule to get a RuleDescription instance, then update the related attributes and call this method. Only a portion of properties can be updated.
- Parameters
TopicDescription] topic (Union[str,) – The topic that owns the subscription.
SubscriptionDescription] subscription (Union[str,) – The subscription that owns this rule.
rule (RuleDescription) – The rule to be updated.
- Return type
-
update_subscription
(topic: Union[str, azure.servicebus.management._models.TopicDescription], subscription: azure.servicebus.management._models.SubscriptionDescription, **kwargs: Any) → None[source]¶ Update a subscription.
Before calling this method, you should use get_subscription to get a SubscriptionDescription instance, then update the related attributes and call this method. Only a portion of properties can be updated.
- Parameters
TopicDescription] topic (Union[str,) – The topic that owns the subscription.
subscription (SubscriptionDescription) – The subscription to be updated.
- Return type
-
update_topic
(topic: azure.servicebus.management._models.TopicDescription, **kwargs: Any) → None[source]¶ Update a topic.
Before calling this method, you should use get_topic to get a TopicDescription instance, then use the keyword arguments to update the properties you want to update. Only a portion of properties can be updated. Refer to https://docs.microsoft.com/en-us/rest/api/servicebus/update-topic.
- Parameters
topic (TopicDescription) – The topic to be updated.
- Keyword Arguments
default_message_time_to_live (timedelta) – The value you want to update to.
duplicate_detection_history_time_window (timedelta) – The value you want to update to.
- Return type
-
class
azure.servicebus.management.
AuthorizationRule
(*, type: Optional[str] = None, claim_type: Optional[str] = None, claim_value: Optional[str] = None, rights: Optional[List[str]] = None, created_time: Optional[datetime.datetime] = None, modified_time: Optional[datetime.datetime] = None, key_name: Optional[str] = None, primary_key: Optional[str] = None, secondary_key: Optional[str] = None, **kwargs)[source]¶ Authorization rule of an entity.
- Parameters
type (str) –
claim_type (str) –
claim_value (str) –
rights (list[str]) – Access rights of the entity. Values are ‘Send’, ‘Listen’, or ‘Manage’.
created_time (datetime) – The date and time when the authorization rule was created.
modified_time (datetime) – The date and time when the authorization rule was modified.
key_name (str) – The authorization rule key name.
primary_key (str) – The primary key of the authorization rule.
secondary_key (str) – The primary key of the authorization rule.
-
as_dict
(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)¶ Return a dict that can be JSONify using json.dump.
Advanced usage might optionaly use a callback as parameter:
Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.
The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.
See the three examples in this file:
attribute_transformer
full_restapi_key_transformer
last_restapi_key_transformer
If you want XML serialization, you can pass the kwargs is_xml=True.
- Parameters
key_transformer (function) – A key transformer function.
- Returns
A dict JSON compatible object
- Return type
-
classmethod
deserialize
(data, content_type=None)¶ Parse a str using the RestAPI syntax and return a model.
-
classmethod
enable_additional_properties_sending
()¶
-
classmethod
from_dict
(data, key_extractors=None, content_type=None)¶ Parse a dict using given key extractor return a model.
By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)
-
classmethod
is_xml_model
()¶
-
serialize
(keep_readonly=False, **kwargs)¶ Return the JSON that would be sent to azure from this model.
This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).
If you want XML serialization, you can pass the kwargs is_xml=True.
-
class
azure.servicebus.management.
MessageCountDetails
(*, active_message_count: Optional[int] = None, dead_letter_message_count: Optional[int] = None, scheduled_message_count: Optional[int] = None, transfer_dead_letter_message_count: Optional[int] = None, transfer_message_count: Optional[int] = None, **kwargs)[source]¶ Details about the message counts in entity.
- Parameters
active_message_count (int) – Number of active messages in the queue, topic, or subscription.
dead_letter_message_count (int) – Number of messages that are dead lettered.
scheduled_message_count (int) – Number of scheduled messages.
transfer_dead_letter_message_count (int) – Number of messages transferred into dead letters.
transfer_message_count (int) – Number of messages transferred to another queue, topic, or subscription.
-
as_dict
(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)¶ Return a dict that can be JSONify using json.dump.
Advanced usage might optionaly use a callback as parameter:
Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.
The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.
See the three examples in this file:
attribute_transformer
full_restapi_key_transformer
last_restapi_key_transformer
If you want XML serialization, you can pass the kwargs is_xml=True.
- Parameters
key_transformer (function) – A key transformer function.
- Returns
A dict JSON compatible object
- Return type
-
classmethod
deserialize
(data, content_type=None)¶ Parse a str using the RestAPI syntax and return a model.
-
classmethod
enable_additional_properties_sending
()¶
-
classmethod
from_dict
(data, key_extractors=None, content_type=None)¶ Parse a dict using given key extractor return a model.
By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)
-
classmethod
is_xml_model
()¶
-
serialize
(keep_readonly=False, **kwargs)¶ Return the JSON that would be sent to azure from this model.
This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).
If you want XML serialization, you can pass the kwargs is_xml=True.
-
class
azure.servicebus.management.
QueueDescription
(name, **kwargs)[source]¶ Description of a Service Bus queue resource.
- Parameters
name (str) – Name of the queue.
- Keyword Arguments
authorization_rules – Authorization rules for resource.
auto_delete_on_idle – ISO 8601 timeSpan idle interval after which the queue is automatically deleted. The minimum duration is 5 minutes.
dead_lettering_on_message_expiration – A value that indicates whether this queue has dead letter support when a message expires.
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 Bus. This is the default value used when TimeToLive is not set on a message itself.
duplicate_detection_history_time_window – ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes.
entity_availability_status – Availibility status of the entity. Possible values include: “Available”, “Limited”, “Renaming”, “Restoring”, “Unknown”.
enable_batched_operations – Value that indicates whether server-side batched operations are enabled.
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.
enable_partitioning – A value that indicates whether the queue is to be partitioned across multiple message brokers.
is_anonymous_accessible – A value indicating if the resource can be accessed without authorization.
lock_duration – ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute.
max_delivery_count – The maximum delivery count. A message is automatically deadlettered after this number of deliveries. Default value is 10.
max_size_in_megabytes – The maximum size of the queue in megabytes, which is the size of memory allocated for the queue.
requires_duplicate_detection – A value indicating if this queue requires duplicate detection.
requires_session – A value that indicates whether the queue supports the concept of sessions.
status – Status of a Service Bus resource. Possible values include: “Active”, “Creating”, “Deleting”, “Disabled”, “ReceiveDisabled”, “Renaming”, “Restoring”, “SendDisabled”, “Unknown”.
forward_to – The name of the recipient entity to which all the messages sent to the queue are forwarded to.
user_metadata – Custom metdata that user can associate with the description. Max length is 1024 chars.
support_ordering – A value that indicates whether the queue supports ordering.
forward_dead_lettered_messages_to – The name of the recipient entity to which all the dead-lettered messages of this subscription are forwarded to.
-
class
azure.servicebus.management.
QueueRuntimeInfo
(name, **kwargs)[source]¶ Service Bus queue metrics.
- Variables
name – Name of the queue.
accessed_at – Last time a message was sent, or the last time there was a receive request to this queue.
created_at – The exact time the queue was created.
updated_at – The exact time a message was updated in the queue.
size_in_bytes – The size of the queue, in bytes.
message_count – The number of messages in the queue.
message_count_details – Details about the message counts in entity.
-
class
azure.servicebus.management.
TopicDescription
(name, **kwargs)[source]¶ Description of a Service Bus topic resource.
- Parameters
name (str) – Name of the topic.
- Keyword Arguments
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 Bus. This is the default value used when TimeToLive is not set on a message itself.
max_size_in_megabytes – The maximum size of the topic in megabytes, which is the size of memory allocated for the topic.
requires_duplicate_detection – A value indicating if this topic requires duplicate detection.
duplicate_detection_history_time_window – ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes.
enable_batched_operations – Value that indicates whether server-side batched operations are enabled.
size_in_bytes – The size of the topic, in bytes.
filtering_messages_before_publishing – Filter messages before publishing.
is_anonymous_accessible – A value indicating if the resource can be accessed without authorization.
authorization_rules – Authorization rules for resource.
status – Status of a Service Bus resource. Possible values include: “Active”, “Creating”, “Deleting”, “Disabled”, “ReceiveDisabled”, “Renaming”, “Restoring”, “SendDisabled”, “Unknown”.
support_ordering – A value that indicates whether the topic supports ordering.
auto_delete_on_idle – ISO 8601 timeSpan idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes.
enable_partitioning – A value that indicates whether the topic is to be partitioned across multiple message brokers.
entity_availability_status – Availability status of the entity. Possible values include: “Available”, “Limited”, “Renaming”, “Restoring”, “Unknown”.
enable_subscription_partitioning – A value that indicates whether the topic’s subscription is to be partitioned.
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.
user_metadata – Metadata associated with the topic.
-
class
azure.servicebus.management.
TopicRuntimeInfo
(name, **kwargs)[source]¶ Description of a Service Bus topic resource.
- Variables
name (str) –
created_at – The exact time the queue was created.
updated_at – The exact time a message was updated in the queue.
accessed_at – Last time a message was sent, or the last time there was a receive request to this queue.
message_count_details – Details about the message counts in queue.
subscription_count – The number of subscriptions in the topic.
-
class
azure.servicebus.management.
SubscriptionDescription
(name, **kwargs)[source]¶ Description of a Service Bus queue resource.
- Parameters
name (str) – Name of the subscription.
- Keyword Arguments
lock_duration – ISO 8601 timespan duration of a peek-lock; that is, the amount of time that the message is locked for other receivers. The maximum value for LockDuration is 5 minutes; the default value is 1 minute.
requires_session – A value that indicates whether the queue supports the concept of sessions.
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 Bus. This is the default value used when TimeToLive is not set on a message itself.
dead_lettering_on_message_expiration – A value that indicates whether this subscription has dead letter support when a message expires.
dead_lettering_on_filter_evaluation_exceptions – A value that indicates whether this subscription has dead letter support when a message expires.
max_delivery_count – The maximum delivery count. A message is automatically deadlettered after this number of deliveries. Default value is 10.
enable_batched_operations – Value that indicates whether server-side batched operations are enabled.
status – Status of a Service Bus resource. Possible values include: “Active”, “Creating”, “Deleting”, “Disabled”, “ReceiveDisabled”, “Renaming”, “Restoring”, “SendDisabled”, “Unknown”.
forward_to – The name of the recipient entity to which all the messages sent to the subscription are forwarded to.
user_metadata – Metadata associated with the subscription. Maximum number of characters is 1024.
forward_dead_lettered_messages_to – The name of the recipient entity to which all the messages sent to the subscription are forwarded to.
auto_delete_on_idle – ISO 8601 timeSpan idle interval after which the subscription is automatically deleted. The minimum duration is 5 minutes.
entity_availability_status – Availability status of the entity. Possible values include: “Available”, “Limited”, “Renaming”, “Restoring”, “Unknown”.
-
class
azure.servicebus.management.
SubscriptionRuntimeInfo
(name, **kwargs)[source]¶ Description of a Service Bus queue resource.
- Variables
name (str) –
created_at – The exact time the queue was created.
updated_at – The exact time a message was updated in the queue.
accessed_at – Last time a message was sent, or the last time there was a receive request to this queue.
message_count – The number of messages in the subscription.
message_count_details – Details about the message counts in queue.
-
class
azure.servicebus.management.
AccessRights
[source]¶ Access rights of the entity
-
listen
= 'Listen'¶
-
manage
= 'Manage'¶
-
send
= 'Send'¶
-
-
class
azure.servicebus.management.
EntityAvailabilityStatus
[source]¶ Availability status of the entity
-
available
= 'Available'¶
-
limited
= 'Limited'¶
-
renaming
= 'Renaming'¶
-
restoring
= 'Restoring'¶
-
unknown
= 'Unknown'¶
-
-
class
azure.servicebus.management.
EntityStatus
[source]¶ Status of a Service Bus resource
-
active
= 'Active'¶
-
creating
= 'Creating'¶
-
deleting
= 'Deleting'¶
-
disabled
= 'Disabled'¶
-
receive_disabled
= 'ReceiveDisabled'¶
-
renaming
= 'Renaming'¶
-
restoring
= 'Restoring'¶
-
send_disabled
= 'SendDisabled'¶
-
unknown
= 'Unknown'¶
-
-
class
azure.servicebus.management.
RuleDescription
(name, **kwargs)[source]¶ Description of a topic subscription rule.
- Parameters
name (str) – Name of the rule.
- Keyword Arguments
filter – The filter of the rule.
action – The action of the rule.
created_at – The exact time the rule was created.
-
class
azure.servicebus.management.
NamespaceProperties
(*, alias: Optional[str] = None, created_time: Optional[datetime.datetime] = None, messaging_sku: Union[str, MessagingSku, None] = None, messaging_units: Optional[int] = None, modified_time: Optional[datetime.datetime] = None, name: Optional[str] = None, namespace_type: Union[str, NamespaceType, None] = None, **kwargs)[source]¶ The metadata related to a Service Bus namespace.
- Parameters
alias (str) – Alias for the geo-disaster recovery Service Bus namespace.
created_time (datetime) – The exact time the namespace was created.
messaging_sku (str or MessagingSku) – The SKU for the messaging entity. Possible values include: “Basic”, “Standard”, “Premium”.
messaging_units (int) – The number of messaging units allocated to the namespace.
modified_time (datetime) – The exact time the namespace was last modified.
name (str) – Name of the namespace.
namespace_type (str or NamespaceType) – The type of entities the namespace can contain. Possible values include: “Messaging”, “NotificationHub”, “Mixed”, “EventHub”, “Relay”.
-
as_dict
(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)¶ Return a dict that can be JSONify using json.dump.
Advanced usage might optionaly use a callback as parameter:
Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.
The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.
See the three examples in this file:
attribute_transformer
full_restapi_key_transformer
last_restapi_key_transformer
If you want XML serialization, you can pass the kwargs is_xml=True.
- Parameters
key_transformer (function) – A key transformer function.
- Returns
A dict JSON compatible object
- Return type
-
classmethod
deserialize
(data, content_type=None)¶ Parse a str using the RestAPI syntax and return a model.
-
classmethod
enable_additional_properties_sending
()¶
-
classmethod
from_dict
(data, key_extractors=None, content_type=None)¶ Parse a dict using given key extractor return a model.
By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)
-
classmethod
is_xml_model
()¶
-
serialize
(keep_readonly=False, **kwargs)¶ Return the JSON that would be sent to azure from this model.
This is an alias to as_dict(full_restapi_key_transformer, keep_readonly=False).
If you want XML serialization, you can pass the kwargs is_xml=True.