Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for message_element in list_element.findall('QueueMessage'):
message = QueueMessage()
message.id = message_element.findtext('MessageId')
dequeue_count = message_element.findtext('DequeueCount')
if dequeue_count is not None:
message.dequeue_count = _to_int(dequeue_count)
# content is not returned for put_message
if content is not None:
message.content = content
else:
message.content = message_element.findtext('MessageText')
if (key_encryption_key is not None) or (resolver is not None):
message.content = _decrypt_queue_message(message.content, require_encryption,
key_encryption_key, resolver)
message.content = decode_function(message.content)
message.insertion_time = parser.parse(message_element.findtext('InsertionTime'))
message.expiration_time = parser.parse(message_element.findtext('ExpirationTime'))
message.pop_receipt = message_element.findtext('PopReceipt')
time_next_visible = message_element.find('TimeNextVisible')
if time_next_visible is not None:
message.time_next_visible = parser.parse(time_next_visible.text)
# Add message to list
messages.append(message)
return messages