models.py•37 kB
# generated by fastapi-codegen:
# filename: openapi.yaml
# timestamp: 2025-07-16T13:07:53+00:00
from __future__ import annotations
from enum import Enum
from typing import List, Optional
from pydantic import BaseModel, Field, RootModel
class Disposition(Enum):
dispositionUnspecified = 'dispositionUnspecified'
leaveInInbox = 'leaveInInbox'
archive = 'archive'
trash = 'trash'
markRead = 'markRead'
class AutoForwarding(BaseModel):
disposition: Optional[Disposition] = Field(
None,
description='The state that a message should be left in after it has been forwarded.',
)
emailAddress: Optional[str] = Field(
None,
description='Email address to which all incoming messages are forwarded. This email address must be a verified member of the forwarding addresses.',
)
enabled: Optional[bool] = Field(
None,
description='Whether all incoming mail is automatically forwarded to another address.',
)
class BatchDeleteMessagesRequest(BaseModel):
ids: Optional[List[str]] = Field(
None, description='The IDs of the messages to delete.'
)
class BatchModifyMessagesRequest(BaseModel):
addLabelIds: Optional[List[str]] = Field(
None, description='A list of label IDs to add to messages.'
)
ids: Optional[List[str]] = Field(
None,
description='The IDs of the messages to modify. There is a limit of 1000 ids per request.',
)
removeLabelIds: Optional[List[str]] = Field(
None, description='A list of label IDs to remove from messages.'
)
class CseIdentity(BaseModel):
emailAddress: Optional[str] = Field(
None,
description='The email address for the sending identity. The email address must be the primary email address of the authenticated user.',
)
primaryKeyPairId: Optional[str] = Field(
None,
description='If a key pair is associated, the identifier of the key pair, CseKeyPair.',
)
class EnablementState(Enum):
stateUnspecified = 'stateUnspecified'
enabled = 'enabled'
disabled = 'disabled'
class VerificationStatus(Enum):
verificationStatusUnspecified = 'verificationStatusUnspecified'
accepted = 'accepted'
pending = 'pending'
rejected = 'rejected'
expired = 'expired'
class Delegate(BaseModel):
delegateEmail: Optional[str] = Field(
None, description='The email address of the delegate.'
)
verificationStatus: Optional[VerificationStatus] = Field(
None,
description='Indicates whether this address has been verified and can act as a delegate for the account. Read-only.',
)
class DisableCseKeyPairRequest(BaseModel):
pass
class EnableCseKeyPairRequest(BaseModel):
pass
class FilterAction(BaseModel):
addLabelIds: Optional[List[str]] = Field(
None, description='List of labels to add to the message.'
)
forward: Optional[str] = Field(
None, description='Email address that the message should be forwarded to.'
)
removeLabelIds: Optional[List[str]] = Field(
None, description='List of labels to remove from the message.'
)
class SizeComparison(Enum):
unspecified = 'unspecified'
smaller = 'smaller'
larger = 'larger'
class FilterCriteria(BaseModel):
excludeChats: Optional[bool] = Field(
None, description='Whether the response should exclude chats.'
)
from_: Optional[str] = Field(
None, alias='from', description="The sender's display name or email address."
)
hasAttachment: Optional[bool] = Field(
None, description='Whether the message has any attachment.'
)
negatedQuery: Optional[str] = Field(
None,
description='Only return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, `"from:someuser@example.com rfc822msgid: is:unread"`.',
)
query: Optional[str] = Field(
None,
description='Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, `"from:someuser@example.com rfc822msgid: is:unread"`.',
)
size: Optional[int] = Field(
None,
description='The size of the entire RFC822 message in bytes, including all headers and attachments.',
)
sizeComparison: Optional[SizeComparison] = Field(
None,
description='How the message size in bytes should be in relation to the size field.',
)
subject: Optional[str] = Field(
None,
description="Case-insensitive phrase found in the message's subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed.",
)
to: Optional[str] = Field(
None,
description='The recipient\'s display name or email address. Includes recipients in the "to", "cc", and "bcc" header fields. You can use simply the local part of the email address. For example, "example" and "example@" both match "example@gmail.com". This field is case-insensitive.',
)
class VerificationStatus1(Enum):
verificationStatusUnspecified = 'verificationStatusUnspecified'
accepted = 'accepted'
pending = 'pending'
class ForwardingAddress(BaseModel):
forwardingEmail: Optional[str] = Field(
None, description='An email address to which messages can be forwarded.'
)
verificationStatus: Optional[VerificationStatus1] = Field(
None,
description='Indicates whether this address has been verified and is usable for forwarding. Read-only.',
)
class ExpungeBehavior(Enum):
expungeBehaviorUnspecified = 'expungeBehaviorUnspecified'
archive = 'archive'
trash = 'trash'
deleteForever = 'deleteForever'
class ImapSettings(BaseModel):
autoExpunge: Optional[bool] = Field(
None,
description='If this value is true, Gmail will immediately expunge a message when it is marked as deleted in IMAP. Otherwise, Gmail will wait for an update from the client before expunging messages marked as deleted.',
)
enabled: Optional[bool] = Field(
None, description='Whether IMAP is enabled for the account.'
)
expungeBehavior: Optional[ExpungeBehavior] = Field(
None,
description='The action that will be executed on a message when it is marked as deleted and expunged from the last visible IMAP folder.',
)
maxFolderSize: Optional[int] = Field(
None,
description='An optional limit on the number of messages that an IMAP folder may contain. Legal values are 0, 1000, 2000, 5000 or 10000. A value of zero is interpreted to mean that there is no limit.',
)
class KaclsKeyMetadata(BaseModel):
kaclsData: Optional[str] = Field(
None,
description='Opaque data generated and used by the key access control list service. Maximum size: 8 KiB.',
)
kaclsUri: Optional[str] = Field(
None,
description='The URI of the key access control list service that manages the private key.',
)
class LabelListVisibility(Enum):
labelShow = 'labelShow'
labelShowIfUnread = 'labelShowIfUnread'
labelHide = 'labelHide'
class MessageListVisibility(Enum):
show = 'show'
hide = 'hide'
class Type(Enum):
system = 'system'
user = 'user'
class LabelColor(BaseModel):
backgroundColor: Optional[str] = Field(
None,
description='The background color represented as hex string #RRGGBB (ex #000000). This field is required in order to set the color of a label. Only the following predefined set of color values are allowed: \\#000000, #434343, #666666, #999999, #cccccc, #efefef, #f3f3f3, #ffffff, \\#fb4c2f, #ffad47, #fad165, #16a766, #43d692, #4a86e8, #a479e2, #f691b3, \\#f6c5be, #ffe6c7, #fef1d1, #b9e4d0, #c6f3de, #c9daf8, #e4d7f5, #fcdee8, \\#efa093, #ffd6a2, #fce8b3, #89d3b2, #a0eac9, #a4c2f4, #d0bcf1, #fbc8d9, \\#e66550, #ffbc6b, #fcda83, #44b984, #68dfa9, #6d9eeb, #b694e8, #f7a7c0, \\#cc3a21, #eaa041, #f2c960, #149e60, #3dc789, #3c78d8, #8e63ce, #e07798, \\#ac2b16, #cf8933, #d5ae49, #0b804b, #2a9c68, #285bac, #653e9b, #b65775, \\#822111, #a46a21, #aa8831, #076239, #1a764d, #1c4587, #41236d, #83334c \\#464646, #e7e7e7, #0d3472, #b6cff5, #0d3b44, #98d7e4, #3d188e, #e3d7ff, \\#711a36, #fbd3e0, #8a1c0a, #f2b2a8, #7a2e0b, #ffc8af, #7a4706, #ffdeb5, \\#594c05, #fbe983, #684e07, #fdedc1, #0b4f30, #b3efd3, #04502e, #a2dcc1, \\#c2c2c2, #4986e7, #2da2bb, #b99aff, #994a64, #f691b2, #ff7537, #ffad46, \\#662e37, #ebdbde, #cca6ac, #094228, #42d692, #16a765',
)
textColor: Optional[str] = Field(
None,
description='The text color of the label, represented as hex string. This field is required in order to set the color of a label. Only the following predefined set of color values are allowed: \\#000000, #434343, #666666, #999999, #cccccc, #efefef, #f3f3f3, #ffffff, \\#fb4c2f, #ffad47, #fad165, #16a766, #43d692, #4a86e8, #a479e2, #f691b3, \\#f6c5be, #ffe6c7, #fef1d1, #b9e4d0, #c6f3de, #c9daf8, #e4d7f5, #fcdee8, \\#efa093, #ffd6a2, #fce8b3, #89d3b2, #a0eac9, #a4c2f4, #d0bcf1, #fbc8d9, \\#e66550, #ffbc6b, #fcda83, #44b984, #68dfa9, #6d9eeb, #b694e8, #f7a7c0, \\#cc3a21, #eaa041, #f2c960, #149e60, #3dc789, #3c78d8, #8e63ce, #e07798, \\#ac2b16, #cf8933, #d5ae49, #0b804b, #2a9c68, #285bac, #653e9b, #b65775, \\#822111, #a46a21, #aa8831, #076239, #1a764d, #1c4587, #41236d, #83334c \\#464646, #e7e7e7, #0d3472, #b6cff5, #0d3b44, #98d7e4, #3d188e, #e3d7ff, \\#711a36, #fbd3e0, #8a1c0a, #f2b2a8, #7a2e0b, #ffc8af, #7a4706, #ffdeb5, \\#594c05, #fbe983, #684e07, #fdedc1, #0b4f30, #b3efd3, #04502e, #a2dcc1, \\#c2c2c2, #4986e7, #2da2bb, #b99aff, #994a64, #f691b2, #ff7537, #ffad46, \\#662e37, #ebdbde, #cca6ac, #094228, #42d692, #16a765',
)
class LanguageSettings(BaseModel):
displayLanguage: Optional[str] = Field(
None,
description='The language to display Gmail in, formatted as an RFC 3066 Language Tag (for example `en-GB`, `fr` or `ja` for British English, French, or Japanese respectively). The set of languages supported by Gmail evolves over time, so please refer to the "Language" dropdown in the Gmail settings for all available options, as described in the language settings help article. A table of sample values is also provided in the Managing Language Settings guide Not all Gmail clients can display the same set of languages. In the case that a user\'s display language is not available for use on a particular client, said client automatically chooses to display in the closest supported variant (or a reasonable default).',
)
class ListCseIdentitiesResponse(BaseModel):
cseIdentities: Optional[List[CseIdentity]] = Field(
None,
description='One page of the list of CSE identities configured for the user.',
)
nextPageToken: Optional[str] = Field(
None,
description='Pagination token to be passed to a subsequent ListCseIdentities call in order to retrieve the next page of identities. If this value is not returned or is the empty string, then no further pages remain.',
)
class ListDelegatesResponse(BaseModel):
delegates: Optional[List[Delegate]] = Field(
None,
description="List of the user's delegates (with any verification status). If an account doesn't have delegates, this field doesn't appear.",
)
class ListForwardingAddressesResponse(BaseModel):
forwardingAddresses: Optional[List[ForwardingAddress]] = Field(
None, description='List of addresses that may be used for forwarding.'
)
class MessagePartBody(BaseModel):
attachmentId: Optional[str] = Field(
None,
description='When present, contains the ID of an external attachment that can be retrieved in a separate `messages.attachments.get` request. When not present, the entire content of the message part body is contained in the data field.',
)
data: Optional[str] = Field(
None,
description='The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment.',
)
size: Optional[int] = Field(
None,
description='Number of bytes for the message part data (encoding notwithstanding).',
)
class MessagePartHeader(BaseModel):
name: Optional[str] = Field(
None,
description='The name of the header before the `:` separator. For example, `To`.',
)
value: Optional[str] = Field(
None,
description='The value of the header after the `:` separator. For example, `someuser@example.com`.',
)
class ModifyMessageRequest(BaseModel):
addLabelIds: Optional[List[str]] = Field(
None,
description='A list of IDs of labels to add to this message. You can add up to 100 labels with each update.',
)
removeLabelIds: Optional[List[str]] = Field(
None,
description='A list IDs of labels to remove from this message. You can remove up to 100 labels with each update.',
)
class ModifyThreadRequest(BaseModel):
addLabelIds: Optional[List[str]] = Field(
None,
description='A list of IDs of labels to add to this thread. You can add up to 100 labels with each update.',
)
removeLabelIds: Optional[List[str]] = Field(
None,
description='A list of IDs of labels to remove from this thread. You can remove up to 100 labels with each update.',
)
class ObliterateCseKeyPairRequest(BaseModel):
pass
class AccessWindow(Enum):
accessWindowUnspecified = 'accessWindowUnspecified'
disabled = 'disabled'
fromNowOn = 'fromNowOn'
allMail = 'allMail'
class PopSettings(BaseModel):
accessWindow: Optional[AccessWindow] = Field(
None, description='The range of messages which are accessible via POP.'
)
disposition: Optional[Disposition] = Field(
None,
description='The action that will be executed on a message after it has been fetched via POP.',
)
class Profile(BaseModel):
emailAddress: Optional[str] = Field(None, description="The user's email address.")
historyId: Optional[str] = Field(
None, description="The ID of the mailbox's current history record."
)
messagesTotal: Optional[int] = Field(
None, description='The total number of messages in the mailbox.'
)
threadsTotal: Optional[int] = Field(
None, description='The total number of threads in the mailbox.'
)
class SmimeInfo(BaseModel):
encryptedKeyPassword: Optional[str] = Field(
None, description='Encrypted key password, when key is encrypted.'
)
expiration: Optional[str] = Field(
None, description='When the certificate expires (in milliseconds since epoch).'
)
id: Optional[str] = Field(None, description='The immutable ID for the SmimeInfo.')
isDefault: Optional[bool] = Field(
None,
description="Whether this SmimeInfo is the default one for this user's send-as address.",
)
issuerCn: Optional[str] = Field(
None, description="The S/MIME certificate issuer's common name."
)
pem: Optional[str] = Field(
None,
description='PEM formatted X509 concatenated certificate string (standard base64 encoding). Format used for returning key, which includes public key as well as certificate chain (not private key).',
)
pkcs12: Optional[str] = Field(
None,
description='PKCS#12 format containing a single private/public key pair and certificate chain. This format is only accepted from client for creating a new SmimeInfo and is never returned, because the private key is not intended to be exported. PKCS#12 may be encrypted, in which case encryptedKeyPassword should be set appropriately.',
)
class SecurityMode(Enum):
securityModeUnspecified = 'securityModeUnspecified'
none = 'none'
ssl = 'ssl'
starttls = 'starttls'
class SmtpMsa(BaseModel):
host: Optional[str] = Field(
None, description='The hostname of the SMTP service. Required.'
)
password: Optional[str] = Field(
None,
description='The password that will be used for authentication with the SMTP service. This is a write-only field that can be specified in requests to create or update SendAs settings; it is never populated in responses.',
)
port: Optional[int] = Field(
None, description='The port of the SMTP service. Required.'
)
securityMode: Optional[SecurityMode] = Field(
None,
description='The protocol that will be used to secure communication with the SMTP service. Required.',
)
username: Optional[str] = Field(
None,
description='The username that will be used for authentication with the SMTP service. This is a write-only field that can be specified in requests to create or update SendAs settings; it is never populated in responses.',
)
class VacationSettings(BaseModel):
enableAutoReply: Optional[bool] = Field(
None,
description='Flag that controls whether Gmail automatically replies to messages.',
)
endTime: Optional[str] = Field(
None,
description='An optional end time for sending auto-replies (epoch ms). When this is specified, Gmail will automatically reply only to messages that it receives before the end time. If both `startTime` and `endTime` are specified, `startTime` must precede `endTime`.',
)
responseBodyHtml: Optional[str] = Field(
None,
description='Response body in HTML format. Gmail will sanitize the HTML before storing it. If both `response_body_plain_text` and `response_body_html` are specified, `response_body_html` will be used.',
)
responseBodyPlainText: Optional[str] = Field(
None,
description='Response body in plain text format. If both `response_body_plain_text` and `response_body_html` are specified, `response_body_html` will be used.',
)
responseSubject: Optional[str] = Field(
None,
description='Optional text to prepend to the subject line in vacation responses. In order to enable auto-replies, either the response subject or the response body must be nonempty.',
)
restrictToContacts: Optional[bool] = Field(
None,
description="Flag that determines whether responses are sent to recipients who are not in the user's list of contacts.",
)
restrictToDomain: Optional[bool] = Field(
None,
description="Flag that determines whether responses are sent to recipients who are outside of the user's domain. This feature is only available for Google Workspace users.",
)
startTime: Optional[str] = Field(
None,
description='An optional start time for sending auto-replies (epoch ms). When this is specified, Gmail will automatically reply only to messages that it receives after the start time. If both `startTime` and `endTime` are specified, `startTime` must precede `endTime`.',
)
class LabelFilterAction(Enum):
include = 'include'
exclude = 'exclude'
class WatchRequest(BaseModel):
labelFilterAction: Optional[LabelFilterAction] = Field(
None, description='Filtering behavior of labelIds list specified.'
)
labelIds: Optional[List[str]] = Field(
None,
description='List of label_ids to restrict notifications about. By default, if unspecified, all changes are pushed out. If specified then dictates which labels are required for a push notification to be generated.',
)
topicName: Optional[str] = Field(
None,
description='A fully qualified Google Cloud Pub/Sub API topic name to publish the events to. This topic name **must** already exist in Cloud Pub/Sub and you **must** have already granted gmail "publish" permission on it. For example, "projects/my-project-identifier/topics/my-topic-name" (using the Cloud Pub/Sub "v1" topic naming format). Note that the "my-project-identifier" portion must exactly match your Google developer project id (the one executing this watch request).',
)
class WatchResponse(BaseModel):
expiration: Optional[str] = Field(
None,
description='When Gmail will stop sending notifications for mailbox updates (epoch millis). Call `watch` again before this time to renew the watch.',
)
historyId: Optional[str] = Field(
None, description="The ID of the mailbox's current history record."
)
class FieldXgafv(Enum):
field_1 = '1'
field_2 = '2'
class Alt(Enum):
json = 'json'
media = 'media'
proto = 'proto'
class Format(Enum):
minimal = 'minimal'
full = 'full'
raw = 'raw'
metadata = 'metadata'
class HistoryType(Enum):
messageAdded = 'messageAdded'
messageDeleted = 'messageDeleted'
labelAdded = 'labelAdded'
labelRemoved = 'labelRemoved'
class HistoryTypes(RootModel[List[HistoryType]]):
root: List[HistoryType]
class LabelIds(RootModel[List[str]]):
root: List[str]
class InternalDateSource(Enum):
receivedTime = 'receivedTime'
dateHeader = 'dateHeader'
class MetadataHeaders(RootModel[List[str]]):
root: List[str]
class Format4(Enum):
full = 'full'
metadata = 'metadata'
minimal = 'minimal'
class CsePrivateKeyMetadata(BaseModel):
kaclsKeyMetadata: Optional[KaclsKeyMetadata] = Field(
None,
description='Metadata for a private key instance managed by an external key access control list service.',
)
privateKeyMetadataId: Optional[str] = Field(
None,
description='Output only. The immutable ID for the private key metadata instance.',
)
class Filter(BaseModel):
action: Optional[FilterAction] = Field(
None, description='Action that the filter performs.'
)
criteria: Optional[FilterCriteria] = Field(
None, description='Matching criteria for the filter.'
)
id: Optional[str] = Field(None, description='The server assigned ID of the filter.')
class Label(BaseModel):
color: Optional[LabelColor] = Field(
None,
description='The color to assign to the label. Color is only available for labels that have their `type` set to `user`.',
)
id: Optional[str] = Field(None, description='The immutable ID of the label.')
labelListVisibility: Optional[LabelListVisibility] = Field(
None,
description='The visibility of the label in the label list in the Gmail web interface.',
)
messageListVisibility: Optional[MessageListVisibility] = Field(
None,
description='The visibility of messages with this label in the message list in the Gmail web interface.',
)
messagesTotal: Optional[int] = Field(
None, description='The total number of messages with the label.'
)
messagesUnread: Optional[int] = Field(
None, description='The number of unread messages with the label.'
)
name: Optional[str] = Field(None, description='The display name of the label.')
threadsTotal: Optional[int] = Field(
None, description='The total number of threads with the label.'
)
threadsUnread: Optional[int] = Field(
None, description='The number of unread threads with the label.'
)
type: Optional[Type] = Field(
None,
description='The owner type for the label. User labels are created by the user and can be modified and deleted by the user and can be applied to any message or thread. System labels are internally created and cannot be added, modified, or deleted. System labels may be able to be applied to or removed from messages and threads under some circumstances but this is not guaranteed. For example, users can apply and remove the `INBOX` and `UNREAD` labels from messages and threads, but cannot apply or remove the `DRAFTS` or `SENT` labels from messages or threads.',
)
class ListFiltersResponse(BaseModel):
filter: Optional[List[Filter]] = Field(
None, description="List of a user's filters."
)
class ListLabelsResponse(BaseModel):
labels: Optional[List[Label]] = Field(
None,
description='List of labels. Note that each label resource only contains an `id`, `name`, `messageListVisibility`, `labelListVisibility`, and `type`. The labels.get method can fetch additional label details.',
)
class ListSmimeInfoResponse(BaseModel):
smimeInfo: Optional[List[SmimeInfo]] = Field(None, description='List of SmimeInfo.')
class MessagePart(BaseModel):
body: Optional[MessagePartBody] = Field(
None,
description='The message part body for this part, which may be empty for container MIME message parts.',
)
filename: Optional[str] = Field(
None,
description='The filename of the attachment. Only present if this message part represents an attachment.',
)
headers: Optional[List[MessagePartHeader]] = Field(
None,
description='List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as `To`, `From`, and `Subject`.',
)
mimeType: Optional[str] = Field(
None, description='The MIME type of the message part.'
)
partId: Optional[str] = Field(
None, description='The immutable ID of the message part.'
)
parts: Optional[List[MessagePart]] = Field(
None,
description='The child MIME message parts of this part. This only applies to container MIME message parts, for example `multipart/*`. For non- container MIME message part types, such as `text/plain`, this field is empty. For more information, see RFC 1521.',
)
class SendAs(BaseModel):
displayName: Optional[str] = Field(
None,
description='A name that appears in the "From:" header for mail sent using this alias. For custom "from" addresses, when this is empty, Gmail will populate the "From:" header with the name that is used for the primary address associated with the account. If the admin has disabled the ability for users to update their name format, requests to update this field for the primary login will silently fail.',
)
isDefault: Optional[bool] = Field(
None,
description='Whether this address is selected as the default "From:" address in situations such as composing a new message or sending a vacation auto-reply. Every Gmail account has exactly one default send-as address, so the only legal value that clients may write to this field is `true`. Changing this from `false` to `true` for an address will result in this field becoming `false` for the other previous default address.',
)
isPrimary: Optional[bool] = Field(
None,
description='Whether this address is the primary address used to login to the account. Every Gmail account has exactly one primary address, and it cannot be deleted from the collection of send-as aliases. This field is read-only.',
)
replyToAddress: Optional[str] = Field(
None,
description='An optional email address that is included in a "Reply-To:" header for mail sent using this alias. If this is empty, Gmail will not generate a "Reply-To:" header.',
)
sendAsEmail: Optional[str] = Field(
None,
description='The email address that appears in the "From:" header for mail sent using this alias. This is read-only for all operations except create.',
)
signature: Optional[str] = Field(
None,
description='An optional HTML signature that is included in messages composed with this alias in the Gmail web UI. This signature is added to new emails only.',
)
smtpMsa: Optional[SmtpMsa] = Field(
None,
description='An optional SMTP service that will be used as an outbound relay for mail sent using this alias. If this is empty, outbound mail will be sent directly from Gmail\'s servers to the destination SMTP service. This setting only applies to custom "from" aliases.',
)
treatAsAlias: Optional[bool] = Field(
None,
description='Whether Gmail should treat this address as an alias for the user\'s primary email address. This setting only applies to custom "from" aliases.',
)
verificationStatus: Optional[VerificationStatus1] = Field(
None,
description='Indicates whether this address has been verified for use as a send-as alias. Read-only. This setting only applies to custom "from" aliases.',
)
class CseKeyPair(BaseModel):
disableTime: Optional[str] = Field(
None,
description="Output only. If a key pair is set to `DISABLED`, the time that the key pair's state changed from `ENABLED` to `DISABLED`. This field is present only when the key pair is in state `DISABLED`.",
)
enablementState: Optional[EnablementState] = Field(
None, description='Output only. The current state of the key pair.'
)
keyPairId: Optional[str] = Field(
None,
description='Output only. The immutable ID for the client-side encryption S/MIME key pair.',
)
pem: Optional[str] = Field(
None,
description='Output only. The public key and its certificate chain, in [PEM](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) format.',
)
pkcs7: Optional[str] = Field(
None,
description='Input only. The public key and its certificate chain. The chain must be in [PKCS#7](https://en.wikipedia.org/wiki/PKCS_7) format and use PEM encoding and ASCII armor.',
)
privateKeyMetadata: Optional[List[CsePrivateKeyMetadata]] = Field(
None, description="Metadata for instances of this key pair's private key."
)
subjectEmailAddresses: Optional[List[str]] = Field(
None,
description='Output only. The email address identities that are specified on the leaf certificate.',
)
class ListCseKeyPairsResponse(BaseModel):
cseKeyPairs: Optional[List[CseKeyPair]] = Field(
None,
description='One page of the list of CSE key pairs installed for the user.',
)
nextPageToken: Optional[str] = Field(
None,
description='Pagination token to be passed to a subsequent ListCseKeyPairs call in order to retrieve the next page of key pairs. If this value is not returned, then no further pages remain.',
)
class ListSendAsResponse(BaseModel):
sendAs: Optional[List[SendAs]] = Field(None, description='List of send-as aliases.')
class Message(BaseModel):
historyId: Optional[str] = Field(
None,
description='The ID of the last history record that modified this message.',
)
id: Optional[str] = Field(None, description='The immutable ID of the message.')
internalDate: Optional[str] = Field(
None,
description='The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header.',
)
labelIds: Optional[List[str]] = Field(
None, description='List of IDs of labels applied to this message.'
)
payload: Optional[MessagePart] = Field(
None, description='The parsed email structure in the message parts.'
)
raw: Optional[str] = Field(
None,
description='The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in `messages.get` and `drafts.get` responses when the `format=RAW` parameter is supplied.',
)
sizeEstimate: Optional[int] = Field(
None, description='Estimated size in bytes of the message.'
)
snippet: Optional[str] = Field(
None, description='A short part of the message text.'
)
threadId: Optional[str] = Field(
None,
description='The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. ',
)
class Thread(BaseModel):
historyId: Optional[str] = Field(
None, description='The ID of the last history record that modified this thread.'
)
id: Optional[str] = Field(None, description='The unique ID of the thread.')
messages: Optional[List[Message]] = Field(
None, description='The list of messages in the thread.'
)
snippet: Optional[str] = Field(
None, description='A short part of the message text.'
)
class Draft(BaseModel):
id: Optional[str] = Field(None, description='The immutable ID of the draft.')
message: Optional[Message] = Field(
None, description='The message content of the draft.'
)
class HistoryLabelAdded(BaseModel):
labelIds: Optional[List[str]] = Field(
None, description='Label IDs added to the message.'
)
message: Optional[Message] = None
class HistoryLabelRemoved(BaseModel):
labelIds: Optional[List[str]] = Field(
None, description='Label IDs removed from the message.'
)
message: Optional[Message] = None
class HistoryMessageAdded(BaseModel):
message: Optional[Message] = None
class HistoryMessageDeleted(BaseModel):
message: Optional[Message] = None
class ListDraftsResponse(BaseModel):
drafts: Optional[List[Draft]] = Field(
None,
description='List of drafts. Note that the `Message` property in each `Draft` resource only contains an `id` and a `threadId`. The messages.get method can fetch additional message details.',
)
nextPageToken: Optional[str] = Field(
None, description='Token to retrieve the next page of results in the list.'
)
resultSizeEstimate: Optional[int] = Field(
None, description='Estimated total number of results.'
)
class ListMessagesResponse(BaseModel):
messages: Optional[List[Message]] = Field(
None,
description='List of messages. Note that each message resource contains only an `id` and a `threadId`. Additional message details can be fetched using the messages.get method.',
)
nextPageToken: Optional[str] = Field(
None, description='Token to retrieve the next page of results in the list.'
)
resultSizeEstimate: Optional[int] = Field(
None, description='Estimated total number of results.'
)
class ListThreadsResponse(BaseModel):
nextPageToken: Optional[str] = Field(
None, description='Page token to retrieve the next page of results in the list.'
)
resultSizeEstimate: Optional[int] = Field(
None, description='Estimated total number of results.'
)
threads: Optional[List[Thread]] = Field(
None,
description='List of threads. Note that each thread resource does not contain a list of `messages`. The list of `messages` for a given thread can be fetched using the threads.get method.',
)
class History(BaseModel):
id: Optional[str] = Field(None, description='The mailbox sequence ID.')
labelsAdded: Optional[List[HistoryLabelAdded]] = Field(
None, description='Labels added to messages in this history record.'
)
labelsRemoved: Optional[List[HistoryLabelRemoved]] = Field(
None, description='Labels removed from messages in this history record.'
)
messages: Optional[List[Message]] = Field(
None,
description='List of messages changed in this history record. The fields for specific change types, such as `messagesAdded` may duplicate messages in this field. We recommend using the specific change-type fields instead of this.',
)
messagesAdded: Optional[List[HistoryMessageAdded]] = Field(
None, description='Messages added to the mailbox in this history record.'
)
messagesDeleted: Optional[List[HistoryMessageDeleted]] = Field(
None,
description='Messages deleted (not Trashed) from the mailbox in this history record.',
)
class ListHistoryResponse(BaseModel):
history: Optional[List[History]] = Field(
None,
description='List of history records. Any `messages` contained in the response will typically only have `id` and `threadId` fields populated.',
)
historyId: Optional[str] = Field(
None, description="The ID of the mailbox's current history record."
)
nextPageToken: Optional[str] = Field(
None, description='Page token to retrieve the next page of results in the list.'
)
MessagePart.model_rebuild()