models.py•73.2 kB
# generated by fastapi-codegen:
# filename: openapi.yaml
# timestamp: 2025-06-29T11:18:29+00:00
from __future__ import annotations
from datetime import datetime
from enum import Enum
from typing import Any, Dict, List, Optional
from pydantic import AnyUrl, BaseModel, Field, constr
class AccessTokenEnumFactorTypes(Enum):
push = 'push'
class ChallengeEnumChallengeReasons(Enum):
none = 'none'
not_needed = 'not_needed'
not_requested = 'not_requested'
class ChallengeEnumChallengeStatuses(Enum):
pending = 'pending'
expired = 'expired'
approved = 'approved'
denied = 'denied'
class ChallengeEnumFactorTypes(Enum):
push = 'push'
totp = 'totp'
class ChallengeEnumListOrders(Enum):
asc = 'asc'
desc = 'desc'
class FactorEnumFactorStatuses(Enum):
unverified = 'unverified'
verified = 'verified'
class FactorEnumFactorTypes(Enum):
push = 'push'
totp = 'totp'
class FactorEnumNotificationPlatforms(Enum):
apn = 'apn'
fcm = 'fcm'
none = 'none'
class FactorEnumTotpAlgorithms(Enum):
sha1 = 'sha1'
sha256 = 'sha256'
sha512 = 'sha512'
class FormEnumFormTypes(Enum):
form_push = 'form-push'
class NewFactorEnumFactorStatuses(Enum):
unverified = 'unverified'
verified = 'verified'
class NewFactorEnumFactorTypes(Enum):
push = 'push'
totp = 'totp'
class NewFactorEnumNotificationPlatforms(Enum):
apn = 'apn'
fcm = 'fcm'
none = 'none'
class NewFactorEnumTotpAlgorithms(Enum):
sha1 = 'sha1'
sha256 = 'sha256'
sha512 = 'sha512'
class VerificationAttemptEnumAttemptStatus(Enum):
confirmed = 'confirmed'
unconfirmed = 'unconfirmed'
expired = 'expired'
class VerificationAttemptEnumCallStatus(Enum):
queued = 'queued'
in_progress = 'in-progress'
completed = 'completed'
busy = 'busy'
failed = 'failed'
no_answer = 'no-answer'
ringing = 'ringing'
canceled = 'canceled'
class VerificationAttemptEnumChannels(Enum):
sms = 'sms'
call = 'call'
email = 'email'
whatsapp = 'whatsapp'
class VerificationAttemptEnumConversionStatus(Enum):
converted = 'converted'
unconverted = 'unconverted'
class VerificationAttemptEnumMessageStatus(Enum):
queued = 'queued'
sending = 'sending'
sent = 'sent'
failed = 'failed'
delivered = 'delivered'
undelivered = 'undelivered'
receiving = 'receiving'
received = 'received'
accepted = 'accepted'
scheduled = 'scheduled'
read = 'read'
partially_delivered = 'partially_delivered'
canceled = 'canceled'
class VerificationAttemptsSummaryEnumChannels(Enum):
sms = 'sms'
call = 'call'
email = 'email'
whatsapp = 'whatsapp'
class VerificationCheckEnumChannel(Enum):
sms = 'sms'
call = 'call'
email = 'email'
whatsapp = 'whatsapp'
sna = 'sna'
class VerificationEnumChannel(Enum):
sms = 'sms'
call = 'call'
email = 'email'
whatsapp = 'whatsapp'
sna = 'sna'
class VerificationEnumStatus(Enum):
canceled = 'canceled'
approved = 'approved'
class VerifyV2Form(BaseModel):
form_meta: Optional[Any] = Field(
None,
description='Additional information for the available forms for this type. E.g. The separator string used for `binding` in a Factor push.',
)
form_type: Optional[FormEnumFormTypes] = Field(
None,
description='The Type of this Form. Currently only `form-push` is supported.',
)
forms: Optional[Any] = Field(
None,
description='Object that contains the available forms for this type. This available forms are given in the standard [JSON Schema](https://json-schema.org/) format',
)
url: Optional[AnyUrl] = Field(
None, description='The URL to access the forms for this type.'
)
class VerifyV2Safelist(BaseModel):
phone_number: Optional[str] = Field(
None, description='The phone number in SafeList.'
)
sid: Optional[
constr(pattern=r'^GN[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The unique string that we created to identify the SafeList resource.',
)
url: Optional[AnyUrl] = Field(
None, description='The absolute URL of the SafeList resource.'
)
class VerifyV2Service(BaseModel):
account_sid: Optional[
constr(pattern=r'^AC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource.',
)
code_length: Optional[int] = Field(
None, description='The length of the verification code to generate.'
)
custom_code_enabled: Optional[bool] = Field(
None,
description='Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers.',
)
date_created: Optional[datetime] = Field(
None,
description='The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.',
)
date_updated: Optional[datetime] = Field(
None,
description='The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.',
)
default_template_sid: Optional[
constr(pattern=r'^HJ[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = None
do_not_share_warning_enabled: Optional[bool] = Field(
None,
description='Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code`',
)
dtmf_input_required: Optional[bool] = Field(
None,
description='Whether to ask the user to press a number before delivering the verify code in a phone call.',
)
friendly_name: Optional[str] = Field(
None,
description='The string that you assigned to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.**',
)
links: Optional[Dict[str, Any]] = Field(
None, description='The URLs of related resources.'
)
lookup_enabled: Optional[bool] = Field(
None,
description='Whether to perform a lookup with each verification started and return info about the phone number.',
)
psd2_enabled: Optional[bool] = Field(
None,
description='Whether to pass PSD2 transaction parameters when starting a verification.',
)
push: Optional[Any] = Field(
None,
description='Configurations for the Push factors (channel) created under this Service.',
)
sid: Optional[
constr(pattern=r'^VA[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The unique string that we created to identify the Service resource.',
)
skip_sms_to_landlines: Optional[bool] = Field(
None,
description='Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`.',
)
totp: Optional[Any] = Field(
None,
description='Configurations for the TOTP factors (channel) created under this Service.',
)
tts_name: Optional[str] = Field(
None,
description='The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages.',
)
url: Optional[AnyUrl] = Field(None, description='The absolute URL of the resource.')
class VerifyV2ServiceAccessToken(BaseModel):
account_sid: Optional[
constr(pattern=r'^AC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Account.')
date_created: Optional[datetime] = Field(
None,
description='The date that this access token was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.',
)
entity_identity: Optional[str] = Field(
None,
description='The unique external identifier for the Entity of the Service.',
)
factor_friendly_name: Optional[str] = Field(
None,
description="A human readable description of this factor, up to 64 characters. For a push factor, this can be the device's name.",
)
factor_type: Optional[AccessTokenEnumFactorTypes] = Field(
None, description='The Type of the Factor. Currently only `push` is supported.'
)
service_sid: Optional[
constr(pattern=r'^VA[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Verify Service.')
sid: Optional[
constr(pattern=r'^YK[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='A 34 character string that uniquely identifies this Access Token.',
)
token: Optional[str] = Field(
None,
description='The access token generated for enrollment, this is an encrypted json web token.',
)
ttl: Optional[int] = Field(
None,
description='How long, in seconds, the access token is valid. Max: 5 minutes',
)
url: Optional[AnyUrl] = Field(None, description='The URL of this resource.')
class VerifyV2ServiceEntity(BaseModel):
account_sid: Optional[
constr(pattern=r'^AC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Account.')
date_created: Optional[datetime] = Field(
None,
description='The date that this Entity was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.',
)
date_updated: Optional[datetime] = Field(
None,
description='The date that this Entity was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.',
)
identity: Optional[str] = Field(
None,
description="The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters.",
)
links: Optional[Dict[str, Any]] = Field(
None,
description='Contains a dictionary of URL links to nested resources of this Entity.',
)
service_sid: Optional[
constr(pattern=r'^VA[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Service.')
sid: Optional[
constr(pattern=r'^YE[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None, description='A 34 character string that uniquely identifies this Entity.'
)
url: Optional[AnyUrl] = Field(None, description='The URL of this resource.')
class VerifyV2ServiceEntityChallenge(BaseModel):
account_sid: Optional[
constr(pattern=r'^AC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Account.')
date_created: Optional[datetime] = Field(
None,
description='The date that this Challenge was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.',
)
date_responded: Optional[datetime] = Field(
None,
description='The date that this Challenge was responded, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.',
)
date_updated: Optional[datetime] = Field(
None,
description='The date that this Challenge was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.',
)
details: Optional[Any] = Field(
None,
description='Details provided to give context about the Challenge. Intended to be shown to the end user.',
)
entity_sid: Optional[
constr(pattern=r'^YE[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Entity.')
expiration_date: Optional[datetime] = Field(
None,
description='The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The default value is five (5) minutes after Challenge creation. The max value is sixty (60) minutes after creation.',
)
factor_sid: Optional[
constr(pattern=r'^YF[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Factor.')
factor_type: Optional[ChallengeEnumFactorTypes] = Field(
None,
description='The Factor Type of this Challenge. Currently `push` and `totp` are supported.',
)
hidden_details: Optional[Any] = Field(
None,
description='Details provided to give context about the Challenge. Intended to be hidden from the end user. It must be a stringified JSON with only strings values eg. `{"ip": "172.168.1.234"}`',
)
identity: Optional[str] = Field(
None,
description="Customer unique identity for the Entity owner of the Challenge. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters.",
)
links: Optional[Dict[str, Any]] = Field(
None,
description='Contains a dictionary of URL links to nested resources of this Challenge.',
)
metadata: Optional[Any] = Field(
None,
description='Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{"os": "Android"}`. Can be up to 1024 characters in length.',
)
responded_reason: Optional[ChallengeEnumChallengeReasons] = Field(
None,
description='Reason for the Challenge to be in certain `status`. One of `none`, `not_needed` or `not_requested`.',
)
service_sid: Optional[
constr(pattern=r'^VA[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Service.')
sid: Optional[
constr(pattern=r'^YC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='A 34 character string that uniquely identifies this Challenge.',
)
status: Optional[ChallengeEnumChallengeStatuses] = Field(
None,
description='The Status of this Challenge. One of `pending`, `expired`, `approved` or `denied`.',
)
url: Optional[AnyUrl] = Field(None, description='The URL of this resource.')
class VerifyV2ServiceEntityChallengeNotification(BaseModel):
account_sid: Optional[
constr(pattern=r'^AC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Account.')
challenge_sid: Optional[
constr(pattern=r'^YC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Challenge.')
date_created: Optional[datetime] = Field(
None,
description='The date that this Notification was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.',
)
entity_sid: Optional[
constr(pattern=r'^YE[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Entity.')
identity: Optional[str] = Field(
None,
description="Customer unique identity for the Entity owner of the Challenge. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters.",
)
priority: Optional[str] = Field(
None,
description="The priority of the notification. For `push` Challenges it's always `high` which sends the notification immediately, and can wake up a sleeping device.",
)
service_sid: Optional[
constr(pattern=r'^VA[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Service.')
sid: Optional[
constr(pattern=r'^NT[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='A 34 character string that uniquely identifies this Notification.',
)
ttl: Optional[int] = Field(
None,
description='How long, in seconds, the notification is valid. Max: 5 minutes',
)
class VerifyV2ServiceEntityFactor(BaseModel):
account_sid: Optional[
constr(pattern=r'^AC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Account.')
config: Optional[Any] = Field(
None,
description='An object that contains configurations specific to a `factor_type`.',
)
date_created: Optional[datetime] = Field(
None,
description='The date that this Factor was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.',
)
date_updated: Optional[datetime] = Field(
None,
description='The date that this Factor was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.',
)
entity_sid: Optional[
constr(pattern=r'^YE[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Entity.')
factor_type: Optional[FactorEnumFactorTypes] = Field(
None,
description='The Type of this Factor. Currently `push` and `totp` are supported.',
)
friendly_name: Optional[str] = Field(
None,
description="A human readable description of this resource, up to 64 characters. For a push factor, this can be the device's name.",
)
identity: Optional[str] = Field(
None,
description="Customer unique identity for the Entity owner of the Factor. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters.",
)
metadata: Optional[Any] = Field(
None,
description='Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{"os": "Android"}`. Can be up to 1024 characters in length.',
)
service_sid: Optional[
constr(pattern=r'^VA[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Service.')
sid: Optional[
constr(pattern=r'^YF[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None, description='A 34 character string that uniquely identifies this Factor.'
)
status: Optional[FactorEnumFactorStatuses] = Field(
None,
description='The Status of this Factor. One of `unverified` or `verified`.',
)
url: Optional[AnyUrl] = Field(None, description='The URL of this resource.')
class VerifyV2ServiceEntityNewFactor(BaseModel):
account_sid: Optional[
constr(pattern=r'^AC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Account.')
binding: Optional[Any] = Field(
None,
description='Contains the `factor_type` specific secret and metadata.\nFor push, this is `binding.public_key` and `binding.alg`.\nFor totp, this is `binding.secret` and `binding.uri`. The `binding.uri` property is generated following the [google authenticator key URI format](https://github.com/google/google-authenticator/wiki/Key-Uri-Format), and `Factor.friendly_name` is used for the “accountname” value and `Service.friendly_name` or `Service.totp.issuer` is used for the `issuer` value.\n\n\nThe Binding property is ONLY returned upon Factor creation.',
)
config: Optional[Any] = Field(
None,
description='An object that contains configurations specific to a `factor_type`.',
)
date_created: Optional[datetime] = Field(
None,
description='The date that this Factor was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.',
)
date_updated: Optional[datetime] = Field(
None,
description='The date that this Factor was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.',
)
entity_sid: Optional[
constr(pattern=r'^YE[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Entity.')
factor_type: Optional[NewFactorEnumFactorTypes] = Field(
None,
description='The Type of this Factor. Currently `push` and `totp` are supported.',
)
friendly_name: Optional[str] = Field(
None,
description='The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors.\nFor `factor_type` `push`, this could be a device name.\nFor `factor_type` `totp`, this value is used as the “account name” in constructing the `binding.uri` property.\nAt the same time, we recommend avoiding providing PII.',
)
identity: Optional[str] = Field(
None,
description="Customer unique identity for the Entity owner of the Factor. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters.",
)
metadata: Optional[Any] = Field(
None,
description='Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{"os": "Android"}`. Can be up to 1024 characters in length.',
)
service_sid: Optional[
constr(pattern=r'^VA[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Service.')
sid: Optional[
constr(pattern=r'^YF[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None, description='A 34 character string that uniquely identifies this Factor.'
)
status: Optional[NewFactorEnumFactorStatuses] = Field(
None,
description='The Status of this Factor. One of `unverified` or `verified`.',
)
url: Optional[AnyUrl] = Field(None, description='The URL of this resource.')
class VerifyV2ServiceMessagingConfiguration(BaseModel):
account_sid: Optional[
constr(pattern=r'^AC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource.',
)
country: Optional[str] = Field(
None,
description='The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`.',
)
date_created: Optional[datetime] = Field(
None,
description='The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.',
)
date_updated: Optional[datetime] = Field(
None,
description='The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.',
)
messaging_service_sid: Optional[
constr(pattern=r'^MG[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) to be used to send SMS to the country of this configuration.',
)
service_sid: Optional[
constr(pattern=r'^VA[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Service](https://www.twilio.com/docs/verify/api/service) that the resource is associated with.',
)
url: Optional[AnyUrl] = Field(None, description='The URL of this resource.')
class VerifyV2ServiceRateLimit(BaseModel):
account_sid: Optional[
constr(pattern=r'^AC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Rate Limit resource.',
)
date_created: Optional[datetime] = Field(
None,
description='The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.',
)
date_updated: Optional[datetime] = Field(
None,
description='The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.',
)
description: Optional[str] = Field(
None, description='Description of this Rate Limit'
)
links: Optional[Dict[str, Any]] = Field(
None, description='The URLs of related resources.'
)
service_sid: Optional[
constr(pattern=r'^VA[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with.',
)
sid: Optional[
constr(pattern=r'^RK[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='A 34 character string that uniquely identifies this Rate Limit.',
)
unique_name: Optional[str] = Field(
None,
description='Provides a unique and addressable name to be assigned to this Rate Limit, assigned by the developer, to be optionally used in addition to SID. **This value should not contain PII.**',
)
url: Optional[AnyUrl] = Field(None, description='The URL of this resource.')
class VerifyV2ServiceRateLimitBucket(BaseModel):
account_sid: Optional[
constr(pattern=r'^AC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Rate Limit resource.',
)
date_created: Optional[datetime] = Field(
None,
description='The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.',
)
date_updated: Optional[datetime] = Field(
None,
description='The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.',
)
interval: Optional[int] = Field(
None, description='Number of seconds that the rate limit will be enforced over.'
)
max: Optional[int] = Field(
None, description='Maximum number of requests permitted in during the interval.'
)
rate_limit_sid: Optional[
constr(pattern=r'^RK[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The Twilio-provided string that uniquely identifies the Rate Limit resource.',
)
service_sid: Optional[
constr(pattern=r'^VA[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with.',
)
sid: Optional[
constr(pattern=r'^BL[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None, description='A 34 character string that uniquely identifies this Bucket.'
)
url: Optional[AnyUrl] = Field(None, description='The URL of this resource.')
class VerifyV2ServiceVerification(BaseModel):
account_sid: Optional[
constr(pattern=r'^AC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Verification resource.',
)
amount: Optional[str] = Field(
None,
description='The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.',
)
channel: Optional[VerificationEnumChannel] = Field(
None,
description='The verification method used. One of: [`email`](https://www.twilio.com/docs/verify/email), `sms`, `whatsapp`, `call`, or `sna`.',
)
date_created: Optional[datetime] = Field(
None,
description='The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.',
)
date_updated: Optional[datetime] = Field(
None,
description='The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format.',
)
lookup: Optional[Any] = Field(
None, description='Information about the phone number being verified.'
)
payee: Optional[str] = Field(
None,
description='The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.',
)
send_code_attempts: Optional[List] = Field(
None,
description='An array of verification attempt objects containing the channel attempted and the channel-specific transaction SID.',
)
service_sid: Optional[
constr(pattern=r'^VA[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with.',
)
sid: Optional[
constr(pattern=r'^VE[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The unique string that we created to identify the Verification resource.',
)
sna: Optional[Any] = Field(
None,
description='The set of fields used for a silent network auth (`sna`) verification. Contains a single field with the URL to be invoked to verify the phone number.',
)
status: Optional[str] = Field(
None,
description='The status of the verification. One of: `pending`, `approved`, or `canceled`',
)
to: Optional[str] = Field(
None,
description='The phone number or [email](https://www.twilio.com/docs/verify/email) being verified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).',
)
url: Optional[AnyUrl] = Field(
None, description='The absolute URL of the Verification resource.'
)
valid: Optional[bool] = Field(
None,
description='Use "status" instead. Legacy property indicating whether the verification was successful.',
)
class VerifyV2ServiceVerificationCheck(BaseModel):
account_sid: Optional[
constr(pattern=r'^AC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the VerificationCheck resource.',
)
amount: Optional[str] = Field(
None,
description='The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.',
)
channel: Optional[VerificationCheckEnumChannel] = Field(
None,
description='The verification method to use. One of: [`email`](https://www.twilio.com/docs/verify/email), `sms`, `whatsapp`, `call`, or `sna`.',
)
date_created: Optional[datetime] = Field(
None,
description='The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the Verification Check resource was created.',
)
date_updated: Optional[datetime] = Field(
None,
description='The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the Verification Check resource was last updated.',
)
payee: Optional[str] = Field(
None,
description='The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.',
)
service_sid: Optional[
constr(pattern=r'^VA[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with.',
)
sid: Optional[
constr(pattern=r'^VE[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The unique string that we created to identify the VerificationCheck resource.',
)
sna_attempts_error_codes: Optional[List] = Field(
None,
description="List of error codes as a result of attempting a verification using the `sna` channel. The error codes are chronologically ordered, from the first attempt to the latest attempt. This will be an empty list if no errors occured or `null` if the last channel used wasn't `sna`.",
)
status: Optional[str] = Field(
None,
description='The status of the verification. Can be: `pending`, `approved`, or `canceled`.',
)
to: Optional[str] = Field(
None,
description='The phone number or [email](https://www.twilio.com/docs/verify/email) being verified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).',
)
valid: Optional[bool] = Field(
None,
description='Use "status" instead. Legacy property indicating whether the verification was successful.',
)
class VerifyV2VerificationAttempt(BaseModel):
account_sid: Optional[
constr(pattern=r'^AC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Verification resource.',
)
channel: Optional[VerificationAttemptEnumChannels] = Field(
None,
description='A string specifying the communication channel used for the verification attempt. i.e SMS, CALL, etc.',
)
channel_data: Optional[Any] = Field(
None,
description='An object containing the channel specific information for an attempt.',
)
conversion_status: Optional[VerificationAttemptEnumConversionStatus] = Field(
None,
description='A string specifying the conversion status of the verification. A conversion happens when the user is able to provide the correct code. Possible values are `CONVERTED` and `UNCONVERTED`.',
)
date_created: Optional[datetime] = Field(
None,
description='The date that this Attempt was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.',
)
date_updated: Optional[datetime] = Field(
None,
description='The date that this Attempt was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.',
)
price: Optional[Any] = Field(
None,
description='An object containing the charge for this verification attempt related to the channel costs and the currency used. The costs related to the succeeded verifications are not included. May not be immediately available. More information on pricing is available [here](https://www.twilio.com/verify/pricing).',
)
service_sid: Optional[
constr(pattern=r'^VA[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Service](https://www.twilio.com/docs/verify/api/service) used to generate the attempt.',
)
sid: Optional[
constr(pattern=r'^VL[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID that uniquely identifies the verification attempt resource.',
)
url: Optional[AnyUrl] = None
verification_sid: Optional[
constr(pattern=r'^VE[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Verification](https://www.twilio.com/docs/verify/api/verification) that generated the attempt.',
)
class VerifyV2VerificationAttemptsSummary(BaseModel):
conversion_rate_percentage: Optional[float] = Field(
None,
description='Percentage of the confirmed messages over the total, defined by (total_converted/total_attempts)*100. ',
)
total_attempts: Optional[int] = Field(
None, description='Total of attempts made according to the provided filters'
)
total_converted: Optional[int] = Field(
None,
description='Total of attempts made that were confirmed by the end user, according to the provided filters.',
)
total_unconverted: Optional[int] = Field(
None,
description='Total of attempts made that were not confirmed by the end user, according to the provided filters.',
)
url: Optional[AnyUrl] = None
class VerifyV2VerificationTemplate(BaseModel):
account_sid: Optional[
constr(pattern=r'^AC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Account.')
channels: Optional[List[str]] = Field(
None,
description='A list of channels that support the Template. Can include: sms, voice.',
)
friendly_name: Optional[str] = Field(
None,
description='A descriptive string that you create to describe a Template. It can be up to 32 characters long.',
)
sid: Optional[
constr(pattern=r'^HJ[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='A 34 character string that uniquely identifies a Verification Template.',
)
translations: Optional[Any] = Field(
None,
description='An object that contains the different translations of the template. Every translation is identified by the language short name and contains its respective information as the approval status, text and created/modified date.',
)
class WebhookEnumMethods(Enum):
GET = 'GET'
POST = 'POST'
class WebhookEnumStatus(Enum):
enabled = 'enabled'
disabled = 'disabled'
class WebhookEnumVersion(Enum):
v1 = 'v1'
v2 = 'v2'
class Meta(BaseModel):
first_page_url: Optional[AnyUrl] = None
key: Optional[str] = None
next_page_url: Optional[AnyUrl] = None
page: Optional[int] = None
page_size: Optional[int] = None
previous_page_url: Optional[AnyUrl] = None
url: Optional[AnyUrl] = None
class V2AttemptsGetResponse(BaseModel):
attempts: Optional[List[VerifyV2VerificationAttempt]] = None
meta: Optional[Meta] = None
class V2SafeListNumbersPostRequest(BaseModel):
PhoneNumber: str = Field(
...,
description='The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).',
)
class V2ServicesGetResponse(BaseModel):
meta: Optional[Meta] = None
services: Optional[List[VerifyV2Service]] = None
class V2ServicesPostRequest(BaseModel):
CodeLength: Optional[int] = Field(
None,
description='The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive.',
)
CustomCodeEnabled: Optional[bool] = Field(
None,
description='Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers.',
)
DefaultTemplateSid: Optional[
constr(pattern=r'^HJ[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only.',
)
DoNotShareWarningEnabled: Optional[bool] = Field(
None,
description='Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code`',
)
DtmfInputRequired: Optional[bool] = Field(
None,
description='Whether to ask the user to press a number before delivering the verify code in a phone call.',
)
FriendlyName: str = Field(
...,
description='A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.**',
)
LookupEnabled: Optional[bool] = Field(
None,
description='Whether to perform a lookup with each verification started and return info about the phone number.',
)
Psd2Enabled: Optional[bool] = Field(
None,
description='Whether to pass PSD2 transaction parameters when starting a verification.',
)
Push_ApnCredentialSid: Optional[
constr(pattern=r'^CR[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
alias='Push.ApnCredentialSid',
description='Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource)',
)
Push_FcmCredentialSid: Optional[
constr(pattern=r'^CR[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
alias='Push.FcmCredentialSid',
description='Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource)',
)
Push_IncludeDate: Optional[bool] = Field(
None,
alias='Push.IncludeDate',
description="Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. This timestamp value is the same one as the one found in `date_created`, please use that one instead.",
)
SkipSmsToLandlines: Optional[bool] = Field(
None,
description='Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`.',
)
Totp_CodeLength: Optional[int] = Field(
None,
alias='Totp.CodeLength',
description='Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6',
)
Totp_Issuer: Optional[str] = Field(
None,
alias='Totp.Issuer',
description='Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. Defaults to the service friendly name if not provided.',
)
Totp_Skew: Optional[int] = Field(
None,
alias='Totp.Skew',
description='Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1',
)
Totp_TimeStep: Optional[int] = Field(
None,
alias='Totp.TimeStep',
description='Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds',
)
TtsName: Optional[str] = Field(
None,
description='The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages.',
)
class V2ServicesServiceSidAccessTokensPostRequest(BaseModel):
FactorFriendlyName: Optional[str] = Field(
None,
description='The friendly name of the factor that is going to be created with this access token',
)
FactorType: AccessTokenEnumFactorTypes = Field(
..., description='The Type of this Factor. Eg. `push`'
)
Identity: str = Field(
...,
description="The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, and generated by your external system, such as your user's UUID, GUID, or SID.",
)
Ttl: Optional[int] = Field(
None,
description='How long, in seconds, the access token is valid. Can be an integer between 60 and 300. Default is 60.',
)
class V2ServicesServiceSidEntitiesGetResponse(BaseModel):
entities: Optional[List[VerifyV2ServiceEntity]] = None
meta: Optional[Meta] = None
class V2ServicesServiceSidEntitiesPostRequest(BaseModel):
Identity: str = Field(
...,
description="The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters.",
)
class V2ServicesServiceSidEntitiesIdentityChallengesGetResponse(BaseModel):
challenges: Optional[List[VerifyV2ServiceEntityChallenge]] = None
meta: Optional[Meta] = None
class V2ServicesServiceSidEntitiesIdentityChallengesPostRequest(BaseModel):
AuthPayload: Optional[str] = Field(
None,
description='Optional payload used to verify the Challenge upon creation. Only used with a Factor of type `totp` to carry the TOTP code that needs to be verified. For `TOTP` this value must be between 3 and 8 characters long.',
)
Details_Fields: Optional[List] = Field(
None,
alias='Details.Fields',
description='A list of objects that describe the Fields included in the Challenge. Each object contains the label and value of the field, the label can be up to 36 characters in length and the value can be up to 128 characters in length. Used when `factor_type` is `push`. There can be up to 20 details fields.',
)
Details_Message: Optional[str] = Field(
None,
alias='Details.Message',
description='Shown to the user when the push notification arrives. Required when `factor_type` is `push`. Can be up to 256 characters in length',
)
ExpirationDate: Optional[datetime] = Field(
None,
description='The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The default value is five (5) minutes after Challenge creation. The max value is sixty (60) minutes after creation.',
)
FactorSid: constr(pattern=r'^YF[0-9a-fA-F]{32}$', min_length=34, max_length=34) = (
Field(..., description='The unique SID identifier of the Factor.')
)
HiddenDetails: Optional[Any] = Field(
None,
description='Details provided to give context about the Challenge. Not shown to the end user. It must be a stringified JSON with only strings values eg. `{"ip": "172.168.1.234"}`. Can be up to 1024 characters in length',
)
class V2ServicesServiceSidEntitiesIdentityChallengesChallengeSidNotificationsPostRequest(
BaseModel
):
Ttl: Optional[int] = Field(
None,
description='How long, in seconds, the notification is valid. Can be an integer between 0 and 300. Default is 300. Delivery is attempted until the TTL elapses, even if the device is offline. 0 means that the notification delivery is attempted immediately, only once, and is not stored for future delivery.',
)
class V2ServicesServiceSidEntitiesIdentityChallengesSidPostRequest(BaseModel):
AuthPayload: Optional[str] = Field(
None,
description='The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must be between 3 and 8 characters long. For `Push` this value can be up to 5456 characters in length',
)
Metadata: Optional[Any] = Field(
None,
description='Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{"os": "Android"}`. Can be up to 1024 characters in length.',
)
class V2ServicesServiceSidEntitiesIdentityFactorsGetResponse(BaseModel):
factors: Optional[List[VerifyV2ServiceEntityFactor]] = None
meta: Optional[Meta] = None
class V2ServicesServiceSidEntitiesIdentityFactorsPostRequest(BaseModel):
Binding_Alg: Optional[str] = Field(
None,
alias='Binding.Alg',
description='The algorithm used when `factor_type` is `push`. Algorithm supported: `ES256`',
)
Binding_PublicKey: Optional[str] = Field(
None,
alias='Binding.PublicKey',
description='The Ecdsa public key in PKIX, ASN.1 DER format encoded in Base64.\n\nRequired when `factor_type` is `push`',
)
Binding_Secret: Optional[str] = Field(
None,
alias='Binding.Secret',
description='The shared secret for TOTP factors encoded in Base32. This can be provided when creating the Factor, otherwise it will be generated.\n\nUsed when `factor_type` is `totp`',
)
Config_Alg: Optional[NewFactorEnumTotpAlgorithms] = Field(
None,
alias='Config.Alg',
description='The algorithm used to derive the TOTP codes. Can be `sha1`, `sha256` or `sha512`. Defaults to `sha1`.\n\nUsed when `factor_type` is `totp`',
)
Config_AppId: Optional[str] = Field(
None,
alias='Config.AppId',
description='The ID that uniquely identifies your app in the Google or Apple store, such as `com.example.myapp`. It can be up to 100 characters long.\n\nRequired when `factor_type` is `push`.',
)
Config_CodeLength: Optional[int] = Field(
None,
alias='Config.CodeLength',
description='Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. The default value is defined at the service level in the property `totp.code_length`. If not configured defaults to 6.\n\nUsed when `factor_type` is `totp`',
)
Config_NotificationPlatform: Optional[NewFactorEnumNotificationPlatforms] = Field(
None,
alias='Config.NotificationPlatform',
description='The transport technology used to generate the Notification Token. Can be `apn`, `fcm` or `none`.\n\nRequired when `factor_type` is `push`.',
)
Config_NotificationToken: Optional[str] = Field(
None,
alias='Config.NotificationToken',
description='For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Must be between 32 and 255 characters long.\n\nRequired when `factor_type` is `push`.',
)
Config_SdkVersion: Optional[str] = Field(
None,
alias='Config.SdkVersion',
description='The Verify Push SDK version used to configure the factor\n\nRequired when `factor_type` is `push`',
)
Config_Skew: Optional[int] = Field(
None,
alias='Config.Skew',
description='The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The default value is defined at the service level in the property `totp.skew`. If not configured defaults to 1.\n\nUsed when `factor_type` is `totp`',
)
Config_TimeStep: Optional[int] = Field(
None,
alias='Config.TimeStep',
description='Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. The default value is defined at the service level in the property `totp.time_step`. Defaults to 30 seconds if not configured.\n\nUsed when `factor_type` is `totp`',
)
FactorType: NewFactorEnumFactorTypes = Field(
...,
description='The Type of this Factor. Currently `push` and `totp` are supported.',
)
FriendlyName: str = Field(
...,
description='The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors.\nFor `factor_type` `push`, this could be a device name.\nFor `factor_type` `totp`, this value is used as the “account name” in constructing the `binding.uri` property.\nAt the same time, we recommend avoiding providing PII.',
)
Metadata: Optional[Any] = Field(
None,
description='Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{"os": "Android"}`. Can be up to 1024 characters in length.',
)
class V2ServicesServiceSidEntitiesIdentityFactorsSidPostRequest(BaseModel):
AuthPayload: Optional[str] = Field(
None,
description='The optional payload needed to verify the Factor for the first time. E.g. for a TOTP, the numeric code.',
)
Config_Alg: Optional[FactorEnumTotpAlgorithms] = Field(
None,
alias='Config.Alg',
description='The algorithm used to derive the TOTP codes. Can be `sha1`, `sha256` or `sha512`',
)
Config_CodeLength: Optional[int] = Field(
None,
alias='Config.CodeLength',
description='Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive',
)
Config_NotificationPlatform: Optional[str] = Field(
None,
alias='Config.NotificationPlatform',
description='The transport technology used to generate the Notification Token. Can be `apn`, `fcm` or `none`.\n\nRequired when `factor_type` is `push`.',
)
Config_NotificationToken: Optional[str] = Field(
None,
alias='Config.NotificationToken',
description='For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Required when `factor_type` is `push`. If specified, this value must be between 32 and 255 characters long.',
)
Config_SdkVersion: Optional[str] = Field(
None,
alias='Config.SdkVersion',
description='The Verify Push SDK version used to configure the factor',
)
Config_Skew: Optional[int] = Field(
None,
alias='Config.Skew',
description='The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive',
)
Config_TimeStep: Optional[int] = Field(
None,
alias='Config.TimeStep',
description='Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive',
)
FriendlyName: Optional[str] = Field(
None,
description='The new friendly name of this Factor. It can be up to 64 characters.',
)
class V2ServicesServiceSidMessagingConfigurationsGetResponse(BaseModel):
messaging_configurations: Optional[List[VerifyV2ServiceMessagingConfiguration]] = (
None
)
meta: Optional[Meta] = None
class V2ServicesServiceSidMessagingConfigurationsPostRequest(BaseModel):
Country: str = Field(
...,
description='The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`.',
)
MessagingServiceSid: constr(
pattern=r'^MG[0-9a-fA-F]{32}$', min_length=34, max_length=34
) = Field(
...,
description='The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) to be used to send SMS to the country of this configuration.',
)
class V2ServicesServiceSidMessagingConfigurationsCountryPostRequest(BaseModel):
MessagingServiceSid: constr(
pattern=r'^MG[0-9a-fA-F]{32}$', min_length=34, max_length=34
) = Field(
...,
description='The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) to be used to send SMS to the country of this configuration.',
)
class V2ServicesServiceSidRateLimitsGetResponse(BaseModel):
meta: Optional[Meta] = None
rate_limits: Optional[List[VerifyV2ServiceRateLimit]] = None
class V2ServicesServiceSidRateLimitsPostRequest(BaseModel):
Description: Optional[str] = Field(
None, description='Description of this Rate Limit'
)
UniqueName: str = Field(
...,
description='Provides a unique and addressable name to be assigned to this Rate Limit, assigned by the developer, to be optionally used in addition to SID. **This value should not contain PII.**',
)
class V2ServicesServiceSidRateLimitsRateLimitSidBucketsGetResponse(BaseModel):
buckets: Optional[List[VerifyV2ServiceRateLimitBucket]] = None
meta: Optional[Meta] = None
class V2ServicesServiceSidRateLimitsRateLimitSidBucketsPostRequest(BaseModel):
Interval: int = Field(
..., description='Number of seconds that the rate limit will be enforced over.'
)
Max: int = Field(
..., description='Maximum number of requests permitted in during the interval.'
)
class V2ServicesServiceSidRateLimitsRateLimitSidBucketsSidPostRequest(BaseModel):
Interval: Optional[int] = Field(
None, description='Number of seconds that the rate limit will be enforced over.'
)
Max: Optional[int] = Field(
None, description='Maximum number of requests permitted in during the interval.'
)
class V2ServicesServiceSidRateLimitsSidPostRequest(BaseModel):
Description: Optional[str] = Field(
None, description='Description of this Rate Limit'
)
class V2ServicesServiceSidVerificationCheckPostRequest(BaseModel):
Amount: Optional[str] = Field(
None,
description='The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.',
)
Code: Optional[str] = Field(
None, description='The 4-10 character string being verified.'
)
Payee: Optional[str] = Field(
None,
description='The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.',
)
To: Optional[str] = Field(
None,
description='The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Either this parameter or the `verification_sid` must be specified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).',
)
VerificationSid: Optional[
constr(pattern=r'^VE[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/[email](https://www.twilio.com/docs/verify/email) must be specified.',
)
class V2ServicesServiceSidVerificationsPostRequest(BaseModel):
Amount: Optional[str] = Field(
None,
description='The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.',
)
AppHash: Optional[str] = Field(
None,
description='Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`.',
)
Channel: str = Field(
...,
description='The verification method to use. One of: [`email`](https://www.twilio.com/docs/verify/email), `sms`, `whatsapp`, `call`, `sna` or `auto`.',
)
ChannelConfiguration: Optional[Any] = Field(
None,
description="[`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address.",
)
CustomCode: Optional[str] = Field(
None,
description='A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive.',
)
CustomFriendlyName: Optional[str] = Field(
None,
description='A custom user defined friendly name that overwrites the existing one in the verification message',
)
CustomMessage: Optional[str] = Field(
None, description='The text of a custom message to use for the verification.'
)
DeviceIp: Optional[str] = Field(
None,
description="Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address.",
)
Locale: Optional[str] = Field(
None,
description='Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages).',
)
Payee: Optional[str] = Field(
None,
description='The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.',
)
RateLimits: Optional[Any] = Field(
None,
description='The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request.',
)
SendDigits: Optional[str] = Field(
None,
description='The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits).',
)
TemplateCustomSubstitutions: Optional[str] = Field(
None,
description="A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions.",
)
TemplateSid: Optional[
constr(pattern=r'^HJ[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only.',
)
To: str = Field(
...,
description='The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).',
)
class V2ServicesServiceSidVerificationsSidPostRequest(BaseModel):
Status: VerificationEnumStatus = Field(
...,
description='The new status of the resource. Can be: `canceled` or `approved`.',
)
class V2ServicesServiceSidWebhooksPostRequest(BaseModel):
EventTypes: List[str] = Field(
...,
description='The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied`',
)
FriendlyName: str = Field(
...,
description='The string that you assigned to describe the webhook. **This value should not contain PII.**',
)
Status: Optional[WebhookEnumStatus] = Field(
None,
description='The webhook status. Default value is `enabled`. One of: `enabled` or `disabled`',
)
Version: Optional[WebhookEnumVersion] = Field(
None,
description='The webhook version. Default value is `v2` which includes all the latest fields. Version `v1` is legacy and may be removed in the future.',
)
WebhookUrl: str = Field(..., description='The URL associated with this Webhook.')
class V2ServicesServiceSidWebhooksSidPostRequest(BaseModel):
EventTypes: Optional[List[str]] = Field(
None,
description='The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied`',
)
FriendlyName: Optional[str] = Field(
None,
description='The string that you assigned to describe the webhook. **This value should not contain PII.**',
)
Status: Optional[WebhookEnumStatus] = Field(
None,
description='The webhook status. Default value is `enabled`. One of: `enabled` or `disabled`',
)
Version: Optional[WebhookEnumVersion] = Field(
None,
description='The webhook version. Default value is `v2` which includes all the latest fields. Version `v1` is legacy and may be removed in the future.',
)
WebhookUrl: Optional[str] = Field(
None, description='The URL associated with this Webhook.'
)
class V2ServicesSidPostRequest(BaseModel):
CodeLength: Optional[int] = Field(
None,
description='The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive.',
)
CustomCodeEnabled: Optional[bool] = Field(
None,
description='Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers.',
)
DefaultTemplateSid: Optional[
constr(pattern=r'^HJ[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only.',
)
DoNotShareWarningEnabled: Optional[bool] = Field(
None,
description='Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.**',
)
DtmfInputRequired: Optional[bool] = Field(
None,
description='Whether to ask the user to press a number before delivering the verify code in a phone call.',
)
FriendlyName: Optional[str] = Field(
None,
description='A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.**',
)
LookupEnabled: Optional[bool] = Field(
None,
description='Whether to perform a lookup with each verification started and return info about the phone number.',
)
Psd2Enabled: Optional[bool] = Field(
None,
description='Whether to pass PSD2 transaction parameters when starting a verification.',
)
Push_ApnCredentialSid: Optional[
constr(pattern=r'^CR[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
alias='Push.ApnCredentialSid',
description='Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource)',
)
Push_FcmCredentialSid: Optional[
constr(pattern=r'^CR[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
alias='Push.FcmCredentialSid',
description='Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource)',
)
Push_IncludeDate: Optional[bool] = Field(
None,
alias='Push.IncludeDate',
description="Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter.",
)
SkipSmsToLandlines: Optional[bool] = Field(
None,
description='Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`.',
)
Totp_CodeLength: Optional[int] = Field(
None,
alias='Totp.CodeLength',
description='Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6',
)
Totp_Issuer: Optional[str] = Field(
None,
alias='Totp.Issuer',
description='Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI.',
)
Totp_Skew: Optional[int] = Field(
None,
alias='Totp.Skew',
description='Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1',
)
Totp_TimeStep: Optional[int] = Field(
None,
alias='Totp.TimeStep',
description='Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds',
)
TtsName: Optional[str] = Field(
None,
description='The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages.',
)
class V2TemplatesGetResponse(BaseModel):
meta: Optional[Meta] = None
templates: Optional[List[VerifyV2VerificationTemplate]] = None
class VerifyV2ServiceWebhook(BaseModel):
account_sid: Optional[
constr(pattern=r'^AC[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource.',
)
date_created: Optional[datetime] = Field(
None,
description='The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.',
)
date_updated: Optional[datetime] = Field(
None,
description='The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.',
)
event_types: Optional[List[str]] = Field(
None,
description='The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied`',
)
friendly_name: Optional[str] = Field(
None,
description='The string that you assigned to describe the webhook. **This value should not contain PII.**',
)
service_sid: Optional[
constr(pattern=r'^VA[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(None, description='The unique SID identifier of the Service.')
sid: Optional[
constr(pattern=r'^YW[0-9a-fA-F]{32}$', min_length=34, max_length=34)
] = Field(
None,
description='The unique string that we created to identify the Webhook resource.',
)
status: Optional[WebhookEnumStatus] = Field(
None,
description='The webhook status. Default value is `enabled`. One of: `enabled` or `disabled`',
)
url: Optional[AnyUrl] = Field(
None, description='The absolute URL of the Webhook resource.'
)
version: Optional[WebhookEnumVersion] = Field(
None,
description='The webhook version. Default value is `v2` which includes all the latest fields. Version `v1` is legacy and may be removed in the future.',
)
webhook_method: Optional[WebhookEnumMethods] = Field(
None, description="The method to be used when calling the webhook's URL."
)
webhook_url: Optional[AnyUrl] = Field(
None, description='The URL associated with this Webhook.'
)
class V2ServicesServiceSidWebhooksGetResponse(BaseModel):
meta: Optional[Meta] = None
webhooks: Optional[List[VerifyV2ServiceWebhook]] = None