S3 (s3)
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.s3.Bucket[source]
Bases:
TagsDictMixin,PrimaryBoto3ModelShow JSON schema
{ "title": "Bucket", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "BucketName": { "title": "Bucketname", "type": "string" }, "BucketArn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Bucketarn" }, "Region": { "title": "Region", "type": "string" }, "CreationDate": { "format": "date-time", "title": "Creationdate", "type": "string" }, "ACL": { "anyOf": [ { "enum": [ "private", "public-read", "public-read-write", "authenticated-read", "aws-exec-read", "bucket-owner-read", "bucket-owner-full-control" ], "type": "string" }, { "type": "null" } ], "default": "private", "title": "Acl" }, "LoggingConfiguration": { "anyOf": [ { "$ref": "#/$defs/BucketLoggingConfiguration" }, { "type": "null" } ] }, "VersioningEnabled": { "title": "Versioningenabled", "type": "boolean" }, "MFADelete": { "default": false, "title": "Mfadelete", "type": "boolean" }, "ObjectOwnership": { "anyOf": [ { "enum": [ "BucketOwnerEnforced", "BucketOwnerPreferred", "ObjectWriter" ], "type": "string" }, { "type": "null" } ], "default": "BucketOwnerPreferred", "title": "Objectownership" }, "CORSRules": { "anyOf": [ { "items": { "$ref": "#/$defs/S3CORSRule" }, "type": "array" }, { "type": "null" } ], "title": "Corsrules" }, "Tags": { "items": { "$ref": "#/$defs/Tag" }, "title": "Tags", "type": "array" } }, "$defs": { "BucketLoggingConfiguration": { "description": "Describes where logs are stored and the prefix that Amazon S3 assigns to all log\nobject keys for a bucket.\n\nFor more information, see\n`PUT Bucket logging <https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html>`_\nin the\n*Amazon S3 API Reference*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "TargetBucket": { "title": "Targetbucket", "type": "string" }, "TargetGrants": { "anyOf": [ { "items": { "$ref": "#/$defs/TargetGrant" }, "type": "array" }, { "type": "null" } ], "title": "Targetgrants" }, "TargetPrefix": { "title": "Targetprefix", "type": "string" }, "TargetObjectKeyFormat": { "anyOf": [ { "$ref": "#/$defs/S3TargetObjectKeyFormat" }, { "type": "null" } ], "default": null } }, "required": [ "TargetBucket", "TargetPrefix" ], "title": "BucketLoggingConfiguration", "type": "object" }, "S3CORSRule": { "description": "Specifies a cross-origin access rule for an Amazon S3 bucket.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "AllowedHeaders": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Allowedheaders" }, "AllowedMethods": { "items": { "type": "string" }, "title": "Allowedmethods", "type": "array" }, "AllowedOrigins": { "items": { "type": "string" }, "title": "Allowedorigins", "type": "array" }, "ExposeHeaders": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Exposeheaders" }, "MaxAgeSeconds": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Maxageseconds" } }, "required": [ "AllowedMethods", "AllowedOrigins" ], "title": "S3CORSRule", "type": "object" }, "S3Grantee": { "description": "Container for the person being granted permissions.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "EmailAddress": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Emailaddress" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "Type": { "enum": [ "CanonicalUser", "AmazonCustomerByEmail", "Group" ], "title": "Type", "type": "string" }, "URI": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Uri" } }, "required": [ "Type" ], "title": "S3Grantee", "type": "object" }, "S3PartitionedPrefix": { "description": "Amazon S3 keys for log objects are partitioned in the following format:\n\n``[DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-\n[UniqueString]``\n\nPartitionedPrefix defaults to EventTime delivery when server access logs are delivered.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "PartitionDateSource": { "anyOf": [ { "enum": [ "EventTime", "DeliveryTime" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Partitiondatesource" } }, "title": "S3PartitionedPrefix", "type": "object" }, "S3SimplePrefix": { "description": "To use simple format for S3 keys for log objects, set SimplePrefix to an empty\nobject.\n\n``[DestinationPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]``", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } }, "title": "S3SimplePrefix", "type": "object" }, "S3TargetObjectKeyFormat": { "description": "Amazon S3 key format for log objects.\n\nOnly one format, PartitionedPrefix or SimplePrefix, is allowed.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "SimplePrefix": { "anyOf": [ { "$ref": "#/$defs/S3SimplePrefix" }, { "type": "null" } ], "default": null }, "PartitionedPrefix": { "anyOf": [ { "$ref": "#/$defs/S3PartitionedPrefix" }, { "type": "null" } ], "default": null } }, "title": "S3TargetObjectKeyFormat", "type": "object" }, "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" }, "TargetGrant": { "description": "Container for granting information.\n\nBuckets that use the bucket owner enforced setting for Object Ownership don't support target grants. For more\ninformation, see `Permissions server access log delivery <https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-\nserver-access-logging.html#grant-log-delivery-permissions-general>`_ in the *Amazon S3 User Guide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Grantee": { "anyOf": [ { "$ref": "#/$defs/S3Grantee" }, { "type": "null" } ], "default": null }, "Permission": { "anyOf": [ { "enum": [ "FULL_CONTROL", "READ", "WRITE" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Permission" } }, "title": "TargetGrant", "type": "object" } }, "required": [ "BucketName", "BucketArn", "Region", "CreationDate", "LoggingConfiguration", "VersioningEnabled" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field ACL: Literal['private', 'public-read', 'public-read-write', 'authenticated-read', 'aws-exec-read', 'bucket-owner-read', 'bucket-owner-full-control'] | None = 'private'
The ACL for the bucket.
This is the ACL for the bucket.
- field BucketArn: str | None [Required]
The ARN of the bucket.
This is a unique identifier for the bucket. Some older buckets don’t have an ARN.
- field BucketName: str [Required]
The name of the bucket.
This is a unique identifier for the bucket, globally.
- field CORSRules: builtins.list[S3CORSRule] | None [Optional]
The CORS rules for the bucket.
- field CreationDate: datetime [Required]
The creation date of the bucket.
This is the date the bucket was created.
- field LoggingConfiguration: BucketLoggingConfiguration | None [Required]
The logging configuration for the bucket.
- field MFADelete: bool = False
Specifies whether MFA delete is enabled in the bucket versioning configuration.
- field ObjectOwnership: Literal['BucketOwnerEnforced', 'BucketOwnerPreferred', 'ObjectWriter'] | None = 'BucketOwnerPreferred'
The object ownership configuration for the bucket.
- field Tags: list[botocraft.services.common.Tag] [Optional]
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
Anyhere because we pydantic complains vociferously if we useboto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.
- manager_class
alias of
BucketManager
- tag_class
alias of
Tag
- delete()
Delete the model.
- delete_lifecycle() None[source]
Deletes the lifecycle configuration from the specified bucket.
Amazon S3 removes all the lifecycle configuration rules in the lifecycle subresource associated with the bucket. Your objects never expire, and Amazon S3 no longer automatically deletes any objects on the basis of rules contained in the deleted lifecycle configuration.
- get_lifecycle() GetBucketLifecycleConfigurationOutput[source]
Returns the lifecycle configuration information set on the bucket.
For information about lifecycle configuration, see Object Lifecycle Management.
- get_public_access_block() GetPublicAccessBlockOutput[source]
This operation is not supported for directory buckets.
- get_website() GetBucketWebsiteOutput[source]
This operation is not supported for directory buckets.
- 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.
- put_lifecycle(LifecycleConfiguration: BucketLifecycleConfiguration) PutBucketLifecycleConfigurationOutput[source]
Creates a new lifecycle configuration for the bucket or replaces an existing lifecycle configuration. Keep in mind that this will overwrite an existing lifecycle configuration, so if you want to retain any configuration details, they must be included in the new lifecycle configuration. For information about lifecycle configuration, see Managing your storage lifecycle.
- Parameters:
LifecycleConfiguration – Container for lifecycle rules. You can add as many as 1,000 rules.
- put_policy(Policy: str) None[source]
Applies an Amazon S3 bucket policy to an Amazon S3 bucket.
- Parameters:
Policy – The bucket policy as a JSON document.
- put_public_access_block(PublicAccessBlockConfiguration: S3PublicAccessBlockConfiguration) None[source]
This operation is not supported for directory buckets.
- Parameters:
PublicAccessBlockConfiguration – The
PublicAccessBlockconfiguration that you want to apply to this Amazon S3 bucket. You can enable the configuration options in any combination. For more information about when Amazon S3 considers a bucket or object public, see The Meaning of “Public” in the Amazon S3 User Guide.
- put_website(WebsiteConfiguration: WebsiteConfiguration) None[source]
This operation is not supported for directory buckets.
- Parameters:
WebsiteConfiguration – Container for the request.
- 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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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
BucketNameattribute.- Returns:
The name of the model instance.
- objects: ClassVar[classproperty] = <botocraft.services.s3.BucketManager object>
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
BucketNameattribute.- Returns:
The primary key of the model instance.
- pydantic model botocraft.services.s3.S3Object[source]
Bases:
TagsDictMixin,PrimaryBoto3ModelAn object consists of data and its descriptive metadata.
Show JSON schema
{ "title": "S3Object", "description": "An object consists of data and its descriptive metadata.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Key": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Key" }, "LastModified": { "default": null, "format": "date-time", "title": "Lastmodified", "type": "string" }, "ETag": { "default": null, "title": "Etag", "type": "string" }, "ChecksumAlgorithm": { "anyOf": [ { "items": { "enum": [ "CRC32", "CRC32C", "SHA1", "SHA256", "CRC64NVME", "SHA512", "MD5", "XXHASH64", "XXHASH3", "XXHASH128" ], "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Checksumalgorithm" }, "ChecksumType": { "default": null, "enum": [ "COMPOSITE", "FULL_OBJECT" ], "title": "Checksumtype", "type": "string" }, "Size": { "default": null, "title": "Size", "type": "integer" }, "StorageClass": { "anyOf": [ { "enum": [ "STANDARD", "REDUCED_REDUNDANCY", "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE", "OUTPOSTS", "GLACIER_IR", "SNOW", "EXPRESS_ONEZONE", "FSX_OPENZFS", "FSX_ONTAP" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Storageclass" }, "Owner": { "$ref": "#/$defs/S3Owner", "default": null }, "RestoreStatus": { "$ref": "#/$defs/S3RestoreStatus", "default": null }, "BucketName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Bucketname" }, "Tags": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Tags" } }, "$defs": { "S3Owner": { "description": "Container for the owner's display name and ID.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" } }, "title": "S3Owner", "type": "object" }, "S3RestoreStatus": { "description": "Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be\nretrieved. For more information about these storage classes and how to work with archived objects, see `Working with\narchived objects <https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html>`_ in the *Amazon S3 User\nGuide*.\n\nThis functionality is not supported for directory buckets. Directory buckets only support ``EXPRESS_ONEZONE`` (the S3\nExpress One Zone storage class) in Availability Zones and ``ONEZONE_IA`` (the S3 One Zone-Infrequent Access storage\nclass) in Dedicated Local Zones.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "IsRestoreInProgress": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Isrestoreinprogress" }, "RestoreExpiryDate": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Restoreexpirydate" } }, "title": "S3RestoreStatus", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field BucketName: str | None = None
The name of the bucket.
This is a unique identifier for the bucket, globally.
- field ChecksumAlgorithm: builtins.list[Literal['CRC32', 'CRC32C', 'SHA1', 'SHA256', 'CRC64NVME', 'SHA512', 'MD5', 'XXHASH64', 'XXHASH3', 'XXHASH128']] | None [Optional]
The algorithm that was used to create a checksum of the object.
- field ChecksumType: Literal['COMPOSITE', 'FULL_OBJECT'] = None
The checksum type that is used to calculate the object’s checksum value.
For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ETag: str = None
The entity tag is a hash of the object.
The ETag reflects changes only to the contents of an object, not its metadata. The ETag may or may not be an MD5 digest of the object data. Whether or not it is depends on how the object was created and how it is encrypted as described below:
- field Key: str | None = None
The name that you assign to an object.
You use the object key to retrieve the object.
- field RestoreStatus: S3RestoreStatus = None
Specifies the restoration status of an object.
Objects in certain storage classes must be restored before they can be retrieved. For more information about these storage classes and how to work with archived objects, see Working with archived objects in the Amazon S3 User Guide.
- field StorageClass: Literal['STANDARD', 'REDUCED_REDUNDANCY', 'GLACIER', 'STANDARD_IA', 'ONEZONE_IA', 'INTELLIGENT_TIERING', 'DEEP_ARCHIVE', 'OUTPOSTS', 'GLACIER_IR', 'SNOW', 'EXPRESS_ONEZONE', 'FSX_OPENZFS', 'FSX_ONTAP'] | None = None
The class of storage used to store the object.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.
- manager_class
alias of
S3ObjectManager
- contents() GetObjectOutput[source]
Retrieves an object from Amazon S3.
- 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.
- 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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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
Keyattribute.- Returns:
The name of the model instance.
- objects: ClassVar[classproperty] = <botocraft.services.s3.S3ObjectManager object>
Get the manager for this model, and set it as a class property
- property pk: OrderedDict[str, Any]
Get the primary key of the model instance.
- Returns:
The primary key of 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.s3.BucketManager[source]
Bases:
BucketManagerMixin,Boto3ModelManager- delete_bucket_policy(Bucket: str, *, ExpectedBucketOwner: str | None = None) None[source]
Deletes the policy of a specified bucket.
- Parameters:
Bucket – The bucket name.
- Keyword Arguments:
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- delete_lifecycle(Bucket: str, *, ExpectedBucketOwner: str | None = None) None[source]
Deletes the lifecycle configuration from the specified bucket. Amazon S3 removes all the lifecycle configuration rules in the lifecycle subresource associated with the bucket. Your objects never expire, and Amazon S3 no longer automatically deletes any objects on the basis of rules contained in the deleted lifecycle configuration.
- Parameters:
Bucket – The bucket name of the lifecycle to delete.
- Keyword Arguments:
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- delete_public_access_block(Bucket: str, *, ExpectedBucketOwner: str | None = None) None[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The Amazon S3 bucket whose
PublicAccessBlockconfiguration you want to delete.- Keyword Arguments:
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- delete_tags(Bucket: str, *, ExpectedBucketOwner: str | None = None) None[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket that has the tag set to be removed.
- Keyword Arguments:
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- delete_website(Bucket: str, *, ExpectedBucketOwner: str | None = None) None[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket name for which you want to remove the website configuration.
- Keyword Arguments:
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- get_bucket_policy(Bucket: str, *, ExpectedBucketOwner: str | None = None) str[source]
Returns the policy of a specified bucket.
- Parameters:
Bucket – The bucket name to get the bucket policy for.
- Keyword Arguments:
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- get_lifecycle(Bucket: str, *, ExpectedBucketOwner: str | None = None) GetBucketLifecycleConfigurationOutput[source]
Returns the lifecycle configuration information set on the bucket. For information about lifecycle configuration, see Object Lifecycle Management.
- Parameters:
Bucket – The name of the bucket for which to get the lifecycle information.
- Keyword Arguments:
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- get_public_access_block(Bucket: str, *, ExpectedBucketOwner: str | None = None) GetPublicAccessBlockOutput[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The name of the Amazon S3 bucket whose
PublicAccessBlockconfiguration you want to retrieve.- Keyword Arguments:
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- get_tags(Bucket: str, *, ExpectedBucketOwner: str | None = None) list[botocraft.services.common.Tag][source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The name of the bucket for which to get the tagging information.
- Keyword Arguments:
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- get_website(Bucket: str, *, ExpectedBucketOwner: str | None = None) GetBucketWebsiteOutput[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket name for which to get the website configuration.
- Keyword Arguments:
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- list(*, MaxBuckets: int | None = None, ContinuationToken: str | None = None, Prefix: str | None = None, BucketRegion: str | None = None) PrimaryBoto3ModelQuerySet[source]
This operation is not supported for directory buckets.
- Keyword Arguments:
MaxBuckets – Maximum number of buckets to be returned in response. When the number is more than the count of buckets that are owned by an Amazon Web Services account, return all the buckets in response.
ContinuationToken –
ContinuationTokenindicates to Amazon S3 that the list is being continued on this bucket with a token.ContinuationTokenis obfuscated and is not a real key. You can use thisContinuationTokenfor pagination of the list results.Prefix – Limits the response to bucket names that begin with the specified bucket name prefix.
BucketRegion – Limits the response to buckets that are located in the specified Amazon Web Services Region. The Amazon Web Services Region must be expressed according to the Amazon Web Services Region code, such as
us-west-2for the US West (Oregon) Region. For a list of the valid values for all of the Amazon Web Services Regions, see Regions and Endpoints.
- put_bucket_policy(Bucket: str, Policy: str, *, ContentMD5: str | None = None, ChecksumAlgorithm: Literal['CRC32', 'CRC32C', 'SHA1', 'SHA256', 'CRC64NVME', 'SHA512', 'MD5', 'XXHASH64', 'XXHASH3', 'XXHASH128'] | None = None, ConfirmRemoveSelfBucketAccess: bool | None = None, ExpectedBucketOwner: str | None = None) None[source]
Applies an Amazon S3 bucket policy to an Amazon S3 bucket.
- Parameters:
Bucket – The name of the bucket.
Policy – The bucket policy as a JSON document.
- Keyword Arguments:
ContentMD5 – The MD5 hash of the request body.
ChecksumAlgorithm – Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don’t use the SDK. When you send this header, there must be a corresponding
x-amz- checksum-algorithmorx-amz-trailerheader sent. Otherwise, Amazon S3 fails the request with the HTTP status code400 Bad Request.ConfirmRemoveSelfBucketAccess – Set this parameter to true to confirm that you want to remove your permissions to change this bucket policy in the future.
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- put_lifecycle(Bucket: str, LifecycleConfiguration: BucketLifecycleConfiguration, *, ChecksumAlgorithm: Literal['CRC32', 'CRC32C', 'SHA1', 'SHA256', 'CRC64NVME', 'SHA512', 'MD5', 'XXHASH64', 'XXHASH3', 'XXHASH128'] | None = None, ExpectedBucketOwner: str | None = None, TransitionDefaultMinimumObjectSize: Literal['varies_by_storage_class', 'all_storage_classes_128K'] | None = None) PutBucketLifecycleConfigurationOutput[source]
Creates a new lifecycle configuration for the bucket or replaces an existing lifecycle configuration. Keep in mind that this will overwrite an existing lifecycle configuration, so if you want to retain any configuration details, they must be included in the new lifecycle configuration. For information about lifecycle configuration, see Managing your storage lifecycle.
- Parameters:
Bucket – The name of the bucket for which to set the configuration.
LifecycleConfiguration – Container for lifecycle rules. You can add as many as 1,000 rules.
- Keyword Arguments:
ChecksumAlgorithm –
Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don’t use the SDK. When you send this header, there must be a corresponding
x-amz- checksumorx-amz-trailerheader sent. Otherwise, Amazon S3 fails the request with the HTTP status code400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).TransitionDefaultMinimumObjectSize – Indicates which default minimum object size behavior is applied to the lifecycle configuration.
- put_public_access_block(Bucket: str, PublicAccessBlockConfiguration: S3PublicAccessBlockConfiguration, *, ContentMD5: str | None = None, ChecksumAlgorithm: Literal['CRC32', 'CRC32C', 'SHA1', 'SHA256', 'CRC64NVME', 'SHA512', 'MD5', 'XXHASH64', 'XXHASH3', 'XXHASH128'] | None = None, ExpectedBucketOwner: str | None = None) None[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The name of the Amazon S3 bucket whose
PublicAccessBlockconfiguration you want to set.PublicAccessBlockConfiguration –
The
PublicAccessBlockconfiguration that you want to apply to this Amazon S3 bucket. You can enable the configuration options in any combination. For more information about when Amazon S3 considers a bucket or object public, see The Meaning of “Public” in the Amazon S3 User Guide.
- Keyword Arguments:
ContentMD5 – The MD5 hash of the
PutPublicAccessBlockrequest body.ChecksumAlgorithm –
Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don’t use the SDK. When you send this header, there must be a corresponding
x-amz- checksumorx-amz-trailerheader sent. Otherwise, Amazon S3 fails the request with the HTTP status code400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- put_tags(Bucket: str, Tagging: S3Tagging, *, ContentMD5: str | None = None, ChecksumAlgorithm: Literal['CRC32', 'CRC32C', 'SHA1', 'SHA256', 'CRC64NVME', 'SHA512', 'MD5', 'XXHASH64', 'XXHASH3', 'XXHASH128'] | None = None, ExpectedBucketOwner: str | None = None) None[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket name.
Tagging – Container for the
TagSetandTagelements.
- Keyword Arguments:
ContentMD5 – The Base64 encoded 128-bit
MD5digest of the data. You must use this header as a message integrity check to verify that the request body was not corrupted in transit. For more information, see RFC 1864.ChecksumAlgorithm –
Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don’t use the SDK. When you send this header, there must be a corresponding
x-amz- checksumorx-amz-trailerheader sent. Otherwise, Amazon S3 fails the request with the HTTP status code400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- put_website(Bucket: str, WebsiteConfiguration: WebsiteConfiguration, *, ContentMD5: str | None = None, ChecksumAlgorithm: Literal['CRC32', 'CRC32C', 'SHA1', 'SHA256', 'CRC64NVME', 'SHA512', 'MD5', 'XXHASH64', 'XXHASH3', 'XXHASH128'] | None = None, ExpectedBucketOwner: str | None = None) None[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket name.
WebsiteConfiguration – Container for the request.
- Keyword Arguments:
ContentMD5 –
The Base64 encoded 128-bit
MD5digest of the data. You must use this header as a message integrity check to verify that the request body was not corrupted in transit. For more information, see RFC 1864.ChecksumAlgorithm –
Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don’t use the SDK. When you send this header, there must be a corresponding
x-amz- checksumorx-amz-trailerheader sent. Otherwise, Amazon S3 fails the request with the HTTP status code400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- class botocraft.services.s3.S3ObjectManager[source]
Bases:
Boto3ModelManager- copy(Bucket: str, CopySource: str, Key: str, *, ACL: Literal['private', 'public-read', 'public-read-write', 'authenticated-read', 'aws-exec-read', 'bucket-owner-read', 'bucket-owner-full-control'] | None = None, CacheControl: str | None = None, ChecksumAlgorithm: Literal['CRC32', 'CRC32C', 'SHA1', 'SHA256', 'CRC64NVME', 'SHA512', 'MD5', 'XXHASH64', 'XXHASH3', 'XXHASH128'] | None = None, ContentDisposition: str | None = None, ContentEncoding: str | None = None, ContentLanguage: str | None = None, ContentType: str | None = None, CopySourceIfMatch: str | None = None, CopySourceIfModifiedSince: datetime | None = None, CopySourceIfNoneMatch: str | None = None, CopySourceIfUnmodifiedSince: datetime | None = None, Expires: datetime | None = None, GrantFullControl: str | None = None, GrantRead: str | None = None, GrantReadACP: str | None = None, GrantWriteACP: str | None = None, IfMatch: str | None = None, IfNoneMatch: str | None = None, Metadata: dict[str, str] | None = None, MetadataDirective: Literal['COPY', 'REPLACE'] | None = None, TaggingDirective: Literal['COPY', 'REPLACE'] | None = None, ServerSideEncryption: Literal['AES256', 'aws:fsx', 'aws:kms', 'aws:kms:dsse'] | None = None, StorageClass: Literal['STANDARD', 'REDUCED_REDUNDANCY', 'GLACIER', 'STANDARD_IA', 'ONEZONE_IA', 'INTELLIGENT_TIERING', 'DEEP_ARCHIVE', 'OUTPOSTS', 'GLACIER_IR', 'SNOW', 'EXPRESS_ONEZONE', 'FSX_OPENZFS', 'FSX_ONTAP'] | None = None, WebsiteRedirectLocation: str | None = None, SSECustomerAlgorithm: str | None = None, SSECustomerKey: str | None = None, SSECustomerKeyMD5: str | None = None, SSEKMSKeyId: str | None = None, SSEKMSEncryptionContext: str | None = None, BucketKeyEnabled: bool | None = None, CopySourceSSECustomerAlgorithm: str | None = None, CopySourceSSECustomerKey: str | None = None, CopySourceSSECustomerKeyMD5: str | None = None, RequestPayer: Literal['requester'] | None = None, Tagging: str | None = None, ObjectLockMode: Literal['GOVERNANCE', 'COMPLIANCE'] | None = None, ObjectLockRetainUntilDate: datetime | None = None, ObjectLockLegalHoldStatus: Literal['ON', 'OFF'] | None = None, ExpectedBucketOwner: str | None = None, ExpectedSourceBucketOwner: str | None = None) CopyObjectOutput[source]
Creates a copy of an object that is already stored in Amazon S3.
- Parameters:
Bucket – The name of the destination bucket.
CopySource – Specifies the source object for the copy operation. The source object can be up to 5 GB. If the source object is an object that was uploaded by using a multipart upload, the object copy will be a single part object after the source object is copied to the destination bucket.
Key – The key of the destination object.
- Keyword Arguments:
ACL – The canned access control list (ACL) to apply to the object.
CacheControl – Specifies the caching behavior along the request/reply chain.
ChecksumAlgorithm –
Indicates the algorithm that you want Amazon S3 to use to create the checksum for the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
ContentDisposition – Specifies presentational information for the object. Indicates whether an object should be displayed in a web browser or downloaded as a file. It allows specifying the desired filename for the downloaded file.
ContentEncoding – Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
ContentLanguage – The language the content is in.
ContentType – A standard MIME type that describes the format of the object data.
CopySourceIfMatch – Copies the object if its entity tag (ETag) matches the specified tag.
CopySourceIfModifiedSince – Copies the object if it has been modified since the specified time.
CopySourceIfNoneMatch – Copies the object if its entity tag (ETag) is different than the specified ETag.
CopySourceIfUnmodifiedSince – Copies the object if it hasn’t been modified since the specified time.
Expires – The date and time at which the object is no longer cacheable.
GrantFullControl – Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.
GrantRead – Allows grantee to read the object data and its metadata.
GrantReadACP – Allows grantee to read the object ACL.
GrantWriteACP – Allows grantee to write the ACL for the applicable object.
IfMatch – Copies the object if the entity tag (ETag) of the destination object matches the specified tag. If the ETag values do not match, the operation returns a
412 Precondition Failederror. If a concurrent operation occurs during the upload S3 returns a409 ConditionalRequestConflictresponse. On a 409 failure you should fetch the object’s ETag and retry the upload.IfNoneMatch – Copies the object only if the object key name at the destination does not already exist in the bucket specified. Otherwise, Amazon S3 returns a
412 Precondition Failederror. If a concurrent operation occurs during the upload S3 returns a409 ConditionalRequestConflictresponse. On a 409 failure you should retry the upload.Metadata – A map of metadata to store with the object in S3.
MetadataDirective – Specifies whether the metadata is copied from the source object or replaced with metadata that’s provided in the request. When copying an object, you can preserve all metadata (the default) or specify new metadata. If this header isn’t specified,
COPYis the default behavior.TaggingDirective – Specifies whether the object tag-set is copied from the source object or replaced with the tag-set that’s provided in the request.
ServerSideEncryption – The server-side encryption algorithm used when storing this object in Amazon S3. Unrecognized or unsupported values won’t write a destination object and will receive a
400 Bad Requestresponse.StorageClass – If the
x-amz-storage-classheader is not used, the copied object will be stored in theSTANDARDStorage Class by default. TheSTANDARDstorage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class.WebsiteRedirectLocation – If the destination bucket is configured as a website, redirects requests for this object copy to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata. This value is unique to each object and is not copied when using the
x-amz-metadata-directiveheader. Instead, you may opt to provide this header in combination with thex-amz-metadata-directiveheader.SSECustomerAlgorithm – Specifies the algorithm to use when encrypting the object (for example,
AES256).SSECustomerKey – Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded. Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the
x-amz-server-side-encryption-customer-algorithmheader.SSECustomerKeyMD5 – Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.
SSEKMSKeyId – Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they’re not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.
SSEKMSEncryptionContext – Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for the destination object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.
BucketKeyEnabled – Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object.
CopySourceSSECustomerAlgorithm – Specifies the algorithm to use when decrypting the source object (for example,
AES256).CopySourceSSECustomerKey – Specifies the customer-provided encryption key for Amazon S3 to use to decrypt the source object. The encryption key provided in this header must be the same one that was used when the source object was created.
CopySourceSSECustomerKeyMD5 – Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.
RequestPayer – Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
Tagging – The tag-set for the object copy in the destination bucket. This value must be used in conjunction with the
x-amz- tagging-directiveif you chooseREPLACEfor thex-amz-tagging-directive. If you chooseCOPYfor thex-amz-tagging-directive, you don’t need to set thex-amz-taggingheader, because the tag-set will be copied from the source object directly. The tag-set must be encoded as URL Query parameters.ObjectLockMode – The Object Lock mode that you want to apply to the object copy.
ObjectLockRetainUntilDate – The date and time when you want the Object Lock of the object copy to expire.
ObjectLockLegalHoldStatus – Specifies whether you want to apply a legal hold to the object copy.
ExpectedBucketOwner – The account ID of the expected destination bucket owner. If the account ID that you provide does not match the actual owner of the destination bucket, the request fails with the HTTP status code
403 Forbidden(access denied).ExpectedSourceBucketOwner – The account ID of the expected source bucket owner. If the account ID that you provide does not match the actual owner of the source bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- create(model: S3Object, Bucket: str, ACL: Literal['private', 'public-read', 'public-read-write', 'authenticated-read', 'aws-exec-read', 'bucket-owner-read', 'bucket-owner-full-control'] | None = None, Body: bytes | None = None, CacheControl: str | None = None, ContentDisposition: str | None = None, ContentEncoding: str | None = None, ContentLanguage: str | None = None, ContentLength: int | None = None, ContentMD5: str | None = None, ContentType: str | None = None, ChecksumCRC32: str | None = None, ChecksumCRC32C: str | None = None, ChecksumCRC64NVME: str | None = None, ChecksumSHA1: str | None = None, ChecksumSHA256: str | None = None, ChecksumSHA512: str | None = None, ChecksumMD5: str | None = None, ChecksumXXHASH64: str | None = None, ChecksumXXHASH3: str | None = None, ChecksumXXHASH128: str | None = None, Expires: datetime | None = None, IfMatch: str | None = None, IfNoneMatch: str | None = None, GrantFullControl: str | None = None, GrantRead: str | None = None, GrantReadACP: str | None = None, GrantWriteACP: str | None = None, WriteOffsetBytes: int | None = None, Metadata: dict[str, str] | None = None, ServerSideEncryption: Literal['AES256', 'aws:fsx', 'aws:kms', 'aws:kms:dsse'] | None = None, WebsiteRedirectLocation: str | None = None, SSECustomerAlgorithm: str | None = None, SSECustomerKey: str | None = None, SSECustomerKeyMD5: str | None = None, SSEKMSKeyId: str | None = None, SSEKMSEncryptionContext: str | None = None, BucketKeyEnabled: bool | None = None, RequestPayer: Literal['requester'] | None = None, ObjectLockMode: Literal['GOVERNANCE', 'COMPLIANCE'] | None = None, ObjectLockRetainUntilDate: datetime | None = None, ObjectLockLegalHoldStatus: Literal['ON', 'OFF'] | None = None, ExpectedBucketOwner: str | None = None) PutObjectOutput[source]
End of support notice: As of October 1, 2025, Amazon S3 has discontinued support for Email Grantee Access Control Lists (ACLs). If you attempt to use an Email Grantee ACL in a request after October 1, 2025, the request will receive an
HTTP 405(Method Not Allowed) error.- Parameters:
model – The
Objectto create.Bucket – The bucket name to which the PUT action was initiated.
- Keyword Arguments:
ACL – The canned ACL to apply to the object. For more information, see Canned ACL in the Amazon S3 User Guide.
Body – Object data.
CacheControl – Can be used to specify caching behavior along the request/reply chain. For more information, see <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9>.
ContentDisposition – Specifies presentational information for the object. For more information, see <https://www.rfc- editor.org/rfc/rfc6266#section-4>.
ContentEncoding – Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. For more information, see <https://www.rfc- editor.org/rfc/rfc9110.html#field.content-encoding>.
ContentLanguage – The language the content is in.
ContentLength – Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically. For more information, see <https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length>.
ContentMD5 – The Base64 encoded 128-bit
MD5digest of the message (without the headers) according to RFC 1864. This header can be used as a message integrity check to verify that the data is the same data that was originally sent. Although it is optional, we recommend using the Content-MD5 mechanism as an end-to-end integrity check. For more information about REST request authentication, see REST Authentication.ContentType – A standard MIME type describing the format of the contents. For more information, see <https://www.rfc- editor.org/rfc/rfc9110.html#name-content-type>.
ChecksumCRC32 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit
CRC32checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumCRC32C –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit
CRC32Cchecksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumCRC64NVME – This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit
CRC64NVMEchecksum of the object. TheCRC64NVMEchecksum is always a full object checksum. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumSHA1 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 160-bit
SHA1digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumSHA256 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 256-bit
SHA256digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumSHA512 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 512-bit
SHA512digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumMD5 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 128-bit
MD5digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumXXHASH64 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit
XXHASH64checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumXXHASH3 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit
XXHASH3checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumXXHASH128 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 128-bit
XXHASH128checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.Expires – The date and time at which the object is no longer cacheable. For more information, see <https://www.rfc- editor.org/rfc/rfc7234#section-5.3>.
IfMatch – Uploads the object only if the ETag (entity tag) value provided during the WRITE operation matches the ETag of the object in S3. If the ETag values do not match, the operation returns a
412 Precondition Failederror.IfNoneMatch – Uploads the object only if the object key name does not already exist in the bucket specified. Otherwise, Amazon S3 returns a
412 Precondition Failederror.GrantFullControl – Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.
GrantRead – Allows grantee to read the object data and its metadata.
GrantReadACP – Allows grantee to read the object ACL.
GrantWriteACP – Allows grantee to write the ACL for the applicable object.
WriteOffsetBytes – Specifies the offset for appending data to existing objects in bytes. The offset must be equal to the size of the existing object being appended to. If no object exists, setting this header to 0 will create a new object.
Metadata – A map of metadata to store with the object in S3.
ServerSideEncryption – The server-side encryption algorithm that was used when you store this object in Amazon S3 or Amazon FSx.
WebsiteRedirectLocation – If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata. For information about object metadata, see Object Key and Metadata in the Amazon S3 User Guide.
SSECustomerAlgorithm – Specifies the algorithm to use when encrypting the object (for example,
AES256).SSECustomerKey – Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the
x-amz-server-side-encryption-customer-algorithmheader.SSECustomerKeyMD5 – Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.
SSEKMSKeyId – Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn’t exist in the same account that’s issuing the command, you must use the full Key ARN not the Key ID.
SSEKMSEncryptionContext – Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future
GetObjectoperations on this object.BucketKeyEnabled – Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).
RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
ObjectLockMode – The Object Lock mode that you want to apply to this object.
ObjectLockRetainUntilDate – The date and time when you want this object’s Object Lock to expire. Must be formatted as a timestamp parameter.
ObjectLockLegalHoldStatus – Specifies whether a legal hold will be applied to this object. For more information about S3 Object Lock, see Object Lock in the Amazon S3 User Guide.
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- delete(Bucket: str, Delete: Delete, *, MFA: str | None = None, RequestPayer: Literal['requester'] | None = None, BypassGovernanceRetention: bool | None = None, ExpectedBucketOwner: str | None = None, ChecksumAlgorithm: Literal['CRC32', 'CRC32C', 'SHA1', 'SHA256', 'CRC64NVME', 'SHA512', 'MD5', 'XXHASH64', 'XXHASH3', 'XXHASH128'] | None = None) S3Object[source]
This operation enables you to delete multiple objects from a bucket using a single HTTP request. If you know the object keys that you want to delete, then this operation provides a suitable alternative to sending individual delete requests, reducing per-request overhead.
- Parameters:
Bucket – The bucket name containing the objects to delete.
Delete – Container for the request.
- Keyword Arguments:
MFA – The concatenation of the authentication device’s serial number, a space, and the value that is displayed on your authentication device. Required to permanently delete a versioned object if versioning is configured with MFA delete enabled.
RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
BypassGovernanceRetention – Specifies whether you want to delete this object even if it has a Governance-type Object Lock in place. To use this header, you must have the
s3:BypassGovernanceRetentionpermission.ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).ChecksumAlgorithm – Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don’t use the SDK. When you send this header, there must be a corresponding
x-amz- checksum-algorithmorx-amz-trailerheader sent. Otherwise, Amazon S3 fails the request with the HTTP status code400 Bad Request.
- delete_tags(Bucket: str, Key: str, *, VersionId: str | None = None, ExpectedBucketOwner: str | None = None) DeleteObjectTaggingOutput[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket name containing the objects from which to remove the tags.
Key – The key that identifies the object in the bucket from which to remove all tags.
- Keyword Arguments:
VersionId – The versionId of the object that the tag-set will be removed from.
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- download(Bucket: str, Key: str, *, IfMatch: str | None = None, IfModifiedSince: datetime | None = None, IfNoneMatch: str | None = None, IfUnmodifiedSince: datetime | None = None, Range: str | None = None, ResponseCacheControl: str | None = None, ResponseContentDisposition: str | None = None, ResponseContentEncoding: str | None = None, ResponseContentLanguage: str | None = None, ResponseContentType: str | None = None, ResponseExpires: datetime | None = None, VersionId: str | None = None, SSECustomerAlgorithm: str | None = None, SSECustomerKey: str | None = None, SSECustomerKeyMD5: str | None = None, RequestPayer: Literal['requester'] | None = None, PartNumber: int | None = None, ExpectedBucketOwner: str | None = None, ChecksumMode: Literal['ENABLED'] | None = None) GetObjectOutput[source]
Retrieves an object from Amazon S3.
- Parameters:
Bucket – The bucket name containing the object.
Key – Key of the object to get.
- Keyword Arguments:
IfMatch – Return the object only if its entity tag (ETag) is the same as the one specified in this header; otherwise, return a
412 Precondition Failederror.IfModifiedSince – Return the object only if it has been modified since the specified time; otherwise, return a
304 Not Modifiederror.IfNoneMatch – Return the object only if its entity tag (ETag) is different from the one specified in this header; otherwise, return a
304 Not Modifiederror.IfUnmodifiedSince – Return the object only if it has not been modified since the specified time; otherwise, return a
412 Precondition Failederror.Range – Downloads the specified byte range of an object. For more information about the HTTP Range header, see <https://www.rfc- editor.org/rfc/rfc9110.html#name-range>.
ResponseCacheControl – Sets the
Cache-Controlheader of the response.ResponseContentDisposition – Sets the
Content-Dispositionheader of the response.ResponseContentEncoding – Sets the
Content-Encodingheader of the response.ResponseContentLanguage – Sets the
Content-Languageheader of the response.ResponseContentType – Sets the
Content-Typeheader of the response.ResponseExpires – Sets the
Expiresheader of the response.VersionId – Version ID used to reference a specific version of the object.
SSECustomerAlgorithm – Specifies the algorithm to use when decrypting the object (for example,
AES256).SSECustomerKey – Specifies the customer-provided encryption key that you originally provided for Amazon S3 to encrypt the data before storing it. This value is used to decrypt the object when recovering it and must match the one used when storing the data. The key must be appropriate for use with the algorithm specified in the
x-amz-server-side- encryption-customer- algorithmheader.SSECustomerKeyMD5 – Specifies the 128-bit MD5 digest of the customer-provided encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.
RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
PartNumber – Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a ‘ranged’ GET request for the part specified. Useful for downloading just a part of an object.
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).ChecksumMode – To retrieve the checksum, this mode must be enabled.
- get(Bucket: str, Key: str, *, IfMatch: str | None = None, IfModifiedSince: datetime | None = None, IfNoneMatch: str | None = None, IfUnmodifiedSince: datetime | None = None, Range: str | None = None, ResponseCacheControl: str | None = None, ResponseContentDisposition: str | None = None, ResponseContentEncoding: str | None = None, ResponseContentLanguage: str | None = None, ResponseContentType: str | None = None, ResponseExpires: datetime | None = None, VersionId: str | None = None, SSECustomerAlgorithm: str | None = None, SSECustomerKey: str | None = None, SSECustomerKeyMD5: str | None = None, RequestPayer: Literal['requester'] | None = None, PartNumber: int | None = None, ExpectedBucketOwner: str | None = None, ChecksumMode: Literal['ENABLED'] | None = None) S3Object | None[source]
Retrieves an object from Amazon S3.
- Parameters:
Bucket – The bucket name containing the object.
Key – Key of the object to get.
- Keyword Arguments:
IfMatch – Return the object only if its entity tag (ETag) is the same as the one specified in this header; otherwise, return a
412 Precondition Failederror.IfModifiedSince – Return the object only if it has been modified since the specified time; otherwise, return a
304 Not Modifiederror.IfNoneMatch – Return the object only if its entity tag (ETag) is different from the one specified in this header; otherwise, return a
304 Not Modifiederror.IfUnmodifiedSince – Return the object only if it has not been modified since the specified time; otherwise, return a
412 Precondition Failederror.Range – Downloads the specified byte range of an object. For more information about the HTTP Range header, see <https://www.rfc- editor.org/rfc/rfc9110.html#name-range>.
ResponseCacheControl – Sets the
Cache-Controlheader of the response.ResponseContentDisposition – Sets the
Content-Dispositionheader of the response.ResponseContentEncoding – Sets the
Content-Encodingheader of the response.ResponseContentLanguage – Sets the
Content-Languageheader of the response.ResponseContentType – Sets the
Content-Typeheader of the response.ResponseExpires – Sets the
Expiresheader of the response.VersionId – Version ID used to reference a specific version of the object.
SSECustomerAlgorithm – Specifies the algorithm to use when decrypting the object (for example,
AES256).SSECustomerKey – Specifies the customer-provided encryption key that you originally provided for Amazon S3 to encrypt the data before storing it. This value is used to decrypt the object when recovering it and must match the one used when storing the data. The key must be appropriate for use with the algorithm specified in the
x-amz-server-side- encryption-customer- algorithmheader.SSECustomerKeyMD5 – Specifies the 128-bit MD5 digest of the customer-provided encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.
RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
PartNumber – Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a ‘ranged’ GET request for the part specified. Useful for downloading just a part of an object.
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).ChecksumMode – To retrieve the checksum, this mode must be enabled.
- get_acl(Bucket: str, Key: str, *, VersionId: str | None = None, RequestPayer: Literal['requester'] | None = None, ExpectedBucketOwner: str | None = None) GetObjectAclOutput[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket name that contains the object for which to get the ACL information.
Key – The key of the object for which to get the ACL information.
- Keyword Arguments:
VersionId – Version ID used to reference a specific version of the object.
RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- get_attributes(Bucket: str, Key: str, ObjectAttributes: list[Literal['ETag', 'Checksum', 'ObjectParts', 'StorageClass', 'ObjectSize']], *, VersionId: str | None = None, MaxParts: int | None = None, PartNumberMarker: int | None = None, SSECustomerAlgorithm: str | None = None, SSECustomerKey: str | None = None, SSECustomerKeyMD5: str | None = None, RequestPayer: Literal['requester'] | None = None, ExpectedBucketOwner: str | None = None) GetObjectAttributesOutput[source]
Retrieves all of the metadata from an object without returning the object itself. This operation is useful if you’re interested only in an object’s metadata.
- Parameters:
Bucket – The name of the bucket that contains the object.
Key – The object key.
ObjectAttributes – Specifies the fields at the root level that you want returned in the response. Fields that you do not specify are not returned.
- Keyword Arguments:
VersionId – The version ID used to reference a specific version of the object.
MaxParts – Sets the maximum number of parts to return. For more information, see Uploading and copying objects using multipart upload in Amazon S3 in the Amazon Simple Storage Service user guide.
PartNumberMarker –
Specifies the part after which listing should begin. Only parts with higher part numbers will be listed. For more information, see Uploading and copying objects using multipart upload in Amazon S3 in the Amazon Simple Storage Service user guide.
SSECustomerAlgorithm – Specifies the algorithm to use when encrypting the object (for example, AES256).
SSECustomerKey – Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the
x-amz-server-side-encryption-customer-algorithmheader.SSECustomerKeyMD5 – Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.
RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- get_legal_hold(Bucket: str, Key: str, *, VersionId: str | None = None, RequestPayer: Literal['requester'] | None = None, ExpectedBucketOwner: str | None = None) S3ObjectLockLegalHold[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket name containing the object whose legal hold status you want to retrieve.
Key – The key name for the object whose legal hold status you want to retrieve.
- Keyword Arguments:
VersionId – The version ID of the object whose legal hold status you want to retrieve.
RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- get_lock_configuration(Bucket: str, *, ExpectedBucketOwner: str | None = None) S3ObjectLockConfiguration[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket whose Object Lock configuration you want to retrieve.
- Keyword Arguments:
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- get_retention(Bucket: str, Key: str, *, VersionId: str | None = None, RequestPayer: Literal['requester'] | None = None, ExpectedBucketOwner: str | None = None) ObjectLockRetention[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket name containing the object whose retention settings you want to retrieve.
Key – The key name for the object whose retention settings you want to retrieve.
- Keyword Arguments:
VersionId – The version ID for the object whose retention settings you want to retrieve.
RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- get_tags(Bucket: str, Key: str, *, VersionId: str | None = None, ExpectedBucketOwner: str | None = None, RequestPayer: Literal['requester'] | None = None) list[botocraft.services.common.Tag][source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket name containing the object for which to get the tagging information.
Key – Object key for which to get the tagging information.
- Keyword Arguments:
VersionId – The versionId of the object for which to get the tagging information.
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
- get_versions(Bucket: str, *, Delimiter: str | None = None, EncodingType: Literal['url'] | None = None, KeyMarker: str | None = None, MaxKeys: int | None = None, Prefix: str | None = None, VersionIdMarker: str | None = None, ExpectedBucketOwner: str | None = None, RequestPayer: Literal['requester'] | None = None, OptionalObjectAttributes: list[Literal['RestoreStatus']] | None = None) ListObjectVersionsOutput[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket name that contains the objects.
- Keyword Arguments:
Delimiter – A delimiter is a character that you specify to group keys. All keys that contain the same string between the
prefixand the first occurrence of the delimiter are grouped under a single result element inCommonPrefixes. These groups are counted as one result against themax-keyslimitation. These keys are not returned elsewhere in the response.EncodingType – Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can’t parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren’t supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. For more information about characters to avoid in object key names, see Object key naming guidelines.
KeyMarker – Specifies the key to start with when listing objects in a bucket.
MaxKeys – Sets the maximum number of keys returned in the response. By default, the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more. If additional keys satisfy the search criteria, but were not returned because
max-keyswas exceeded, the response contains<isTruncated>true</isTruncated>. To return the additional keys, seekey-markerandversion-id-marker.Prefix – Use this parameter to select only those keys that begin with the specified prefix. You can use prefixes to separate a bucket into different groupings of keys. (You can think of using
prefixto make groups in the same way that you’d use a folder in a file system.) You can useprefixwithdelimiterto roll up numerous objects into a single result underCommonPrefixes.VersionIdMarker – Specifies the object version you want to start listing from.
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
OptionalObjectAttributes – Specifies the optional fields that you want returned in the response. Fields that you do not specify are not returned.
- list(Bucket: str, *, Delimiter: str | None = None, EncodingType: Literal['url'] | None = None, MaxKeys: int | None = None, Prefix: str | None = None, ContinuationToken: str | None = None, FetchOwner: bool | None = None, StartAfter: str | None = None, RequestPayer: Literal['requester'] | None = None, ExpectedBucketOwner: str | None = None, OptionalObjectAttributes: list[Literal['RestoreStatus']] | None = None, Include: list[Literal['TAGS']] | None = None) PrimaryBoto3ModelQuerySet[source]
Returns some or all (up to 1,000) of the objects in a bucket with each request. You can use the request parameters as selection criteria to return a subset of the objects in a bucket. A
200 OKresponse can contain valid or invalid XML. Make sure to design your application to parse the contents of the response and handle it appropriately. For more information about listing objects, see Listing object keys programmatically in the Amazon S3 User Guide. To get a list of your buckets, see ListBuckets.- Parameters:
Bucket – Directory buckets - When you use this operation with a directory bucket, you must use virtual-hosted- style requests in the format
Bucket-name.s3express-zone-id.region-code.amazonaws.com. Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the formatbucket-base-name--zone-id--x-s3(for example,amzn-s3-demo-bucket--usw2-az1-- x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide.- Keyword Arguments:
Delimiter – A delimiter is a character that you use to group keys.
EncodingType –
Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can’t parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren’t supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. For more information about characters to avoid in object key names, see Object key naming guidelines.
MaxKeys – Sets the maximum number of keys returned in the response. By default, the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more.
Prefix – Limits the response to keys that begin with the specified prefix.
ContinuationToken –
ContinuationTokenindicates to Amazon S3 that the list is being continued on this bucket with a token.ContinuationTokenis obfuscated and is not a real key. You can use thisContinuationTokenfor pagination of the list results.FetchOwner – The owner field is not present in
ListObjectsV2by default. If you want to return the owner field with each key in the result, then set theFetchOwnerfield totrue.StartAfter – StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts listing after this specified key. StartAfter can be any key in the bucket.
RequestPayer – Confirms that the requester knows that she or he will be charged for the list objects request in V2 style. Bucket owners need not specify this parameter in their requests.
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).OptionalObjectAttributes – Specifies the optional fields that you want returned in the response. Fields that you do not specify are not returned.
Include – Extra things to include in the response. Tags are expensive to retrieve because they need a second, slow API call, so you have to request them specifically.
- put_acl(Bucket: str, Key: str, *, ACL: Literal['private', 'public-read', 'public-read-write', 'authenticated-read', 'aws-exec-read', 'bucket-owner-read', 'bucket-owner-full-control'] | None = None, AccessControlPolicy: AccessControlPolicy | None = None, ContentMD5: str | None = None, ChecksumAlgorithm: Literal['CRC32', 'CRC32C', 'SHA1', 'SHA256', 'CRC64NVME', 'SHA512', 'MD5', 'XXHASH64', 'XXHASH3', 'XXHASH128'] | None = None, GrantFullControl: str | None = None, GrantRead: str | None = None, GrantReadACP: str | None = None, GrantWrite: str | None = None, GrantWriteACP: str | None = None, RequestPayer: Literal['requester'] | None = None, VersionId: str | None = None, ExpectedBucketOwner: str | None = None) PutObjectAclOutput[source]
End of support notice: As of October 1, 2025, Amazon S3 has discontinued support for Email Grantee Access Control Lists (ACLs). If you attempt to use an Email Grantee ACL in a request after October 1, 2025, the request will receive an
HTTP 405(Method Not Allowed) error.- Parameters:
Bucket – The bucket name that contains the object to which you want to attach the ACL.
Key – Key for which the PUT action was initiated.
- Keyword Arguments:
ACL –
The canned ACL to apply to the object. For more information, see Canned ACL.
AccessControlPolicy – Contains the elements that set the ACL permissions for an object per grantee.
ContentMD5 – The Base64 encoded 128-bit
MD5digest of the data. This header must be used as a message integrity check to verify that the request body was not corrupted in transit. For more information, go to RFC 1864.>ChecksumAlgorithm –
Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don’t use the SDK. When you send this header, there must be a corresponding
x-amz- checksumorx-amz-trailerheader sent. Otherwise, Amazon S3 fails the request with the HTTP status code400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.GrantFullControl – Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.
GrantRead – Allows grantee to list the objects in the bucket.
GrantReadACP – Allows grantee to read the bucket ACL.
GrantWrite – Allows grantee to create new objects in the bucket.
GrantWriteACP – Allows grantee to write the ACL for the applicable bucket.
RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
VersionId – Version ID used to reference a specific version of the object.
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- put_legal_hold(Bucket: str, Key: str, *, LegalHold: S3ObjectLockLegalHold | None = None, RequestPayer: Literal['requester'] | None = None, VersionId: str | None = None, ContentMD5: str | None = None, ChecksumAlgorithm: Literal['CRC32', 'CRC32C', 'SHA1', 'SHA256', 'CRC64NVME', 'SHA512', 'MD5', 'XXHASH64', 'XXHASH3', 'XXHASH128'] | None = None, ExpectedBucketOwner: str | None = None) PutObjectLegalHoldOutput[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket name containing the object that you want to place a legal hold on.
Key – The key name for the object that you want to place a legal hold on.
- Keyword Arguments:
LegalHold – Container element for the legal hold configuration you want to apply to the specified object.
RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
VersionId – The version ID of the object that you want to place a legal hold on.
ContentMD5 – The MD5 hash for the request body.
ChecksumAlgorithm –
Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don’t use the SDK. When you send this header, there must be a corresponding
x-amz- checksumorx-amz-trailerheader sent. Otherwise, Amazon S3 fails the request with the HTTP status code400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- put_lock_configuration(Bucket: str, *, ObjectLockConfiguration: S3ObjectLockConfiguration | None = None, RequestPayer: Literal['requester'] | None = None, Token: str | None = None, ContentMD5: str | None = None, ChecksumAlgorithm: Literal['CRC32', 'CRC32C', 'SHA1', 'SHA256', 'CRC64NVME', 'SHA512', 'MD5', 'XXHASH64', 'XXHASH3', 'XXHASH128'] | None = None, ExpectedBucketOwner: str | None = None) PutObjectLockConfigurationOutput[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket whose Object Lock configuration you want to create or replace.
- Keyword Arguments:
ObjectLockConfiguration – The Object Lock configuration that you want to apply to the specified bucket.
RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
Token – A token to allow Object Lock to be enabled for an existing bucket.
ContentMD5 – The MD5 hash for the request body.
ChecksumAlgorithm –
Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don’t use the SDK. When you send this header, there must be a corresponding
x-amz- checksumorx-amz-trailerheader sent. Otherwise, Amazon S3 fails the request with the HTTP status code400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- put_retention(Bucket: str, Key: str, *, Retention: ObjectLockRetention | None = None, RequestPayer: Literal['requester'] | None = None, VersionId: str | None = None, BypassGovernanceRetention: bool | None = None, ContentMD5: str | None = None, ChecksumAlgorithm: Literal['CRC32', 'CRC32C', 'SHA1', 'SHA256', 'CRC64NVME', 'SHA512', 'MD5', 'XXHASH64', 'XXHASH3', 'XXHASH128'] | None = None, ExpectedBucketOwner: str | None = None) PutObjectRetentionOutput[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket name that contains the object you want to apply this Object Retention configuration to.
Key – The key name for the object that you want to apply this Object Retention configuration to.
- Keyword Arguments:
Retention – The container element for the Object Retention configuration.
RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
VersionId – The version ID for the object that you want to apply this Object Retention configuration to.
BypassGovernanceRetention – Indicates whether this action should bypass Governance-mode restrictions.
ContentMD5 – The MD5 hash for the request body.
ChecksumAlgorithm –
Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don’t use the SDK. When you send this header, there must be a corresponding
x-amz- checksumorx-amz-trailerheader sent. Otherwise, Amazon S3 fails the request with the HTTP status code400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- put_tags(Bucket: str, Key: str, Tagging: S3Tagging, *, VersionId: str | None = None, ContentMD5: str | None = None, ChecksumAlgorithm: Literal['CRC32', 'CRC32C', 'SHA1', 'SHA256', 'CRC64NVME', 'SHA512', 'MD5', 'XXHASH64', 'XXHASH3', 'XXHASH128'] | None = None, ExpectedBucketOwner: str | None = None, RequestPayer: Literal['requester'] | None = None) str[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket name containing the object.
Key – Name of the object key.
Tagging – Container for the
TagSetandTagelements
- Keyword Arguments:
VersionId – The versionId of the object that the tag-set will be added to.
ContentMD5 – The MD5 hash for the request body.
ChecksumAlgorithm –
Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don’t use the SDK. When you send this header, there must be a corresponding
x-amz- checksumorx-amz-trailerheader sent. Otherwise, Amazon S3 fails the request with the HTTP status code400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).RequestPayer – Confirms that the requester knows that she or he will be charged for the tagging object request. Bucket owners need not specify this parameter in their requests.
- rename(Bucket: str, Key: str, RenameSource: str, *, DestinationIfMatch: str | None = None, DestinationIfNoneMatch: str | None = None, DestinationIfModifiedSince: datetime | None = None, DestinationIfUnmodifiedSince: datetime | None = None, SourceIfMatch: str | None = None, SourceIfNoneMatch: str | None = None, SourceIfModifiedSince: datetime | None = None, SourceIfUnmodifiedSince: datetime | None = None, ClientToken: str | None = None) RenameObjectOutput[source]
Renames an existing object in a directory bucket that uses the S3 Express One Zone storage class. You can use
RenameObjectby specifying an existing object’s name as the source and the new name of the object as the destination within the same directory bucket.- Parameters:
Bucket – The bucket name of the directory bucket containing the object.
Key – Key name of the object to rename.
RenameSource – Specifies the source for the rename operation. The value must be URL encoded.
- Keyword Arguments:
DestinationIfMatch – Renames the object only if the ETag (entity tag) value provided during the operation matches the ETag of the object in S3. The
If-Matchheader field makes the request method conditional on ETags. If the ETag values do not match, the operation returns a412 Precondition Failederror.DestinationIfNoneMatch – Renames the object only if the destination does not already exist in the specified directory bucket. If the object does exist when you send a request with
If-None-Match:*, the S3 API will return a412 Precondition Failederror, preventing an overwrite. TheIf-None-Matchheader prevents overwrites of existing data by validating that there’s not an object with the same key name already in your directory bucket.DestinationIfModifiedSince – Renames the object if the destination exists and if it has been modified since the specified time.
DestinationIfUnmodifiedSince – Renames the object if it hasn’t been modified since the specified time.
SourceIfMatch – Renames the object if the source exists and if its entity tag (ETag) matches the specified ETag.
SourceIfNoneMatch – Renames the object if the source exists and if its entity tag (ETag) is different than the specified ETag. If an asterisk (
*) character is provided, the operation will fail and return a412 Precondition Failederror.SourceIfModifiedSince – Renames the object if the source exists and if it has been modified since the specified time.
SourceIfUnmodifiedSince – Renames the object if the source exists and hasn’t been modified since the specified time.
ClientToken – A unique string with a max of 64 ASCII characters in the ASCII range of 33 - 126.
- restore(Bucket: str, Key: str, *, VersionId: str | None = None, RestoreRequest: RestoreRequest | None = None, RequestPayer: Literal['requester'] | None = None, ChecksumAlgorithm: Literal['CRC32', 'CRC32C', 'SHA1', 'SHA256', 'CRC64NVME', 'SHA512', 'MD5', 'XXHASH64', 'XXHASH3', 'XXHASH128'] | None = None, ExpectedBucketOwner: str | None = None) str[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The bucket name containing the object to restore.
Key – Object key for which the action was initiated.
- Keyword Arguments:
VersionId – VersionId used to reference a specific version of the object.
RestoreRequest – Container for restore job parameters.
RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
ChecksumAlgorithm –
Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don’t use the SDK. When you send this header, there must be a corresponding
x-amz- checksumorx-amz-trailerheader sent. Otherwise, Amazon S3 fails the request with the HTTP status code400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- select_content(Bucket: str, Key: str, Expression: str, ExpressionType: Literal['SQL'], InputSerialization: InputSerialization, OutputSerialization: OutputSerialization, *, SSECustomerAlgorithm: str | None = None, SSECustomerKey: str | None = None, SSECustomerKeyMD5: str | None = None, RequestProgress: RequestProgress | None = None, ScanRange: ScanRange | None = None, ExpectedBucketOwner: str | None = None) SelectObjectContentEventStream[source]
This operation is not supported for directory buckets.
- Parameters:
Bucket – The S3 bucket.
Key – The object key.
Expression – The expression that is used to query the object.
ExpressionType – The type of the provided expression (for example, SQL).
InputSerialization – Describes the format of the data in the object that is being queried.
OutputSerialization – Describes the format of the data that you want Amazon S3 to return in response.
- Keyword Arguments:
SSECustomerAlgorithm – The server-side encryption (SSE) algorithm used to encrypt the object. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the Amazon S3 User Guide.
SSECustomerKey –
The server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the Amazon S3 User Guide.
SSECustomerKeyMD5 –
The MD5 server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the Amazon S3 User Guide.
RequestProgress – Specifies if periodic request progress information should be enabled.
ScanRange – Specifies the byte range of the object to get the records from. A record is processed when its first byte is contained by the range. This parameter is optional, but when specified, it must not be empty. See RFC 2616, Section 14.35.1 about how to specify the start and end of the range.
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
- update(model: S3Object, Bucket: str, ACL: Literal['private', 'public-read', 'public-read-write', 'authenticated-read', 'aws-exec-read', 'bucket-owner-read', 'bucket-owner-full-control'] | None = None, Body: bytes | None = None, CacheControl: str | None = None, ContentDisposition: str | None = None, ContentEncoding: str | None = None, ContentLanguage: str | None = None, ContentLength: int | None = None, ContentMD5: str | None = None, ContentType: str | None = None, ChecksumCRC32: str | None = None, ChecksumCRC32C: str | None = None, ChecksumCRC64NVME: str | None = None, ChecksumSHA1: str | None = None, ChecksumSHA256: str | None = None, ChecksumSHA512: str | None = None, ChecksumMD5: str | None = None, ChecksumXXHASH64: str | None = None, ChecksumXXHASH3: str | None = None, ChecksumXXHASH128: str | None = None, Expires: datetime | None = None, IfMatch: str | None = None, IfNoneMatch: str | None = None, GrantFullControl: str | None = None, GrantRead: str | None = None, GrantReadACP: str | None = None, GrantWriteACP: str | None = None, WriteOffsetBytes: int | None = None, Metadata: dict[str, str] | None = None, ServerSideEncryption: Literal['AES256', 'aws:fsx', 'aws:kms', 'aws:kms:dsse'] | None = None, WebsiteRedirectLocation: str | None = None, SSECustomerAlgorithm: str | None = None, SSECustomerKey: str | None = None, SSECustomerKeyMD5: str | None = None, SSEKMSKeyId: str | None = None, SSEKMSEncryptionContext: str | None = None, BucketKeyEnabled: bool | None = None, RequestPayer: Literal['requester'] | None = None, Tagging: str | None = None, ObjectLockMode: Literal['GOVERNANCE', 'COMPLIANCE'] | None = None, ObjectLockRetainUntilDate: datetime | None = None, ObjectLockLegalHoldStatus: Literal['ON', 'OFF'] | None = None, ExpectedBucketOwner: str | None = None) PutObjectOutput[source]
End of support notice: As of October 1, 2025, Amazon S3 has discontinued support for Email Grantee Access Control Lists (ACLs). If you attempt to use an Email Grantee ACL in a request after October 1, 2025, the request will receive an
HTTP 405(Method Not Allowed) error.- Parameters:
model – The
Objectto update.Bucket – The bucket name to which the PUT action was initiated.
- Keyword Arguments:
ACL –
The canned ACL to apply to the object. For more information, see Canned ACL in the Amazon S3 User Guide.
Body – Object data.
CacheControl – Can be used to specify caching behavior along the request/reply chain. For more information, see <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9>.
ContentDisposition – Specifies presentational information for the object. For more information, see <https://www.rfc- editor.org/rfc/rfc6266#section-4>.
ContentEncoding – Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field. For more information, see <https://www.rfc- editor.org/rfc/rfc9110.html#field.content-encoding>.
ContentLanguage – The language the content is in.
ContentLength – Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically. For more information, see <https://www.rfc-editor.org/rfc/rfc9110.html#name-content-length>.
ContentMD5 –
The Base64 encoded 128-bit
MD5digest of the message (without the headers) according to RFC 1864. This header can be used as a message integrity check to verify that the data is the same data that was originally sent. Although it is optional, we recommend using the Content-MD5 mechanism as an end-to-end integrity check. For more information about REST request authentication, see REST Authentication.ContentType – A standard MIME type describing the format of the contents. For more information, see <https://www.rfc- editor.org/rfc/rfc9110.html#name-content-type>.
ChecksumCRC32 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit
CRC32checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumCRC32C –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit
CRC32Cchecksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumCRC64NVME –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit
CRC64NVMEchecksum of the object. TheCRC64NVMEchecksum is always a full object checksum. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumSHA1 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 160-bit
SHA1digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumSHA256 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 256-bit
SHA256digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumSHA512 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 512-bit
SHA512digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumMD5 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 128-bit
MD5digest of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumXXHASH64 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit
XXHASH64checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumXXHASH3 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit
XXHASH3checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.ChecksumXXHASH128 –
This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 128-bit
XXHASH128checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide.Expires – The date and time at which the object is no longer cacheable. For more information, see <https://www.rfc- editor.org/rfc/rfc7234#section-5.3>.
IfMatch – Uploads the object only if the ETag (entity tag) value provided during the WRITE operation matches the ETag of the object in S3. If the ETag values do not match, the operation returns a
412 Precondition Failederror.IfNoneMatch – Uploads the object only if the object key name does not already exist in the bucket specified. Otherwise, Amazon S3 returns a
412 Precondition Failederror.GrantFullControl – Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.
GrantRead – Allows grantee to read the object data and its metadata.
GrantReadACP – Allows grantee to read the object ACL.
GrantWriteACP – Allows grantee to write the ACL for the applicable object.
WriteOffsetBytes – Specifies the offset for appending data to existing objects in bytes. The offset must be equal to the size of the existing object being appended to. If no object exists, setting this header to 0 will create a new object.
Metadata – A map of metadata to store with the object in S3.
ServerSideEncryption – The server-side encryption algorithm that was used when you store this object in Amazon S3 or Amazon FSx.
WebsiteRedirectLocation –
If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata. For information about object metadata, see Object Key and Metadata in the Amazon S3 User Guide.
SSECustomerAlgorithm – Specifies the algorithm to use when encrypting the object (for example,
AES256).SSECustomerKey – Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the
x-amz-server-side-encryption-customer-algorithmheader.SSECustomerKeyMD5 – Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.
SSEKMSKeyId – Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn’t exist in the same account that’s issuing the command, you must use the full Key ARN not the Key ID.
SSEKMSEncryptionContext – Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future
GetObjectoperations on this object.BucketKeyEnabled – Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).
RequestPayer –
Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.
Tagging – The tag-set for the object. The tag-set must be encoded as URL Query parameters. (For example, “Key1=Value1”)
ObjectLockMode – The Object Lock mode that you want to apply to this object.
ObjectLockRetainUntilDate – The date and time when you want this object’s Object Lock to expire. Must be formatted as a timestamp parameter.
ObjectLockLegalHoldStatus –
Specifies whether a legal hold will be applied to this object. For more information about S3 Object Lock, see Object Lock in the Amazon S3 User Guide.
ExpectedBucketOwner – The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code
403 Forbidden(access denied).
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.s3.BucketLifecycleConfiguration[source]
Bases:
Boto3ModelSpecifies the lifecycle configuration for objects in an Amazon S3 bucket.
For more information, see Object Lifecycle Management in the Amazon S3 User Guide.
Show JSON schema
{ "title": "BucketLifecycleConfiguration", "description": "Specifies the lifecycle configuration for objects in an Amazon S3 bucket.\n\nFor more information, see\n`Object Lifecycle Management <https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html>`_\nin the *Amazon S3 User Guide*.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Rules": { "items": { "$ref": "#/$defs/LifecycleRule" }, "title": "Rules", "type": "array" } }, "$defs": { "LifecycleExpiration": { "description": "Container for the expiration for the lifecycle of the object.\n\nFor more information see,\n`Managing your storage lifecycle <https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html>`_\nin the *Amazon S3 User\nGuide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Date": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Date" }, "Days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Days" }, "ExpiredObjectDeleteMarker": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Expiredobjectdeletemarker" } }, "title": "LifecycleExpiration", "type": "object" }, "LifecycleRule": { "description": "A lifecycle rule for individual objects in an Amazon S3 bucket.\n\nFor more information see,\n`Managing your storage lifecycle <https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html>`_\nin the *Amazon S3 User\nGuide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Expiration": { "anyOf": [ { "$ref": "#/$defs/LifecycleExpiration" }, { "type": "null" } ], "default": null }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" }, "Filter": { "anyOf": [ { "$ref": "#/$defs/LifecycleRuleFilter" }, { "type": "null" } ], "default": null }, "Status": { "enum": [ "Enabled", "Disabled" ], "title": "Status", "type": "string" }, "Transitions": { "anyOf": [ { "items": { "$ref": "#/$defs/Transition" }, "type": "array" }, { "type": "null" } ], "title": "Transitions" }, "NoncurrentVersionTransitions": { "anyOf": [ { "items": { "$ref": "#/$defs/NoncurrentVersionTransition" }, "type": "array" }, { "type": "null" } ], "title": "Noncurrentversiontransitions" }, "NoncurrentVersionExpiration": { "anyOf": [ { "$ref": "#/$defs/S3NoncurrentVersionExpiration" }, { "type": "null" } ], "default": null }, "AbortIncompleteMultipartUpload": { "anyOf": [ { "$ref": "#/$defs/S3AbortIncompleteMultipartUpload" }, { "type": "null" } ], "default": null } }, "required": [ "Status" ], "title": "LifecycleRule", "type": "object" }, "LifecycleRuleAndOperator": { "description": "This is used in a Lifecycle Rule Filter to apply a logical AND to two or more\npredicates.\n\nThe Lifecycle Rule will apply to any object matching all of the predicates\nconfigured inside the And operator.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" }, "Tags": { "anyOf": [ { "items": { "$ref": "#/$defs/Tag" }, "type": "array" }, { "type": "null" } ], "title": "Tags" }, "ObjectSizeGreaterThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizegreaterthan" }, "ObjectSizeLessThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizelessthan" } }, "title": "LifecycleRuleAndOperator", "type": "object" }, "LifecycleRuleFilter": { "description": "The ``Filter`` is used to identify objects that a Lifecycle Rule applies to.\n\nA ``Filter`` can have exactly one of\n``Prefix``, ``Tag``, ``ObjectSizeGreaterThan``, ``ObjectSizeLessThan``, or ``And`` specified. If the ``Filter`` element\nis left empty, the Lifecycle Rule applies to all objects in the bucket.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Tag": { "$ref": "#/$defs/Tag", "default": null }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" }, "ObjectSizeGreaterThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizegreaterthan" }, "ObjectSizeLessThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizelessthan" }, "And": { "anyOf": [ { "$ref": "#/$defs/LifecycleRuleAndOperator" }, { "type": "null" } ], "default": null } }, "title": "LifecycleRuleFilter", "type": "object" }, "NoncurrentVersionTransition": { "description": "Container for the transition rule that describes when noncurrent objects transition\nto the ``STANDARD_IA``, ``ONEZONE_IA``, ``INTELLIGENT_TIERING``, ``GLACIER_IR``,\n``GLACIER``, or ``DEEP_ARCHIVE`` storage class.\n\nIf your bucket\nis versioning-enabled (or versioning is suspended), you can set this action to request that Amazon S3 transition\nnoncurrent object versions to the ``STANDARD_IA``, ``ONEZONE_IA``, ``INTELLIGENT_TIERING``, ``GLACIER_IR``, ``GLACIER``,\nor ``DEEP_ARCHIVE`` storage class at a specific period in the object's lifetime.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "NoncurrentDays": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Noncurrentdays" }, "StorageClass": { "anyOf": [ { "enum": [ "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE", "GLACIER_IR" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Storageclass" }, "NewerNoncurrentVersions": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Newernoncurrentversions" } }, "title": "NoncurrentVersionTransition", "type": "object" }, "S3AbortIncompleteMultipartUpload": { "description": "Specifies the days since the initiation of an incomplete multipart upload that\nAmazon S3 will wait before permanently removing all parts of the upload.\n\nFor more information, see\n`Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration <https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-\nlifecycle-config>`_ in the *Amazon S3 User Guide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DaysAfterInitiation": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Daysafterinitiation" } }, "title": "S3AbortIncompleteMultipartUpload", "type": "object" }, "S3NoncurrentVersionExpiration": { "description": "Specifies when noncurrent object versions expire. Upon expiration, Amazon S3\npermanently deletes the noncurrent object versions. You set this lifecycle\nconfiguration action on a bucket that has versioning enabled (or suspended) to\nrequest that Amazon S3 delete noncurrent object versions at a specific period in the\nobject's lifetime.\n\nThis parameter applies to general purpose buckets only. It is not supported for\ndirectory bucket lifecycle configurations.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "NoncurrentDays": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Noncurrentdays" }, "NewerNoncurrentVersions": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Newernoncurrentversions" } }, "title": "S3NoncurrentVersionExpiration", "type": "object" }, "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" }, "Transition": { "description": "Specifies when an object transitions to a specified storage class.\n\nFor more information about Amazon S3 lifecycle configuration rules, see\n`Transitioning Objects Using Amazon S3 Lifecycle <https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html>`_\nin the\n*Amazon S3 User Guide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Date": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Date" }, "Days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Days" }, "StorageClass": { "anyOf": [ { "enum": [ "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE", "GLACIER_IR" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Storageclass" } }, "title": "Transition", "type": "object" } }, "required": [ "Rules" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Rules: builtins.list[LifecycleRule] [Required]
A lifecycle rule for individual objects in an Amazon S3 bucket.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.BucketLoggingConfiguration[source]
Bases:
Boto3ModelDescribes where logs are stored and the prefix that Amazon S3 assigns to all log object keys for a bucket.
For more information, see PUT Bucket logging in the Amazon S3 API Reference.
Show JSON schema
{ "title": "BucketLoggingConfiguration", "description": "Describes where logs are stored and the prefix that Amazon S3 assigns to all log\nobject keys for a bucket.\n\nFor more information, see\n`PUT Bucket logging <https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html>`_\nin the\n*Amazon S3 API Reference*.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "TargetBucket": { "title": "Targetbucket", "type": "string" }, "TargetGrants": { "anyOf": [ { "items": { "$ref": "#/$defs/TargetGrant" }, "type": "array" }, { "type": "null" } ], "title": "Targetgrants" }, "TargetPrefix": { "title": "Targetprefix", "type": "string" }, "TargetObjectKeyFormat": { "anyOf": [ { "$ref": "#/$defs/S3TargetObjectKeyFormat" }, { "type": "null" } ], "default": null } }, "$defs": { "S3Grantee": { "description": "Container for the person being granted permissions.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "EmailAddress": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Emailaddress" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "Type": { "enum": [ "CanonicalUser", "AmazonCustomerByEmail", "Group" ], "title": "Type", "type": "string" }, "URI": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Uri" } }, "required": [ "Type" ], "title": "S3Grantee", "type": "object" }, "S3PartitionedPrefix": { "description": "Amazon S3 keys for log objects are partitioned in the following format:\n\n``[DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-\n[UniqueString]``\n\nPartitionedPrefix defaults to EventTime delivery when server access logs are delivered.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "PartitionDateSource": { "anyOf": [ { "enum": [ "EventTime", "DeliveryTime" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Partitiondatesource" } }, "title": "S3PartitionedPrefix", "type": "object" }, "S3SimplePrefix": { "description": "To use simple format for S3 keys for log objects, set SimplePrefix to an empty\nobject.\n\n``[DestinationPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]``", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } }, "title": "S3SimplePrefix", "type": "object" }, "S3TargetObjectKeyFormat": { "description": "Amazon S3 key format for log objects.\n\nOnly one format, PartitionedPrefix or SimplePrefix, is allowed.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "SimplePrefix": { "anyOf": [ { "$ref": "#/$defs/S3SimplePrefix" }, { "type": "null" } ], "default": null }, "PartitionedPrefix": { "anyOf": [ { "$ref": "#/$defs/S3PartitionedPrefix" }, { "type": "null" } ], "default": null } }, "title": "S3TargetObjectKeyFormat", "type": "object" }, "TargetGrant": { "description": "Container for granting information.\n\nBuckets that use the bucket owner enforced setting for Object Ownership don't support target grants. For more\ninformation, see `Permissions server access log delivery <https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-\nserver-access-logging.html#grant-log-delivery-permissions-general>`_ in the *Amazon S3 User Guide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Grantee": { "anyOf": [ { "$ref": "#/$defs/S3Grantee" }, { "type": "null" } ], "default": null }, "Permission": { "anyOf": [ { "enum": [ "FULL_CONTROL", "READ", "WRITE" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Permission" } }, "title": "TargetGrant", "type": "object" } }, "required": [ "TargetBucket", "TargetPrefix" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field TargetBucket: str [Required]
Specifies the bucket where you want Amazon S3 to store server access logs.
You can have your logs delivered to any bucket that you own, including the same bucket that is being logged. You can also configure multiple buckets to deliver their logs to the same target bucket. In this case, you should choose a different
TargetPrefixfor each source bucket so that the delivered log files can be distinguished by key.
- field TargetGrants: builtins.list[TargetGrant] | None [Optional]
Container for granting information.
- field TargetObjectKeyFormat: S3TargetObjectKeyFormat | None = None
Amazon S3 key format for log objects.
- field TargetPrefix: str [Required]
A prefix for all log object keys.
If you store log files from multiple Amazon S3 buckets in a single bucket, you can use a prefix to distinguish which log files came from which bucket.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.LifecycleExpiration[source]
Bases:
Boto3ModelContainer for the expiration for the lifecycle of the object.
For more information see, Managing your storage lifecycle in the Amazon S3 User Guide.
Show JSON schema
{ "title": "LifecycleExpiration", "description": "Container for the expiration for the lifecycle of the object.\n\nFor more information see,\n`Managing your storage lifecycle <https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html>`_\nin the *Amazon S3 User\nGuide*.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Date": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Date" }, "Days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Days" }, "ExpiredObjectDeleteMarker": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Expiredobjectdeletemarker" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Date: datetime | None = None
Indicates at what date the object is to be moved or deleted.
The date value must conform to the ISO 8601 format. The time is always midnight UTC.
- field Days: int | None = None
Indicates the lifetime, in days, of the objects that are subject to the rule.
The value must be a non-zero positive integer.
- field ExpiredObjectDeleteMarker: bool | None = None
Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions.
If set to true, the delete marker will be expired; if set to false the policy takes no action. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.LifecycleRule[source]
Bases:
Boto3ModelA lifecycle rule for individual objects in an Amazon S3 bucket.
For more information see, Managing your storage lifecycle in the Amazon S3 User Guide.
Show JSON schema
{ "title": "LifecycleRule", "description": "A lifecycle rule for individual objects in an Amazon S3 bucket.\n\nFor more information see,\n`Managing your storage lifecycle <https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html>`_\nin the *Amazon S3 User\nGuide*.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Expiration": { "anyOf": [ { "$ref": "#/$defs/LifecycleExpiration" }, { "type": "null" } ], "default": null }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" }, "Filter": { "anyOf": [ { "$ref": "#/$defs/LifecycleRuleFilter" }, { "type": "null" } ], "default": null }, "Status": { "enum": [ "Enabled", "Disabled" ], "title": "Status", "type": "string" }, "Transitions": { "anyOf": [ { "items": { "$ref": "#/$defs/Transition" }, "type": "array" }, { "type": "null" } ], "title": "Transitions" }, "NoncurrentVersionTransitions": { "anyOf": [ { "items": { "$ref": "#/$defs/NoncurrentVersionTransition" }, "type": "array" }, { "type": "null" } ], "title": "Noncurrentversiontransitions" }, "NoncurrentVersionExpiration": { "anyOf": [ { "$ref": "#/$defs/S3NoncurrentVersionExpiration" }, { "type": "null" } ], "default": null }, "AbortIncompleteMultipartUpload": { "anyOf": [ { "$ref": "#/$defs/S3AbortIncompleteMultipartUpload" }, { "type": "null" } ], "default": null } }, "$defs": { "LifecycleExpiration": { "description": "Container for the expiration for the lifecycle of the object.\n\nFor more information see,\n`Managing your storage lifecycle <https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html>`_\nin the *Amazon S3 User\nGuide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Date": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Date" }, "Days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Days" }, "ExpiredObjectDeleteMarker": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Expiredobjectdeletemarker" } }, "title": "LifecycleExpiration", "type": "object" }, "LifecycleRuleAndOperator": { "description": "This is used in a Lifecycle Rule Filter to apply a logical AND to two or more\npredicates.\n\nThe Lifecycle Rule will apply to any object matching all of the predicates\nconfigured inside the And operator.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" }, "Tags": { "anyOf": [ { "items": { "$ref": "#/$defs/Tag" }, "type": "array" }, { "type": "null" } ], "title": "Tags" }, "ObjectSizeGreaterThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizegreaterthan" }, "ObjectSizeLessThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizelessthan" } }, "title": "LifecycleRuleAndOperator", "type": "object" }, "LifecycleRuleFilter": { "description": "The ``Filter`` is used to identify objects that a Lifecycle Rule applies to.\n\nA ``Filter`` can have exactly one of\n``Prefix``, ``Tag``, ``ObjectSizeGreaterThan``, ``ObjectSizeLessThan``, or ``And`` specified. If the ``Filter`` element\nis left empty, the Lifecycle Rule applies to all objects in the bucket.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Tag": { "$ref": "#/$defs/Tag", "default": null }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" }, "ObjectSizeGreaterThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizegreaterthan" }, "ObjectSizeLessThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizelessthan" }, "And": { "anyOf": [ { "$ref": "#/$defs/LifecycleRuleAndOperator" }, { "type": "null" } ], "default": null } }, "title": "LifecycleRuleFilter", "type": "object" }, "NoncurrentVersionTransition": { "description": "Container for the transition rule that describes when noncurrent objects transition\nto the ``STANDARD_IA``, ``ONEZONE_IA``, ``INTELLIGENT_TIERING``, ``GLACIER_IR``,\n``GLACIER``, or ``DEEP_ARCHIVE`` storage class.\n\nIf your bucket\nis versioning-enabled (or versioning is suspended), you can set this action to request that Amazon S3 transition\nnoncurrent object versions to the ``STANDARD_IA``, ``ONEZONE_IA``, ``INTELLIGENT_TIERING``, ``GLACIER_IR``, ``GLACIER``,\nor ``DEEP_ARCHIVE`` storage class at a specific period in the object's lifetime.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "NoncurrentDays": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Noncurrentdays" }, "StorageClass": { "anyOf": [ { "enum": [ "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE", "GLACIER_IR" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Storageclass" }, "NewerNoncurrentVersions": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Newernoncurrentversions" } }, "title": "NoncurrentVersionTransition", "type": "object" }, "S3AbortIncompleteMultipartUpload": { "description": "Specifies the days since the initiation of an incomplete multipart upload that\nAmazon S3 will wait before permanently removing all parts of the upload.\n\nFor more information, see\n`Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration <https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-\nlifecycle-config>`_ in the *Amazon S3 User Guide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DaysAfterInitiation": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Daysafterinitiation" } }, "title": "S3AbortIncompleteMultipartUpload", "type": "object" }, "S3NoncurrentVersionExpiration": { "description": "Specifies when noncurrent object versions expire. Upon expiration, Amazon S3\npermanently deletes the noncurrent object versions. You set this lifecycle\nconfiguration action on a bucket that has versioning enabled (or suspended) to\nrequest that Amazon S3 delete noncurrent object versions at a specific period in the\nobject's lifetime.\n\nThis parameter applies to general purpose buckets only. It is not supported for\ndirectory bucket lifecycle configurations.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "NoncurrentDays": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Noncurrentdays" }, "NewerNoncurrentVersions": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Newernoncurrentversions" } }, "title": "S3NoncurrentVersionExpiration", "type": "object" }, "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" }, "Transition": { "description": "Specifies when an object transitions to a specified storage class.\n\nFor more information about Amazon S3 lifecycle configuration rules, see\n`Transitioning Objects Using Amazon S3 Lifecycle <https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html>`_\nin the\n*Amazon S3 User Guide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Date": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Date" }, "Days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Days" }, "StorageClass": { "anyOf": [ { "enum": [ "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE", "GLACIER_IR" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Storageclass" } }, "title": "Transition", "type": "object" } }, "required": [ "Status" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
AbortIncompleteMultipartUpload (botocraft.services.s3.S3AbortIncompleteMultipartUpload | None)Expiration (botocraft.services.s3.LifecycleExpiration | None)NoncurrentVersionExpiration (botocraft.services.s3.S3NoncurrentVersionExpiration | None)NoncurrentVersionTransitions (list[botocraft.services.s3.NoncurrentVersionTransition] | None)
- field AbortIncompleteMultipartUpload: S3AbortIncompleteMultipartUpload | None = None
Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload.
For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration in the Amazon S3 User Guide.
- field Expiration: LifecycleExpiration | None = None
Specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker.
- field Filter: LifecycleRuleFilter | None = None
The
Filteris used to identify objects that a Lifecycle Rule applies to.A
Filtermust have exactly one ofPrefix,Tag,ObjectSizeGreaterThan,ObjectSizeLessThan, orAndspecified.Filteris required if theLifecycleRuledoes not contain aPrefixelement.
- field ID: str | None = None
Unique identifier for the rule.
The value cannot be longer than 255 characters.
- field NoncurrentVersionExpiration: S3NoncurrentVersionExpiration | None = None
Specifies when noncurrent object versions expire.
Upon expiration, Amazon S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that Amazon S3 delete noncurrent object versions at a specific period in the object’s lifetime.
- field NoncurrentVersionTransitions: builtins.list[NoncurrentVersionTransition] | None [Optional]
Specifies the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific storage class.
If your bucket is versioning-enabled (or versioning is suspended), you can set this action to request that Amazon S3 transition noncurrent object versions to a specific storage class at a set period in the object’s lifetime.
- field Prefix: str | None = None
The general purpose bucket prefix that identifies one or more objects to which the rule applies.
We recommend using
Filterinstead ofPrefixfor new PUTs. Previous configurations where a prefix is defined will continue to operate as before.
- field Status: Literal['Enabled', 'Disabled'] [Required]
If ‘Enabled’, the rule is currently being applied.
If ‘Disabled’, the rule is not currently being applied.
- field Transitions: builtins.list[Transition] | None [Optional]
Specifies when an Amazon S3 object transitions to a specified storage class.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.LifecycleRuleAndOperator[source]
Bases:
TagsDictMixin,Boto3ModelThis is used in a Lifecycle Rule Filter to apply a logical AND to two or more predicates.
The Lifecycle Rule will apply to any object matching all of the predicates configured inside the And operator.
Show JSON schema
{ "title": "LifecycleRuleAndOperator", "description": "This is used in a Lifecycle Rule Filter to apply a logical AND to two or more\npredicates.\n\nThe Lifecycle Rule will apply to any object matching all of the predicates\nconfigured inside the And operator.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" }, "Tags": { "anyOf": [ { "items": { "$ref": "#/$defs/Tag" }, "type": "array" }, { "type": "null" } ], "title": "Tags" }, "ObjectSizeGreaterThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizegreaterthan" }, "ObjectSizeLessThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizelessthan" } }, "$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" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Tags: builtins.list[Tag] | None [Optional]
All of these tags must exist in the object’s tag set in order for the rule to apply.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.session.Session. We exclude it from the model dump because it’s not something that should be serialized.
- tag_class
alias of
Tag
- 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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.LifecycleRuleFilter[source]
Bases:
Boto3ModelThe
Filteris used to identify objects that a Lifecycle Rule applies to.A
Filtercan have exactly one ofPrefix,Tag,ObjectSizeGreaterThan,ObjectSizeLessThan, orAndspecified. If theFilterelement is left empty, the Lifecycle Rule applies to all objects in the bucket.Show JSON schema
{ "title": "LifecycleRuleFilter", "description": "The ``Filter`` is used to identify objects that a Lifecycle Rule applies to.\n\nA ``Filter`` can have exactly one of\n``Prefix``, ``Tag``, ``ObjectSizeGreaterThan``, ``ObjectSizeLessThan``, or ``And`` specified. If the ``Filter`` element\nis left empty, the Lifecycle Rule applies to all objects in the bucket.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Tag": { "$ref": "#/$defs/Tag", "default": null }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" }, "ObjectSizeGreaterThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizegreaterthan" }, "ObjectSizeLessThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizelessthan" }, "And": { "anyOf": [ { "$ref": "#/$defs/LifecycleRuleAndOperator" }, { "type": "null" } ], "default": null } }, "$defs": { "LifecycleRuleAndOperator": { "description": "This is used in a Lifecycle Rule Filter to apply a logical AND to two or more\npredicates.\n\nThe Lifecycle Rule will apply to any object matching all of the predicates\nconfigured inside the And operator.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" }, "Tags": { "anyOf": [ { "items": { "$ref": "#/$defs/Tag" }, "type": "array" }, { "type": "null" } ], "title": "Tags" }, "ObjectSizeGreaterThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizegreaterthan" }, "ObjectSizeLessThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizelessthan" } }, "title": "LifecycleRuleAndOperator", "type": "object" }, "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" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field And: LifecycleRuleAndOperator | None = None
This is used in a Lifecycle Rule Filter to apply a logical AND to two or more predicates.
The Lifecycle Rule will apply to any object matching all of the predicates configured inside the And operator.
- field RuleTag: Tag = None (alias 'Tag')
This tag must exist in the object’s tag set in order for the rule to apply.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.NoncurrentVersionTransition[source]
Bases:
Boto3ModelContainer for the transition rule that describes when noncurrent objects transition to the
STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,GLACIER_IR,GLACIER, orDEEP_ARCHIVEstorage class.If your bucket is versioning-enabled (or versioning is suspended), you can set this action to request that Amazon S3 transition noncurrent object versions to the
STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,GLACIER_IR,GLACIER, orDEEP_ARCHIVEstorage class at a specific period in the object’s lifetime.Show JSON schema
{ "title": "NoncurrentVersionTransition", "description": "Container for the transition rule that describes when noncurrent objects transition\nto the ``STANDARD_IA``, ``ONEZONE_IA``, ``INTELLIGENT_TIERING``, ``GLACIER_IR``,\n``GLACIER``, or ``DEEP_ARCHIVE`` storage class.\n\nIf your bucket\nis versioning-enabled (or versioning is suspended), you can set this action to request that Amazon S3 transition\nnoncurrent object versions to the ``STANDARD_IA``, ``ONEZONE_IA``, ``INTELLIGENT_TIERING``, ``GLACIER_IR``, ``GLACIER``,\nor ``DEEP_ARCHIVE`` storage class at a specific period in the object's lifetime.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "NoncurrentDays": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Noncurrentdays" }, "StorageClass": { "anyOf": [ { "enum": [ "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE", "GLACIER_IR" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Storageclass" }, "NewerNoncurrentVersions": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Newernoncurrentversions" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field NewerNoncurrentVersions: int | None = None
Specifies how many noncurrent versions Amazon S3 will retain in the same storage class before transitioning objects.
You can specify up to 100 noncurrent versions to retain. Amazon S3 will transition any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the Amazon S3 User Guide.
- field NoncurrentDays: int | None = None
Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action.
For information about the noncurrent days calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent in the Amazon S3 User Guide.
- field StorageClass: Literal['GLACIER', 'STANDARD_IA', 'ONEZONE_IA', 'INTELLIGENT_TIERING', 'DEEP_ARCHIVE', 'GLACIER_IR'] | None = None
The class of storage used to store the object.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.Redirect[source]
Bases:
Boto3ModelSpecifies how requests are redirected.
In the event of an error, you can specify a different error code to return.
Show JSON schema
{ "title": "Redirect", "description": "Specifies how requests are redirected.\n\nIn the event of an error, you can specify a different error code to return.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "HostName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Hostname" }, "HttpRedirectCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Httpredirectcode" }, "Protocol": { "anyOf": [ { "enum": [ "http", "https" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Protocol" }, "ReplaceKeyPrefixWith": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Replacekeyprefixwith" }, "ReplaceKeyWith": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Replacekeywith" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field HttpRedirectCode: str | None = None
The HTTP redirect code to use on the response.
Not required if one of the siblings is present.
- field Protocol: Literal['http', 'https'] | None = None
Protocol to use when redirecting requests.
The default is the protocol that is used in the original request.
- field ReplaceKeyPrefixWith: str | None = None
The object key prefix to use in the redirect request.
For example, to redirect requests for all pages with prefix
docs/(objects in thedocs/folder) todocuments/, you can set a condition block withKeyPrefixEqualsset todocs/and in the Redirect setReplaceKeyPrefixWithto/documents. Not required if one of the siblings is present. Can be present only ifReplaceKeyWithis not provided.
- field ReplaceKeyWith: str | None = None
The specific object key to use in the redirect request.
For example, redirect request to
error.html. Not required if one of the siblings is present. Can be present only ifReplaceKeyPrefixWithis not provided.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3AbortIncompleteMultipartUpload[source]
Bases:
Boto3ModelSpecifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload.
For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration in the Amazon S3 User Guide.
Show JSON schema
{ "title": "S3AbortIncompleteMultipartUpload", "description": "Specifies the days since the initiation of an incomplete multipart upload that\nAmazon S3 will wait before permanently removing all parts of the upload.\n\nFor more information, see\n`Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration <https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-\nlifecycle-config>`_ in the *Amazon S3 User Guide*.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DaysAfterInitiation": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Daysafterinitiation" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field DaysAfterInitiation: int | None = None
Specifies the number of days after which Amazon S3 aborts an incomplete multipart upload.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3CORSRule[source]
Bases:
Boto3ModelSpecifies a cross-origin access rule for an Amazon S3 bucket.
Show JSON schema
{ "title": "S3CORSRule", "description": "Specifies a cross-origin access rule for an Amazon S3 bucket.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "AllowedHeaders": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Allowedheaders" }, "AllowedMethods": { "items": { "type": "string" }, "title": "Allowedmethods", "type": "array" }, "AllowedOrigins": { "items": { "type": "string" }, "title": "Allowedorigins", "type": "array" }, "ExposeHeaders": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Exposeheaders" }, "MaxAgeSeconds": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Maxageseconds" } }, "required": [ "AllowedMethods", "AllowedOrigins" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field AllowedHeaders: builtins.list[str] | None [Optional]
Headers that are specified in the
Access-Control-Request-Headersheader.These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed.
- field AllowedMethods: builtins.list[str] [Required]
An HTTP method that you allow the origin to execute.
Valid values are
GET,PUT,HEAD,POST, andDELETE.
- field AllowedOrigins: builtins.list[str] [Required]
One or more origins you want customers to be able to access the bucket from.
- field ExposeHeaders: builtins.list[str] | None [Optional]
One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript
XMLHttpRequestobject).
- field ID: str | None = None
Unique identifier for the rule.
The value cannot be longer than 255 characters.
- field MaxAgeSeconds: int | None = None
The time in seconds that your browser is to cache the preflight response for the specified resource.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3Condition[source]
Bases:
Boto3ModelA container for describing a condition that must be met for the specified redirect to apply.
For example, 1. If request is for pages in the
/docsfolder, redirect to the/documentsfolder. 2. If request results in HTTP error 4xx, redirect request to another host where you might process the error.Show JSON schema
{ "title": "S3Condition", "description": "A container for describing a condition that must be met for the specified redirect\nto apply.\n\nFor example, 1. If request\nis for pages in the ``/docs`` folder, redirect to the ``/documents`` folder. 2. If request results in HTTP error 4xx,\nredirect request to another host where you might process the error.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "HttpErrorCodeReturnedEquals": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Httperrorcodereturnedequals" }, "KeyPrefixEquals": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Keyprefixequals" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field HttpErrorCodeReturnedEquals: str | None = None
The HTTP error code when the redirect is applied.
In the event of an error, if the error code equals this value, then the specified redirect is applied. Required when parent element
Conditionis specified and siblingKeyPrefixEqualsis not specified. If both are specified, then both must be true for the redirect to be applied.
- field KeyPrefixEquals: str | None = None
The object key name prefix when the redirect is applied.
For example, to redirect requests for
ExamplePage.html, the key prefix will beExamplePage.html. To redirect request for all pages with the prefixdocs/, the key prefix will be/docs, which identifies all objects in thedocs/folder. Required when the parent elementConditionis specified and siblingHttpErrorCodeReturnedEqualsis not specified. If both conditions are specified, both must be true for the redirect to be applied.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3ErrorDocument[source]
Bases:
Boto3ModelThe error information.
Show JSON schema
{ "title": "S3ErrorDocument", "description": "The error information.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Key": { "title": "Key", "type": "string" } }, "required": [ "Key" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3Grantee[source]
Bases:
Boto3ModelContainer for the person being granted permissions.
Show JSON schema
{ "title": "S3Grantee", "description": "Container for the person being granted permissions.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "EmailAddress": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Emailaddress" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "Type": { "enum": [ "CanonicalUser", "AmazonCustomerByEmail", "Group" ], "title": "Type", "type": "string" }, "URI": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Uri" } }, "required": [ "Type" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3IndexDocument[source]
Bases:
Boto3ModelContainer for the
Suffixelement.Show JSON schema
{ "title": "S3IndexDocument", "description": "Container for the ``Suffix`` element.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Suffix": { "title": "Suffix", "type": "string" } }, "required": [ "Suffix" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Suffix: str [Required]
A suffix that is appended to a request that is for a directory on the website endpoint.
(For example, if the suffix is
index.htmland you make a request tosamplebucket/images/, the data that is returned will be for the object with the key nameimages/index.html.) The suffix must not be empty and must not include a slash character.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3NoncurrentVersionExpiration[source]
Bases:
Boto3ModelSpecifies when noncurrent object versions expire. Upon expiration, Amazon S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that Amazon S3 delete noncurrent object versions at a specific period in the object’s lifetime.
This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations.
Show JSON schema
{ "title": "S3NoncurrentVersionExpiration", "description": "Specifies when noncurrent object versions expire. Upon expiration, Amazon S3\npermanently deletes the noncurrent object versions. You set this lifecycle\nconfiguration action on a bucket that has versioning enabled (or suspended) to\nrequest that Amazon S3 delete noncurrent object versions at a specific period in the\nobject's lifetime.\n\nThis parameter applies to general purpose buckets only. It is not supported for\ndirectory bucket lifecycle configurations.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "NoncurrentDays": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Noncurrentdays" }, "NewerNoncurrentVersions": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Newernoncurrentversions" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field NewerNoncurrentVersions: int | None = None
Specifies how many noncurrent versions Amazon S3 will retain.
You can specify up to 100 noncurrent versions to retain. Amazon S3 will permanently delete any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the Amazon S3 User Guide.
- field NoncurrentDays: int | None = None
Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action.
The value must be a non-zero positive integer. For information about the noncurrent days calculations, see How Amazon S3 Calculates When an Object Became Noncurrent in the Amazon S3 User Guide.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3Owner[source]
Bases:
Boto3ModelContainer for the owner’s display name and ID.
Show JSON schema
{ "title": "S3Owner", "description": "Container for the owner's display name and ID.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3PartitionedPrefix[source]
Bases:
Boto3ModelAmazon S3 keys for log objects are partitioned in the following format:
[DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]- [UniqueString]PartitionedPrefix defaults to EventTime delivery when server access logs are delivered.
Show JSON schema
{ "title": "S3PartitionedPrefix", "description": "Amazon S3 keys for log objects are partitioned in the following format:\n\n``[DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-\n[UniqueString]``\n\nPartitionedPrefix defaults to EventTime delivery when server access logs are delivered.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "PartitionDateSource": { "anyOf": [ { "enum": [ "EventTime", "DeliveryTime" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Partitiondatesource" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field PartitionDateSource: Literal['EventTime', 'DeliveryTime'] | None = None
Specifies the partition date source for the partitioned prefix.
PartitionDateSourcecan beEventTimeorDeliveryTime.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3PublicAccessBlockConfiguration[source]
Bases:
Boto3ModelThe PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket.
You can enable the configuration options in any combination. Bucket-level settings work alongside account-level settings (which may inherit from organization-level policies). For more information about when Amazon S3 considers a bucket or object public, see The Meaning of “Public” in the Amazon S3 User Guide.
Show JSON schema
{ "title": "S3PublicAccessBlockConfiguration", "description": "The PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket.\n\nYou can enable the configuration\noptions in any combination. Bucket-level settings work alongside account-level settings (which may inherit from\norganization-level policies). For more information about when Amazon S3 considers a bucket or object public, see `The\nMeaning of \"Public\" <https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-\ncontrol-block-public-access-policy-status>`_ in the *Amazon S3 User Guide*.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "BlockPublicAcls": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Blockpublicacls" }, "IgnorePublicAcls": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Ignorepublicacls" }, "BlockPublicPolicy": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Blockpublicpolicy" }, "RestrictPublicBuckets": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Restrictpublicbuckets" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field BlockPublicAcls: bool | None = None
Specifies whether Amazon S3 should block public access control lists (ACLs) for this bucket and objects in this bucket.
Setting this element to
TRUEcauses the following behavior:
- field BlockPublicPolicy: bool | None = None
Specifies whether Amazon S3 should block public bucket policies for this bucket.
Setting this element to
TRUEcauses Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access.
- field IgnorePublicAcls: bool | None = None
Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket.
Setting this element to
TRUEcauses Amazon S3 to ignore all public ACLs on this bucket and objects in this bucket.
- field RestrictPublicBuckets: bool | None = None
Specifies whether Amazon S3 should restrict public bucket policies for this bucket.
Setting this element to
TRUErestricts access to this bucket to only Amazon Web Services service principals and authorized users within this account if the bucket has a public policy.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3RedirectAllRequestsTo[source]
Bases:
Boto3ModelSpecifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.
Show JSON schema
{ "title": "S3RedirectAllRequestsTo", "description": "Specifies the redirect behavior of all requests to a website endpoint of an Amazon\nS3 bucket.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "HostName": { "title": "Hostname", "type": "string" }, "Protocol": { "anyOf": [ { "enum": [ "http", "https" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Protocol" } }, "required": [ "HostName" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Protocol: Literal['http', 'https'] | None = None
Protocol to use when redirecting requests.
The default is the protocol that is used in the original 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3RestoreStatus[source]
Bases:
Boto3ModelSpecifies the restoration status of an object. Objects in certain storage classes must be restored before they can be retrieved. For more information about these storage classes and how to work with archived objects, see Working with archived objects in the Amazon S3 User Guide.
This functionality is not supported for directory buckets. Directory buckets only support
EXPRESS_ONEZONE(the S3 Express One Zone storage class) in Availability Zones andONEZONE_IA(the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones.Show JSON schema
{ "title": "S3RestoreStatus", "description": "Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be\nretrieved. For more information about these storage classes and how to work with archived objects, see `Working with\narchived objects <https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html>`_ in the *Amazon S3 User\nGuide*.\n\nThis functionality is not supported for directory buckets. Directory buckets only support ``EXPRESS_ONEZONE`` (the S3\nExpress One Zone storage class) in Availability Zones and ``ONEZONE_IA`` (the S3 One Zone-Infrequent Access storage\nclass) in Dedicated Local Zones.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "IsRestoreInProgress": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Isrestoreinprogress" }, "RestoreExpiryDate": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Restoreexpirydate" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field IsRestoreInProgress: bool | None = None
Specifies whether the object is currently being restored.
If the object restoration is in progress, the header returns the value
TRUE. For example:
- field RestoreExpiryDate: datetime | None = None
Indicates when the restored copy will expire.
This value is populated only if the object has already been restored. For example:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3RoutingRule[source]
Bases:
Boto3ModelSpecifies the redirect behavior and when a redirect is applied.
For more information about routing rules, see Configuring advanced conditional redirects in the Amazon S3 User Guide.
Show JSON schema
{ "title": "S3RoutingRule", "description": "Specifies the redirect behavior and when a redirect is applied.\n\nFor more information about routing rules, see\n`Configuring advanced conditional redirects <https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-\nredirect.html#advanced-conditional-redirects>`_ in the *Amazon S3 User Guide*.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Condition": { "anyOf": [ { "$ref": "#/$defs/S3Condition" }, { "type": "null" } ], "default": null }, "Redirect": { "$ref": "#/$defs/Redirect" } }, "$defs": { "Redirect": { "description": "Specifies how requests are redirected.\n\nIn the event of an error, you can specify a different error code to return.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "HostName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Hostname" }, "HttpRedirectCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Httpredirectcode" }, "Protocol": { "anyOf": [ { "enum": [ "http", "https" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Protocol" }, "ReplaceKeyPrefixWith": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Replacekeyprefixwith" }, "ReplaceKeyWith": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Replacekeywith" } }, "title": "Redirect", "type": "object" }, "S3Condition": { "description": "A container for describing a condition that must be met for the specified redirect\nto apply.\n\nFor example, 1. If request\nis for pages in the ``/docs`` folder, redirect to the ``/documents`` folder. 2. If request results in HTTP error 4xx,\nredirect request to another host where you might process the error.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "HttpErrorCodeReturnedEquals": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Httperrorcodereturnedequals" }, "KeyPrefixEquals": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Keyprefixequals" } }, "title": "S3Condition", "type": "object" } }, "required": [ "Redirect" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Condition: S3Condition | None = None
A container for describing a condition that must be met for the specified redirect to apply.
For example, 1. If request is for pages in the
/docsfolder, redirect to the/documentsfolder. 2. If request results in HTTP error 4xx, redirect request to another host where you might process the error.
- field Redirect: Redirect [Required]
Container for redirect information.
You can redirect requests to another host, to another page, or with another protocol. In the event of an error, you can specify a different error code to return.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3SimplePrefix[source]
Bases:
Boto3ModelTo use simple format for S3 keys for log objects, set SimplePrefix to an empty object.
[DestinationPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]Show JSON schema
{ "title": "S3SimplePrefix", "description": "To use simple format for S3 keys for log objects, set SimplePrefix to an empty\nobject.\n\n``[DestinationPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]``", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3TargetObjectKeyFormat[source]
Bases:
Boto3ModelAmazon S3 key format for log objects.
Only one format, PartitionedPrefix or SimplePrefix, is allowed.
Show JSON schema
{ "title": "S3TargetObjectKeyFormat", "description": "Amazon S3 key format for log objects.\n\nOnly one format, PartitionedPrefix or SimplePrefix, is allowed.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "SimplePrefix": { "anyOf": [ { "$ref": "#/$defs/S3SimplePrefix" }, { "type": "null" } ], "default": null }, "PartitionedPrefix": { "anyOf": [ { "$ref": "#/$defs/S3PartitionedPrefix" }, { "type": "null" } ], "default": null } }, "$defs": { "S3PartitionedPrefix": { "description": "Amazon S3 keys for log objects are partitioned in the following format:\n\n``[DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-\n[UniqueString]``\n\nPartitionedPrefix defaults to EventTime delivery when server access logs are delivered.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "PartitionDateSource": { "anyOf": [ { "enum": [ "EventTime", "DeliveryTime" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Partitiondatesource" } }, "title": "S3PartitionedPrefix", "type": "object" }, "S3SimplePrefix": { "description": "To use simple format for S3 keys for log objects, set SimplePrefix to an empty\nobject.\n\n``[DestinationPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]``", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } }, "title": "S3SimplePrefix", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field PartitionedPrefix: S3PartitionedPrefix | None = None
Partitioned S3 key for log objects.
- field SimplePrefix: S3SimplePrefix | None = None
To use the simple format for S3 keys for log objects.
To specify SimplePrefix format, set SimplePrefix to {}.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.TargetGrant[source]
Bases:
Boto3ModelContainer for granting information.
Buckets that use the bucket owner enforced setting for Object Ownership don’t support target grants. For more information, see Permissions server access log delivery in the Amazon S3 User Guide.
Show JSON schema
{ "title": "TargetGrant", "description": "Container for granting information.\n\nBuckets that use the bucket owner enforced setting for Object Ownership don't support target grants. For more\ninformation, see `Permissions server access log delivery <https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-\nserver-access-logging.html#grant-log-delivery-permissions-general>`_ in the *Amazon S3 User Guide*.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Grantee": { "anyOf": [ { "$ref": "#/$defs/S3Grantee" }, { "type": "null" } ], "default": null }, "Permission": { "anyOf": [ { "enum": [ "FULL_CONTROL", "READ", "WRITE" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Permission" } }, "$defs": { "S3Grantee": { "description": "Container for the person being granted permissions.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "EmailAddress": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Emailaddress" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "Type": { "enum": [ "CanonicalUser", "AmazonCustomerByEmail", "Group" ], "title": "Type", "type": "string" }, "URI": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Uri" } }, "required": [ "Type" ], "title": "S3Grantee", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Permission: Literal['FULL_CONTROL', 'READ', 'WRITE'] | None = None
Logging permissions assigned to the grantee for the bucket.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.Transition[source]
Bases:
Boto3ModelSpecifies when an object transitions to a specified storage class.
For more information about Amazon S3 lifecycle configuration rules, see Transitioning Objects Using Amazon S3 Lifecycle in the Amazon S3 User Guide.
Show JSON schema
{ "title": "Transition", "description": "Specifies when an object transitions to a specified storage class.\n\nFor more information about Amazon S3 lifecycle configuration rules, see\n`Transitioning Objects Using Amazon S3 Lifecycle <https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html>`_\nin the\n*Amazon S3 User Guide*.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Date": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Date" }, "Days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Days" }, "StorageClass": { "anyOf": [ { "enum": [ "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE", "GLACIER_IR" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Storageclass" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Date: datetime | None = None
Indicates when objects are transitioned to the specified storage class.
The date value must be in ISO 8601 format. The time is always midnight UTC.
- field Days: int | None = None
Indicates the number of days after creation when objects are transitioned to the specified storage class.
If the specified storage class is
INTELLIGENT_TIERING,GLACIER_IR,GLACIER, orDEEP_ARCHIVE, valid values are0or positive integers. If the specified storage class isSTANDARD_IAorONEZONE_IA, valid values are positive integers greater than30. Be aware that some storage classes have a minimum storage duration and that you’re charged for transitioning objects before their minimum storage duration. For more information, see Constraints and considerations for transitions in the Amazon S3 User Guide.
- field StorageClass: Literal['GLACIER', 'STANDARD_IA', 'ONEZONE_IA', 'INTELLIGENT_TIERING', 'DEEP_ARCHIVE', 'GLACIER_IR'] | None = None
The storage class to which you want the object to transition.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.WebsiteConfiguration[source]
Bases:
Boto3ModelSpecifies website configuration parameters for an Amazon S3 bucket.
Show JSON schema
{ "title": "WebsiteConfiguration", "description": "Specifies website configuration parameters for an Amazon S3 bucket.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "ErrorDocument": { "anyOf": [ { "$ref": "#/$defs/S3ErrorDocument" }, { "type": "null" } ], "default": null }, "IndexDocument": { "anyOf": [ { "$ref": "#/$defs/S3IndexDocument" }, { "type": "null" } ], "default": null }, "RedirectAllRequestsTo": { "anyOf": [ { "$ref": "#/$defs/S3RedirectAllRequestsTo" }, { "type": "null" } ], "default": null }, "RoutingRules": { "anyOf": [ { "items": { "$ref": "#/$defs/S3RoutingRule" }, "type": "array" }, { "type": "null" } ], "title": "Routingrules" } }, "$defs": { "Redirect": { "description": "Specifies how requests are redirected.\n\nIn the event of an error, you can specify a different error code to return.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "HostName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Hostname" }, "HttpRedirectCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Httpredirectcode" }, "Protocol": { "anyOf": [ { "enum": [ "http", "https" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Protocol" }, "ReplaceKeyPrefixWith": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Replacekeyprefixwith" }, "ReplaceKeyWith": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Replacekeywith" } }, "title": "Redirect", "type": "object" }, "S3Condition": { "description": "A container for describing a condition that must be met for the specified redirect\nto apply.\n\nFor example, 1. If request\nis for pages in the ``/docs`` folder, redirect to the ``/documents`` folder. 2. If request results in HTTP error 4xx,\nredirect request to another host where you might process the error.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "HttpErrorCodeReturnedEquals": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Httperrorcodereturnedequals" }, "KeyPrefixEquals": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Keyprefixequals" } }, "title": "S3Condition", "type": "object" }, "S3ErrorDocument": { "description": "The error information.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Key": { "title": "Key", "type": "string" } }, "required": [ "Key" ], "title": "S3ErrorDocument", "type": "object" }, "S3IndexDocument": { "description": "Container for the ``Suffix`` element.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Suffix": { "title": "Suffix", "type": "string" } }, "required": [ "Suffix" ], "title": "S3IndexDocument", "type": "object" }, "S3RedirectAllRequestsTo": { "description": "Specifies the redirect behavior of all requests to a website endpoint of an Amazon\nS3 bucket.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "HostName": { "title": "Hostname", "type": "string" }, "Protocol": { "anyOf": [ { "enum": [ "http", "https" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Protocol" } }, "required": [ "HostName" ], "title": "S3RedirectAllRequestsTo", "type": "object" }, "S3RoutingRule": { "description": "Specifies the redirect behavior and when a redirect is applied.\n\nFor more information about routing rules, see\n`Configuring advanced conditional redirects <https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-\nredirect.html#advanced-conditional-redirects>`_ in the *Amazon S3 User Guide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Condition": { "anyOf": [ { "$ref": "#/$defs/S3Condition" }, { "type": "null" } ], "default": null }, "Redirect": { "$ref": "#/$defs/Redirect" } }, "required": [ "Redirect" ], "title": "S3RoutingRule", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field ErrorDocument: S3ErrorDocument | None = None
The name of the error document for the website.
- field IndexDocument: S3IndexDocument | None = None
The name of the index document for the website.
- field RedirectAllRequestsTo: S3RedirectAllRequestsTo | None = None
The redirect behavior for every request to this bucket’s website endpoint.
- field RoutingRules: builtins.list[S3RoutingRule] | None [Optional]
Rules that define when a redirect is applied and the redirect behavior.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.AccessControlPolicy[source]
Bases:
Boto3ModelContains the elements that set the ACL permissions for an object per grantee.
Show JSON schema
{ "title": "AccessControlPolicy", "description": "Contains the elements that set the ACL permissions for an object per grantee.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Grants": { "anyOf": [ { "items": { "$ref": "#/$defs/Grant" }, "type": "array" }, { "type": "null" } ], "title": "Grants" }, "Owner": { "anyOf": [ { "$ref": "#/$defs/S3Owner" }, { "type": "null" } ], "default": null } }, "$defs": { "Grant": { "description": "Container for grant information.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Grantee": { "anyOf": [ { "$ref": "#/$defs/S3Grantee" }, { "type": "null" } ], "default": null }, "Permission": { "anyOf": [ { "enum": [ "FULL_CONTROL", "WRITE", "WRITE_ACP", "READ", "READ_ACP" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Permission" } }, "title": "Grant", "type": "object" }, "S3Grantee": { "description": "Container for the person being granted permissions.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "EmailAddress": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Emailaddress" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "Type": { "enum": [ "CanonicalUser", "AmazonCustomerByEmail", "Group" ], "title": "Type", "type": "string" }, "URI": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Uri" } }, "required": [ "Type" ], "title": "S3Grantee", "type": "object" }, "S3Owner": { "description": "Container for the owner's display name and ID.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" } }, "title": "S3Owner", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.CSVOutput[source]
Bases:
Boto3ModelDescribes how uncompressed comma-separated values (CSV)-formatted results are formatted.
Show JSON schema
{ "title": "CSVOutput", "description": "Describes how uncompressed comma-separated values (CSV)-formatted results are\nformatted.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "QuoteFields": { "anyOf": [ { "enum": [ "ALWAYS", "ASNEEDED" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Quotefields" }, "QuoteEscapeCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quoteescapecharacter" }, "RecordDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Recorddelimiter" }, "FieldDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Fielddelimiter" }, "QuoteCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quotecharacter" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field FieldDelimiter: str | None = None
The value used to separate individual fields in a record.
You can specify an arbitrary delimiter.
- field QuoteCharacter: str | None = None
A single character used for escaping when the field delimiter is part of the value.
For example, if the value is
a, b, Amazon S3 wraps this field value in quotation marks, as follows:" a , b ".
- field QuoteEscapeCharacter: str | None = None
The single character used for escaping the quote character inside an already escaped value.
- field QuoteFields: Literal['ALWAYS', 'ASNEEDED'] | None = None
Indicates whether to use quotation marks around output fields.
- field RecordDelimiter: str | None = None
A single character used to separate individual records in the output.
Instead of the default value, you can specify an arbitrary delimiter.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.CommonPrefix[source]
Bases:
Boto3ModelContainer for all (if there are any) keys between Prefix and the next occurrence of the string specified by a delimiter.
CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix. For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common prefix is notes/summer/.
Show JSON schema
{ "title": "CommonPrefix", "description": "Container for all (if there are any) keys between Prefix and the next occurrence of\nthe string specified by a delimiter.\n\nCommonPrefixes lists keys that act like subdirectories in the directory specified by\nPrefix. For example, if the prefix is notes/ and the delimiter is a slash (/) as in\nnotes/summer/july, the common prefix is notes/summer/.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.ContinuationEvent[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "ContinuationEvent", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.CopyObjectOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "CopyObjectOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "CopyObjectResult": { "anyOf": [ { "$ref": "#/$defs/S3CopyObjectResult" }, { "type": "null" } ], "default": null }, "Expiration": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Expiration" }, "CopySourceVersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Copysourceversionid" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" }, "ServerSideEncryption": { "anyOf": [ { "enum": [ "AES256", "aws:fsx", "aws:kms", "aws:kms:dsse" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Serversideencryption" }, "SSECustomerAlgorithm": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ssecustomeralgorithm" }, "SSECustomerKeyMD5": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ssecustomerkeymd5" }, "SSEKMSKeyId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ssekmskeyid" }, "SSEKMSEncryptionContext": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ssekmsencryptioncontext" }, "BucketKeyEnabled": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Bucketkeyenabled" }, "RequestCharged": { "anyOf": [ { "const": "requester", "type": "string" }, { "type": "null" } ], "default": null, "title": "Requestcharged" } }, "$defs": { "S3CopyObjectResult": { "description": "Container for all response elements.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "ETag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Etag" }, "LastModified": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Lastmodified" }, "ChecksumType": { "anyOf": [ { "enum": [ "COMPOSITE", "FULL_OBJECT" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumtype" }, "ChecksumCRC32": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32" }, "ChecksumCRC32C": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32C" }, "ChecksumCRC64NVME": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc64Nvme" }, "ChecksumSHA1": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha1" }, "ChecksumSHA256": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha256" }, "ChecksumSHA512": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha512" }, "ChecksumMD5": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksummd5" }, "ChecksumXXHASH64": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash64" }, "ChecksumXXHASH3": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash3" }, "ChecksumXXHASH128": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash128" } }, "title": "S3CopyObjectResult", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field BucketKeyEnabled: bool | None = None
Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).
- field CopyObjectResult: S3CopyObjectResult | None = None
Container for all response elements.
- field Expiration: str | None = None
If the object expiration is configured, the response includes this header.
- field RequestCharged: Literal['requester'] | None = None
If present, indicates that the requester was successfully charged for the request.
For more information, see Using Requester Pays buckets for storage transfers and usage in the Amazon Simple Storage Service user guide.
- field SSECustomerAlgorithm: str | None = None
If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that’s used.
- field SSECustomerKeyMD5: str | None = None
If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.
- field SSEKMSEncryptionContext: str | None = None
If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption.
The value of this header is a Base64 encoded UTF-8 string holding JSON with the encryption context key-value pairs.
- field SSEKMSKeyId: str | None = None
If present, indicates the ID of the KMS key that was used for object encryption.
- field ServerSideEncryption: Literal['AES256', 'aws:fsx', 'aws:kms', 'aws:kms:dsse'] | None = None
The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.Delete[source]
Bases:
Boto3ModelContainer for the objects to delete.
Show JSON schema
{ "title": "Delete", "description": "Container for the objects to delete.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Objects": { "items": { "$ref": "#/$defs/ObjectIdentifier" }, "title": "Objects", "type": "array" }, "Quiet": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Quiet" } }, "$defs": { "ObjectIdentifier": { "description": "Object Identifier is unique value to identify objects.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Key": { "title": "Key", "type": "string" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" }, "ETag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Etag" }, "LastModifiedTime": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Lastmodifiedtime" }, "Size": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Size" } }, "required": [ "Key" ], "title": "ObjectIdentifier", "type": "object" } }, "required": [ "Objects" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Objects: builtins.list[ObjectIdentifier] [Required]
The object to delete.
- field Quiet: bool | None = None
Element to enable quiet mode for the request.
When you add this element, you must set its value to
true.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.DeleteMarkerEntry[source]
Bases:
Boto3ModelInformation about the delete marker.
Show JSON schema
{ "title": "DeleteMarkerEntry", "description": "Information about the delete marker.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Owner": { "anyOf": [ { "$ref": "#/$defs/S3Owner" }, { "type": "null" } ], "default": null }, "Key": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Key" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" }, "IsLatest": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Islatest" }, "LastModified": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Lastmodified" } }, "$defs": { "S3Owner": { "description": "Container for the owner's display name and ID.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" } }, "title": "S3Owner", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field IsLatest: bool | None = None
Specifies whether the object is (true) or is not (false) the latest version of an object.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.DeleteObjectTaggingOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "DeleteObjectTaggingOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.DeleteObjectsOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "DeleteObjectsOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Deleted": { "anyOf": [ { "items": { "$ref": "#/$defs/DeletedObject" }, "type": "array" }, { "type": "null" } ], "title": "Deleted" }, "RequestCharged": { "anyOf": [ { "const": "requester", "type": "string" }, { "type": "null" } ], "default": null, "title": "Requestcharged" }, "Errors": { "anyOf": [ { "items": { "$ref": "#/$defs/Error" }, "type": "array" }, { "type": "null" } ], "title": "Errors" } }, "$defs": { "DeletedObject": { "description": "Information about the deleted object.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Key": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Key" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" }, "DeleteMarker": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Deletemarker" }, "DeleteMarkerVersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Deletemarkerversionid" } }, "title": "DeletedObject", "type": "object" }, "Error": { "description": "Container for all error elements.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Key": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Key" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" }, "Code": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Code" }, "Message": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Message" } }, "title": "Error", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Deleted: builtins.list[DeletedObject] | None [Optional]
Container element for a successful delete.
It identifies the object that was successfully deleted.
- field Errors: builtins.list[Error] | None [Optional]
Container for a failed delete action that describes the object that Amazon S3 attempted to delete and the error it encountered.
- field RequestCharged: Literal['requester'] | None = None
If present, indicates that the requester was successfully charged for the request.
For more information, see Using Requester Pays buckets for storage transfers and usage in the Amazon Simple Storage Service user guide.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.DeletedObject[source]
Bases:
Boto3ModelInformation about the deleted object.
Show JSON schema
{ "title": "DeletedObject", "description": "Information about the deleted object.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Key": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Key" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" }, "DeleteMarker": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Deletemarker" }, "DeleteMarkerVersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Deletemarkerversionid" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field DeleteMarker: bool | None = None
Indicates whether the specified object version that was permanently deleted was (true) or was not (false) a delete marker before deletion.
In a simple DELETE, this header indicates whether (true) or not (false) the current version of the object is a delete marker. To learn more about delete markers, see Working with delete markers.
- field DeleteMarkerVersionId: str | None = None
The version ID of the delete marker created as a result of the DELETE operation.
If you delete a specific object version, the value returned by this header is the version ID of the object version deleted.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.EndEvent[source]
Bases:
Boto3ModelA message that indicates the request is complete and no more messages will be sent.
You should not assume that the request is complete until the client receives an
EndEvent.Show JSON schema
{ "title": "EndEvent", "description": "A message that indicates the request is complete and no more messages will be sent.\n\nYou should not assume that the\nrequest is complete until the client receives an ``EndEvent``.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.Error[source]
Bases:
Boto3ModelContainer for all error elements.
Show JSON schema
{ "title": "Error", "description": "Container for all error elements.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Key": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Key" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" }, "Code": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Code" }, "Message": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Message" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Code: str | None = None
The error code is a string that uniquely identifies an error condition.
It is meant to be read and understood by programs that detect and handle errors by type. The following is a list of Amazon S3 error codes. For more information, see Error responses.
- field Message: str | None = None
The error message contains a generic description of the error condition in English.
It is intended for a human audience. Simple programs display the message directly to the end user if they encounter an error condition they don’t know how or don’t care to handle. Sophisticated programs with more exhaustive error handling and proper internationalization are more likely to ignore the error 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.GetBucketLifecycleConfigurationOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "GetBucketLifecycleConfigurationOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Rules": { "anyOf": [ { "items": { "$ref": "#/$defs/LifecycleRule" }, "type": "array" }, { "type": "null" } ], "title": "Rules" }, "TransitionDefaultMinimumObjectSize": { "anyOf": [ { "enum": [ "varies_by_storage_class", "all_storage_classes_128K" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Transitiondefaultminimumobjectsize" } }, "$defs": { "LifecycleExpiration": { "description": "Container for the expiration for the lifecycle of the object.\n\nFor more information see,\n`Managing your storage lifecycle <https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html>`_\nin the *Amazon S3 User\nGuide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Date": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Date" }, "Days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Days" }, "ExpiredObjectDeleteMarker": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Expiredobjectdeletemarker" } }, "title": "LifecycleExpiration", "type": "object" }, "LifecycleRule": { "description": "A lifecycle rule for individual objects in an Amazon S3 bucket.\n\nFor more information see,\n`Managing your storage lifecycle <https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html>`_\nin the *Amazon S3 User\nGuide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Expiration": { "anyOf": [ { "$ref": "#/$defs/LifecycleExpiration" }, { "type": "null" } ], "default": null }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" }, "Filter": { "anyOf": [ { "$ref": "#/$defs/LifecycleRuleFilter" }, { "type": "null" } ], "default": null }, "Status": { "enum": [ "Enabled", "Disabled" ], "title": "Status", "type": "string" }, "Transitions": { "anyOf": [ { "items": { "$ref": "#/$defs/Transition" }, "type": "array" }, { "type": "null" } ], "title": "Transitions" }, "NoncurrentVersionTransitions": { "anyOf": [ { "items": { "$ref": "#/$defs/NoncurrentVersionTransition" }, "type": "array" }, { "type": "null" } ], "title": "Noncurrentversiontransitions" }, "NoncurrentVersionExpiration": { "anyOf": [ { "$ref": "#/$defs/S3NoncurrentVersionExpiration" }, { "type": "null" } ], "default": null }, "AbortIncompleteMultipartUpload": { "anyOf": [ { "$ref": "#/$defs/S3AbortIncompleteMultipartUpload" }, { "type": "null" } ], "default": null } }, "required": [ "Status" ], "title": "LifecycleRule", "type": "object" }, "LifecycleRuleAndOperator": { "description": "This is used in a Lifecycle Rule Filter to apply a logical AND to two or more\npredicates.\n\nThe Lifecycle Rule will apply to any object matching all of the predicates\nconfigured inside the And operator.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" }, "Tags": { "anyOf": [ { "items": { "$ref": "#/$defs/Tag" }, "type": "array" }, { "type": "null" } ], "title": "Tags" }, "ObjectSizeGreaterThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizegreaterthan" }, "ObjectSizeLessThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizelessthan" } }, "title": "LifecycleRuleAndOperator", "type": "object" }, "LifecycleRuleFilter": { "description": "The ``Filter`` is used to identify objects that a Lifecycle Rule applies to.\n\nA ``Filter`` can have exactly one of\n``Prefix``, ``Tag``, ``ObjectSizeGreaterThan``, ``ObjectSizeLessThan``, or ``And`` specified. If the ``Filter`` element\nis left empty, the Lifecycle Rule applies to all objects in the bucket.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Tag": { "$ref": "#/$defs/Tag", "default": null }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" }, "ObjectSizeGreaterThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizegreaterthan" }, "ObjectSizeLessThan": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsizelessthan" }, "And": { "anyOf": [ { "$ref": "#/$defs/LifecycleRuleAndOperator" }, { "type": "null" } ], "default": null } }, "title": "LifecycleRuleFilter", "type": "object" }, "NoncurrentVersionTransition": { "description": "Container for the transition rule that describes when noncurrent objects transition\nto the ``STANDARD_IA``, ``ONEZONE_IA``, ``INTELLIGENT_TIERING``, ``GLACIER_IR``,\n``GLACIER``, or ``DEEP_ARCHIVE`` storage class.\n\nIf your bucket\nis versioning-enabled (or versioning is suspended), you can set this action to request that Amazon S3 transition\nnoncurrent object versions to the ``STANDARD_IA``, ``ONEZONE_IA``, ``INTELLIGENT_TIERING``, ``GLACIER_IR``, ``GLACIER``,\nor ``DEEP_ARCHIVE`` storage class at a specific period in the object's lifetime.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "NoncurrentDays": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Noncurrentdays" }, "StorageClass": { "anyOf": [ { "enum": [ "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE", "GLACIER_IR" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Storageclass" }, "NewerNoncurrentVersions": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Newernoncurrentversions" } }, "title": "NoncurrentVersionTransition", "type": "object" }, "S3AbortIncompleteMultipartUpload": { "description": "Specifies the days since the initiation of an incomplete multipart upload that\nAmazon S3 will wait before permanently removing all parts of the upload.\n\nFor more information, see\n`Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration <https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-\nlifecycle-config>`_ in the *Amazon S3 User Guide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DaysAfterInitiation": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Daysafterinitiation" } }, "title": "S3AbortIncompleteMultipartUpload", "type": "object" }, "S3NoncurrentVersionExpiration": { "description": "Specifies when noncurrent object versions expire. Upon expiration, Amazon S3\npermanently deletes the noncurrent object versions. You set this lifecycle\nconfiguration action on a bucket that has versioning enabled (or suspended) to\nrequest that Amazon S3 delete noncurrent object versions at a specific period in the\nobject's lifetime.\n\nThis parameter applies to general purpose buckets only. It is not supported for\ndirectory bucket lifecycle configurations.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "NoncurrentDays": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Noncurrentdays" }, "NewerNoncurrentVersions": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Newernoncurrentversions" } }, "title": "S3NoncurrentVersionExpiration", "type": "object" }, "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" }, "Transition": { "description": "Specifies when an object transitions to a specified storage class.\n\nFor more information about Amazon S3 lifecycle configuration rules, see\n`Transitioning Objects Using Amazon S3 Lifecycle <https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html>`_\nin the\n*Amazon S3 User Guide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Date": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Date" }, "Days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Days" }, "StorageClass": { "anyOf": [ { "enum": [ "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE", "GLACIER_IR" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Storageclass" } }, "title": "Transition", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Rules: builtins.list[LifecycleRule] | None [Optional]
Container for a lifecycle rule.
- field TransitionDefaultMinimumObjectSize: Literal['varies_by_storage_class', 'all_storage_classes_128K'] | None = None
Indicates which default minimum object size behavior is applied to the lifecycle configuration.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.GetBucketPolicyOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "GetBucketPolicyOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Policy": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Policy" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.GetBucketTaggingOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "GetBucketTaggingOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "TagSet": { "items": { "$ref": "#/$defs/Tag" }, "title": "Tagset", "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": [ "TagSet" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field TagSet: builtins.list[Tag] [Required]
Contains the tag set.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.GetBucketWebsiteOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "GetBucketWebsiteOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "RedirectAllRequestsTo": { "anyOf": [ { "$ref": "#/$defs/S3RedirectAllRequestsTo" }, { "type": "null" } ], "default": null }, "IndexDocument": { "anyOf": [ { "$ref": "#/$defs/S3IndexDocument" }, { "type": "null" } ], "default": null }, "ErrorDocument": { "anyOf": [ { "$ref": "#/$defs/S3ErrorDocument" }, { "type": "null" } ], "default": null }, "RoutingRules": { "anyOf": [ { "items": { "$ref": "#/$defs/S3RoutingRule" }, "type": "array" }, { "type": "null" } ], "title": "Routingrules" } }, "$defs": { "Redirect": { "description": "Specifies how requests are redirected.\n\nIn the event of an error, you can specify a different error code to return.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "HostName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Hostname" }, "HttpRedirectCode": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Httpredirectcode" }, "Protocol": { "anyOf": [ { "enum": [ "http", "https" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Protocol" }, "ReplaceKeyPrefixWith": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Replacekeyprefixwith" }, "ReplaceKeyWith": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Replacekeywith" } }, "title": "Redirect", "type": "object" }, "S3Condition": { "description": "A container for describing a condition that must be met for the specified redirect\nto apply.\n\nFor example, 1. If request\nis for pages in the ``/docs`` folder, redirect to the ``/documents`` folder. 2. If request results in HTTP error 4xx,\nredirect request to another host where you might process the error.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "HttpErrorCodeReturnedEquals": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Httperrorcodereturnedequals" }, "KeyPrefixEquals": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Keyprefixequals" } }, "title": "S3Condition", "type": "object" }, "S3ErrorDocument": { "description": "The error information.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Key": { "title": "Key", "type": "string" } }, "required": [ "Key" ], "title": "S3ErrorDocument", "type": "object" }, "S3IndexDocument": { "description": "Container for the ``Suffix`` element.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Suffix": { "title": "Suffix", "type": "string" } }, "required": [ "Suffix" ], "title": "S3IndexDocument", "type": "object" }, "S3RedirectAllRequestsTo": { "description": "Specifies the redirect behavior of all requests to a website endpoint of an Amazon\nS3 bucket.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "HostName": { "title": "Hostname", "type": "string" }, "Protocol": { "anyOf": [ { "enum": [ "http", "https" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Protocol" } }, "required": [ "HostName" ], "title": "S3RedirectAllRequestsTo", "type": "object" }, "S3RoutingRule": { "description": "Specifies the redirect behavior and when a redirect is applied.\n\nFor more information about routing rules, see\n`Configuring advanced conditional redirects <https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-\nredirect.html#advanced-conditional-redirects>`_ in the *Amazon S3 User Guide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Condition": { "anyOf": [ { "$ref": "#/$defs/S3Condition" }, { "type": "null" } ], "default": null }, "Redirect": { "$ref": "#/$defs/Redirect" } }, "required": [ "Redirect" ], "title": "S3RoutingRule", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field ErrorDocument: S3ErrorDocument | None = None
The object key name of the website error document to use for 4XX class errors.
- field IndexDocument: S3IndexDocument | None = None
The name of the index document for the website (for example
index.html).
- field RedirectAllRequestsTo: S3RedirectAllRequestsTo | None = None
Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.
- field RoutingRules: builtins.list[S3RoutingRule] | None [Optional]
Rules that define when a redirect is applied and the redirect behavior.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.GetObjectAclOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "GetObjectAclOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Owner": { "anyOf": [ { "$ref": "#/$defs/S3Owner" }, { "type": "null" } ], "default": null }, "Grants": { "anyOf": [ { "items": { "$ref": "#/$defs/Grant" }, "type": "array" }, { "type": "null" } ], "title": "Grants" }, "RequestCharged": { "anyOf": [ { "const": "requester", "type": "string" }, { "type": "null" } ], "default": null, "title": "Requestcharged" } }, "$defs": { "Grant": { "description": "Container for grant information.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Grantee": { "anyOf": [ { "$ref": "#/$defs/S3Grantee" }, { "type": "null" } ], "default": null }, "Permission": { "anyOf": [ { "enum": [ "FULL_CONTROL", "WRITE", "WRITE_ACP", "READ", "READ_ACP" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Permission" } }, "title": "Grant", "type": "object" }, "S3Grantee": { "description": "Container for the person being granted permissions.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "EmailAddress": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Emailaddress" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "Type": { "enum": [ "CanonicalUser", "AmazonCustomerByEmail", "Group" ], "title": "Type", "type": "string" }, "URI": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Uri" } }, "required": [ "Type" ], "title": "S3Grantee", "type": "object" }, "S3Owner": { "description": "Container for the owner's display name and ID.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" } }, "title": "S3Owner", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field RequestCharged: Literal['requester'] | None = None
If present, indicates that the requester was successfully charged for the request.
For more information, see Using Requester Pays buckets for storage transfers and usage in the Amazon Simple Storage Service user guide.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.GetObjectAttributesOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "GetObjectAttributesOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DeleteMarker": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Deletemarker" }, "LastModified": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Lastmodified" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" }, "RequestCharged": { "anyOf": [ { "const": "requester", "type": "string" }, { "type": "null" } ], "default": null, "title": "Requestcharged" }, "ETag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Etag" }, "Checksum": { "anyOf": [ { "$ref": "#/$defs/S3Checksum" }, { "type": "null" } ], "default": null }, "ObjectParts": { "anyOf": [ { "$ref": "#/$defs/GetObjectAttributesParts" }, { "type": "null" } ], "default": null }, "StorageClass": { "anyOf": [ { "enum": [ "STANDARD", "REDUCED_REDUNDANCY", "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE", "OUTPOSTS", "GLACIER_IR", "SNOW", "EXPRESS_ONEZONE", "FSX_OPENZFS", "FSX_ONTAP" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Storageclass" }, "ObjectSize": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Objectsize" } }, "$defs": { "GetObjectAttributesParts": { "description": "A collection of parts associated with a multipart upload.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "TotalPartsCount": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Totalpartscount" }, "PartNumberMarker": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Partnumbermarker" }, "NextPartNumberMarker": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Nextpartnumbermarker" }, "MaxParts": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Maxparts" }, "IsTruncated": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Istruncated" }, "Parts": { "anyOf": [ { "items": { "$ref": "#/$defs/ObjectPart" }, "type": "array" }, { "type": "null" } ], "title": "Parts" } }, "title": "GetObjectAttributesParts", "type": "object" }, "ObjectPart": { "description": "A container for elements related to an individual part.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "PartNumber": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Partnumber" }, "Size": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Size" }, "ChecksumCRC32": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32" }, "ChecksumCRC32C": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32C" }, "ChecksumCRC64NVME": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc64Nvme" }, "ChecksumSHA1": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha1" }, "ChecksumSHA256": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha256" }, "ChecksumSHA512": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha512" }, "ChecksumMD5": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksummd5" }, "ChecksumXXHASH64": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash64" }, "ChecksumXXHASH3": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash3" }, "ChecksumXXHASH128": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash128" } }, "title": "ObjectPart", "type": "object" }, "S3Checksum": { "description": "Contains all the possible checksum or digest values for an object.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "ChecksumCRC32": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32" }, "ChecksumCRC32C": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32C" }, "ChecksumCRC64NVME": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc64Nvme" }, "ChecksumSHA1": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha1" }, "ChecksumSHA256": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha256" }, "ChecksumSHA512": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha512" }, "ChecksumMD5": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksummd5" }, "ChecksumXXHASH64": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash64" }, "ChecksumXXHASH3": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash3" }, "ChecksumXXHASH128": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash128" }, "ChecksumType": { "anyOf": [ { "enum": [ "COMPOSITE", "FULL_OBJECT" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumtype" } }, "title": "S3Checksum", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Checksum: S3Checksum | None = None
The checksum or digest of the object.
- field DeleteMarker: bool | None = None
Specifies whether the object retrieved was (
true) or was not (false) a delete marker.If
false, this response header does not appear in the response. To learn more about delete markers, see Working with delete markers.
- field ETag: str | None = None
An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL.
- field ObjectParts: GetObjectAttributesParts | None = None
A collection of parts associated with a multipart upload.
- field RequestCharged: Literal['requester'] | None = None
If present, indicates that the requester was successfully charged for the request.
For more information, see Using Requester Pays buckets for storage transfers and usage in the Amazon Simple Storage Service user guide.
- field StorageClass: Literal['STANDARD', 'REDUCED_REDUNDANCY', 'STANDARD_IA', 'ONEZONE_IA', 'INTELLIGENT_TIERING', 'GLACIER', 'DEEP_ARCHIVE', 'OUTPOSTS', 'GLACIER_IR', 'SNOW', 'EXPRESS_ONEZONE', 'FSX_OPENZFS', 'FSX_ONTAP'] | None = None
Provides the storage class information of the object.
Amazon S3 returns this header for all objects except for S3 Standard storage class 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.GetObjectAttributesParts[source]
Bases:
Boto3ModelA collection of parts associated with a multipart upload.
Show JSON schema
{ "title": "GetObjectAttributesParts", "description": "A collection of parts associated with a multipart upload.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "TotalPartsCount": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Totalpartscount" }, "PartNumberMarker": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Partnumbermarker" }, "NextPartNumberMarker": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Nextpartnumbermarker" }, "MaxParts": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Maxparts" }, "IsTruncated": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Istruncated" }, "Parts": { "anyOf": [ { "items": { "$ref": "#/$defs/ObjectPart" }, "type": "array" }, { "type": "null" } ], "title": "Parts" } }, "$defs": { "ObjectPart": { "description": "A container for elements related to an individual part.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "PartNumber": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Partnumber" }, "Size": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Size" }, "ChecksumCRC32": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32" }, "ChecksumCRC32C": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32C" }, "ChecksumCRC64NVME": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc64Nvme" }, "ChecksumSHA1": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha1" }, "ChecksumSHA256": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha256" }, "ChecksumSHA512": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha512" }, "ChecksumMD5": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksummd5" }, "ChecksumXXHASH64": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash64" }, "ChecksumXXHASH3": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash3" }, "ChecksumXXHASH128": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash128" } }, "title": "ObjectPart", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field IsTruncated: bool | None = None
Indicates whether the returned list of parts is truncated.
A value of
trueindicates that the list was truncated. A list can be truncated if the number of parts exceeds the limit returned in theMaxPartselement.
- field NextPartNumberMarker: int | None = None
When a list is truncated, this element specifies the last part in the list, as well as the value to use for the
PartNumberMarkerrequest parameter in a subsequent request.
- field Parts: builtins.list[ObjectPart] | None [Optional]
A container for elements related to a particular part.
A response can contain zero or more
Partselements.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.GetObjectLegalHoldOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "GetObjectLegalHoldOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "LegalHold": { "anyOf": [ { "$ref": "#/$defs/S3ObjectLockLegalHold" }, { "type": "null" } ], "default": null } }, "$defs": { "S3ObjectLockLegalHold": { "description": "A legal hold configuration for an object.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Status": { "anyOf": [ { "enum": [ "ON", "OFF" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Status" } }, "title": "S3ObjectLockLegalHold", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field LegalHold: S3ObjectLockLegalHold | None = None
The current legal hold status for the specified object.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.GetObjectLockConfigurationOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "GetObjectLockConfigurationOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "ObjectLockConfiguration": { "anyOf": [ { "$ref": "#/$defs/S3ObjectLockConfiguration" }, { "type": "null" } ], "default": null } }, "$defs": { "S3DefaultRetention": { "description": "The container element for optionally specifying the default Object Lock retention\nsettings for new objects placed in the specified bucket.\n\n* The ``DefaultRetention`` settings require both a mode and a period.\n* The ``DefaultRetention`` period can be either ``Days`` or ``Years`` but you must select one. You cannot specify\n ``Days`` and ``Years`` at the same time.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Mode": { "anyOf": [ { "enum": [ "GOVERNANCE", "COMPLIANCE" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Mode" }, "Days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Days" }, "Years": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Years" } }, "title": "S3DefaultRetention", "type": "object" }, "S3ObjectLockConfiguration": { "description": "The container element for Object Lock configuration parameters.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "ObjectLockEnabled": { "anyOf": [ { "const": "Enabled", "type": "string" }, { "type": "null" } ], "default": null, "title": "Objectlockenabled" }, "Rule": { "anyOf": [ { "$ref": "#/$defs/S3ObjectLockRule" }, { "type": "null" } ], "default": null } }, "title": "S3ObjectLockConfiguration", "type": "object" }, "S3ObjectLockRule": { "description": "The container element for an Object Lock rule.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DefaultRetention": { "anyOf": [ { "$ref": "#/$defs/S3DefaultRetention" }, { "type": "null" } ], "default": null } }, "title": "S3ObjectLockRule", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field ObjectLockConfiguration: S3ObjectLockConfiguration | None = None
The specified bucket’s Object Lock configuration.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.GetObjectOutput[source]
Bases:
GetObjectOutputMixin,Boto3ModelShow JSON schema
{ "title": "GetObjectOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Body": { "default": null, "title": "Body" }, "DeleteMarker": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Deletemarker" }, "AcceptRanges": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Acceptranges" }, "Expiration": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Expiration" }, "Restore": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Restore" }, "LastModified": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Lastmodified" }, "ContentLength": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Contentlength" }, "ETag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Etag" }, "ChecksumCRC32": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32" }, "ChecksumCRC32C": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32C" }, "ChecksumCRC64NVME": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc64Nvme" }, "ChecksumSHA1": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha1" }, "ChecksumSHA256": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha256" }, "ChecksumSHA512": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha512" }, "ChecksumMD5": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksummd5" }, "ChecksumXXHASH64": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash64" }, "ChecksumXXHASH3": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash3" }, "ChecksumXXHASH128": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash128" }, "ChecksumType": { "anyOf": [ { "enum": [ "COMPOSITE", "FULL_OBJECT" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumtype" }, "MissingMeta": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Missingmeta" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" }, "CacheControl": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Cachecontrol" }, "ContentDisposition": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Contentdisposition" }, "ContentEncoding": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Contentencoding" }, "ContentLanguage": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Contentlanguage" }, "ContentRange": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Contentrange" }, "ContentType": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Contenttype" }, "Expires": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Expires" }, "WebsiteRedirectLocation": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Websiteredirectlocation" }, "ServerSideEncryption": { "anyOf": [ { "enum": [ "AES256", "aws:fsx", "aws:kms", "aws:kms:dsse" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Serversideencryption" }, "Metadata": { "anyOf": [ { "additionalProperties": { "type": "string" }, "type": "object" }, { "type": "null" } ], "title": "Metadata" }, "SSECustomerAlgorithm": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ssecustomeralgorithm" }, "SSECustomerKeyMD5": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ssecustomerkeymd5" }, "SSEKMSKeyId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ssekmskeyid" }, "BucketKeyEnabled": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Bucketkeyenabled" }, "StorageClass": { "anyOf": [ { "enum": [ "STANDARD", "REDUCED_REDUNDANCY", "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE", "OUTPOSTS", "GLACIER_IR", "SNOW", "EXPRESS_ONEZONE", "FSX_OPENZFS", "FSX_ONTAP" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Storageclass" }, "RequestCharged": { "anyOf": [ { "const": "requester", "type": "string" }, { "type": "null" } ], "default": null, "title": "Requestcharged" }, "ReplicationStatus": { "anyOf": [ { "enum": [ "COMPLETE", "PENDING", "FAILED", "REPLICA", "COMPLETED" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Replicationstatus" }, "PartsCount": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Partscount" }, "TagCount": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Tagcount" }, "ObjectLockMode": { "anyOf": [ { "enum": [ "GOVERNANCE", "COMPLIANCE" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Objectlockmode" }, "ObjectLockRetainUntilDate": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Objectlockretainuntildate" }, "ObjectLockLegalHoldStatus": { "anyOf": [ { "enum": [ "ON", "OFF" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Objectlocklegalholdstatus" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field AcceptRanges: str | None = None
Indicates that a range of bytes was specified in the request.
- field BucketKeyEnabled: bool | None = None
Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).
- field ChecksumCRC32: str | None = None
The Base64 encoded, 32-bit
CRC32checksum of the object.This checksum is only present if the object was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumCRC32C: str | None = None
The Base64 encoded, 32-bit
CRC32Cchecksum of the object.This checksum is only present if the checksum was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumCRC64NVME: str | None = None
The Base64 encoded, 64-bit
CRC64NVMEchecksum of the object.For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumMD5: str | None = None
The Base64 encoded, 128-bit
MD5digest of the object.For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumSHA1: str | None = None
The Base64 encoded, 160-bit
SHA1digest of the object.This checksum is only present if the checksum was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumSHA256: str | None = None
The Base64 encoded, 256-bit
SHA256digest of the object.This checksum is only present if the checksum was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumSHA512: str | None = None
The Base64 encoded, 512-bit
SHA512digest of the object.For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumType: Literal['COMPOSITE', 'FULL_OBJECT'] | None = None
The checksum type, which determines how part-level checksums are combined to create an object-level checksum for multipart objects.
You can use this header response to verify that the checksum type that is received is the same checksum type that was specified in the
CreateMultipartUploadrequest. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumXXHASH128: str | None = None
The Base64 encoded, 128-bit
XXHASH128checksum of the object.For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumXXHASH3: str | None = None
The Base64 encoded, 64-bit
XXHASH3checksum of the object.For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumXXHASH64: str | None = None
The Base64 encoded, 64-bit
XXHASH64checksum of the object.For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ContentEncoding: str | None = None
Indicates what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
- field ContentType: str | None = None
A standard MIME type describing the format of the object data.
- field DeleteMarker: bool | None = None
Indicates whether the object retrieved was (true) or was not (false) a Delete Marker.
If false, this response header does not appear in the response.
- field ETag: str | None = None
An entity tag (ETag) is an opaque identifier assigned by a web server to a specific version of a resource found at a URL.
- field Expiration: str | None = None
If the object expiration is configured (see
`PutBucketLifecycleConfiguration<https://docs.aws.amazon.com/AmazonS3/ latest/API/API_PutBucketLifecycleConfiguration.html>`_ ), the response includes this header. It includes theexpiry- dateandrule-idkey-value pairs providing object expiration information. The value of therule-idis URL- encoded.
- field Expires: datetime | None = None
The date and time at which the object is no longer cacheable.
- field MissingMeta: int | None = None
This is set to the number of metadata entries not returned in the headers that are prefixed with
x-amz-meta-.This can happen if you create metadata using an API like SOAP that supports more flexible metadata than the REST API. For example, using SOAP, you can create metadata whose values are not legal HTTP headers.
- field ObjectLockLegalHoldStatus: Literal['ON', 'OFF'] | None = None
Indicates whether this object has an active legal hold.
This field is only returned if you have permission to view an object’s legal hold status.
- field ObjectLockMode: Literal['GOVERNANCE', 'COMPLIANCE'] | None = None
The Object Lock mode that’s currently in place for this object.
- field ObjectLockRetainUntilDate: datetime | None = None
The date and time when this object’s Object Lock will expire.
- field PartsCount: int | None = None
The count of parts this object has.
This value is only returned if you specify
partNumberin your request and the object was uploaded as a multipart upload.
- field ReplicationStatus: Literal['COMPLETE', 'PENDING', 'FAILED', 'REPLICA', 'COMPLETED'] | None = None
Amazon S3 can return this if your request involves a bucket that is either a source or destination in a replication rule.
- field RequestCharged: Literal['requester'] | None = None
If present, indicates that the requester was successfully charged for the request.
For more information, see Using Requester Pays buckets for storage transfers and usage in the Amazon Simple Storage Service user guide.
- field Restore: str | None = None
Provides information about object restoration action and expiration time of the restored object copy.
- field SSECustomerAlgorithm: str | None = None
If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that’s used.
- field SSECustomerKeyMD5: str | None = None
If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.
- field SSEKMSKeyId: str | None = None
If present, indicates the ID of the KMS key that was used for object encryption.
- field ServerSideEncryption: Literal['AES256', 'aws:fsx', 'aws:kms', 'aws:kms:dsse'] | None = None
The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx.
- field StorageClass: Literal['STANDARD', 'REDUCED_REDUNDANCY', 'STANDARD_IA', 'ONEZONE_IA', 'INTELLIGENT_TIERING', 'GLACIER', 'DEEP_ARCHIVE', 'OUTPOSTS', 'GLACIER_IR', 'SNOW', 'EXPRESS_ONEZONE', 'FSX_OPENZFS', 'FSX_ONTAP'] | None = None
Provides storage class information of the object.
Amazon S3 returns this header for all objects except for S3 Standard storage class objects.
- field TagCount: int | None = None
The number of tags, if any, on the object, when you have the relevant permission to read object tags.
- field WebsiteRedirectLocation: str | None = None
If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL.
Amazon S3 stores the value of this header in the object metadata.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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 data: bytes
Examine the
Bodyof the and determine if it is a gzip file. If it is, return the decompressed data. If it is not, return the raw data.Cache the decompressed data in
_body_cache. This is done because theBodyis a streaming body that can only be read once – all further attempts to read the body will returnb"".- Returns:
The decompressed data.
- pydantic model botocraft.services.s3.GetObjectRetentionOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "GetObjectRetentionOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Retention": { "anyOf": [ { "$ref": "#/$defs/ObjectLockRetention" }, { "type": "null" } ], "default": null } }, "$defs": { "ObjectLockRetention": { "description": "A Retention configuration for an object.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Mode": { "anyOf": [ { "enum": [ "GOVERNANCE", "COMPLIANCE" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Mode" }, "RetainUntilDate": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Retainuntildate" } }, "title": "ObjectLockRetention", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Retention: ObjectLockRetention | None = None
The container element for an object’s retention settings.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.GetObjectTaggingOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "GetObjectTaggingOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" }, "TagSet": { "items": { "$ref": "#/$defs/Tag" }, "title": "Tagset", "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": [ "TagSet" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field TagSet: builtins.list[Tag] [Required]
Contains the tag set.
- field VersionId: str | None = None
The versionId of the object for which you got the tagging information.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.GetPublicAccessBlockOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "GetPublicAccessBlockOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "PublicAccessBlockConfiguration": { "anyOf": [ { "$ref": "#/$defs/S3PublicAccessBlockConfiguration" }, { "type": "null" } ], "default": null } }, "$defs": { "S3PublicAccessBlockConfiguration": { "description": "The PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket.\n\nYou can enable the configuration\noptions in any combination. Bucket-level settings work alongside account-level settings (which may inherit from\norganization-level policies). For more information about when Amazon S3 considers a bucket or object public, see `The\nMeaning of \"Public\" <https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-\ncontrol-block-public-access-policy-status>`_ in the *Amazon S3 User Guide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "BlockPublicAcls": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Blockpublicacls" }, "IgnorePublicAcls": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Ignorepublicacls" }, "BlockPublicPolicy": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Blockpublicpolicy" }, "RestrictPublicBuckets": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Restrictpublicbuckets" } }, "title": "S3PublicAccessBlockConfiguration", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field PublicAccessBlockConfiguration: S3PublicAccessBlockConfiguration | None = None
The
PublicAccessBlockconfiguration currently in effect for this Amazon S3 bucket.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.Grant[source]
Bases:
Boto3ModelContainer for grant information.
Show JSON schema
{ "title": "Grant", "description": "Container for grant information.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Grantee": { "anyOf": [ { "$ref": "#/$defs/S3Grantee" }, { "type": "null" } ], "default": null }, "Permission": { "anyOf": [ { "enum": [ "FULL_CONTROL", "WRITE", "WRITE_ACP", "READ", "READ_ACP" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Permission" } }, "$defs": { "S3Grantee": { "description": "Container for the person being granted permissions.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "EmailAddress": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Emailaddress" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "Type": { "enum": [ "CanonicalUser", "AmazonCustomerByEmail", "Group" ], "title": "Type", "type": "string" }, "URI": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Uri" } }, "required": [ "Type" ], "title": "S3Grantee", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Permission: Literal['FULL_CONTROL', 'WRITE', 'WRITE_ACP', 'READ', 'READ_ACP'] | None = None
Specifies the permission given to the grantee.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.InputSerialization[source]
Bases:
Boto3ModelDescribes the serialization format of the object.
Show JSON schema
{ "title": "InputSerialization", "description": "Describes the serialization format of the object.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "CSV": { "anyOf": [ { "$ref": "#/$defs/S3CSVInput" }, { "type": "null" } ], "default": null }, "CompressionType": { "anyOf": [ { "enum": [ "NONE", "GZIP", "BZIP2" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Compressiontype" }, "JSON": { "anyOf": [ { "$ref": "#/$defs/JSONInput" }, { "type": "null" } ], "default": null }, "Parquet": { "anyOf": [ { "$ref": "#/$defs/ParquetInput" }, { "type": "null" } ], "default": null } }, "$defs": { "JSONInput": { "description": "Specifies JSON as object's input serialization format.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Type": { "anyOf": [ { "enum": [ "DOCUMENT", "LINES" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Type" } }, "title": "JSONInput", "type": "object" }, "ParquetInput": { "description": "Container for Parquet.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } }, "title": "ParquetInput", "type": "object" }, "S3CSVInput": { "description": "Describes how an uncompressed comma-separated values (CSV)-formatted input object is\nformatted.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "QuoteEscapeCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quoteescapecharacter" }, "FileHeaderInfo": { "anyOf": [ { "enum": [ "USE", "IGNORE", "NONE" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Fileheaderinfo" }, "Comments": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Comments" }, "RecordDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Recorddelimiter" }, "FieldDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Fielddelimiter" }, "QuoteCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quotecharacter" }, "AllowQuotedRecordDelimiter": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Allowquotedrecorddelimiter" } }, "title": "S3CSVInput", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field CSV: S3CSVInput | None = None
Describes the serialization of a CSV-encoded object.
- field CompressionType: Literal['NONE', 'GZIP', 'BZIP2'] | None = None
Specifies object’s compression format.
Valid values: NONE, GZIP, BZIP2. Default Value: NONE.
- field Parquet: ParquetInput | None = None
Specifies Parquet as object’s input serialization format.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.JSONInput[source]
Bases:
Boto3ModelSpecifies JSON as object’s input serialization format.
Show JSON schema
{ "title": "JSONInput", "description": "Specifies JSON as object's input serialization format.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Type": { "anyOf": [ { "enum": [ "DOCUMENT", "LINES" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Type" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Type: Literal['DOCUMENT', 'LINES'] | None = None
The type of JSON.
Valid values: Document, Lines.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.JSONOutput[source]
Bases:
Boto3ModelSpecifies JSON as request’s output serialization format.
Show JSON schema
{ "title": "JSONOutput", "description": "Specifies JSON as request's output serialization format.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "RecordDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Recorddelimiter" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field RecordDelimiter: str | None = None
The value used to separate individual records in the output.
If no value is specified, Amazon S3 uses a newline character (‘n’).
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.ListBucketsOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "ListBucketsOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Buckets": { "anyOf": [ { "items": { "$ref": "#/$defs/Bucket" }, "type": "array" }, { "type": "null" } ], "title": "Buckets" }, "Owner": { "anyOf": [ { "$ref": "#/$defs/S3Owner" }, { "type": "null" } ], "default": null }, "ContinuationToken": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Continuationtoken" }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" } }, "$defs": { "Bucket": { "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "BucketName": { "title": "Bucketname", "type": "string" }, "BucketArn": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "title": "Bucketarn" }, "Region": { "title": "Region", "type": "string" }, "CreationDate": { "format": "date-time", "title": "Creationdate", "type": "string" }, "ACL": { "anyOf": [ { "enum": [ "private", "public-read", "public-read-write", "authenticated-read", "aws-exec-read", "bucket-owner-read", "bucket-owner-full-control" ], "type": "string" }, { "type": "null" } ], "default": "private", "title": "Acl" }, "LoggingConfiguration": { "anyOf": [ { "$ref": "#/$defs/BucketLoggingConfiguration" }, { "type": "null" } ] }, "VersioningEnabled": { "title": "Versioningenabled", "type": "boolean" }, "MFADelete": { "default": false, "title": "Mfadelete", "type": "boolean" }, "ObjectOwnership": { "anyOf": [ { "enum": [ "BucketOwnerEnforced", "BucketOwnerPreferred", "ObjectWriter" ], "type": "string" }, { "type": "null" } ], "default": "BucketOwnerPreferred", "title": "Objectownership" }, "CORSRules": { "anyOf": [ { "items": { "$ref": "#/$defs/S3CORSRule" }, "type": "array" }, { "type": "null" } ], "title": "Corsrules" }, "Tags": { "items": { "$ref": "#/$defs/Tag" }, "title": "Tags", "type": "array" } }, "required": [ "BucketName", "BucketArn", "Region", "CreationDate", "LoggingConfiguration", "VersioningEnabled" ], "title": "Bucket", "type": "object" }, "BucketLoggingConfiguration": { "description": "Describes where logs are stored and the prefix that Amazon S3 assigns to all log\nobject keys for a bucket.\n\nFor more information, see\n`PUT Bucket logging <https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html>`_\nin the\n*Amazon S3 API Reference*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "TargetBucket": { "title": "Targetbucket", "type": "string" }, "TargetGrants": { "anyOf": [ { "items": { "$ref": "#/$defs/TargetGrant" }, "type": "array" }, { "type": "null" } ], "title": "Targetgrants" }, "TargetPrefix": { "title": "Targetprefix", "type": "string" }, "TargetObjectKeyFormat": { "anyOf": [ { "$ref": "#/$defs/S3TargetObjectKeyFormat" }, { "type": "null" } ], "default": null } }, "required": [ "TargetBucket", "TargetPrefix" ], "title": "BucketLoggingConfiguration", "type": "object" }, "S3CORSRule": { "description": "Specifies a cross-origin access rule for an Amazon S3 bucket.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "AllowedHeaders": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Allowedheaders" }, "AllowedMethods": { "items": { "type": "string" }, "title": "Allowedmethods", "type": "array" }, "AllowedOrigins": { "items": { "type": "string" }, "title": "Allowedorigins", "type": "array" }, "ExposeHeaders": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Exposeheaders" }, "MaxAgeSeconds": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Maxageseconds" } }, "required": [ "AllowedMethods", "AllowedOrigins" ], "title": "S3CORSRule", "type": "object" }, "S3Grantee": { "description": "Container for the person being granted permissions.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "EmailAddress": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Emailaddress" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" }, "Type": { "enum": [ "CanonicalUser", "AmazonCustomerByEmail", "Group" ], "title": "Type", "type": "string" }, "URI": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Uri" } }, "required": [ "Type" ], "title": "S3Grantee", "type": "object" }, "S3Owner": { "description": "Container for the owner's display name and ID.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" } }, "title": "S3Owner", "type": "object" }, "S3PartitionedPrefix": { "description": "Amazon S3 keys for log objects are partitioned in the following format:\n\n``[DestinationPrefix][SourceAccountId]/[SourceRegion]/[SourceBucket]/[YYYY]/[MM]/[DD]/[YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-\n[UniqueString]``\n\nPartitionedPrefix defaults to EventTime delivery when server access logs are delivered.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "PartitionDateSource": { "anyOf": [ { "enum": [ "EventTime", "DeliveryTime" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Partitiondatesource" } }, "title": "S3PartitionedPrefix", "type": "object" }, "S3SimplePrefix": { "description": "To use simple format for S3 keys for log objects, set SimplePrefix to an empty\nobject.\n\n``[DestinationPrefix][YYYY]-[MM]-[DD]-[hh]-[mm]-[ss]-[UniqueString]``", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } }, "title": "S3SimplePrefix", "type": "object" }, "S3TargetObjectKeyFormat": { "description": "Amazon S3 key format for log objects.\n\nOnly one format, PartitionedPrefix or SimplePrefix, is allowed.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "SimplePrefix": { "anyOf": [ { "$ref": "#/$defs/S3SimplePrefix" }, { "type": "null" } ], "default": null }, "PartitionedPrefix": { "anyOf": [ { "$ref": "#/$defs/S3PartitionedPrefix" }, { "type": "null" } ], "default": null } }, "title": "S3TargetObjectKeyFormat", "type": "object" }, "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" }, "TargetGrant": { "description": "Container for granting information.\n\nBuckets that use the bucket owner enforced setting for Object Ownership don't support target grants. For more\ninformation, see `Permissions server access log delivery <https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-\nserver-access-logging.html#grant-log-delivery-permissions-general>`_ in the *Amazon S3 User Guide*.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Grantee": { "anyOf": [ { "$ref": "#/$defs/S3Grantee" }, { "type": "null" } ], "default": null }, "Permission": { "anyOf": [ { "enum": [ "FULL_CONTROL", "READ", "WRITE" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Permission" } }, "title": "TargetGrant", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field ContinuationToken: str | None = None
ContinuationTokenis included in the response when there are more buckets that can be listed with pagination.The next
ListBucketsrequest to Amazon S3 can be continued with thisContinuationToken.ContinuationTokenis obfuscated and is not a real bucket.
- field Prefix: str | None = None
If
Prefixwas sent with the request, it is included in the response.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.ListObjectVersionsOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "ListObjectVersionsOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "IsTruncated": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Istruncated" }, "KeyMarker": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Keymarker" }, "VersionIdMarker": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionidmarker" }, "NextKeyMarker": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Nextkeymarker" }, "NextVersionIdMarker": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Nextversionidmarker" }, "Versions": { "anyOf": [ { "items": { "$ref": "#/$defs/ObjectVersion" }, "type": "array" }, { "type": "null" } ], "title": "Versions" }, "DeleteMarkers": { "anyOf": [ { "items": { "$ref": "#/$defs/DeleteMarkerEntry" }, "type": "array" }, { "type": "null" } ], "title": "Deletemarkers" }, "Name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Name" }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" }, "Delimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Delimiter" }, "MaxKeys": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Maxkeys" }, "CommonPrefixes": { "anyOf": [ { "items": { "$ref": "#/$defs/CommonPrefix" }, "type": "array" }, { "type": "null" } ], "title": "Commonprefixes" }, "EncodingType": { "anyOf": [ { "const": "url", "type": "string" }, { "type": "null" } ], "default": null, "title": "Encodingtype" }, "RequestCharged": { "anyOf": [ { "const": "requester", "type": "string" }, { "type": "null" } ], "default": null, "title": "Requestcharged" } }, "$defs": { "CommonPrefix": { "description": "Container for all (if there are any) keys between Prefix and the next occurrence of\nthe string specified by a delimiter.\n\nCommonPrefixes lists keys that act like subdirectories in the directory specified by\nPrefix. For example, if the prefix is notes/ and the delimiter is a slash (/) as in\nnotes/summer/july, the common prefix is notes/summer/.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" } }, "title": "CommonPrefix", "type": "object" }, "DeleteMarkerEntry": { "description": "Information about the delete marker.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Owner": { "anyOf": [ { "$ref": "#/$defs/S3Owner" }, { "type": "null" } ], "default": null }, "Key": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Key" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" }, "IsLatest": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Islatest" }, "LastModified": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Lastmodified" } }, "title": "DeleteMarkerEntry", "type": "object" }, "ObjectVersion": { "description": "The version of an object.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "ETag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Etag" }, "ChecksumAlgorithm": { "anyOf": [ { "items": { "enum": [ "CRC32", "CRC32C", "SHA1", "SHA256", "CRC64NVME", "SHA512", "MD5", "XXHASH64", "XXHASH3", "XXHASH128" ], "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Checksumalgorithm" }, "ChecksumType": { "anyOf": [ { "enum": [ "COMPOSITE", "FULL_OBJECT" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumtype" }, "Size": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Size" }, "StorageClass": { "anyOf": [ { "const": "STANDARD", "type": "string" }, { "type": "null" } ], "default": null, "title": "Storageclass" }, "Key": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Key" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" }, "IsLatest": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Islatest" }, "LastModified": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Lastmodified" }, "Owner": { "anyOf": [ { "$ref": "#/$defs/S3Owner" }, { "type": "null" } ], "default": null }, "RestoreStatus": { "anyOf": [ { "$ref": "#/$defs/S3RestoreStatus" }, { "type": "null" } ], "default": null } }, "title": "ObjectVersion", "type": "object" }, "S3Owner": { "description": "Container for the owner's display name and ID.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" } }, "title": "S3Owner", "type": "object" }, "S3RestoreStatus": { "description": "Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be\nretrieved. For more information about these storage classes and how to work with archived objects, see `Working with\narchived objects <https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html>`_ in the *Amazon S3 User\nGuide*.\n\nThis functionality is not supported for directory buckets. Directory buckets only support ``EXPRESS_ONEZONE`` (the S3\nExpress One Zone storage class) in Availability Zones and ``ONEZONE_IA`` (the S3 One Zone-Infrequent Access storage\nclass) in Dedicated Local Zones.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "IsRestoreInProgress": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Isrestoreinprogress" }, "RestoreExpiryDate": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Restoreexpirydate" } }, "title": "S3RestoreStatus", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field CommonPrefixes: builtins.list[CommonPrefix] | None [Optional]
All of the keys rolled up into a common prefix count as a single return when calculating the number of returns.
- field DeleteMarkers: builtins.list[DeleteMarkerEntry] | None [Optional]
Container for an object that is a delete marker.
To learn more about delete markers, see Working with delete markers.
- field Delimiter: str | None = None
The delimiter grouping the included keys.
A delimiter is a character that you specify to group keys. All keys that contain the same string between the prefix and the first occurrence of the delimiter are grouped under a single result element in
CommonPrefixes. These groups are counted as one result against themax-keyslimitation. These keys are not returned elsewhere in the response.
- field EncodingType: Literal['url'] | None = None
Encoding type used by Amazon S3 to encode object key names in the XML response.
- field IsTruncated: bool | None = None
A flag that indicates whether Amazon S3 returned all of the results that satisfied the search criteria.
If your results were truncated, you can make a follow-up paginated request by using the
NextKeyMarkerandNextVersionIdMarkerresponse parameters as a starting place in another request to return the rest of the results.
- field NextKeyMarker: str | None = None
When the number of responses exceeds the value of
MaxKeys,NextKeyMarkerspecifies the first key not returned that satisfies the search criteria.Use this value for the key-marker request parameter in a subsequent request.
- field NextVersionIdMarker: str | None = None
When the number of responses exceeds the value of
MaxKeys,NextVersionIdMarkerspecifies the first object version not returned that satisfies the search criteria.Use this value for the
version-id-markerrequest parameter in a subsequent request.
- field Prefix: str | None = None
Selects objects that start with the value supplied by this parameter.
- field RequestCharged: Literal['requester'] | None = None
If present, indicates that the requester was successfully charged for the request.
For more information, see Using Requester Pays buckets for storage transfers and usage in the Amazon Simple Storage Service user guide.
- field VersionIdMarker: str | None = None
Marks the last version of the key returned in a truncated response.
- field Versions: builtins.list[ObjectVersion] | None [Optional]
Container for version information.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.ListObjectsV2Output[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "ListObjectsV2Output", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "IsTruncated": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Istruncated" }, "Contents": { "anyOf": [ { "items": { "$ref": "#/$defs/S3Object" }, "type": "array" }, { "type": "null" } ], "title": "Contents" }, "Name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Name" }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" }, "Delimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Delimiter" }, "MaxKeys": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Maxkeys" }, "CommonPrefixes": { "anyOf": [ { "items": { "$ref": "#/$defs/CommonPrefix" }, "type": "array" }, { "type": "null" } ], "title": "Commonprefixes" }, "EncodingType": { "anyOf": [ { "const": "url", "type": "string" }, { "type": "null" } ], "default": null, "title": "Encodingtype" }, "KeyCount": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Keycount" }, "ContinuationToken": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Continuationtoken" }, "NextContinuationToken": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Nextcontinuationtoken" }, "StartAfter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Startafter" }, "RequestCharged": { "anyOf": [ { "const": "requester", "type": "string" }, { "type": "null" } ], "default": null, "title": "Requestcharged" } }, "$defs": { "CommonPrefix": { "description": "Container for all (if there are any) keys between Prefix and the next occurrence of\nthe string specified by a delimiter.\n\nCommonPrefixes lists keys that act like subdirectories in the directory specified by\nPrefix. For example, if the prefix is notes/ and the delimiter is a slash (/) as in\nnotes/summer/july, the common prefix is notes/summer/.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" } }, "title": "CommonPrefix", "type": "object" }, "S3Object": { "description": "An object consists of data and its descriptive metadata.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Key": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Key" }, "LastModified": { "default": null, "format": "date-time", "title": "Lastmodified", "type": "string" }, "ETag": { "default": null, "title": "Etag", "type": "string" }, "ChecksumAlgorithm": { "anyOf": [ { "items": { "enum": [ "CRC32", "CRC32C", "SHA1", "SHA256", "CRC64NVME", "SHA512", "MD5", "XXHASH64", "XXHASH3", "XXHASH128" ], "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Checksumalgorithm" }, "ChecksumType": { "default": null, "enum": [ "COMPOSITE", "FULL_OBJECT" ], "title": "Checksumtype", "type": "string" }, "Size": { "default": null, "title": "Size", "type": "integer" }, "StorageClass": { "anyOf": [ { "enum": [ "STANDARD", "REDUCED_REDUNDANCY", "GLACIER", "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "DEEP_ARCHIVE", "OUTPOSTS", "GLACIER_IR", "SNOW", "EXPRESS_ONEZONE", "FSX_OPENZFS", "FSX_ONTAP" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Storageclass" }, "Owner": { "$ref": "#/$defs/S3Owner", "default": null }, "RestoreStatus": { "$ref": "#/$defs/S3RestoreStatus", "default": null }, "BucketName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Bucketname" }, "Tags": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Tags" } }, "title": "S3Object", "type": "object" }, "S3Owner": { "description": "Container for the owner's display name and ID.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" } }, "title": "S3Owner", "type": "object" }, "S3RestoreStatus": { "description": "Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be\nretrieved. For more information about these storage classes and how to work with archived objects, see `Working with\narchived objects <https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html>`_ in the *Amazon S3 User\nGuide*.\n\nThis functionality is not supported for directory buckets. Directory buckets only support ``EXPRESS_ONEZONE`` (the S3\nExpress One Zone storage class) in Availability Zones and ``ONEZONE_IA`` (the S3 One Zone-Infrequent Access storage\nclass) in Dedicated Local Zones.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "IsRestoreInProgress": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Isrestoreinprogress" }, "RestoreExpiryDate": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Restoreexpirydate" } }, "title": "S3RestoreStatus", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field CommonPrefixes: builtins.list[CommonPrefix] | None [Optional]
All of the keys (up to 1,000) that share the same prefix are grouped together.
When counting the total numbers of returns by this API operation, this group of keys is considered as one item.
- field ContinuationToken: str | None = None
If
ContinuationTokenwas sent with the request, it is included in the response.You can use the returned
ContinuationTokenfor pagination of the list response.
- field Delimiter: str | None = None
Causes keys that contain the same string between the
prefixand the first occurrence of the delimiter to be rolled up into a single result element in theCommonPrefixescollection.These rolled-up keys are not returned elsewhere in the response. Each rolled-up result counts as only one return against the
MaxKeysvalue.
- field EncodingType: Literal['url'] | None = None
Encoding type used by Amazon S3 to encode object key names in the XML response.
- field IsTruncated: bool | None = None
Set to
falseif all of the results were returned.Set to
trueif more keys are available to return. If the number of results exceeds that specified byMaxKeys, all of the results might not be returned.
- field KeyCount: int | None = None
KeyCountis the number of keys returned with this request.KeyCountwill always be less than or equal to theMaxKeysfield. For example, if you ask for 50 keys, your result will include 50 keys or fewer.
- field MaxKeys: int | None = None
Sets the maximum number of keys returned in the response.
By default, the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more.
- field NextContinuationToken: str | None = None
NextContinuationTokenis sent whenisTruncatedis true, which means there are more keys in the bucket that can be listed.The next list requests to Amazon S3 can be continued with this
NextContinuationToken.NextContinuationTokenis obfuscated and is not a real key
- field RequestCharged: Literal['requester'] | None = None
If present, indicates that the requester was successfully charged for the request.
For more information, see Using Requester Pays buckets for storage transfers and usage in the Amazon Simple Storage Service user guide.
- field StartAfter: str | None = None
If StartAfter was sent with the request, it is included in the response.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.ObjectIdentifier[source]
Bases:
Boto3ModelObject Identifier is unique value to identify objects.
Show JSON schema
{ "title": "ObjectIdentifier", "description": "Object Identifier is unique value to identify objects.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Key": { "title": "Key", "type": "string" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" }, "ETag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Etag" }, "LastModifiedTime": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Lastmodifiedtime" }, "Size": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Size" } }, "required": [ "Key" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field ETag: str | None = None
An entity tag (ETag) is an identifier assigned by a web server to a specific version of a resource found at a URL.
This header field makes the request method conditional on
ETags.
- field LastModifiedTime: datetime | None = None
If present, the objects are deleted only if its modification times matches the provided
Timestamp.
- field Size: int | None = None
If present, the objects are deleted only if its size matches the provided size in bytes.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.ObjectLockRetention[source]
Bases:
Boto3ModelA Retention configuration for an object.
Show JSON schema
{ "title": "ObjectLockRetention", "description": "A Retention configuration for an object.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Mode": { "anyOf": [ { "enum": [ "GOVERNANCE", "COMPLIANCE" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Mode" }, "RetainUntilDate": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Retainuntildate" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Mode: Literal['GOVERNANCE', 'COMPLIANCE'] | None = None
Indicates the Retention mode for the specified object.
- field RetainUntilDate: datetime | None = None
The date on which this Object Lock Retention will expire.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.ObjectPart[source]
Bases:
Boto3ModelA container for elements related to an individual part.
Show JSON schema
{ "title": "ObjectPart", "description": "A container for elements related to an individual part.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "PartNumber": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Partnumber" }, "Size": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Size" }, "ChecksumCRC32": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32" }, "ChecksumCRC32C": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32C" }, "ChecksumCRC64NVME": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc64Nvme" }, "ChecksumSHA1": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha1" }, "ChecksumSHA256": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha256" }, "ChecksumSHA512": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha512" }, "ChecksumMD5": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksummd5" }, "ChecksumXXHASH64": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash64" }, "ChecksumXXHASH3": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash3" }, "ChecksumXXHASH128": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash128" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field ChecksumCRC32: str | None = None
The Base64 encoded, 32-bit
CRC32checksum of the part.This checksum is present if the multipart upload request was created with the
CRC32checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumCRC32C: str | None = None
The Base64 encoded, 32-bit
CRC32Cchecksum of the part.This checksum is present if the multipart upload request was created with the
CRC32Cchecksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumCRC64NVME: str | None = None
The Base64 encoded, 64-bit
CRC64NVMEchecksum of the part.This checksum is present if the multipart upload request was created with the
CRC64NVMEchecksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum,CRC64NVME, to the uploaded object). For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumMD5: str | None = None
The Base64 encoded, 128-bit
MD5digest of the part.This checksum is present if the multipart upload request was created with the
MD5checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumSHA1: str | None = None
The Base64 encoded, 160-bit
SHA1checksum of the part.This checksum is present if the multipart upload request was created with the
SHA1checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumSHA256: str | None = None
The Base64 encoded, 256-bit
SHA256checksum of the part.This checksum is present if the multipart upload request was created with the
SHA256checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumSHA512: str | None = None
The Base64 encoded, 512-bit
SHA512digest of the part.This checksum is present if the multipart upload request was created with the
SHA512checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumXXHASH128: str | None = None
The Base64 encoded, 128-bit
XXHASH128checksum of the part.This checksum is present if the multipart upload request was created with the
XXHASH128checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumXXHASH3: str | None = None
The Base64 encoded, 64-bit
XXHASH3checksum of the part.This checksum is present if the multipart upload request was created with the
XXHASH3checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumXXHASH64: str | None = None
The Base64 encoded, 64-bit
XXHASH64checksum of the part.This checksum is present if the multipart upload request was created with the
XXHASH64checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field PartNumber: int | None = None
The part number identifying the part.
This value is a positive integer between 1 and 10,000.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.ObjectVersion[source]
Bases:
Boto3ModelThe version of an object.
Show JSON schema
{ "title": "ObjectVersion", "description": "The version of an object.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "ETag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Etag" }, "ChecksumAlgorithm": { "anyOf": [ { "items": { "enum": [ "CRC32", "CRC32C", "SHA1", "SHA256", "CRC64NVME", "SHA512", "MD5", "XXHASH64", "XXHASH3", "XXHASH128" ], "type": "string" }, "type": "array" }, { "type": "null" } ], "title": "Checksumalgorithm" }, "ChecksumType": { "anyOf": [ { "enum": [ "COMPOSITE", "FULL_OBJECT" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumtype" }, "Size": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Size" }, "StorageClass": { "anyOf": [ { "const": "STANDARD", "type": "string" }, { "type": "null" } ], "default": null, "title": "Storageclass" }, "Key": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Key" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" }, "IsLatest": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Islatest" }, "LastModified": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Lastmodified" }, "Owner": { "anyOf": [ { "$ref": "#/$defs/S3Owner" }, { "type": "null" } ], "default": null }, "RestoreStatus": { "anyOf": [ { "$ref": "#/$defs/S3RestoreStatus" }, { "type": "null" } ], "default": null } }, "$defs": { "S3Owner": { "description": "Container for the owner's display name and ID.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DisplayName": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Displayname" }, "ID": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Id" } }, "title": "S3Owner", "type": "object" }, "S3RestoreStatus": { "description": "Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be\nretrieved. For more information about these storage classes and how to work with archived objects, see `Working with\narchived objects <https://docs.aws.amazon.com/AmazonS3/latest/userguide/archived-objects.html>`_ in the *Amazon S3 User\nGuide*.\n\nThis functionality is not supported for directory buckets. Directory buckets only support ``EXPRESS_ONEZONE`` (the S3\nExpress One Zone storage class) in Availability Zones and ``ONEZONE_IA`` (the S3 One Zone-Infrequent Access storage\nclass) in Dedicated Local Zones.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "IsRestoreInProgress": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Isrestoreinprogress" }, "RestoreExpiryDate": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Restoreexpirydate" } }, "title": "S3RestoreStatus", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field ChecksumAlgorithm: builtins.list[Literal['CRC32', 'CRC32C', 'SHA1', 'SHA256', 'CRC64NVME', 'SHA512', 'MD5', 'XXHASH64', 'XXHASH3', 'XXHASH128']] | None [Optional]
The algorithm that was used to create a checksum of the object.
- field ChecksumType: Literal['COMPOSITE', 'FULL_OBJECT'] | None = None
The checksum type that is used to calculate the object’s checksum value.
For more information, see Checking object integrity in the Amazon S3 User Guide.
- field IsLatest: bool | None = None
Specifies whether the object is (true) or is not (false) the latest version of an object.
- field RestoreStatus: S3RestoreStatus | None = None
Specifies the restoration status of an object.
Objects in certain storage classes must be restored before they can be retrieved. For more information about these storage classes and how to work with archived objects, see Working with archived objects in the Amazon S3 User Guide.
- field StorageClass: Literal['STANDARD'] | None = None
The class of storage used to store the object.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.OutputSerialization[source]
Bases:
Boto3ModelDescribes how results of the Select job are serialized.
Show JSON schema
{ "title": "OutputSerialization", "description": "Describes how results of the Select job are serialized.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "CSV": { "anyOf": [ { "$ref": "#/$defs/CSVOutput" }, { "type": "null" } ], "default": null }, "JSON": { "anyOf": [ { "$ref": "#/$defs/JSONOutput" }, { "type": "null" } ], "default": null } }, "$defs": { "CSVOutput": { "description": "Describes how uncompressed comma-separated values (CSV)-formatted results are\nformatted.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "QuoteFields": { "anyOf": [ { "enum": [ "ALWAYS", "ASNEEDED" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Quotefields" }, "QuoteEscapeCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quoteescapecharacter" }, "RecordDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Recorddelimiter" }, "FieldDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Fielddelimiter" }, "QuoteCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quotecharacter" } }, "title": "CSVOutput", "type": "object" }, "JSONOutput": { "description": "Specifies JSON as request's output serialization format.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "RecordDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Recorddelimiter" } }, "title": "JSONOutput", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field JSON: JSONOutput | None = None
Specifies JSON as request’s output serialization format.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.ParquetInput[source]
Bases:
Boto3ModelContainer for Parquet.
Show JSON schema
{ "title": "ParquetInput", "description": "Container for Parquet.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.Progress[source]
Bases:
Boto3ModelThis data type contains information about progress of an operation.
Show JSON schema
{ "title": "Progress", "description": "This data type contains information about progress of an operation.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "BytesScanned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesscanned" }, "BytesProcessed": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesprocessed" }, "BytesReturned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesreturned" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field BytesReturned: int | None = None
The current number of bytes of records payload data returned.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.ProgressEvent[source]
Bases:
Boto3ModelThis data type contains information about the progress event of an operation.
Show JSON schema
{ "title": "ProgressEvent", "description": "This data type contains information about the progress event of an operation.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Details": { "anyOf": [ { "$ref": "#/$defs/Progress" }, { "type": "null" } ], "default": null } }, "$defs": { "Progress": { "description": "This data type contains information about progress of an operation.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "BytesScanned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesscanned" }, "BytesProcessed": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesprocessed" }, "BytesReturned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesreturned" } }, "title": "Progress", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.PutBucketLifecycleConfigurationOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "PutBucketLifecycleConfigurationOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "TransitionDefaultMinimumObjectSize": { "anyOf": [ { "enum": [ "varies_by_storage_class", "all_storage_classes_128K" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Transitiondefaultminimumobjectsize" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field TransitionDefaultMinimumObjectSize: Literal['varies_by_storage_class', 'all_storage_classes_128K'] | None = None
Indicates which default minimum object size behavior is applied to the lifecycle configuration.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.PutObjectAclOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "PutObjectAclOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "RequestCharged": { "anyOf": [ { "const": "requester", "type": "string" }, { "type": "null" } ], "default": null, "title": "Requestcharged" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field RequestCharged: Literal['requester'] | None = None
If present, indicates that the requester was successfully charged for the request.
For more information, see Using Requester Pays buckets for storage transfers and usage in the Amazon Simple Storage Service user guide.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.PutObjectLegalHoldOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "PutObjectLegalHoldOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "RequestCharged": { "anyOf": [ { "const": "requester", "type": "string" }, { "type": "null" } ], "default": null, "title": "Requestcharged" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field RequestCharged: Literal['requester'] | None = None
If present, indicates that the requester was successfully charged for the request.
For more information, see Using Requester Pays buckets for storage transfers and usage in the Amazon Simple Storage Service user guide.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.PutObjectLockConfigurationOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "PutObjectLockConfigurationOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "RequestCharged": { "anyOf": [ { "const": "requester", "type": "string" }, { "type": "null" } ], "default": null, "title": "Requestcharged" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field RequestCharged: Literal['requester'] | None = None
If present, indicates that the requester was successfully charged for the request.
For more information, see Using Requester Pays buckets for storage transfers and usage in the Amazon Simple Storage Service user guide.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.PutObjectOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "PutObjectOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Expiration": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Expiration" }, "ETag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Etag" }, "ChecksumCRC32": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32" }, "ChecksumCRC32C": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32C" }, "ChecksumCRC64NVME": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc64Nvme" }, "ChecksumSHA1": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha1" }, "ChecksumSHA256": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha256" }, "ChecksumSHA512": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha512" }, "ChecksumMD5": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksummd5" }, "ChecksumXXHASH64": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash64" }, "ChecksumXXHASH3": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash3" }, "ChecksumXXHASH128": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash128" }, "ChecksumType": { "anyOf": [ { "enum": [ "COMPOSITE", "FULL_OBJECT" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumtype" }, "ServerSideEncryption": { "anyOf": [ { "enum": [ "AES256", "aws:fsx", "aws:kms", "aws:kms:dsse" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Serversideencryption" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" }, "SSECustomerAlgorithm": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ssecustomeralgorithm" }, "SSECustomerKeyMD5": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ssecustomerkeymd5" }, "SSEKMSKeyId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ssekmskeyid" }, "SSEKMSEncryptionContext": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ssekmsencryptioncontext" }, "BucketKeyEnabled": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Bucketkeyenabled" }, "Size": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Size" }, "RequestCharged": { "anyOf": [ { "const": "requester", "type": "string" }, { "type": "null" } ], "default": null, "title": "Requestcharged" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field BucketKeyEnabled: bool | None = None
Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).
- field ChecksumCRC32: str | None = None
The Base64 encoded, 32-bit
CRC32 checksumof the object.This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it’s a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumCRC32C: str | None = None
The Base64 encoded, 32-bit
CRC32Cchecksum of the object.This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it’s a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumCRC64NVME: str | None = None
The Base64 encoded, 64-bit
CRC64NVMEchecksum of the object.This header is present if the object was uploaded with the
CRC64NVMEchecksum algorithm, or if it was uploaded without a checksum (and Amazon S3 added the default checksum,CRC64NVME, to the uploaded object). For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumMD5: str | None = None
The Base64 encoded, 128-bit
MD5digest of the object.This header is present if the object was uploaded with the
MD5checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumSHA1: str | None = None
The Base64 encoded, 160-bit
SHA1digest of the object.This checksum is only present if the checksum was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it’s a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumSHA256: str | None = None
The Base64 encoded, 256-bit
SHA256digest of the object.This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it’s a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumSHA512: str | None = None
The Base64 encoded, 512-bit
SHA512digest of the object.This header is present if the object was uploaded with the
SHA512checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumType: Literal['COMPOSITE', 'FULL_OBJECT'] | None = None
This header specifies the checksum type of the object, which determines how part- level checksums are combined to create an object-level checksum for multipart objects.
For
PutObjectuploads, the checksum type is alwaysFULL_OBJECT. You can use this header as a data integrity check to verify that the checksum type that is received is the same checksum that was specified. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumXXHASH128: str | None = None
The Base64 encoded, 128-bit
XXHASH128checksum of the object.This header is present if the object was uploaded with the
XXHASH128checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumXXHASH3: str | None = None
The Base64 encoded, 64-bit
XXHASH3checksum of the object.This header is present if the object was uploaded with the
XXHASH3checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumXXHASH64: str | None = None
The Base64 encoded, 64-bit
XXHASH64checksum of the object.This header is present if the object was uploaded with the
XXHASH64checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field Expiration: str | None = None
If the expiration is configured for the object (see PutBucketLifecycleConfiguration) in the Amazon S3 User Guide, the response includes this header. It includes the
expiry-dateandrule-idkey-value pairs that provide information about object expiration. The value of therule-idis URL-encoded.
- field RequestCharged: Literal['requester'] | None = None
If present, indicates that the requester was successfully charged for the request.
For more information, see Using Requester Pays buckets for storage transfers and usage in the Amazon Simple Storage Service user guide.
- field SSECustomerAlgorithm: str | None = None
If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that’s used.
- field SSECustomerKeyMD5: str | None = None
If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.
- field SSEKMSEncryptionContext: str | None = None
If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption.
The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future
GetObjectoperations on this object.
- field SSEKMSKeyId: str | None = None
If present, indicates the ID of the KMS key that was used for object encryption.
- field ServerSideEncryption: Literal['AES256', 'aws:fsx', 'aws:kms', 'aws:kms:dsse'] | None = None
The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx.
- field Size: int | None = None
The size of the object in bytes.
This value is only be present if you append to an object.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.PutObjectRetentionOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "PutObjectRetentionOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "RequestCharged": { "anyOf": [ { "const": "requester", "type": "string" }, { "type": "null" } ], "default": null, "title": "Requestcharged" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field RequestCharged: Literal['requester'] | None = None
If present, indicates that the requester was successfully charged for the request.
For more information, see Using Requester Pays buckets for storage transfers and usage in the Amazon Simple Storage Service user guide.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.PutObjectTaggingOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "PutObjectTaggingOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "VersionId": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Versionid" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.RecordsEvent[source]
Bases:
Boto3ModelThe container for the records event.
Show JSON schema
{ "title": "RecordsEvent", "description": "The container for the records event.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Payload": { "anyOf": [ { "format": "binary", "type": "string" }, { "type": "null" } ], "default": null, "title": "Payload" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Payload: bytes | None = None
The byte array of partial, one or more result records.
S3 Select doesn’t guarantee that a record will be self-contained in one record frame. To ensure continuous streaming of data, S3 Select might split the same record across multiple record frames instead of aggregating the results in memory. Some S3 clients (for example, the SDK for Java) handle this behavior by creating a
ByteStreamout of the response by default. Other clients might not handle this behavior by default. In those cases, you must aggregate the results on the client side and parse the response.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.RenameObjectOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "RenameObjectOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.RequestProgress[source]
Bases:
Boto3ModelContainer for specifying if periodic
QueryProgressmessages should be sent.Show JSON schema
{ "title": "RequestProgress", "description": "Container for specifying if periodic ``QueryProgress`` messages should be sent.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Enabled": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Enabled" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Enabled: bool | None = None
Specifies whether periodic QueryProgress frames should be sent.
Valid values: TRUE, FALSE. Default value: FALSE.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.RestoreObjectOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "RestoreObjectOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "RequestCharged": { "anyOf": [ { "const": "requester", "type": "string" }, { "type": "null" } ], "default": null, "title": "Requestcharged" }, "RestoreOutputPath": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Restoreoutputpath" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field RequestCharged: Literal['requester'] | None = None
If present, indicates that the requester was successfully charged for the request.
For more information, see Using Requester Pays buckets for storage transfers and usage in the Amazon Simple Storage Service user guide.
- field RestoreOutputPath: str | None = None
Indicates the path in the provided S3 output location where Select results will be restored to.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.RestoreRequest[source]
Bases:
Boto3ModelContainer for restore job parameters.
Show JSON schema
{ "title": "RestoreRequest", "description": "Container for restore job parameters.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Days" }, "GlacierJobParameters": { "anyOf": [ { "$ref": "#/$defs/S3GlacierJobParameters" }, { "type": "null" } ], "default": null }, "Type": { "anyOf": [ { "const": "SELECT", "type": "string" }, { "type": "null" } ], "default": null, "title": "Type" }, "Tier": { "anyOf": [ { "enum": [ "Standard", "Bulk", "Expedited" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Tier" }, "Description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Description" }, "SelectParameters": { "anyOf": [ { "$ref": "#/$defs/S3SelectParameters" }, { "type": "null" } ], "default": null }, "OutputLocation": { "anyOf": [ { "$ref": "#/$defs/S3OutputLocation" }, { "type": "null" } ], "default": null } }, "$defs": { "CSVOutput": { "description": "Describes how uncompressed comma-separated values (CSV)-formatted results are\nformatted.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "QuoteFields": { "anyOf": [ { "enum": [ "ALWAYS", "ASNEEDED" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Quotefields" }, "QuoteEscapeCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quoteescapecharacter" }, "RecordDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Recorddelimiter" }, "FieldDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Fielddelimiter" }, "QuoteCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quotecharacter" } }, "title": "CSVOutput", "type": "object" }, "InputSerialization": { "description": "Describes the serialization format of the object.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "CSV": { "anyOf": [ { "$ref": "#/$defs/S3CSVInput" }, { "type": "null" } ], "default": null }, "CompressionType": { "anyOf": [ { "enum": [ "NONE", "GZIP", "BZIP2" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Compressiontype" }, "JSON": { "anyOf": [ { "$ref": "#/$defs/JSONInput" }, { "type": "null" } ], "default": null }, "Parquet": { "anyOf": [ { "$ref": "#/$defs/ParquetInput" }, { "type": "null" } ], "default": null } }, "title": "InputSerialization", "type": "object" }, "JSONInput": { "description": "Specifies JSON as object's input serialization format.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Type": { "anyOf": [ { "enum": [ "DOCUMENT", "LINES" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Type" } }, "title": "JSONInput", "type": "object" }, "JSONOutput": { "description": "Specifies JSON as request's output serialization format.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "RecordDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Recorddelimiter" } }, "title": "JSONOutput", "type": "object" }, "OutputSerialization": { "description": "Describes how results of the Select job are serialized.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "CSV": { "anyOf": [ { "$ref": "#/$defs/CSVOutput" }, { "type": "null" } ], "default": null }, "JSON": { "anyOf": [ { "$ref": "#/$defs/JSONOutput" }, { "type": "null" } ], "default": null } }, "title": "OutputSerialization", "type": "object" }, "ParquetInput": { "description": "Container for Parquet.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } }, "title": "ParquetInput", "type": "object" }, "S3CSVInput": { "description": "Describes how an uncompressed comma-separated values (CSV)-formatted input object is\nformatted.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "QuoteEscapeCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quoteescapecharacter" }, "FileHeaderInfo": { "anyOf": [ { "enum": [ "USE", "IGNORE", "NONE" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Fileheaderinfo" }, "Comments": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Comments" }, "RecordDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Recorddelimiter" }, "FieldDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Fielddelimiter" }, "QuoteCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quotecharacter" }, "AllowQuotedRecordDelimiter": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Allowquotedrecorddelimiter" } }, "title": "S3CSVInput", "type": "object" }, "S3GlacierJobParameters": { "description": "Container for S3 Glacier job parameters.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Tier": { "enum": [ "Standard", "Bulk", "Expedited" ], "title": "Tier", "type": "string" } }, "required": [ "Tier" ], "title": "S3GlacierJobParameters", "type": "object" }, "S3Location": { "description": "A storage location in an Amazon S3 bucket.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "uri": { "title": "Uri", "type": "string" }, "bucketOwner": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Bucketowner" } }, "required": [ "uri" ], "title": "S3Location", "type": "object" }, "S3OutputLocation": { "description": "Describes the location where the restore job's output is stored.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "S3": { "anyOf": [ { "$ref": "#/$defs/S3Location" }, { "type": "null" } ], "default": null } }, "title": "S3OutputLocation", "type": "object" }, "S3SelectParameters": { "description": "Amazon S3 Select is no longer available to new customers. Existing customers of Amazon S3 Select can continue to use the\nfeature as usual. `Learn more <http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/>`_\n\nDescribes the parameters for Select job types.\n\nLearn `How to optimize querying your data in Amazon S3 <http://aws.amazon.com/blogs/storage/how-to-optimize-querying-\nyour-data-in-amazon-s3/>`_ using `Amazon Athena <https://docs.aws.amazon.com/athena/latest/ug/what-is.html>`_, `S3 Object\nLambda <https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html>`_, or client-side filtering.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "InputSerialization": { "$ref": "#/$defs/InputSerialization" }, "ExpressionType": { "const": "SQL", "title": "Expressiontype", "type": "string" }, "Expression": { "title": "Expression", "type": "string" }, "OutputSerialization": { "$ref": "#/$defs/OutputSerialization" } }, "required": [ "InputSerialization", "ExpressionType", "Expression", "OutputSerialization" ], "title": "S3SelectParameters", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Days: int | None = None
Lifetime of the active copy in days.
Do not use with restores that specify
OutputLocation.
- field GlacierJobParameters: S3GlacierJobParameters | None = None
S3 Glacier related parameters pertaining to this job.
Do not use with restores that specify
OutputLocation.
- field OutputLocation: S3OutputLocation | None = None
Describes the location where the restore job’s output is stored.
- field SelectParameters: S3SelectParameters | None = None
Amazon S3 Select is no longer available to new customers.
Existing customers of Amazon S3 Select can continue to use the feature as usual. Learn more
- field Tier: Literal['Standard', 'Bulk', 'Expedited'] | None = None
Retrieval tier at which the restore will be processed.
- field Type: Literal['SELECT'] | None = None
Amazon S3 Select is no longer available to new customers.
Existing customers of Amazon S3 Select can continue to use the feature as usual. Learn more
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3CSVInput[source]
Bases:
Boto3ModelDescribes how an uncompressed comma-separated values (CSV)-formatted input object is formatted.
Show JSON schema
{ "title": "S3CSVInput", "description": "Describes how an uncompressed comma-separated values (CSV)-formatted input object is\nformatted.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "QuoteEscapeCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quoteescapecharacter" }, "FileHeaderInfo": { "anyOf": [ { "enum": [ "USE", "IGNORE", "NONE" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Fileheaderinfo" }, "Comments": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Comments" }, "RecordDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Recorddelimiter" }, "FieldDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Fielddelimiter" }, "QuoteCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quotecharacter" }, "AllowQuotedRecordDelimiter": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Allowquotedrecorddelimiter" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field AllowQuotedRecordDelimiter: bool | None = None
Specifies that CSV field values may contain quoted record delimiters and such records should be allowed.
Default value is FALSE. Setting this value to TRUE may lower performance.
- field Comments: str | None = None
A single character used to indicate that a row should be ignored when the character is present at the start of that row.
You can specify any character to indicate a comment line. The default character is
#.
- field FieldDelimiter: str | None = None
A single character used to separate individual fields in a record.
You can specify an arbitrary delimiter.
- field FileHeaderInfo: Literal['USE', 'IGNORE', 'NONE'] | None = None
Describes the first line of input.
Valid values are:
- field QuoteCharacter: str | None = None
A single character used for escaping when the field delimiter is part of the value.
For example, if the value is
a, b, Amazon S3 wraps this field value in quotation marks, as follows:" a , b ".
- field QuoteEscapeCharacter: str | None = None
A single character used for escaping the quote character inside an already escaped value.
- field RecordDelimiter: str | None = None
A single character used to separate individual records in the input.
Instead of the default value, you can specify an arbitrary delimiter.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3Checksum[source]
Bases:
Boto3ModelContains all the possible checksum or digest values for an object.
Show JSON schema
{ "title": "S3Checksum", "description": "Contains all the possible checksum or digest values for an object.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "ChecksumCRC32": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32" }, "ChecksumCRC32C": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32C" }, "ChecksumCRC64NVME": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc64Nvme" }, "ChecksumSHA1": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha1" }, "ChecksumSHA256": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha256" }, "ChecksumSHA512": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha512" }, "ChecksumMD5": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksummd5" }, "ChecksumXXHASH64": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash64" }, "ChecksumXXHASH3": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash3" }, "ChecksumXXHASH128": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash128" }, "ChecksumType": { "anyOf": [ { "enum": [ "COMPOSITE", "FULL_OBJECT" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumtype" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field ChecksumCRC32: str | None = None
The Base64 encoded, 32-bit
CRC32 checksumof the object.This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it’s a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumCRC32C: str | None = None
The Base64 encoded, 32-bit
CRC32Cchecksum of the object.This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it’s a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumCRC64NVME: str | None = None
The Base64 encoded, 64-bit
CRC64NVMEchecksum of the object.This checksum is present if the object was uploaded with the
CRC64NVMEchecksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum,CRC64NVME, to the uploaded object). For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumMD5: str | None = None
The Base64 encoded, 128-bit
MD5digest of the object.This checksum is present if the object was uploaded with the
MD5checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumSHA1: str | None = None
The Base64 encoded, 160-bit
SHA1digest of the object.This checksum is only present if the checksum was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it’s a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumSHA256: str | None = None
The Base64 encoded, 256-bit
SHA256digest of the object.This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it’s a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumSHA512: str | None = None
The Base64 encoded, 512-bit
SHA512digest of the object.This checksum is present if the object was uploaded with the
SHA512checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumType: Literal['COMPOSITE', 'FULL_OBJECT'] | None = None
The checksum type that is used to calculate the object’s checksum value.
For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumXXHASH128: str | None = None
The Base64 encoded, 128-bit
XXHASH128checksum of the object.This checksum is present if the object was uploaded with the
XXHASH128checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumXXHASH3: str | None = None
The Base64 encoded, 64-bit
XXHASH3checksum of the object.This checksum is present if the object was uploaded with the
XXHASH3checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumXXHASH64: str | None = None
The Base64 encoded, 64-bit
XXHASH64checksum of the object.This checksum is present if the object was uploaded with the
XXHASH64checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3CopyObjectResult[source]
Bases:
Boto3ModelContainer for all response elements.
Show JSON schema
{ "title": "S3CopyObjectResult", "description": "Container for all response elements.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "ETag": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Etag" }, "LastModified": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Lastmodified" }, "ChecksumType": { "anyOf": [ { "enum": [ "COMPOSITE", "FULL_OBJECT" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumtype" }, "ChecksumCRC32": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32" }, "ChecksumCRC32C": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc32C" }, "ChecksumCRC64NVME": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumcrc64Nvme" }, "ChecksumSHA1": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha1" }, "ChecksumSHA256": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha256" }, "ChecksumSHA512": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumsha512" }, "ChecksumMD5": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksummd5" }, "ChecksumXXHASH64": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash64" }, "ChecksumXXHASH3": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash3" }, "ChecksumXXHASH128": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Checksumxxhash128" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field ChecksumCRC32: str | None = None
The Base64 encoded, 32-bit
CRC32checksum of the object.This checksum is only present if the object was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumCRC32C: str | None = None
The Base64 encoded, 32-bit
CRC32Cchecksum of the object.This checksum is only present if the checksum was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumCRC64NVME: str | None = None
The Base64 encoded, 64-bit
CRC64NVMEchecksum of the object.This checksum is present if the object being copied was uploaded with the
CRC64NVMEchecksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum,CRC64NVME, to the uploaded object). For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumMD5: str | None = None
The Base64 encoded, 128-bit
MD5digest of the object.This checksum is only present if the object was uploaded with the
MD5checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumSHA1: str | None = None
The Base64 encoded, 160-bit
SHA1digest of the object.This checksum is only present if the checksum was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumSHA256: str | None = None
The Base64 encoded, 256-bit
SHA256digest of the object.This checksum is only present if the checksum was uploaded with the object. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumSHA512: str | None = None
The Base64 encoded, 512-bit
SHA512digest of the object.This checksum is only present if the object was uploaded with the
SHA512checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumType: Literal['COMPOSITE', 'FULL_OBJECT'] | None = None
The checksum type that is used to calculate the object’s checksum value.
For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumXXHASH128: str | None = None
The Base64 encoded, 128-bit
XXHASH128checksum of the object.This checksum is only present if the object was uploaded with the
XXHASH128checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumXXHASH3: str | None = None
The Base64 encoded, 64-bit
XXHASH3checksum of the object.This checksum is only present if the object was uploaded with the
XXHASH3checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ChecksumXXHASH64: str | None = None
The Base64 encoded, 64-bit
XXHASH64checksum of the object.This checksum is only present if the object was uploaded with the
XXHASH64checksum algorithm. For more information, see Checking object integrity in the Amazon S3 User Guide.
- field ETag: str | None = None
Returns the ETag of the new object.
The ETag reflects only changes to the contents of an object, not its metadata.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3DefaultRetention[source]
Bases:
Boto3ModelThe container element for optionally specifying the default Object Lock retention settings for new objects placed in the specified bucket.
The
DefaultRetentionsettings require both a mode and a period.The
DefaultRetentionperiod can be eitherDaysorYearsbut you must select one. You cannot specifyDaysandYearsat the same time.
Show JSON schema
{ "title": "S3DefaultRetention", "description": "The container element for optionally specifying the default Object Lock retention\nsettings for new objects placed in the specified bucket.\n\n* The ``DefaultRetention`` settings require both a mode and a period.\n* The ``DefaultRetention`` period can be either ``Days`` or ``Years`` but you must select one. You cannot specify\n ``Days`` and ``Years`` at the same time.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Mode": { "anyOf": [ { "enum": [ "GOVERNANCE", "COMPLIANCE" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Mode" }, "Days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Days" }, "Years": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Years" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Days: int | None = None
The number of days that you want to specify for the default retention period.
Must be used with
Mode.
- field Mode: Literal['GOVERNANCE', 'COMPLIANCE'] | None = None
The default Object Lock retention mode you want to apply to new objects placed in the specified bucket.
Must be used with either
DaysorYears.
- field Years: int | None = None
The number of years that you want to specify for the default retention period.
Must be used with
Mode.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3GlacierJobParameters[source]
Bases:
Boto3ModelContainer for S3 Glacier job parameters.
Show JSON schema
{ "title": "S3GlacierJobParameters", "description": "Container for S3 Glacier job parameters.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Tier": { "enum": [ "Standard", "Bulk", "Expedited" ], "title": "Tier", "type": "string" } }, "required": [ "Tier" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Tier: Literal['Standard', 'Bulk', 'Expedited'] [Required]
Retrieval tier at which the restore will be processed.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3ObjectLockConfiguration[source]
Bases:
Boto3ModelThe container element for Object Lock configuration parameters.
Show JSON schema
{ "title": "S3ObjectLockConfiguration", "description": "The container element for Object Lock configuration parameters.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "ObjectLockEnabled": { "anyOf": [ { "const": "Enabled", "type": "string" }, { "type": "null" } ], "default": null, "title": "Objectlockenabled" }, "Rule": { "anyOf": [ { "$ref": "#/$defs/S3ObjectLockRule" }, { "type": "null" } ], "default": null } }, "$defs": { "S3DefaultRetention": { "description": "The container element for optionally specifying the default Object Lock retention\nsettings for new objects placed in the specified bucket.\n\n* The ``DefaultRetention`` settings require both a mode and a period.\n* The ``DefaultRetention`` period can be either ``Days`` or ``Years`` but you must select one. You cannot specify\n ``Days`` and ``Years`` at the same time.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Mode": { "anyOf": [ { "enum": [ "GOVERNANCE", "COMPLIANCE" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Mode" }, "Days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Days" }, "Years": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Years" } }, "title": "S3DefaultRetention", "type": "object" }, "S3ObjectLockRule": { "description": "The container element for an Object Lock rule.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DefaultRetention": { "anyOf": [ { "$ref": "#/$defs/S3DefaultRetention" }, { "type": "null" } ], "default": null } }, "title": "S3ObjectLockRule", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field ObjectLockEnabled: Literal['Enabled'] | None = None
Indicates whether this bucket has an Object Lock configuration enabled.
Enable
ObjectLockEnabledwhen you applyObjectLockConfigurationto a bucket.
- field Rule: S3ObjectLockRule | None = None
Specifies the Object Lock rule for the specified object.
Enable the this rule when you apply
ObjectLockConfigurationto a bucket. Bucket settings require both a mode and a period. The period can be eitherDaysorYearsbut you must select one. You cannot specifyDaysandYearsat the same time.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3ObjectLockLegalHold[source]
Bases:
Boto3ModelA legal hold configuration for an object.
Show JSON schema
{ "title": "S3ObjectLockLegalHold", "description": "A legal hold configuration for an object.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Status": { "anyOf": [ { "enum": [ "ON", "OFF" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Status" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Status: Literal['ON', 'OFF'] | None = None
Indicates whether the specified object has a legal hold in place.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3ObjectLockRule[source]
Bases:
Boto3ModelThe container element for an Object Lock rule.
Show JSON schema
{ "title": "S3ObjectLockRule", "description": "The container element for an Object Lock rule.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "DefaultRetention": { "anyOf": [ { "$ref": "#/$defs/S3DefaultRetention" }, { "type": "null" } ], "default": null } }, "$defs": { "S3DefaultRetention": { "description": "The container element for optionally specifying the default Object Lock retention\nsettings for new objects placed in the specified bucket.\n\n* The ``DefaultRetention`` settings require both a mode and a period.\n* The ``DefaultRetention`` period can be either ``Days`` or ``Years`` but you must select one. You cannot specify\n ``Days`` and ``Years`` at the same time.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Mode": { "anyOf": [ { "enum": [ "GOVERNANCE", "COMPLIANCE" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Mode" }, "Days": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Days" }, "Years": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Years" } }, "title": "S3DefaultRetention", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field DefaultRetention: S3DefaultRetention | None = None
The default Object Lock retention mode and period that you want to apply to new objects placed in the specified bucket.
Bucket settings require both a mode and a period. The period can be either
DaysorYearsbut you must select one. You cannot specifyDaysandYearsat the same time.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3OutputLocation[source]
Bases:
Boto3ModelDescribes the location where the restore job’s output is stored.
Show JSON schema
{ "title": "S3OutputLocation", "description": "Describes the location where the restore job's output is stored.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "S3": { "anyOf": [ { "$ref": "#/$defs/S3Location" }, { "type": "null" } ], "default": null } }, "$defs": { "S3Location": { "description": "A storage location in an Amazon S3 bucket.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "uri": { "title": "Uri", "type": "string" }, "bucketOwner": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Bucketowner" } }, "required": [ "uri" ], "title": "S3Location", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field S3: S3Location | None = None
Describes an S3 location that will receive the results of the restore 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3SelectParameters[source]
Bases:
Boto3ModelAmazon S3 Select is no longer available to new customers. Existing customers of Amazon S3 Select can continue to use the feature as usual. Learn more
Describes the parameters for Select job types.
Learn How to optimize querying your data in Amazon S3 using Amazon Athena, S3 Object Lambda, or client-side filtering.
Show JSON schema
{ "title": "S3SelectParameters", "description": "Amazon S3 Select is no longer available to new customers. Existing customers of Amazon S3 Select can continue to use the\nfeature as usual. `Learn more <http://aws.amazon.com/blogs/storage/how-to-optimize-querying-your-data-in-amazon-s3/>`_\n\nDescribes the parameters for Select job types.\n\nLearn `How to optimize querying your data in Amazon S3 <http://aws.amazon.com/blogs/storage/how-to-optimize-querying-\nyour-data-in-amazon-s3/>`_ using `Amazon Athena <https://docs.aws.amazon.com/athena/latest/ug/what-is.html>`_, `S3 Object\nLambda <https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html>`_, or client-side filtering.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "InputSerialization": { "$ref": "#/$defs/InputSerialization" }, "ExpressionType": { "const": "SQL", "title": "Expressiontype", "type": "string" }, "Expression": { "title": "Expression", "type": "string" }, "OutputSerialization": { "$ref": "#/$defs/OutputSerialization" } }, "$defs": { "CSVOutput": { "description": "Describes how uncompressed comma-separated values (CSV)-formatted results are\nformatted.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "QuoteFields": { "anyOf": [ { "enum": [ "ALWAYS", "ASNEEDED" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Quotefields" }, "QuoteEscapeCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quoteescapecharacter" }, "RecordDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Recorddelimiter" }, "FieldDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Fielddelimiter" }, "QuoteCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quotecharacter" } }, "title": "CSVOutput", "type": "object" }, "InputSerialization": { "description": "Describes the serialization format of the object.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "CSV": { "anyOf": [ { "$ref": "#/$defs/S3CSVInput" }, { "type": "null" } ], "default": null }, "CompressionType": { "anyOf": [ { "enum": [ "NONE", "GZIP", "BZIP2" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Compressiontype" }, "JSON": { "anyOf": [ { "$ref": "#/$defs/JSONInput" }, { "type": "null" } ], "default": null }, "Parquet": { "anyOf": [ { "$ref": "#/$defs/ParquetInput" }, { "type": "null" } ], "default": null } }, "title": "InputSerialization", "type": "object" }, "JSONInput": { "description": "Specifies JSON as object's input serialization format.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Type": { "anyOf": [ { "enum": [ "DOCUMENT", "LINES" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Type" } }, "title": "JSONInput", "type": "object" }, "JSONOutput": { "description": "Specifies JSON as request's output serialization format.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "RecordDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Recorddelimiter" } }, "title": "JSONOutput", "type": "object" }, "OutputSerialization": { "description": "Describes how results of the Select job are serialized.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "CSV": { "anyOf": [ { "$ref": "#/$defs/CSVOutput" }, { "type": "null" } ], "default": null }, "JSON": { "anyOf": [ { "$ref": "#/$defs/JSONOutput" }, { "type": "null" } ], "default": null } }, "title": "OutputSerialization", "type": "object" }, "ParquetInput": { "description": "Container for Parquet.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } }, "title": "ParquetInput", "type": "object" }, "S3CSVInput": { "description": "Describes how an uncompressed comma-separated values (CSV)-formatted input object is\nformatted.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "QuoteEscapeCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quoteescapecharacter" }, "FileHeaderInfo": { "anyOf": [ { "enum": [ "USE", "IGNORE", "NONE" ], "type": "string" }, { "type": "null" } ], "default": null, "title": "Fileheaderinfo" }, "Comments": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Comments" }, "RecordDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Recorddelimiter" }, "FieldDelimiter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Fielddelimiter" }, "QuoteCharacter": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Quotecharacter" }, "AllowQuotedRecordDelimiter": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Allowquotedrecorddelimiter" } }, "title": "S3CSVInput", "type": "object" } }, "required": [ "InputSerialization", "ExpressionType", "Expression", "OutputSerialization" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Expression: str [Required]
Amazon S3 Select is no longer available to new customers.
Existing customers of Amazon S3 Select can continue to use the feature as usual. Learn more
- field ExpressionType: Literal['SQL'] [Required]
The type of the provided expression (for example, SQL).
- field InputSerialization: InputSerialization [Required]
Describes the serialization format of the object.
- field OutputSerialization: OutputSerialization [Required]
Describes how the results of the Select job are serialized.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.S3Tagging[source]
Bases:
Boto3ModelContainer for
TagSetelements.Show JSON schema
{ "title": "S3Tagging", "description": "Container for ``TagSet`` elements.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "TagSet": { "items": { "$ref": "#/$defs/Tag" }, "title": "Tagset", "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": [ "TagSet" ] }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field TagSet: builtins.list[Tag] [Required]
A collection for a set of tags.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.ScanRange[source]
Bases:
Boto3ModelSpecifies the byte range of the object to get the records from.
A record is processed when its first byte is contained by the range. This parameter is optional, but when specified, it must not be empty. See RFC 2616, Section 14.35.1 about how to specify the start and end of the range.
Show JSON schema
{ "title": "ScanRange", "description": "Specifies the byte range of the object to get the records from.\n\nA record is processed when its first byte is contained by the range. This parameter\nis optional, but when specified, it must not be empty. See RFC 2616, Section 14.35.1\nabout how to specify the start and end of the range.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Start": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Start" }, "End": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "End" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field End: int | None = None
Specifies the end of the byte range.
This parameter is optional. Valid values: non-negative integers. The default value is one less than the size of the object being queried. If only the End parameter is supplied, it is interpreted to mean scan the last N bytes of the file. For example,
<scanrange><end>50</end></scanrange>means scan the last 50 bytes.
- field Start: int | None = None
Specifies the start of the byte range.
This parameter is optional. Valid values: non-negative integers. The default value is 0. If only
startis supplied, it means scan from that point to the end of the file. For example,<scanrange><start>50</start></scanrange>means scan from byte 50 until the end of the file.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.SelectObjectContentEventStream[source]
Bases:
Boto3ModelThe container for selecting objects from a content event stream.
Show JSON schema
{ "title": "SelectObjectContentEventStream", "description": "The container for selecting objects from a content event stream.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Records": { "anyOf": [ { "$ref": "#/$defs/RecordsEvent" }, { "type": "null" } ], "default": null }, "Stats": { "anyOf": [ { "$ref": "#/$defs/StatsEvent" }, { "type": "null" } ], "default": null }, "Progress": { "anyOf": [ { "$ref": "#/$defs/ProgressEvent" }, { "type": "null" } ], "default": null }, "Cont": { "anyOf": [ { "$ref": "#/$defs/ContinuationEvent" }, { "type": "null" } ], "default": null }, "End": { "anyOf": [ { "$ref": "#/$defs/EndEvent" }, { "type": "null" } ], "default": null } }, "$defs": { "ContinuationEvent": { "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } }, "title": "ContinuationEvent", "type": "object" }, "EndEvent": { "description": "A message that indicates the request is complete and no more messages will be sent.\n\nYou should not assume that the\nrequest is complete until the client receives an ``EndEvent``.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } }, "title": "EndEvent", "type": "object" }, "Progress": { "description": "This data type contains information about progress of an operation.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "BytesScanned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesscanned" }, "BytesProcessed": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesprocessed" }, "BytesReturned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesreturned" } }, "title": "Progress", "type": "object" }, "ProgressEvent": { "description": "This data type contains information about the progress event of an operation.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Details": { "anyOf": [ { "$ref": "#/$defs/Progress" }, { "type": "null" } ], "default": null } }, "title": "ProgressEvent", "type": "object" }, "RecordsEvent": { "description": "The container for the records event.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Payload": { "anyOf": [ { "format": "binary", "type": "string" }, { "type": "null" } ], "default": null, "title": "Payload" } }, "title": "RecordsEvent", "type": "object" }, "Stats": { "description": "Container for the stats details.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "BytesScanned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesscanned" }, "BytesProcessed": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesprocessed" }, "BytesReturned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesreturned" } }, "title": "Stats", "type": "object" }, "StatsEvent": { "description": "Container for the Stats Event.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Details": { "anyOf": [ { "$ref": "#/$defs/Stats" }, { "type": "null" } ], "default": null } }, "title": "StatsEvent", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Cont: ContinuationEvent | None = None
The Continuation Event.
- field Progress: ProgressEvent | None = None
The Progress Event.
- field Records: RecordsEvent | None = None
The Records Event.
- field Stats: StatsEvent | None = None
The Stats Event.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.SelectObjectContentOutput[source]
Bases:
Boto3ModelShow JSON schema
{ "title": "SelectObjectContentOutput", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Payload": { "anyOf": [ { "$ref": "#/$defs/SelectObjectContentEventStream" }, { "type": "null" } ], "default": null } }, "$defs": { "ContinuationEvent": { "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } }, "title": "ContinuationEvent", "type": "object" }, "EndEvent": { "description": "A message that indicates the request is complete and no more messages will be sent.\n\nYou should not assume that the\nrequest is complete until the client receives an ``EndEvent``.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" } }, "title": "EndEvent", "type": "object" }, "Progress": { "description": "This data type contains information about progress of an operation.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "BytesScanned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesscanned" }, "BytesProcessed": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesprocessed" }, "BytesReturned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesreturned" } }, "title": "Progress", "type": "object" }, "ProgressEvent": { "description": "This data type contains information about the progress event of an operation.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Details": { "anyOf": [ { "$ref": "#/$defs/Progress" }, { "type": "null" } ], "default": null } }, "title": "ProgressEvent", "type": "object" }, "RecordsEvent": { "description": "The container for the records event.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Payload": { "anyOf": [ { "format": "binary", "type": "string" }, { "type": "null" } ], "default": null, "title": "Payload" } }, "title": "RecordsEvent", "type": "object" }, "SelectObjectContentEventStream": { "description": "The container for selecting objects from a content event stream.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Records": { "anyOf": [ { "$ref": "#/$defs/RecordsEvent" }, { "type": "null" } ], "default": null }, "Stats": { "anyOf": [ { "$ref": "#/$defs/StatsEvent" }, { "type": "null" } ], "default": null }, "Progress": { "anyOf": [ { "$ref": "#/$defs/ProgressEvent" }, { "type": "null" } ], "default": null }, "Cont": { "anyOf": [ { "$ref": "#/$defs/ContinuationEvent" }, { "type": "null" } ], "default": null }, "End": { "anyOf": [ { "$ref": "#/$defs/EndEvent" }, { "type": "null" } ], "default": null } }, "title": "SelectObjectContentEventStream", "type": "object" }, "Stats": { "description": "Container for the stats details.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "BytesScanned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesscanned" }, "BytesProcessed": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesprocessed" }, "BytesReturned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesreturned" } }, "title": "Stats", "type": "object" }, "StatsEvent": { "description": "Container for the Stats Event.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Details": { "anyOf": [ { "$ref": "#/$defs/Stats" }, { "type": "null" } ], "default": null } }, "title": "StatsEvent", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- field Payload: SelectObjectContentEventStream | None = None
The array of results.
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.Stats[source]
Bases:
Boto3ModelContainer for the stats details.
Show JSON schema
{ "title": "Stats", "description": "Container for the stats details.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "BytesScanned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesscanned" }, "BytesProcessed": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesprocessed" }, "BytesReturned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesreturned" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.s3.StatsEvent[source]
Bases:
Boto3ModelContainer for the Stats Event.
Show JSON schema
{ "title": "StatsEvent", "description": "Container for the Stats Event.", "type": "object", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "Details": { "anyOf": [ { "$ref": "#/$defs/Stats" }, { "type": "null" } ], "default": null } }, "$defs": { "Stats": { "description": "Container for the stats details.", "properties": { "session": { "anyOf": [ {}, { "type": "null" } ], "default": null, "title": "Session" }, "BytesScanned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesscanned" }, "BytesProcessed": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesprocessed" }, "BytesReturned": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Bytesreturned" } }, "title": "Stats", "type": "object" } } }
- Config:
validate_assignment: bool = True
arbitrary_types_allowed: bool = True
- Fields:
- 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
Anyhere because we pydantic complains vociferously if we useboto3.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.
transformeris 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
transformerisNone, the attribute will be returned verbatim.If
transformerhas no named groups, the attribute will be replaced with the value of the first group.If
transformerhas 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.