azure.storage.queue.models module

class azure.storage.queue.models.Queue[source]

Bases: object

Queue class.

Variables:
  • name (str) – The name of the queue.
  • metadata (dict(str, str)) – A dict containing name-value pairs associated with the queue as metadata. This var is set to None unless the include=metadata param was included for the list queues operation. If this parameter was specified but the queue has no metadata, metadata will be set to an empty dictionary.
class azure.storage.queue.models.QueueMessage[source]

Bases: object

Queue message class.

Variables:
  • id (str) – A GUID value assigned to the message by the Queue service that identifies the message in the queue. This value may be used together with the value of pop_receipt to delete a message from the queue after it has been retrieved with the get messages operation.
  • insertion_time (date) – A UTC date value representing the time the messages was inserted.
  • expiration_time (date) – A UTC date value representing the time the message expires.
  • dequeue_count (int) – Begins with a value of 1 the first time the message is dequeued. This value is incremented each time the message is subsequently dequeued.
  • content (obj) – The message content. Type is determined by the decode_function set on the service. Default is str.
  • pop_receipt (str) – A receipt str which can be used together with the message_id element to delete a message from the queue after it has been retrieved with the get messages operation. Only returned by get messages operations. Set to None for peek messages.
  • time_next_visible (date) – A UTC date value representing the time the message will next be visible. Only returned by get messages operations. Set to None for peek messages.
class azure.storage.queue.models.QueueMessageFormat[source]

Encoding and decoding methods which can be used to modify how the queue service encodes and decodes queue messages. Set these to queueservice.encode_function and queueservice.decode_function to modify the behavior. The defaults are text_xmlencode and text_xmldecode, respectively.

static binary_base64decode(data)[source]

Base64 decode to byte string.

Parameters:data (str) – Data to decode to a byte string.
Returns:Base64 decoded data.
Return type:str
static binary_base64encode(data)[source]

Base64 encode byte strings.

Parameters:data (str) – Binary string to encode.
Returns:Base64 encoded data.
Return type:str
static nodecode(data)[source]

Do no decoding.

Parameters:data (str) – Data.
Returns:The data passed in is returned unmodified.
Return type:str
static noencode(data)[source]

Do no encoding.

Parameters:data (str) – Data.
Returns:The data passed in is returned unmodified.
Return type:str
static text_base64decode(data)[source]

Base64 decode to unicode text.

Parameters:data (str) – String data to decode to unicode.
Returns:Base64 decoded string.
Return type:str
static text_base64encode(data)[source]

Base64 encode unicode text.

Parameters:data (str) – String to encode.
Returns:Base64 encoded string.
Return type:str
static text_xmldecode(data)[source]

XML decode to unicode text.

Parameters:data (str) – Data to decode to unicode.
Returns:XML decoded data.
Return type:str
static text_xmlencode(data)[source]

XML encode unicode text.

Parameters:data (str) – Unicode string to encode
Returns:XML encoded data.
Return type:str
class azure.storage.queue.models.QueuePermissions(read=False, add=False, update=False, process=False, _str=None)[source]

Bases: object

QueuePermissions class to be used with generate_queue_shared_access_signature() method and for the AccessPolicies used with set_queue_acl().

Variables:
Parameters:
  • read (bool) – Read metadata and properties, including message count. Peek at messages.
  • add (bool) – Add messages to the queue.
  • update (bool) – Update messages in the queue. Note: Use the Process permission with Update so you can first get the message you want to update.
  • process (bool) – Get and delete messages from the queue.
  • _str (str) – A string representing the permissions.
ADD = <azure.storage.queue.models.QueuePermissions object>
PROCESS = <azure.storage.queue.models.QueuePermissions object>
READ = <azure.storage.queue.models.QueuePermissions object>
UPDATE = <azure.storage.queue.models.QueuePermissions object>