SQS (sqs)

Primary Models

Primary models are models that you can act on directly. They are the models that represent resources in the AWS service, and are acted on by the managers.

pydantic model botocraft.services.sqs.Message[source]

Bases: MessageModelMixin, PrimaryBoto3Model

An Amazon SQS message.

Show JSON schema
{
   "title": "Message",
   "description": "An Amazon SQS message.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "MessageId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Messageid"
      },
      "ReceiptHandle": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Receipthandle"
      },
      "MD5OfBody": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Md5Ofbody"
      },
      "Body": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Body"
      },
      "Attributes": {
         "anyOf": [
            {
               "additionalProperties": {
                  "type": "string"
               },
               "propertyNames": {
                  "enum": [
                     "All",
                     "SenderId",
                     "SentTimestamp",
                     "ApproximateReceiveCount",
                     "ApproximateFirstReceiveTimestamp",
                     "SequenceNumber",
                     "MessageDeduplicationId",
                     "MessageGroupId",
                     "AWSTraceHeader",
                     "DeadLetterQueueSourceArn"
                  ]
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "title": "Attributes"
      },
      "MD5OfMessageAttributes": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Md5Ofmessageattributes"
      },
      "MessageAttributes": {
         "anyOf": [
            {
               "additionalProperties": {
                  "$ref": "#/$defs/MessageAttributeValue"
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "title": "Messageattributes"
      },
      "QueueUrl": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Queueurl"
      },
      "EventFactoryClass": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "title": "Eventfactoryclass"
      }
   },
   "$defs": {
      "MessageAttributeValue": {
         "description": "The user-specified message attribute value. For string data types, the ``Value``\nattribute has the same restrictions on the content as the message body. For more\ninformation, see  ``SendMessage.``\n\n``Name``, ``type``, ``value`` and the message body must not be empty or null. All parts of the message attribute,\nincluding ``Name``, ``Type``, and ``Value``, are part of the message size restriction (1 MiB or 1,048,576 bytes).",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "StringValue": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Stringvalue"
            },
            "BinaryValue": {
               "anyOf": [
                  {
                     "format": "binary",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Binaryvalue"
            },
            "StringListValues": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Stringlistvalues"
            },
            "BinaryListValues": {
               "anyOf": [
                  {
                     "items": {
                        "format": "binary",
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Binarylistvalues"
            },
            "DataType": {
               "title": "Datatype",
               "type": "string"
            }
         },
         "required": [
            "DataType"
         ],
         "title": "MessageAttributeValue",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field Attributes: dict[Literal['All', 'SenderId', 'SentTimestamp', 'ApproximateReceiveCount', 'ApproximateFirstReceiveTimestamp', 'SequenceNumber', 'MessageDeduplicationId', 'MessageGroupId', 'AWSTraceHeader', 'DeadLetterQueueSourceArn'], str] | None [Optional]

A map of the attributes requested in ReceiveMessage to their respective values.

Supported attributes:

field Body: str | None = None

The message’s contents (not URL-encoded).

field EventFactoryClass: type[AbstractEventFactory] | None = <class 'botocraft.eventbridge.factory.EventFactory'>

The factory class for the event.

This is used to create events from messages received from the queue.

field MD5OfBody: str | None = None

An MD5 digest of the non-URL-encoded message body string.

field MD5OfMessageAttributes: str | None = None

An MD5 digest of the non-URL-encoded message attribute string.

You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see RFC1321.

field MessageAttributes: dict[str, MessageAttributeValue] | None [Optional]

Each message attribute consists of a Name, Type, and Value.

For more information, see Amazon SQS message attributes in the Amazon SQS Developer Guide.

field MessageId: str | None = None

A unique identifier for the message.

A ``MessageId``is considered unique across all Amazon Web Services accounts for an extended period of time.

field QueueUrl: str | None = None

The URL of the queue.

This is a unique identifier for the queue.

field ReceiptHandle: str | None = None

An identifier associated with the act of receiving the message.

A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

manager_class

alias of MessageManager

delete()

Delete the model.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

save(**kwargs)

Save the model.

send(DelaySeconds: int | None = None, MessageDeduplicationId: str | None = None, MessageGroupId: str | None = None) str[source]

Send this message to the queue.

Keyword Arguments:
  • DelaySeconds – The length of time, in seconds, for which to delay a specific message. Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive DelaySeconds value become available for processing after the delay period is finished. If you don’t specify a value, the default value for the queue applies.

  • MessageDeduplicationId – This parameter applies only to FIFO (first-in-first-out) queues.

  • MessageGroupIdMessageGroupId is an attribute used in Amazon SQS FIFO (First-In-First-Out) and standard queues. In FIFO queues, MessageGroupId organizes messages into distinct groups. Messages within the same message group are always processed one at a time, in strict order, ensuring that no two messages from the same group are processed simultaneously. In standard queues, using MessageGroupId enables fair queues. It is used to identify the tenant a message belongs to, helping maintain consistent message dwell time across all tenants during noisy neighbor events. Unlike FIFO queues, messages with the same MessageGroupId can be processed in parallel, maintaining the high throughput of standard queues.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

property arn: str | None

Get the ARN of the model instance.

Returns:

The ARN of the model instance.

Raises:

ValueError – If the model has no ARN identity field.

property event: EventBridgeEvent | dict[str, Any]

Convert the message body to an event object using the EventFactory class.

Returns:

An event object or dict representing the message body.

property name: str | None

Get the name of the model instance.

Returns:

The name of the model instance.

Raises:

ValueError – If the model has no name identity field.

objects: ClassVar[classproperty]

Get the manager for this model, and set it as a class property

property pk: OrderedDict[str, Any]

The primary key of the message.

This can be used to delete the message from its queue with the botocraft.services.sqs.MessageManager.delete method.

pydantic model botocraft.services.sqs.Queue[source]

Bases: TagsDictMixin, QueueModelMixin, PrimaryBoto3Model

Show JSON schema
{
   "title": "Queue",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "QueueUrl": {
         "title": "Queueurl",
         "type": "string"
      },
      "QueueName": {
         "title": "Queuename",
         "type": "string"
      },
      "Attributes": {
         "anyOf": [
            {
               "additionalProperties": {
                  "type": "string"
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "title": "Attributes"
      },
      "tags": {
         "items": {
            "$ref": "#/$defs/Tag"
         },
         "title": "Tags",
         "type": "array"
      }
   },
   "$defs": {
      "Tag": {
         "description": "The metadata that you apply to a resource to help you categorize and\norganize them. Each tag consists of a key and an optional value. You define\nthem.\n\nThe following basic restrictions apply to tags:\n\n* Maximum number of tags per resource - 50\n* For each resource, each tag key must be unique, and each tag key can have\n  only one value.\n* Maximum key length - 128 Unicode characters in UTF-8\n* Maximum value length - 256 Unicode characters in UTF-8\n* If your tagging schema is used across multiple services and resources,\n  remember that other services may have restrictions on allowed characters.\n  Generally allowed characters are: letters, numbers, and spaces representable in\n  UTF-8, and the following characters: + - = . _ : / @.\n* Tag keys and values are case-sensitive.\n* Do not use ``aws:``, ``AWS:``, or any upper or lowercase combination of such\n  as a prefix for either keys or values as it is reserved for Amazon Web Services\n  use. You cannot edit or delete tag keys or values with this prefix. Tags with\n  this prefix do not count against your tags per resource limit.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "Key": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Key"
            },
            "Value": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Value"
            }
         },
         "title": "Tag",
         "type": "object"
      }
   },
   "required": [
      "QueueUrl",
      "QueueName"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field Attributes: dict[str, str] | None [Optional]

The attributes of the queue.

This is a dictionary of attribute names and values.

field QueueName: str [Required]

The name of the queue.

This is a unique identifier for the queue.

field QueueUrl: str [Required]

The URL of the queue.

This is a unique identifier for the queue.

field Tags: list[botocraft.services.common.Tag] [Optional] (alias 'tags')

The tags of the queue.

This is a list of Tag objects.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

manager_class

alias of QueueManager

tag_class

alias of Tag

add_permission(Label: str, AWSAccountIds: list[str], Actions: list[str]) None[source]

Add permission to the queue.

Parameters:
  • Label – The unique identification of the permission you’re setting (for example, AliceSendMessage). Maximum 80 characters. Allowed characters include alphanumeric characters, hyphens (-), and underscores (_).

  • AWSAccountIds – The Amazon Web Services account numbers of the principals who are to receive permission. For information about locating the Amazon Web Services account identification, see Your Amazon Web Services Identifiers in the Amazon SQS Developer Guide.

  • Actions – The action the client wants to allow for the specified principal. Valid values: the name of any action or *.

delete()

Delete the model.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

poll(EventFactoryClass: AbstractEventFactory | None = None) Generator[Message, None, None]

Eternally poll for messages in the queue, and yield them as EventBridgeEvent objects or dicts (if we can’t identify the event) as they arrive. This is useful for a job that needs to listen continuously for messages on a queue.

Keyword Arguments:

EventFactoryClass – The class to use to convert the message body to an event object. If not provided, the default EventFactory class will be used.

Yields:

A Message from the queue

purge() None[source]

Purge the queue.

receive(MessageAttributeNames: list[str] | None = None, MaxNumberOfMessages: int | None = None, VisibilityTimeout: int | None = None, WaitTimeSeconds: int | None = None, ReceiveRequestAttemptId: str | None = None, EventFactoryClass: type[botocraft.eventbridge.factory.AbstractEventFactory] | None = None) list[botocraft.services.sqs.Message][source]

Receive messages from the queue.

Keyword Arguments:
  • MessageAttributeNames – The name of the message attribute, where N is the index.

  • MaxNumberOfMessages – The maximum number of messages to return. Amazon SQS never returns more messages than this value (however, fewer messages might be returned). Valid values: 1 to 10. Default: 1.

  • VisibilityTimeout – The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request. If not specified, the default visibility timeout for the queue is used, which is 30 seconds.

  • WaitTimeSeconds – The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a message is available, the call returns sooner than WaitTimeSeconds. If no messages are available and the wait time expires, the call does not return a message list. If you are using the Java SDK, it returns a ReceiveMessageResponse object, which has a empty list instead of a Null object.

  • ReceiveRequestAttemptId – This parameter applies only to FIFO (first-in-first-out) queues.

  • EventFactoryClass – the value to set for EventFactoryClass

remove_permission(Label: str) None[source]

Remove permission from the queue.

Parameters:

Label – The identification of the permission to remove. This is the label added using the AddPermission action.

save(**kwargs)

Save the model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

property arn: str | None

Get the ARN of the model instance.

Returns:

The ARN of the model instance.

Raises:

ValueError – If the model has no ARN identity field.

property name: str | None

Return the name of the model. This is the value of the QueueName attribute.

Returns:

The name of the model instance.

objects: ClassVar[classproperty]

Get the manager for this model, and set it as a class property

property pk: str | None

Return the primary key of the model. This is the value of the QueueUrl attribute.

Returns:

The primary key of the model instance.

property tags: TagsDict

Get the tags for the model instance.

Returns:

The tags for the model instance.

Managers

Managers work with the primary models to provide a high-level interface to the AWS service. They are responsible for creating, updating, and deleting the resources in the service, as well as any additional operations that are available for those models.

class botocraft.services.sqs.MessageManager[source]

Bases: Boto3ModelManager

delete(QueueUrl: str, ReceiptHandle: str) None[source]

Deletes the specified message from the specified queue. To select the message to delete, use the ReceiptHandle of the message (not the MessageId which you receive when you send the message). Amazon SQS can delete a message from a queue even if a visibility timeout setting causes the message to be locked by another consumer. Amazon SQS automatically deletes messages left in a queue longer than the retention period configured for the queue.

Parameters:
  • QueueUrl – The URL of the Amazon SQS queue from which messages are deleted.

  • ReceiptHandle – The receipt handle associated with the message to delete.

send(QueueUrl: str, MessageBody: str, *, DelaySeconds: int | None = None, MessageAttributes: dict[str, botocraft.services.sqs.MessageAttributeValue] | None = None, MessageSystemAttributes: dict[Literal['AWSTraceHeader'], botocraft.services.sqs.MessageSystemAttributeValue] | None = None, MessageDeduplicationId: str | None = None, MessageGroupId: str | None = None) str[source]

Delivers a message to the specified queue.

Parameters:
  • QueueUrl – The URL of the Amazon SQS queue to which a message is sent.

  • MessageBody – The message to send. The minimum size is one character. The maximum size is 1 MiB or 1,048,576 bytes

Keyword Arguments:
  • DelaySeconds – The length of time, in seconds, for which to delay a specific message. Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive DelaySeconds value become available for processing after the delay period is finished. If you don’t specify a value, the default value for the queue applies.

  • MessageAttributes

    Each message attribute consists of a Name, Type, and Value. For more information, see Amazon SQS message attributes in the Amazon SQS Developer Guide.

  • MessageSystemAttributes – The message system attribute to send. Each message system attribute consists of a Name, Type, and Value.

  • MessageDeduplicationId – This parameter applies only to FIFO (first-in-first-out) queues.

  • MessageGroupIdMessageGroupId is an attribute used in Amazon SQS FIFO (First-In-First-Out) and standard queues. In FIFO queues, MessageGroupId organizes messages into distinct groups. Messages within the same message group are always processed one at a time, in strict order, ensuring that no two messages from the same group are processed simultaneously. In standard queues, using MessageGroupId enables fair queues. It is used to identify the tenant a message belongs to, helping maintain consistent message dwell time across all tenants during noisy neighbor events. Unlike FIFO queues, messages with the same MessageGroupId can be processed in parallel, maintaining the high throughput of standard queues.

service_name: str = 'sqs'

ec2, s3, etc.

Type:

The name of the boto3 service. Example

class botocraft.services.sqs.QueueManager[source]

Bases: QueueManagerMixin, Boto3ModelManager

add_permission(QueueUrl: str, Label: str, AWSAccountIds: list[str], Actions: list[str]) None[source]

Adds a permission to a queue for a specific principal. This allows sharing access to the queue.

Parameters:
  • QueueUrl – The URL of the Amazon SQS queue to which permissions are added.

  • Label – The unique identification of the permission you’re setting (for example, AliceSendMessage). Maximum 80 characters. Allowed characters include alphanumeric characters, hyphens (-), and underscores (_).

  • AWSAccountIds

    The Amazon Web Services account numbers of the principals who are to receive permission. For information about locating the Amazon Web Services account identification, see Your Amazon Web Services Identifiers in the Amazon SQS Developer Guide.

  • Actions – The action the client wants to allow for the specified principal. Valid values: the name of any action or *.

batch_delete_messages(QueueUrl: str, Entries: list[botocraft.services.sqs.DeleteMessageBatchRequestEntry]) DeleteMessageBatchResult[source]

Deletes up to ten messages from the specified queue. This is a batch version of DeleteMessage. The result of the action on each message is reported individually in the response.

Parameters:
  • QueueUrl – The URL of the Amazon SQS queue from which messages are deleted.

  • Entries – Lists the receipt handles for the messages to be deleted.

batch_send_messages(QueueUrl: str, Entries: list[botocraft.services.sqs.SendMessageBatchRequestEntry]) SendMessageBatchResult[source]

You can use SendMessageBatch to send up to 10 messages to the specified queue by assigning either identical or different values to each message (or by not assigning values at all). This is a batch version of SendMessage. For a FIFO queue, multiple messages within a single batch are enqueued in the order they are sent.

Parameters:
  • QueueUrl – The URL of the Amazon SQS queue to which batched messages are sent.

  • Entries – A list of SendMessageBatchRequestEntry items.

change_message_visibility(QueueUrl: str, ReceiptHandle: str, VisibilityTimeout: int) None[source]

Changes the visibility timeout of a specified message in a queue to a new value. The default visibility timeout for a message is 30 seconds. The minimum is 0 seconds. The maximum is 12 hours. For more information, see Visibility Timeout in the Amazon SQS Developer Guide.

Parameters:
  • QueueUrl – The URL of the Amazon SQS queue whose message’s visibility is changed.

  • ReceiptHandle – The receipt handle associated with the message, whose visibility timeout is changed. This parameter is returned by the ReceiveMessage action.

  • VisibilityTimeout – The new value for the message’s visibility timeout (in seconds). Values range: 0 to 43200. Maximum: 12 hours.

change_message_visibility_batch(QueueUrl: str, Entries: list[botocraft.services.sqs.ChangeMessageVisibilityBatchRequestEntry]) ChangeMessageVisibilityBatchResult[source]

Changes the visibility timeout of multiple messages. This is a batch version of ChangeMessageVisibility. The result of the action on each message is reported individually in the response. You can send up to 10 ChangeMessageVisibility requests with each ChangeMessageVisibilityBatch action.

Parameters:
  • QueueUrl – The URL of the Amazon SQS queue whose messages’ visibility is changed.

  • Entries – Lists the receipt handles of the messages for which the visibility timeout must be changed.

create(model: Queue) str[source]

Creates a new standard or FIFO queue. You can pass one or more attributes in the request. Keep the following in mind:

Parameters:

model – The Queue to create.

delete(QueueUrl: str) None[source]

Deletes the queue specified by the QueueUrl, regardless of the queue’s contents.

Parameters:

QueueUrl – The URL of the Amazon SQS queue to delete.

delete_message(QueueUrl: str, ReceiptHandle: str) None[source]

Deletes the specified message from the specified queue. To select the message to delete, use the ReceiptHandle of the message (not the MessageId which you receive when you send the message). Amazon SQS can delete a message from a queue even if a visibility timeout setting causes the message to be locked by another consumer. Amazon SQS automatically deletes messages left in a queue longer than the retention period configured for the queue.

Parameters:
  • QueueUrl – The URL of the Amazon SQS queue from which messages are deleted.

  • ReceiptHandle – The receipt handle associated with the message to delete.

list(*, QueueNamePrefix: str | None = None) PrimaryBoto3ModelQuerySet[source]

Returns a list of your queues in the current region. The response includes a maximum of 1,000 results. If you specify a value for the optional QueueNamePrefix parameter, only queues with a name that begins with the specified value are returned.

Keyword Arguments:

QueueNamePrefix – A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.

purge(QueueUrl: str) None[source]

Deletes available messages in a queue (including in-flight messages) specified by the QueueURL parameter.

Parameters:

QueueUrl – The URL of the queue from which the PurgeQueue action deletes messages.

receive_messages(QueueUrl: str, *, AttributeNames: list[Literal['All', 'Policy', 'VisibilityTimeout', 'MaximumMessageSize', 'MessageRetentionPeriod', 'ApproximateNumberOfMessages', 'ApproximateNumberOfMessagesNotVisible', 'CreatedTimestamp', 'LastModifiedTimestamp', 'QueueArn', 'ApproximateNumberOfMessagesDelayed', 'DelaySeconds', 'ReceiveMessageWaitTimeSeconds', 'RedrivePolicy', 'FifoQueue', 'ContentBasedDeduplication', 'KmsMasterKeyId', 'KmsDataKeyReusePeriodSeconds', 'DeduplicationScope', 'FifoThroughputLimit', 'RedriveAllowPolicy', 'SqsManagedSseEnabled']] | None = None, MessageSystemAttributeNames: list[Literal['All', 'SenderId', 'SentTimestamp', 'ApproximateReceiveCount', 'ApproximateFirstReceiveTimestamp', 'SequenceNumber', 'MessageDeduplicationId', 'MessageGroupId', 'AWSTraceHeader', 'DeadLetterQueueSourceArn']] | None = None, MessageAttributeNames: list[str] | None = None, MaxNumberOfMessages: int | None = None, VisibilityTimeout: int | None = None, WaitTimeSeconds: int | None = None, ReceiveRequestAttemptId: str | None = None, EventFactoryClass: type[botocraft.eventbridge.factory.AbstractEventFactory] | None = None) list[botocraft.services.sqs.Message][source]

Retrieves one or more messages (up to 10), from the specified queue. Using the WaitTimeSeconds parameter enables long-poll support. For more information, see Amazon SQS Long Polling in the Amazon SQS Developer Guide.

Parameters:

QueueUrl – The URL of the Amazon SQS queue from which messages are received.

Keyword Arguments:
  • AttributeNames – This parameter has been discontinued but will be supported for backward compatibility. To provide attribute names, you are encouraged to use MessageSystemAttributeNames.

  • MessageSystemAttributeNames – A list of attributes that need to be returned along with each message. These attributes include:

  • MessageAttributeNames – The name of the message attribute, where N is the index.

  • MaxNumberOfMessages – The maximum number of messages to return. Amazon SQS never returns more messages than this value (however, fewer messages might be returned). Valid values: 1 to 10. Default: 1.

  • VisibilityTimeout – The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request. If not specified, the default visibility timeout for the queue is used, which is 30 seconds.

  • WaitTimeSeconds – The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a message is available, the call returns sooner than WaitTimeSeconds. If no messages are available and the wait time expires, the call does not return a message list. If you are using the Java SDK, it returns a ReceiveMessageResponse object, which has a empty list instead of a Null object.

  • ReceiveRequestAttemptId – This parameter applies only to FIFO (first-in-first-out) queues.

  • EventFactoryClass – The class to use to convert the message body to an event object. If not provided, the default EventFactory class will be used.

remove_permission(QueueUrl: str, Label: str) None[source]

Revokes any permissions in the queue policy that matches the specified Label parameter.

Parameters:
  • QueueUrl – The URL of the Amazon SQS queue from which permissions are removed.

  • Label – The identification of the permission to remove. This is the label added using the AddPermission action.

service_name: str = 'sqs'

ec2, s3, etc.

Type:

The name of the boto3 service. Example

Secondary Models

Secondary models are models that are used by the primary models to organize their data. They are not acted on directly, but are used to describe the structure of the fields in the primary models or other secondary models.

pydantic model botocraft.services.sqs.MessageAttributeValue[source]

Bases: Boto3Model

The user-specified message attribute value. For string data types, the Value attribute has the same restrictions on the content as the message body. For more information, see SendMessage.

Name, type, value and the message body must not be empty or null. All parts of the message attribute, including Name, Type, and Value, are part of the message size restriction (1 MiB or 1,048,576 bytes).

Show JSON schema
{
   "title": "MessageAttributeValue",
   "description": "The user-specified message attribute value. For string data types, the ``Value``\nattribute has the same restrictions on the content as the message body. For more\ninformation, see  ``SendMessage.``\n\n``Name``, ``type``, ``value`` and the message body must not be empty or null. All parts of the message attribute,\nincluding ``Name``, ``Type``, and ``Value``, are part of the message size restriction (1 MiB or 1,048,576 bytes).",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "StringValue": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Stringvalue"
      },
      "BinaryValue": {
         "anyOf": [
            {
               "format": "binary",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Binaryvalue"
      },
      "StringListValues": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Stringlistvalues"
      },
      "BinaryListValues": {
         "anyOf": [
            {
               "items": {
                  "format": "binary",
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Binarylistvalues"
      },
      "DataType": {
         "title": "Datatype",
         "type": "string"
      }
   },
   "required": [
      "DataType"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field BinaryListValues: builtins.list[bytes] | None [Optional]

Not implemented.

Reserved for future use.

field BinaryValue: bytes | None = None

Binary type attributes can store any binary data, such as compressed data, encrypted data, or images.

field DataType: str [Required]

Amazon SQS supports the following logical data types: String, Number, and Binary. For the Number data type, you must use StringValue.

field StringListValues: builtins.list[str] | None [Optional]

Not implemented.

Reserved for future use.

field StringValue: str | None = None

Strings are Unicode with UTF-8 binary encoding.

For a list of code values, see ASCII Printable Characters.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.sqs.MessageSystemAttributeValue[source]

Bases: Boto3Model

The user-specified message system attribute value. For string data types, the Value attribute has the same restrictions on the content as the message body. For more information, see SendMessage.

Name, type, value and the message body must not be empty or null.

Show JSON schema
{
   "title": "MessageSystemAttributeValue",
   "description": "The user-specified message system attribute value. For string data types, the\n``Value`` attribute has the same restrictions on the content as the message body.\nFor more information, see  ``SendMessage.``\n\n``Name``, ``type``, ``value`` and the message body must not be empty or null.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "StringValue": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Stringvalue"
      },
      "BinaryValue": {
         "anyOf": [
            {
               "format": "binary",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Binaryvalue"
      },
      "StringListValues": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Stringlistvalues"
      },
      "BinaryListValues": {
         "anyOf": [
            {
               "items": {
                  "format": "binary",
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Binarylistvalues"
      },
      "DataType": {
         "title": "Datatype",
         "type": "string"
      }
   },
   "required": [
      "DataType"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field BinaryListValues: builtins.list[bytes] | None [Optional]

Not implemented.

Reserved for future use.

field BinaryValue: bytes | None = None

Binary type attributes can store any binary data, such as compressed data, encrypted data, or images.

field DataType: str [Required]

Amazon SQS supports the following logical data types: String, Number, and Binary. For the Number data type, you must use StringValue.

field StringListValues: builtins.list[str] | None [Optional]

Not implemented.

Reserved for future use.

field StringValue: str | None = None

Strings are Unicode with UTF-8 binary encoding.

For a list of code values, see ASCII Printable Characters.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

Request/Response Models

Request/response models are models that are used to describe the structure of the data that is sent to and received from the AWS service. They are used by the managers to send requests to the service and to parse the responses that are received.

You will not often use them directly – typically they are used by the managers internally to send requests and parse responses – but they are included here for completeness, and because occasionally we return them directly to you because they have some useful additional information.

pydantic model botocraft.services.sqs.BatchResultErrorEntry[source]

Bases: Boto3Model

Gives a detailed description of the result of an action on each entry in the request.

Show JSON schema
{
   "title": "BatchResultErrorEntry",
   "description": "Gives a detailed description of the result of an action on each entry in the\nrequest.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "Id": {
         "title": "Id",
         "type": "string"
      },
      "SenderFault": {
         "title": "Senderfault",
         "type": "boolean"
      },
      "Code": {
         "title": "Code",
         "type": "string"
      },
      "Message": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Message"
      }
   },
   "required": [
      "Id",
      "SenderFault",
      "Code"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field Code: str [Required]

An error code representing why the action failed on this entry.

field Id: str [Required]

The Id of an entry in a batch request.

field Message: str | None = None

A message explaining why the action failed on this entry.

field SenderFault: bool [Required]

Specifies whether the error happened due to the caller of the batch API action.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.sqs.ChangeMessageVisibilityBatchRequestEntry[source]

Bases: Boto3Model

Encloses a receipt handle and an entry ID for each message in ChangeMessageVisibilityBatch.

Show JSON schema
{
   "title": "ChangeMessageVisibilityBatchRequestEntry",
   "description": "Encloses a receipt handle and an entry ID for each message in\n``ChangeMessageVisibilityBatch.``",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "Id": {
         "title": "Id",
         "type": "string"
      },
      "ReceiptHandle": {
         "title": "Receipthandle",
         "type": "string"
      },
      "VisibilityTimeout": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Visibilitytimeout"
      }
   },
   "required": [
      "Id",
      "ReceiptHandle"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field Id: str [Required]

An identifier for this particular receipt handle used to communicate the result.

field ReceiptHandle: str [Required]

A receipt handle.

field VisibilityTimeout: int | None = None

The new value (in seconds) for the message’s visibility timeout.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.sqs.ChangeMessageVisibilityBatchResult[source]

Bases: Boto3Model

For each message in the batch, the response contains a ChangeMessageVisibilityBatchResultEntry tag if the message succeeds or a BatchResultErrorEntry tag if the message fails.

Show JSON schema
{
   "title": "ChangeMessageVisibilityBatchResult",
   "description": "For each message in the batch, the response contains a\n``ChangeMessageVisibilityBatchResultEntry``  tag if the message succeeds or a\n``BatchResultErrorEntry``  tag if the message fails.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "Successful": {
         "items": {
            "$ref": "#/$defs/ChangeMessageVisibilityBatchResultEntry"
         },
         "title": "Successful",
         "type": "array"
      },
      "Failed": {
         "items": {
            "$ref": "#/$defs/BatchResultErrorEntry"
         },
         "title": "Failed",
         "type": "array"
      }
   },
   "$defs": {
      "BatchResultErrorEntry": {
         "description": "Gives a detailed description of the result of an action on each entry in the\nrequest.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "Id": {
               "title": "Id",
               "type": "string"
            },
            "SenderFault": {
               "title": "Senderfault",
               "type": "boolean"
            },
            "Code": {
               "title": "Code",
               "type": "string"
            },
            "Message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Message"
            }
         },
         "required": [
            "Id",
            "SenderFault",
            "Code"
         ],
         "title": "BatchResultErrorEntry",
         "type": "object"
      },
      "ChangeMessageVisibilityBatchResultEntry": {
         "description": "Encloses the ``Id`` of an entry in  ``ChangeMessageVisibilityBatch.``",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "Id": {
               "title": "Id",
               "type": "string"
            }
         },
         "required": [
            "Id"
         ],
         "title": "ChangeMessageVisibilityBatchResultEntry",
         "type": "object"
      }
   },
   "required": [
      "Successful",
      "Failed"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field Failed: builtins.list[BatchResultErrorEntry] [Required]

A list of BatchResultErrorEntry items.

field Successful: builtins.list[ChangeMessageVisibilityBatchResultEntry] [Required]

A list of ChangeMessageVisibilityBatchResultEntry items.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.sqs.ChangeMessageVisibilityBatchResultEntry[source]

Bases: Boto3Model

Encloses the Id of an entry in ChangeMessageVisibilityBatch.

Show JSON schema
{
   "title": "ChangeMessageVisibilityBatchResultEntry",
   "description": "Encloses the ``Id`` of an entry in  ``ChangeMessageVisibilityBatch.``",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "Id": {
         "title": "Id",
         "type": "string"
      }
   },
   "required": [
      "Id"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field Id: str [Required]

Represents a message whose visibility timeout has been changed successfully.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.sqs.CreateQueueResult[source]

Bases: Boto3Model

Returns the QueueUrl attribute of the created queue.

Show JSON schema
{
   "title": "CreateQueueResult",
   "description": "Returns the ``QueueUrl`` attribute of the created queue.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "QueueUrl": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Queueurl"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field QueueUrl: str | None = None

The URL of the created Amazon SQS queue.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.sqs.DeleteMessageBatchRequestEntry[source]

Bases: Boto3Model

Encloses a receipt handle and an identifier for it.

Show JSON schema
{
   "title": "DeleteMessageBatchRequestEntry",
   "description": "Encloses a receipt handle and an identifier for it.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "Id": {
         "title": "Id",
         "type": "string"
      },
      "ReceiptHandle": {
         "title": "Receipthandle",
         "type": "string"
      }
   },
   "required": [
      "Id",
      "ReceiptHandle"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field Id: str [Required]

The identifier for this particular receipt handle.

This is used to communicate the result.

field ReceiptHandle: str [Required]

A receipt handle.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.sqs.DeleteMessageBatchResult[source]

Bases: Boto3Model

For each message in the batch, the response contains a DeleteMessageBatchResultEntry tag if the message is deleted or a BatchResultErrorEntry tag if the message can’t be deleted.

Show JSON schema
{
   "title": "DeleteMessageBatchResult",
   "description": "For each message in the batch, the response contains a\n``DeleteMessageBatchResultEntry``  tag if the message is deleted or a\n``BatchResultErrorEntry``  tag if the message can't be deleted.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "Successful": {
         "items": {
            "$ref": "#/$defs/DeleteMessageBatchResultEntry"
         },
         "title": "Successful",
         "type": "array"
      },
      "Failed": {
         "items": {
            "$ref": "#/$defs/BatchResultErrorEntry"
         },
         "title": "Failed",
         "type": "array"
      }
   },
   "$defs": {
      "BatchResultErrorEntry": {
         "description": "Gives a detailed description of the result of an action on each entry in the\nrequest.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "Id": {
               "title": "Id",
               "type": "string"
            },
            "SenderFault": {
               "title": "Senderfault",
               "type": "boolean"
            },
            "Code": {
               "title": "Code",
               "type": "string"
            },
            "Message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Message"
            }
         },
         "required": [
            "Id",
            "SenderFault",
            "Code"
         ],
         "title": "BatchResultErrorEntry",
         "type": "object"
      },
      "DeleteMessageBatchResultEntry": {
         "description": "Encloses the ``Id`` of an entry in  ``DeleteMessageBatch.``",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "Id": {
               "title": "Id",
               "type": "string"
            }
         },
         "required": [
            "Id"
         ],
         "title": "DeleteMessageBatchResultEntry",
         "type": "object"
      }
   },
   "required": [
      "Successful",
      "Failed"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field Failed: builtins.list[BatchResultErrorEntry] [Required]

A list of BatchResultErrorEntry items.

field Successful: builtins.list[DeleteMessageBatchResultEntry] [Required]

A list of DeleteMessageBatchResultEntry items.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.sqs.DeleteMessageBatchResultEntry[source]

Bases: Boto3Model

Encloses the Id of an entry in DeleteMessageBatch.

Show JSON schema
{
   "title": "DeleteMessageBatchResultEntry",
   "description": "Encloses the ``Id`` of an entry in  ``DeleteMessageBatch.``",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "Id": {
         "title": "Id",
         "type": "string"
      }
   },
   "required": [
      "Id"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field Id: str [Required]

Represents a successfully deleted message.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.sqs.ListQueuesResult[source]

Bases: Boto3Model

A list of your queues.

Show JSON schema
{
   "title": "ListQueuesResult",
   "description": "A list of your queues.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "QueueUrls": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Queueurls"
      },
      "NextToken": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Nexttoken"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field NextToken: str | None = None

Pagination token to include in the next request.

Token value is null if there are no additional results to request, or if you did not set MaxResults in the request.

field QueueUrls: builtins.list[str] | None [Optional]

A list of queue URLs, up to 1,000 entries, or the value of MaxResults that you sent in the request.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.sqs.ReceiveMessageResult[source]

Bases: Boto3Model

A list of received messages.

Show JSON schema
{
   "title": "ReceiveMessageResult",
   "description": "A list of received messages.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "Messages": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Message"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "title": "Messages"
      }
   },
   "$defs": {
      "Message": {
         "description": "An Amazon SQS message.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "MessageId": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Messageid"
            },
            "ReceiptHandle": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Receipthandle"
            },
            "MD5OfBody": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Md5Ofbody"
            },
            "Body": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Body"
            },
            "Attributes": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "type": "string"
                     },
                     "propertyNames": {
                        "enum": [
                           "All",
                           "SenderId",
                           "SentTimestamp",
                           "ApproximateReceiveCount",
                           "ApproximateFirstReceiveTimestamp",
                           "SequenceNumber",
                           "MessageDeduplicationId",
                           "MessageGroupId",
                           "AWSTraceHeader",
                           "DeadLetterQueueSourceArn"
                        ]
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Attributes"
            },
            "MD5OfMessageAttributes": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Md5Ofmessageattributes"
            },
            "MessageAttributes": {
               "anyOf": [
                  {
                     "additionalProperties": {
                        "$ref": "#/$defs/MessageAttributeValue"
                     },
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Messageattributes"
            },
            "QueueUrl": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Queueurl"
            },
            "EventFactoryClass": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "title": "Eventfactoryclass"
            }
         },
         "title": "Message",
         "type": "object"
      },
      "MessageAttributeValue": {
         "description": "The user-specified message attribute value. For string data types, the ``Value``\nattribute has the same restrictions on the content as the message body. For more\ninformation, see  ``SendMessage.``\n\n``Name``, ``type``, ``value`` and the message body must not be empty or null. All parts of the message attribute,\nincluding ``Name``, ``Type``, and ``Value``, are part of the message size restriction (1 MiB or 1,048,576 bytes).",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "StringValue": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Stringvalue"
            },
            "BinaryValue": {
               "anyOf": [
                  {
                     "format": "binary",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Binaryvalue"
            },
            "StringListValues": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Stringlistvalues"
            },
            "BinaryListValues": {
               "anyOf": [
                  {
                     "items": {
                        "format": "binary",
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Binarylistvalues"
            },
            "DataType": {
               "title": "Datatype",
               "type": "string"
            }
         },
         "required": [
            "DataType"
         ],
         "title": "MessageAttributeValue",
         "type": "object"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field Messages: builtins.list[Message] | None [Optional]

A list of messages.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.sqs.SendMessageBatchRequestEntry[source]

Bases: Boto3Model

Contains the details of a single Amazon SQS message along with an Id.

Show JSON schema
{
   "title": "SendMessageBatchRequestEntry",
   "description": "Contains the details of a single Amazon SQS message along with an ``Id``.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "Id": {
         "title": "Id",
         "type": "string"
      },
      "MessageBody": {
         "title": "Messagebody",
         "type": "string"
      },
      "DelaySeconds": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Delayseconds"
      },
      "MessageAttributes": {
         "anyOf": [
            {
               "additionalProperties": {
                  "$ref": "#/$defs/MessageAttributeValue"
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "title": "Messageattributes"
      },
      "MessageSystemAttributes": {
         "anyOf": [
            {
               "additionalProperties": {
                  "$ref": "#/$defs/MessageSystemAttributeValue"
               },
               "propertyNames": {
                  "const": "AWSTraceHeader"
               },
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "title": "Messagesystemattributes"
      },
      "MessageDeduplicationId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Messagededuplicationid"
      },
      "MessageGroupId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Messagegroupid"
      }
   },
   "$defs": {
      "MessageAttributeValue": {
         "description": "The user-specified message attribute value. For string data types, the ``Value``\nattribute has the same restrictions on the content as the message body. For more\ninformation, see  ``SendMessage.``\n\n``Name``, ``type``, ``value`` and the message body must not be empty or null. All parts of the message attribute,\nincluding ``Name``, ``Type``, and ``Value``, are part of the message size restriction (1 MiB or 1,048,576 bytes).",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "StringValue": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Stringvalue"
            },
            "BinaryValue": {
               "anyOf": [
                  {
                     "format": "binary",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Binaryvalue"
            },
            "StringListValues": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Stringlistvalues"
            },
            "BinaryListValues": {
               "anyOf": [
                  {
                     "items": {
                        "format": "binary",
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Binarylistvalues"
            },
            "DataType": {
               "title": "Datatype",
               "type": "string"
            }
         },
         "required": [
            "DataType"
         ],
         "title": "MessageAttributeValue",
         "type": "object"
      },
      "MessageSystemAttributeValue": {
         "description": "The user-specified message system attribute value. For string data types, the\n``Value`` attribute has the same restrictions on the content as the message body.\nFor more information, see  ``SendMessage.``\n\n``Name``, ``type``, ``value`` and the message body must not be empty or null.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "StringValue": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Stringvalue"
            },
            "BinaryValue": {
               "anyOf": [
                  {
                     "format": "binary",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Binaryvalue"
            },
            "StringListValues": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Stringlistvalues"
            },
            "BinaryListValues": {
               "anyOf": [
                  {
                     "items": {
                        "format": "binary",
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "title": "Binarylistvalues"
            },
            "DataType": {
               "title": "Datatype",
               "type": "string"
            }
         },
         "required": [
            "DataType"
         ],
         "title": "MessageSystemAttributeValue",
         "type": "object"
      }
   },
   "required": [
      "Id",
      "MessageBody"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field DelaySeconds: int | None = None

The length of time, in seconds, for which a specific message is delayed.

Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive DelaySeconds value become available for processing after the delay period is finished. If you don’t specify a value, the default value for the queue is applied.

field Id: str [Required]

An identifier for a message in this batch used to communicate the result.

field MessageAttributes: dict[str, MessageAttributeValue] | None [Optional]

Each message attribute consists of a Name, Type, and Value.

For more information, see Amazon SQS message attributes in the Amazon SQS Developer Guide.

field MessageBody: str [Required]

The body of the message.

field MessageDeduplicationId: str | None = None

This parameter applies only to FIFO (first-in-first-out) queues.

field MessageGroupId: str | None = None

MessageGroupId is an attribute used in Amazon SQS FIFO (First-In-First-Out) and standard queues.

In FIFO queues, MessageGroupId organizes messages into distinct groups. Messages within the same message group are always processed one at a time, in strict order, ensuring that no two messages from the same group are processed simultaneously. In standard queues, using MessageGroupId enables fair queues. It is used to identify the tenant a message belongs to, helping maintain consistent message dwell time across all tenants during noisy neighbor events. Unlike FIFO queues, messages with the same MessageGroupId can be processed in parallel, maintaining the high throughput of standard queues.

field MessageSystemAttributes: dict[Literal['AWSTraceHeader'], MessageSystemAttributeValue] | None [Optional]

The message system attribute to send Each message system attribute consists of a Name, Type, and Value.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.sqs.SendMessageBatchResult[source]

Bases: Boto3Model

For each message in the batch, the response contains a SendMessageBatchResultEntry tag if the message succeeds or a BatchResultErrorEntry tag if the message fails.

Show JSON schema
{
   "title": "SendMessageBatchResult",
   "description": "For each message in the batch, the response contains a\n``SendMessageBatchResultEntry``  tag if the message succeeds or a\n``BatchResultErrorEntry``  tag if the message fails.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "Successful": {
         "items": {
            "$ref": "#/$defs/SendMessageBatchResultEntry"
         },
         "title": "Successful",
         "type": "array"
      },
      "Failed": {
         "items": {
            "$ref": "#/$defs/BatchResultErrorEntry"
         },
         "title": "Failed",
         "type": "array"
      }
   },
   "$defs": {
      "BatchResultErrorEntry": {
         "description": "Gives a detailed description of the result of an action on each entry in the\nrequest.",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "Id": {
               "title": "Id",
               "type": "string"
            },
            "SenderFault": {
               "title": "Senderfault",
               "type": "boolean"
            },
            "Code": {
               "title": "Code",
               "type": "string"
            },
            "Message": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Message"
            }
         },
         "required": [
            "Id",
            "SenderFault",
            "Code"
         ],
         "title": "BatchResultErrorEntry",
         "type": "object"
      },
      "SendMessageBatchResultEntry": {
         "description": "Encloses a ``MessageId`` for a successfully-enqueued message in a\n``SendMessageBatch.``",
         "properties": {
            "session": {
               "anyOf": [
                  {},
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Session"
            },
            "Id": {
               "title": "Id",
               "type": "string"
            },
            "MessageId": {
               "title": "Messageid",
               "type": "string"
            },
            "MD5OfMessageBody": {
               "title": "Md5Ofmessagebody",
               "type": "string"
            },
            "MD5OfMessageAttributes": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Md5Ofmessageattributes"
            },
            "MD5OfMessageSystemAttributes": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Md5Ofmessagesystemattributes"
            },
            "SequenceNumber": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Sequencenumber"
            }
         },
         "required": [
            "Id",
            "MessageId",
            "MD5OfMessageBody"
         ],
         "title": "SendMessageBatchResultEntry",
         "type": "object"
      }
   },
   "required": [
      "Successful",
      "Failed"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field Failed: builtins.list[BatchResultErrorEntry] [Required]

A list of BatchResultErrorEntry items with error details about each message that can’t be enqueued.

field Successful: builtins.list[SendMessageBatchResultEntry] [Required]

A list of SendMessageBatchResultEntry items.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.sqs.SendMessageBatchResultEntry[source]

Bases: Boto3Model

Encloses a MessageId for a successfully-enqueued message in a SendMessageBatch.

Show JSON schema
{
   "title": "SendMessageBatchResultEntry",
   "description": "Encloses a ``MessageId`` for a successfully-enqueued message in a\n``SendMessageBatch.``",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "Id": {
         "title": "Id",
         "type": "string"
      },
      "MessageId": {
         "title": "Messageid",
         "type": "string"
      },
      "MD5OfMessageBody": {
         "title": "Md5Ofmessagebody",
         "type": "string"
      },
      "MD5OfMessageAttributes": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Md5Ofmessageattributes"
      },
      "MD5OfMessageSystemAttributes": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Md5Ofmessagesystemattributes"
      },
      "SequenceNumber": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Sequencenumber"
      }
   },
   "required": [
      "Id",
      "MessageId",
      "MD5OfMessageBody"
   ]
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field Id: str [Required]

An identifier for the message in this batch.

field MD5OfMessageAttributes: str | None = None

An MD5 digest of the non-URL-encoded message attribute string.

You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see RFC1321.

field MD5OfMessageBody: str [Required]

An MD5 digest of the non-URL-encoded message body string.

You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see RFC1321.

field MD5OfMessageSystemAttributes: str | None = None

An MD5 digest of the non-URL-encoded message system attribute string.

You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see RFC1321.

field MessageId: str [Required]

An identifier for the message.

field SequenceNumber: str | None = None

This parameter applies only to FIFO (first-in-first-out) queues.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.

pydantic model botocraft.services.sqs.SendMessageResult[source]

Bases: Boto3Model

The MD5OfMessageBody and MessageId elements.

Show JSON schema
{
   "title": "SendMessageResult",
   "description": "The ``MD5OfMessageBody`` and ``MessageId`` elements.",
   "type": "object",
   "properties": {
      "session": {
         "anyOf": [
            {},
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Session"
      },
      "MD5OfMessageBody": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Md5Ofmessagebody"
      },
      "MD5OfMessageAttributes": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Md5Ofmessageattributes"
      },
      "MD5OfMessageSystemAttributes": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Md5Ofmessagesystemattributes"
      },
      "MessageId": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Messageid"
      },
      "SequenceNumber": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Sequencenumber"
      }
   }
}

Config:
  • validate_assignment: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field MD5OfMessageAttributes: str | None = None

An MD5 digest of the non-URL-encoded message attribute string.

You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see RFC1321.

field MD5OfMessageBody: str | None = None

An MD5 digest of the non-URL-encoded message body string.

You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see RFC1321.

field MD5OfMessageSystemAttributes: str | None = None

An MD5 digest of the non-URL-encoded message system attribute string.

You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest.

field MessageId: str | None = None

An attribute containing the MessageId of the message sent to the queue.

For more information, see Queue and Message Identifiers in the Amazon SQS Developer Guide.

field SequenceNumber: str | None = None

This parameter applies only to FIFO (first-in-first-out) queues.

field session: Any | None = None

The boto3 session to use for this model. This is set by the manager, and is used in relationships. We have to use Any here because we pydantic complains vociferously if we use boto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.

classmethod model_construct(_fields_set: set[str] | None = None, **values: Any) Self

Creates a new instance of the Model class with validated data.

Creates a new model setting __dict__ and __pydantic_fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed.

!!! note

model_construct() generally respects the model_config.extra setting on the provided model. That is, if model_config.extra == ‘allow’, then all extra passed values are added to the model instance’s __dict__ and __pydantic_extra__ fields. If model_config.extra == ‘ignore’ (the default), then all extra passed values are ignored. Because no validation is performed with a call to model_construct(), having model_config.extra == ‘forbid’ does not result in an error if extra values are passed, but they will be ignored.

Parameters:
  • _fields_set – A set of field names that were originally explicitly set during instantiation. If provided, this is directly used for the [model_fields_set][pydantic.BaseModel.model_fields_set] attribute. Otherwise, the field names from the values argument will be used.

  • values – Trusted or pre-validated data dictionary.

Returns:

A new instance of the Model class with validated data.

classmethod model_validate_strings(obj: Any, *, strict: bool | None = None, context: Any | None = None, by_alias: bool | None = None, by_name: bool | None = None) Self

Validate the given object with string data against the Pydantic model.

Parameters:
  • obj – The object containing string data to validate.

  • strict – Whether to enforce types strictly.

  • context – Extra variables to pass to the validator.

  • by_alias – Whether to use the field’s alias when validating against the provided input data.

  • by_name – Whether to use the field’s name when validating against the provided input data.

Returns:

The validated Pydantic model.

set_session(session: Session) None

Set the boto3 session for this model.

Parameters:

session – The boto3 session to use.

Returns:

The model instance.

transform(attribute: str, transformer: str | None) Any

Transform an attribute using a regular expression into something else before it is returned.

Important

This only makes sense for attributes that are strings.

transformer is a regular expression that will be used to transform the value of the attribute.

  • If the attribute is None, it will be returned verbatim.

  • If transformer is None, the attribute will be returned verbatim.

  • If transformer has no named groups, the attribute will be replaced with the value of the first group.

  • If transformer has named groups, the attribute will be replaced with a dictionary of the named groups.

Raises:
  • ValueError – If the attribute does not exist on the model.

  • RuntimeError – If the transformer fails to match the attribute value.

Parameters:
  • attribute – The attribute to transform.

  • transformer – The regular expression to use to transform the attribute.

Returns:

The transformed attribute.