diff --git a/CHANGES.md b/CHANGES.md index d7b92d664..795df38ee 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,72 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2026-10-06] Version 9.11.3 +--------------------------- +**Audiences** +- ## 2026-10-02 +- **Added 1 new path(s)**: +- `/preview/Cohorts/{cohortId}/Operations` (AdminListCohortOperations) +- ## 2026-10-01 +- **Content updates**: +- Updated description for `AdminListSnapshotOperations` +- ## 2026-09-28 +- **Content updates**: +- Updated description for `AdminListCohortSnapshots` +- Updated description for `AdminFetchCohortSnapshot` +- Updated schema description for `Criteria` +- Added properties to `OperationPayload`: cohortId +- Removed properties from `OperationPayload`: audienceId +- Updated schema description for `OperationResult` +- Added properties to `OperationResult`: cohortId +- Removed properties from `OperationResult`: audienceId +- Updated schema description for `Record` +- Updated schema description for `Cohort` +- ...and 3 more changes +- ## 2026-10-01 +- Minor updates (formatting, metadata) +- ## 2026-09-28 +- **Content updates**: +- Updated schema description for `CohortOperationResult` +- Updated schema description for `PartitionCount` + +**Conversations** +- Add `traitExtractionStrategyIds` and `observationExtractionStrategyIds` to the Conversations v2 Admin Configuration schema. +- Align the Conversations v2 Capabilities list and create contracts with the backend `domainId` field. + +**Data-ingress** +- ## 2026-10-01 +- Minor updates (formatting, metadata) +- ## 2026-09-17 +- Add support for Hubspot connector +- ## 2026-10-01 +- Minor updates (formatting, metadata) +- ## 2026-09-17 +- Add support for Hubspot connector + +**Knowledge** +- ## 2026-09-24 +- **Routing updates**: +- Changed `downstreamServiceName` from `memora-domain` to `enterprise-knowledge-domain` for all operations + +**Memory** +- ## 2026-09-30 +- The `source` field on observations and conversation summaries, and the `source` filter +- on `ListProfileObservations`, now also accept forward slashes (`/`). The pattern is +- `^[a-zA-Z0-9 _./-]+$`. This is additive and backwards compatible: every previously +- valid value is still accepted. +- `UpdateStore`, `UpdateTraitGroup`, and `UpdateDataMapping` now require a body with at least one property. An empty `{}` gets a 400. + +**Messaging** +- Add opt-out configuration admin endpoints (`GET/PUT/DELETE /v1/Accounts/{AccountSid}/OptOuts/{OptOutSid}/...`) to the messaging admin-api (dev-us1 and stage-us1 only) +- Add create opt-out configuration endpoint (`POST /v1/Accounts/{AccountSid}/OptOuts`) to the messaging admin-api (dev-us1 and stage-us1 only) +- Add update messaging service endpoint (`PUT /v1/Accounts/{AccountSid}/Services/{MessagingServiceSid}`) to the messaging admin-api (dev-us1 and stage-us1 only) +- Add WhatsApp display name change support to Sender API: `pending_display_name`, `pending_display_name_status` and `pending_display_name_status_date` on fetch, and `display_name_status` on update and partial update + +**Routes** +- Set SDK and docs visibility of `GET`/`POST` `/v3/ShortCodes/{isoCountryCode}/{shortCode}` to `public`, maturity to `ga` + + [2026-09-28] Version 9.11.2 --------------------------- **Twiml** diff --git a/setup.py b/setup.py index 949cb38de..b91c43b36 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.11.2", + version="9.11.3", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 3ff49ac6e..fc05cc3bb 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "11", "2") +__version_info__ = ("9", "11", "3") __version__ = ".".join(__version_info__) diff --git a/twilio/rest/api/v2010/account/conference/__init__.py b/twilio/rest/api/v2010/account/conference/__init__.py index 9edc8ce21..03cc250b7 100644 --- a/twilio/rest/api/v2010/account/conference/__init__.py +++ b/twilio/rest/api/v2010/account/conference/__init__.py @@ -642,7 +642,7 @@ def stream( :param date date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param date date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param str friendly_name: The string that identifies the Conference resources to read. - :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. Starting from September 30th, 2026, the default is `in-progress`. To read completed conferences, set `Status` to `completed`. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -693,7 +693,7 @@ async def stream_async( :param date date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param date date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param str friendly_name: The string that identifies the Conference resources to read. - :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. Starting from September 30th, 2026, the default is `in-progress`. To read completed conferences, set `Status` to `completed`. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -742,7 +742,7 @@ def stream_with_http_info( :param date date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param date date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param str friendly_name: The string that identifies the Conference resources to read. - :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. Starting from September 30th, 2026, the default is `in-progress`. To read completed conferences, set `Status` to `completed`. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -792,7 +792,7 @@ async def stream_with_http_info_async( :param date date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param date date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param str friendly_name: The string that identifies the Conference resources to read. - :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. Starting from September 30th, 2026, the default is `in-progress`. To read completed conferences, set `Status` to `completed`. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -843,7 +843,7 @@ def list( :param date date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param date date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param str friendly_name: The string that identifies the Conference resources to read. - :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. Starting from September 30th, 2026, the default is `in-progress`. To read completed conferences, set `Status` to `completed`. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -894,7 +894,7 @@ async def list_async( :param date date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param date date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param str friendly_name: The string that identifies the Conference resources to read. - :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. Starting from September 30th, 2026, the default is `in-progress`. To read completed conferences, set `Status` to `completed`. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -945,7 +945,7 @@ def list_with_http_info( :param date date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param date date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param str friendly_name: The string that identifies the Conference resources to read. - :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. Starting from September 30th, 2026, the default is `in-progress`. To read completed conferences, set `Status` to `completed`. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -994,7 +994,7 @@ async def list_with_http_info_async( :param date date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param date date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param str friendly_name: The string that identifies the Conference resources to read. - :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. Starting from September 30th, 2026, the default is `in-progress`. To read completed conferences, set `Status` to `completed`. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1044,7 +1044,7 @@ def page( :param date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param friendly_name: The string that identifies the Conference resources to read. - :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. Starting from September 30th, 2026, the default is `in-progress`. To read completed conferences, set `Status` to `completed`. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -1101,7 +1101,7 @@ async def page_async( :param date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param friendly_name: The string that identifies the Conference resources to read. - :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. Starting from September 30th, 2026, the default is `in-progress`. To read completed conferences, set `Status` to `completed`. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -1158,7 +1158,7 @@ def page_with_http_info( :param date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param friendly_name: The string that identifies the Conference resources to read. - :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. Starting from September 30th, 2026, the default is `in-progress`. To read completed conferences, set `Status` to `completed`. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -1216,7 +1216,7 @@ async def page_with_http_info_async( :param date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param friendly_name: The string that identifies the Conference resources to read. - :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. Starting from September 30th, 2026, the default is `in-progress`. To read completed conferences, set `Status` to `completed`. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 diff --git a/twilio/rest/conversations/v2/action.py b/twilio/rest/conversations/v2/action.py index b09e961c2..554c0a54b 100644 --- a/twilio/rest/conversations/v2/action.py +++ b/twilio/rest/conversations/v2/action.py @@ -41,13 +41,14 @@ class ConversationsV2Channel(object): """ :ivar id: Unique identifier for this Action. - :ivar type: The type of action. Accepted values: SEND_MESSAGE. + :ivar type: The type of action: action-send-message or action-start-flow. :ivar status: :ivar conversation_id: The conversation this action belongs to. - :ivar related: Named identifiers from downstream. For SEND_MESSAGE: - messageSid: The downstream message SID (present when PENDING or COMPLETED) - communicationId: The Communication ID (present when COMPLETED) + :ivar related: Named identifiers from downstream. For SEND_MESSAGE: - messageSid: The downstream message SID (present when PENDING or COMPLETED) - communicationId: The Communication ID (present when COMPLETED) For START_FLOW: - executionSid: The Studio Flow execution SID (present when COMPLETED) :ivar created_at: Timestamp when the action was created. :ivar updated_at: Timestamp when the action was last updated. :ivar completed_at: Timestamp when the action reached a terminal status. + :ivar failure_reason: Human-readable failure reason. Null unless status is FAILED. """ def __init__( @@ -75,6 +76,7 @@ def __init__( self.completed_at: Optional[datetime] = deserialize.iso8601_datetime( payload.get("completedAt") ) + self.failure_reason: Optional[str] = payload.get("failureReason") # Only set _solution if path params are provided (not None) if conversation_id is not None or action_id is not None: diff --git a/twilio/rest/conversations/v2/communication.py b/twilio/rest/conversations/v2/communication.py index 299490962..43274b566 100644 --- a/twilio/rest/conversations/v2/communication.py +++ b/twilio/rest/conversations/v2/communication.py @@ -389,6 +389,7 @@ class CreateCommunicationInConversationRequest(object): :ivar author: :ivar content: :ivar channel_id: + :ivar resource_id: External resource identifier for this Communication (e.g. MessageSid for SMS/RCS/WhatsApp, TranscriptionSid + MessageIndex for Voice). If a Communication with the same resourceId already exists in the Conversation, it is updated instead of a new one being created. :ivar recipients: :ivar occurred_at: Timestamp when this Communication occurred. If omitted, the server uses the current time. """ @@ -414,6 +415,7 @@ def __init__(self, payload: Dict[str, Any]): else None ) self.channel_id: Optional[str] = payload.get("channelId") + self.resource_id: Optional[str] = payload.get("resourceId") self.recipients: Optional[ List[ CommunicationList.CreateCommunicationInConversationRequestRecipients @@ -439,6 +441,7 @@ def to_dict(self): "author": self.author.to_dict() if self.author is not None else None, "content": self.content.to_dict() if self.content is not None else None, "channelId": self.channel_id, + "resourceId": self.resource_id, "recipients": ( [recipients.to_dict() for recipients in self.recipients] if self.recipients is not None diff --git a/twilio/rest/conversations/v2/configuration.py b/twilio/rest/conversations/v2/configuration.py index 84a67a9b4..188797f8f 100644 --- a/twilio/rest/conversations/v2/configuration.py +++ b/twilio/rest/conversations/v2/configuration.py @@ -35,8 +35,6 @@ class ConversationsV2ConversationGroupingType(object): ) """ - :ivar status_url: URL to poll for operation status. - :ivar related: Named resource identifiers associated with this operation. Keys depend on the operation type: - config-create, config-update, config-delete: configurationId - conversation-delete: conversationId :ivar id: Configuration ID. :ivar display_name: A human-readable name for the configuration. Limited to 32 characters. :ivar description: Human-readable description for the Configuration. Allows spaces and special characters, typically limited to a paragraph of text. This serves as a descriptive field rather than just a name. @@ -45,11 +43,15 @@ class ConversationsV2ConversationGroupingType(object): :ivar channel_settings: Channel-specific configuration settings by channel type. Keys should be valid channel types (`VOICE`, `SMS`, `RCS`, `WHATSAPP`, `CHAT`). :ivar status_callbacks: List of default webhook configurations applied to Conversations under this Configuration. :ivar intelligence_configuration_ids: A list of Conversational Intelligence configuration IDs. + :ivar trait_extraction_strategy_ids: A list of Trait Extraction Strategy IDs. + :ivar observation_extraction_strategy_ids: A list of Observation Extraction Strategy IDs. :ivar memory_extraction_enabled: Whether memory extraction is enabled for conversations under this configuration. Defaults to false. :ivar conversations_v1_bridge: :ivar created_at: Timestamp when this Configuration was created. :ivar updated_at: Timestamp when this Configuration was last updated. :ivar version: Version number used for optimistic locking. + :ivar status_url: URL to poll for operation status. + :ivar related: Named resource identifiers associated with this operation. Keys depend on the operation type: - config-create, config-update, config-delete: configurationId - conversation-delete: conversationId """ def __init__( @@ -57,8 +59,6 @@ def __init__( ): super().__init__(version) - self.status_url: Optional[str] = payload.get("statusUrl") - self.related: Optional[Dict[str, str]] = payload.get("related") self.id: Optional[str] = payload.get("id") self.display_name: Optional[str] = payload.get("displayName") self.description: Optional[str] = payload.get("description") @@ -75,6 +75,12 @@ def __init__( self.intelligence_configuration_ids: Optional[List[str]] = payload.get( "intelligenceConfigurationIds" ) + self.trait_extraction_strategy_ids: Optional[List[str]] = payload.get( + "traitExtractionStrategyIds" + ) + self.observation_extraction_strategy_ids: Optional[List[str]] = payload.get( + "observationExtractionStrategyIds" + ) self.memory_extraction_enabled: Optional[bool] = payload.get( "memoryExtractionEnabled" ) @@ -88,6 +94,8 @@ def __init__( payload.get("updatedAt") ) self.version: Optional[int] = payload.get("version") + self.status_url: Optional[str] = payload.get("statusUrl") + self.related: Optional[Dict[str, str]] = payload.get("related") # Only set _solution if path params are provided (not None) if id is not None: diff --git a/twilio/rest/conversations/v2/conversation.py b/twilio/rest/conversations/v2/conversation.py index 9b80ae4af..b8e6e7a46 100644 --- a/twilio/rest/conversations/v2/conversation.py +++ b/twilio/rest/conversations/v2/conversation.py @@ -928,6 +928,8 @@ def to_dict(self): class CreateConversationWithConfigRequestConfiguration(object): """ :ivar intelligence_configuration_ids: A list of Conversational Intelligence configuration IDs. + :ivar trait_extraction_strategy_ids: A list of Trait Extraction Strategy IDs. + :ivar observation_extraction_strategy_ids: A list of Observation Extraction Strategy IDs. :ivar workflows: The Workflows to associate with this Conversation. Overrides the Configuration's own. """ @@ -936,6 +938,12 @@ def __init__(self, payload: Dict[str, Any]): self.intelligence_configuration_ids: Optional[List[str]] = payload.get( "intelligenceConfigurationIds" ) + self.trait_extraction_strategy_ids: Optional[List[str]] = payload.get( + "traitExtractionStrategyIds" + ) + self.observation_extraction_strategy_ids: Optional[List[str]] = payload.get( + "observationExtractionStrategyIds" + ) self.workflows: Optional[List[ConversationList.ConversationWorkflow]] = ( [ ( @@ -952,6 +960,8 @@ def __init__(self, payload: Dict[str, Any]): def to_dict(self): return { "intelligenceConfigurationIds": self.intelligence_configuration_ids, + "traitExtractionStrategyIds": self.trait_extraction_strategy_ids, + "observationExtractionStrategyIds": self.observation_extraction_strategy_ids, "workflows": ( [workflows.to_dict() for workflows in self.workflows] if self.workflows is not None diff --git a/twilio/rest/insights/v1/call/call_summary.py b/twilio/rest/insights/v1/call/call_summary.py index 4d1e0d94d..628cb7153 100644 --- a/twilio/rest/insights/v1/call/call_summary.py +++ b/twilio/rest/insights/v1/call/call_summary.py @@ -78,7 +78,7 @@ class ProcessingState(object): :ivar client_edge: `object` Contains metrics and properties for the Twilio media gateway of a Client call. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties. :ivar sdk_edge: `object` Contains metrics and properties for the SDK sensor library for Client calls. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties. :ivar sip_edge: `object` Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties. - :ivar tags: Tags applied to calls by Voice Insights analysis indicating a condition that could result in subjective degradation of the call quality. + :ivar tags: [Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags) that Voice Insights analysis applies to calls. They indicate a condition that may influence the subjective experience of call audio quality. :ivar url: The URL of this resource. :ivar attributes: `object` Attributes capturing call-flow-specific details. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#attributes-object) for the object properties. :ivar properties: `object` Contains edge-agnostic call-level details. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#properties-object) for the object properties. diff --git a/twilio/rest/insights/v1/call_summaries.py b/twilio/rest/insights/v1/call_summaries.py index 1f66d767e..accf7159c 100644 --- a/twilio/rest/insights/v1/call_summaries.py +++ b/twilio/rest/insights/v1/call_summaries.py @@ -89,7 +89,7 @@ class CallSummaryCrelaySessionState(object): :ivar client_edge: `object` Contains metrics and properties for the Twilio media gateway of a Client call. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties. :ivar sdk_edge: `object` Contains metrics and properties for the SDK sensor library for Client calls. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties. :ivar sip_edge: `object` Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#edges-and-their-properties) for the object properties. - :ivar tags: Tags applied to calls by Voice Insights analysis indicating a condition that could result in subjective degradation of the call quality. + :ivar tags: [Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags) that Voice Insights analysis applies to calls. They indicate a condition that may influence the subjective experience of call audio quality. :ivar url: The URL of this resource. :ivar attributes: `object` Attributes capturing call-flow-specific details. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#attributes-object) for the object properties. :ivar properties: `object` Contains edge-agnostic call-level details. See [Details: Call Summary](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-summary#properties-object) for the object properties. diff --git a/twilio/rest/memory/v1/conversation_summary.py b/twilio/rest/memory/v1/conversation_summary.py index a53ba66c0..16933d864 100644 --- a/twilio/rest/memory/v1/conversation_summary.py +++ b/twilio/rest/memory/v1/conversation_summary.py @@ -27,14 +27,14 @@ class ConversationSummaryInstance(InstanceResource): """ - :ivar source: The source system that generated the summary. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :ivar message: + :ivar source: The source system that generated the summary. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :ivar content: The main content of the summary. :ivar occurred_at: The timestamp when the summary was originally created. :ivar conversation_id: A unique identifier for the conversation using Twilio Type ID (TTID) format. :ivar id: A unique identifier for the summary using Twilio Type ID (TTID) format. :ivar created_at: The timestamp when the summary was created. :ivar updated_at: The timestamp when the summary was last updated. - :ivar message: """ def __init__( @@ -47,6 +47,7 @@ def __init__( ): super().__init__(version) + self.message: Optional[str] = payload.get("message") self.source: Optional[str] = payload.get("source") self.content: Optional[str] = payload.get("content") self.occurred_at: Optional[datetime] = deserialize.iso8601_datetime( @@ -60,7 +61,6 @@ def __init__( self.updated_at: Optional[datetime] = deserialize.iso8601_datetime( payload.get("updatedAt") ) - self.message: Optional[str] = payload.get("message") # Only set _solution if path params are provided (not None) if store_id is not None or profile_id is not None or summary_id is not None: @@ -580,7 +580,7 @@ def to_dict(self): class SummaryCore(object): """ - :ivar source: The source system that generated the summary. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :ivar source: The source system that generated the summary. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :ivar content: The main content of the summary. :ivar occurred_at: The timestamp when the summary was originally created. :ivar conversation_id: A unique identifier for the conversation using Twilio Type ID (TTID) format. @@ -603,7 +603,7 @@ def to_dict(self): class SummaryCorePatch(object): """ - :ivar source: The source system that generated the summary. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :ivar source: The source system that generated the summary. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :ivar content: The main content of the summary. :ivar occurred_at: The timestamp when the summary was originally created. If not provided, defaults to the time the summary was received. :ivar conversation_id: A unique identifier for the conversation using Twilio Type ID (TTID) format. diff --git a/twilio/rest/memory/v1/observation.py b/twilio/rest/memory/v1/observation.py index c24f89897..c4e1473f5 100644 --- a/twilio/rest/memory/v1/observation.py +++ b/twilio/rest/memory/v1/observation.py @@ -30,7 +30,7 @@ class ObservationInstance(InstanceResource): :ivar message: :ivar content: The main content of the observation. :ivar occurred_at: The timestamp when the observation originally occurred. - :ivar source: The source system that generated this observation. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :ivar source: The source system that generated this observation. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :ivar conversation_ids: Array of conversation IDs associated with this observation. :ivar id: A unique identifier for the observation using Twilio Type ID (TTID) format. :ivar created_at: The timestamp when the observation was created. @@ -578,7 +578,7 @@ class ObservationBase(object): """ :ivar content: The main content of the observation. :ivar occurred_at: The timestamp when the observation originally occurred. - :ivar source: The source system that generated this observation. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :ivar source: The source system that generated this observation. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :ivar conversation_ids: Array of conversation IDs associated with this observation. """ @@ -601,7 +601,7 @@ class ObservationCreateRequest(object): """ :ivar content: The main content of the observation. :ivar occurred_at: The timestamp when the observation originally occurred. - :ivar source: The source system that generated this observation. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :ivar source: The source system that generated this observation. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :ivar conversation_ids: Array of conversation IDs associated with this observation. """ @@ -830,7 +830,7 @@ def stream( :param str page_token: The token for the page of results to retrieve. :param str order_by: Either 'ASC' or 'DESC' to sort results ascending or descending respectively. - :param str source: Filter by source. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :param str source: Filter by source. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :param datetime created_after: Filter observations created after this timestamp (inclusive). :param datetime created_before: Filter observations created before this timestamp (exclusive). :param str conversation_id: Filter by conversation ID. Returns only items associated with the specified conversation. @@ -878,7 +878,7 @@ async def stream_async( :param str page_token: The token for the page of results to retrieve. :param str order_by: Either 'ASC' or 'DESC' to sort results ascending or descending respectively. - :param str source: Filter by source. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :param str source: Filter by source. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :param datetime created_after: Filter observations created after this timestamp (inclusive). :param datetime created_before: Filter observations created before this timestamp (exclusive). :param str conversation_id: Filter by conversation ID. Returns only items associated with the specified conversation. @@ -924,7 +924,7 @@ def stream_with_http_info( :param str page_token: The token for the page of results to retrieve. :param str order_by: Either 'ASC' or 'DESC' to sort results ascending or descending respectively. - :param str source: Filter by source. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :param str source: Filter by source. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :param datetime created_after: Filter observations created after this timestamp (inclusive). :param datetime created_before: Filter observations created before this timestamp (exclusive). :param str conversation_id: Filter by conversation ID. Returns only items associated with the specified conversation. @@ -971,7 +971,7 @@ async def stream_with_http_info_async( :param str page_token: The token for the page of results to retrieve. :param str order_by: Either 'ASC' or 'DESC' to sort results ascending or descending respectively. - :param str source: Filter by source. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :param str source: Filter by source. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :param datetime created_after: Filter observations created after this timestamp (inclusive). :param datetime created_before: Filter observations created before this timestamp (exclusive). :param str conversation_id: Filter by conversation ID. Returns only items associated with the specified conversation. @@ -1019,7 +1019,7 @@ def list( :param str page_token: The token for the page of results to retrieve. :param str order_by: Either 'ASC' or 'DESC' to sort results ascending or descending respectively. - :param str source: Filter by source. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :param str source: Filter by source. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :param datetime created_after: Filter observations created after this timestamp (inclusive). :param datetime created_before: Filter observations created before this timestamp (exclusive). :param str conversation_id: Filter by conversation ID. Returns only items associated with the specified conversation. @@ -1067,7 +1067,7 @@ async def list_async( :param str page_token: The token for the page of results to retrieve. :param str order_by: Either 'ASC' or 'DESC' to sort results ascending or descending respectively. - :param str source: Filter by source. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :param str source: Filter by source. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :param datetime created_after: Filter observations created after this timestamp (inclusive). :param datetime created_before: Filter observations created before this timestamp (exclusive). :param str conversation_id: Filter by conversation ID. Returns only items associated with the specified conversation. @@ -1115,7 +1115,7 @@ def list_with_http_info( :param str page_token: The token for the page of results to retrieve. :param str order_by: Either 'ASC' or 'DESC' to sort results ascending or descending respectively. - :param str source: Filter by source. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :param str source: Filter by source. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :param datetime created_after: Filter observations created after this timestamp (inclusive). :param datetime created_before: Filter observations created before this timestamp (exclusive). :param str conversation_id: Filter by conversation ID. Returns only items associated with the specified conversation. @@ -1161,7 +1161,7 @@ async def list_with_http_info_async( :param str page_token: The token for the page of results to retrieve. :param str order_by: Either 'ASC' or 'DESC' to sort results ascending or descending respectively. - :param str source: Filter by source. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :param str source: Filter by source. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :param datetime created_after: Filter observations created after this timestamp (inclusive). :param datetime created_before: Filter observations created before this timestamp (exclusive). :param str conversation_id: Filter by conversation ID. Returns only items associated with the specified conversation. @@ -1207,7 +1207,7 @@ def page( :param page_size: The maximum number of items to return per page, maximum of 1000. :param page_token: The token for the page of results to retrieve. :param order_by: Either 'ASC' or 'DESC' to sort results ascending or descending respectively. - :param source: Filter by source. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :param source: Filter by source. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :param created_after: Filter observations created after this timestamp (inclusive). :param created_before: Filter observations created before this timestamp (exclusive). :param conversation_id: Filter by conversation ID. Returns only items associated with the specified conversation. @@ -1261,7 +1261,7 @@ async def page_async( :param page_size: The maximum number of items to return per page, maximum of 1000. :param page_token: The token for the page of results to retrieve. :param order_by: Either 'ASC' or 'DESC' to sort results ascending or descending respectively. - :param source: Filter by source. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :param source: Filter by source. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :param created_after: Filter observations created after this timestamp (inclusive). :param created_before: Filter observations created before this timestamp (exclusive). :param conversation_id: Filter by conversation ID. Returns only items associated with the specified conversation. @@ -1315,7 +1315,7 @@ def page_with_http_info( :param page_token: The token for the page of results to retrieve. :param order_by: Either 'ASC' or 'DESC' to sort results ascending or descending respectively. - :param source: Filter by source. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :param source: Filter by source. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :param created_after: Filter observations created after this timestamp (inclusive). :param created_before: Filter observations created before this timestamp (exclusive). :param conversation_id: Filter by conversation ID. Returns only items associated with the specified conversation. @@ -1376,7 +1376,7 @@ async def page_with_http_info_async( :param page_token: The token for the page of results to retrieve. :param order_by: Either 'ASC' or 'DESC' to sort results ascending or descending respectively. - :param source: Filter by source. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :param source: Filter by source. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :param created_after: Filter observations created after this timestamp (inclusive). :param created_before: Filter observations created before this timestamp (exclusive). :param conversation_id: Filter by conversation ID. Returns only items associated with the specified conversation. diff --git a/twilio/rest/memory/v1/revision.py b/twilio/rest/memory/v1/revision.py index 34684c408..5f9a41745 100644 --- a/twilio/rest/memory/v1/revision.py +++ b/twilio/rest/memory/v1/revision.py @@ -29,7 +29,7 @@ class RevisionInstance(InstanceResource): """ :ivar content: The main content of the observation. :ivar occurred_at: The timestamp when the observation originally occurred. - :ivar source: The source system that generated this observation. Allows letters, numbers, spaces, and URL-safe symbols. Excludes URL-unsafe characters like quotes, angle brackets, and control characters. + :ivar source: The source system that generated this observation. Allows letters, numbers, spaces, periods, underscores, hyphens, and forward slashes. :ivar conversation_ids: Array of conversation IDs associated with this observation. :ivar id: A unique identifier for the observation using Twilio Type ID (TTID) format. :ivar created_at: The timestamp when the observation was created. diff --git a/twilio/rest/messaging/v2/channels_sender.py b/twilio/rest/messaging/v2/channels_sender.py index 23462b7d0..88b7b6a35 100644 --- a/twilio/rest/messaging/v2/channels_sender.py +++ b/twilio/rest/messaging/v2/channels_sender.py @@ -12,8 +12,9 @@ Do not edit the class manually. """ +from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import deserialize, values from twilio.base.api_response import ApiResponse from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -54,7 +55,7 @@ def to_dict(self): class MessagingV2ChannelsSenderProfile(object): """ - :ivar name: The name of the sender. Required for WhatsApp senders and must follow [Meta's display name guidelines](https://www.facebook.com/business/help/757569725593362). + :ivar name: The name of the sender. Required for WhatsApp senders and must follow [Meta's display name guidelines](https://www.facebook.com/business/help/757569725593362). On update, a WhatsApp sender's name is not changed synchronously: it is submitted to Meta for review, and `profile.name` continues to report the current active name until Meta approves the new one and the sender is automatically re-registered. Track progress with `pending_display_name_status` on Fetch Sender, and see `display_name_status` on the update response for the immediate outcome. Re-submitting the same name is how you retry applying a name Meta has already approved, for example after correcting the sender's two-step verification PIN. Meta permits a limited number of display name changes per 30-day period. :ivar about: The profile about text for the sender. :ivar address: The address of the sender. :ivar description: The description of the sender. @@ -388,10 +389,14 @@ class MessagingV2RcsCountryStatus(object): :ivar configuration: :ivar webhook: :ivar profile: + :ivar pending_display_name: WhatsApp only. The display name the most recent change applies to — awaiting Meta review, approved by Meta and awaiting re-registration, or, once `pending_display_name_status` is `COMPLETED`, the name now in effect (identical to `name`). Absent when no display name change has been made, and once a completed change stops being reported. + :ivar pending_display_name_status: WhatsApp only. The status of the most recent display name change. `PENDING_REVIEW`, `APPROVED` and `DECLINED` are reported by Meta. `PIN_MISMATCH` and `REGISTRATION_FAILED` mean Meta approved the name but it could not be applied; `EXPIRED` means Meta's 14-day window to apply an approved name elapsed. In all three cases, re-submit the same `profile.name` to retry. `COMPLETED` means the name was approved and applied — `name` now returns it. A `COMPLETED` change is reported for 14 days after it completes and is absent afterwards, so treat its presence as \"recently completed\" rather than a permanent flag; use `pending_display_name_status_date` to tell how recent. Absent when no display name change has been made. + :ivar pending_display_name_status_date: WhatsApp only. The date and time in UTC when `pending_display_name_status` last changed, specified in ISO 8601 format. Absent whenever `pending_display_name_status` is absent, so the three `pending_display_name*` fields are always present or absent together. :ivar properties: :ivar offline_reasons: The reasons why the sender is offline. :ivar compliance: :ivar url: The URL of the resource. + :ivar display_name_status: WhatsApp only. The outcome of the display name operation in this request. Present only when the request included `profile.name`. `updating` — accepted; either submitted to Meta for review, or, when Meta had already approved this exact name, routed straight to re-registration. `no_change` — the name already matches the sender's active display name; nothing was submitted to Meta. `pending_review` — the same name is already under review at Meta; the existing request continues unchanged. `error` — the display name could not be processed, while other profile fields in the same request were still applied. Returned with a 202 and carries no error code or message. This covers every failure mode, including the case where Meta accepted the name but tracking could not be started — poll `pending_display_name_status` to establish the real state rather than assuming the name was rejected. When `profile.name` is the only field in the request, the failure is returned as an error response with a specific code instead of this status. """ def __init__( @@ -406,10 +411,20 @@ def __init__( self.configuration: Optional[str] = payload.get("configuration") self.webhook: Optional[str] = payload.get("webhook") self.profile: Optional[str] = payload.get("profile") + self.pending_display_name: Optional[str] = payload.get("pending_display_name") + self.pending_display_name_status: Optional[str] = payload.get( + "pending_display_name_status" + ) + self.pending_display_name_status_date: Optional[datetime] = ( + deserialize.iso8601_datetime( + payload.get("pending_display_name_status_date") + ) + ) self.properties: Optional[str] = payload.get("properties") self.offline_reasons: Optional[List[str]] = payload.get("offline_reasons") self.compliance: Optional[str] = payload.get("compliance") self.url: Optional[str] = payload.get("url") + self.display_name_status: Optional[str] = payload.get("display_name_status") self._solution = { "sid": sid or self.sid, @@ -614,7 +629,7 @@ def to_dict(self): class MessagingV2ChannelsSenderProfile(object): """ - :ivar name: The name of the sender. Required for WhatsApp senders and must follow [Meta's display name guidelines](https://www.facebook.com/business/help/757569725593362). + :ivar name: The name of the sender. Required for WhatsApp senders and must follow [Meta's display name guidelines](https://www.facebook.com/business/help/757569725593362). On update, a WhatsApp sender's name is not changed synchronously: it is submitted to Meta for review, and `profile.name` continues to report the current active name until Meta approves the new one and the sender is automatically re-registered. Track progress with `pending_display_name_status` on Fetch Sender, and see `display_name_status` on the update response for the immediate outcome. Re-submitting the same name is how you retry applying a name Meta has already approved, for example after correcting the sender's two-step verification PIN. Meta permits a limited number of display name changes per 30-day period. :ivar about: The profile about text for the sender. :ivar address: The address of the sender. :ivar description: The description of the sender. @@ -1276,7 +1291,7 @@ def to_dict(self): class MessagingV2ChannelsSenderProfile(object): """ - :ivar name: The name of the sender. Required for WhatsApp senders and must follow [Meta's display name guidelines](https://www.facebook.com/business/help/757569725593362). + :ivar name: The name of the sender. Required for WhatsApp senders and must follow [Meta's display name guidelines](https://www.facebook.com/business/help/757569725593362). On update, a WhatsApp sender's name is not changed synchronously: it is submitted to Meta for review, and `profile.name` continues to report the current active name until Meta approves the new one and the sender is automatically re-registered. Track progress with `pending_display_name_status` on Fetch Sender, and see `display_name_status` on the update response for the immediate outcome. Re-submitting the same name is how you retry applying a name Meta has already approved, for example after correcting the sender's two-step verification PIN. Meta permits a limited number of display name changes per 30-day period. :ivar about: The profile about text for the sender. :ivar address: The address of the sender. :ivar description: The description of the sender. diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 59dd3d522..2ca3e1151 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -37,7 +37,6 @@ from twilio.rest.numbers.v1.sms_verification import SmsVerificationList from twilio.rest.numbers.v1.sms_verification_check import SmsVerificationCheckList from twilio.rest.numbers.v1.voice_verification import VoiceVerificationList -from twilio.rest.numbers.v1.voice_verification_check import VoiceVerificationCheckList from twilio.rest.numbers.v1.webhook import WebhookList @@ -71,7 +70,6 @@ def __init__(self, domain: Domain): self._sms_verifications: Optional[SmsVerificationList] = None self._sms_verification_checks: Optional[SmsVerificationCheckList] = None self._voice_verifications: Optional[VoiceVerificationList] = None - self._voice_verification_checks: Optional[VoiceVerificationCheckList] = None self._webhook: Optional[WebhookList] = None @property @@ -170,12 +168,6 @@ def voice_verifications(self) -> VoiceVerificationList: self._voice_verifications = VoiceVerificationList(self) return self._voice_verifications - @property - def voice_verification_checks(self) -> VoiceVerificationCheckList: - if self._voice_verification_checks is None: - self._voice_verification_checks = VoiceVerificationCheckList(self) - return self._voice_verification_checks - @property def webhook(self) -> WebhookList: if self._webhook is None: diff --git a/twilio/rest/numbers/v1/sms_verification.py b/twilio/rest/numbers/v1/sms_verification.py index 71d0d2215..d673b039c 100644 --- a/twilio/rest/numbers/v1/sms_verification.py +++ b/twilio/rest/numbers/v1/sms_verification.py @@ -22,6 +22,27 @@ class SmsVerificationInstance(InstanceResource): + + class NumbersV1SmsVerificationRequest(object): + """ + :ivar to: The phone number to verify in E.164 format. + :ivar locale: The locale for the verification SMS message. + :ivar friendly_name: A human-readable name for the caller ID. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.to: Optional[str] = payload.get("to") + self.locale: Optional[str] = payload.get("locale") + self.friendly_name: Optional[str] = payload.get("friendly_name") + + def to_dict(self): + return { + "to": self.to, + "locale": self.locale, + "friendly_name": self.friendly_name, + } + """ :ivar to: The phone number being verified in E.164 format. :ivar verification_sid: The unique SID of this verification resource. @@ -47,6 +68,26 @@ def __repr__(self) -> str: class SmsVerificationList(ListResource): + class NumbersV1SmsVerificationRequest(object): + """ + :ivar to: The phone number to verify in E.164 format. + :ivar locale: The locale for the verification SMS message. + :ivar friendly_name: A human-readable name for the caller ID. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.to: Optional[str] = payload.get("to") + self.locale: Optional[str] = payload.get("locale") + self.friendly_name: Optional[str] = payload.get("friendly_name") + + def to_dict(self): + return { + "to": self.to, + "locale": self.locale, + "friendly_name": self.friendly_name, + } + def __init__(self, version: Version): """ Initialize the SmsVerificationList @@ -58,77 +99,107 @@ def __init__(self, version: Version): self._uri = "/CallerIds/SmsVerifications" - def _create(self) -> tuple: + def _create( + self, numbers_v1_sms_verification_request: NumbersV1SmsVerificationRequest + ) -> tuple: """ Internal helper for create operation Returns: tuple: (payload, status_code, headers) """ + data = numbers_v1_sms_verification_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" return self._version.create_with_response_info( - method="POST", uri=self._uri, headers=headers + method="POST", uri=self._uri, data=data, headers=headers ) - def create(self) -> SmsVerificationInstance: + def create( + self, numbers_v1_sms_verification_request: NumbersV1SmsVerificationRequest + ) -> SmsVerificationInstance: """ Create the SmsVerificationInstance + :param numbers_v1_sms_verification_request: :returns: The created SmsVerificationInstance """ - payload, _, _ = self._create() + payload, _, _ = self._create( + numbers_v1_sms_verification_request=numbers_v1_sms_verification_request + ) return SmsVerificationInstance(self._version, payload) - def create_with_http_info(self) -> ApiResponse: + def create_with_http_info( + self, numbers_v1_sms_verification_request: NumbersV1SmsVerificationRequest + ) -> ApiResponse: """ Create the SmsVerificationInstance and return response metadata + :param numbers_v1_sms_verification_request: :returns: ApiResponse with instance, status code, and headers """ - payload, status_code, headers = self._create() + payload, status_code, headers = self._create( + numbers_v1_sms_verification_request=numbers_v1_sms_verification_request + ) instance = SmsVerificationInstance(self._version, payload) return ApiResponse(data=instance, status_code=status_code, headers=headers) - async def _create_async(self) -> tuple: + async def _create_async( + self, numbers_v1_sms_verification_request: NumbersV1SmsVerificationRequest + ) -> tuple: """ Internal async helper for create operation Returns: tuple: (payload, status_code, headers) """ + data = numbers_v1_sms_verification_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" return await self._version.create_with_response_info_async( - method="POST", uri=self._uri, headers=headers + method="POST", uri=self._uri, data=data, headers=headers ) - async def create_async(self) -> SmsVerificationInstance: + async def create_async( + self, numbers_v1_sms_verification_request: NumbersV1SmsVerificationRequest + ) -> SmsVerificationInstance: """ Asynchronously create the SmsVerificationInstance + :param numbers_v1_sms_verification_request: :returns: The created SmsVerificationInstance """ - payload, _, _ = await self._create_async() + payload, _, _ = await self._create_async( + numbers_v1_sms_verification_request=numbers_v1_sms_verification_request + ) return SmsVerificationInstance(self._version, payload) - async def create_with_http_info_async(self) -> ApiResponse: + async def create_with_http_info_async( + self, numbers_v1_sms_verification_request: NumbersV1SmsVerificationRequest + ) -> ApiResponse: """ Asynchronously create the SmsVerificationInstance and return response metadata + :param numbers_v1_sms_verification_request: :returns: ApiResponse with instance, status code, and headers """ - payload, status_code, headers = await self._create_async() + payload, status_code, headers = await self._create_async( + numbers_v1_sms_verification_request=numbers_v1_sms_verification_request + ) instance = SmsVerificationInstance(self._version, payload) return ApiResponse(data=instance, status_code=status_code, headers=headers) diff --git a/twilio/rest/numbers/v1/sms_verification_check.py b/twilio/rest/numbers/v1/sms_verification_check.py index f57035319..1bba87b5f 100644 --- a/twilio/rest/numbers/v1/sms_verification_check.py +++ b/twilio/rest/numbers/v1/sms_verification_check.py @@ -22,6 +22,27 @@ class SmsVerificationCheckInstance(InstanceResource): + + class NumbersV1SmsVerificationCheckRequest(object): + """ + :ivar to: The phone number being verified in E.164 format. + :ivar verification_code: The 6 character verification code to check. + :ivar friendly_name: A human-readable name for the caller ID. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.to: Optional[str] = payload.get("to") + self.verification_code: Optional[str] = payload.get("verification_code") + self.friendly_name: Optional[str] = payload.get("friendly_name") + + def to_dict(self): + return { + "to": self.to, + "verification_code": self.verification_code, + "friendly_name": self.friendly_name, + } + """ :ivar to: The phone number that was verified in E.164 format. :ivar verification_sid: The unique SID of this verification resource. @@ -49,6 +70,26 @@ def __repr__(self) -> str: class SmsVerificationCheckList(ListResource): + class NumbersV1SmsVerificationCheckRequest(object): + """ + :ivar to: The phone number being verified in E.164 format. + :ivar verification_code: The 6 character verification code to check. + :ivar friendly_name: A human-readable name for the caller ID. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.to: Optional[str] = payload.get("to") + self.verification_code: Optional[str] = payload.get("verification_code") + self.friendly_name: Optional[str] = payload.get("friendly_name") + + def to_dict(self): + return { + "to": self.to, + "verification_code": self.verification_code, + "friendly_name": self.friendly_name, + } + def __init__(self, version: Version): """ Initialize the SmsVerificationCheckList @@ -60,77 +101,113 @@ def __init__(self, version: Version): self._uri = "/CallerIds/SmsVerificationChecks" - def _create(self) -> tuple: + def _create( + self, + numbers_v1_sms_verification_check_request: NumbersV1SmsVerificationCheckRequest, + ) -> tuple: """ Internal helper for create operation Returns: tuple: (payload, status_code, headers) """ + data = numbers_v1_sms_verification_check_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" return self._version.create_with_response_info( - method="POST", uri=self._uri, headers=headers + method="POST", uri=self._uri, data=data, headers=headers ) - def create(self) -> SmsVerificationCheckInstance: + def create( + self, + numbers_v1_sms_verification_check_request: NumbersV1SmsVerificationCheckRequest, + ) -> SmsVerificationCheckInstance: """ Create the SmsVerificationCheckInstance + :param numbers_v1_sms_verification_check_request: :returns: The created SmsVerificationCheckInstance """ - payload, _, _ = self._create() + payload, _, _ = self._create( + numbers_v1_sms_verification_check_request=numbers_v1_sms_verification_check_request + ) return SmsVerificationCheckInstance(self._version, payload) - def create_with_http_info(self) -> ApiResponse: + def create_with_http_info( + self, + numbers_v1_sms_verification_check_request: NumbersV1SmsVerificationCheckRequest, + ) -> ApiResponse: """ Create the SmsVerificationCheckInstance and return response metadata + :param numbers_v1_sms_verification_check_request: :returns: ApiResponse with instance, status code, and headers """ - payload, status_code, headers = self._create() + payload, status_code, headers = self._create( + numbers_v1_sms_verification_check_request=numbers_v1_sms_verification_check_request + ) instance = SmsVerificationCheckInstance(self._version, payload) return ApiResponse(data=instance, status_code=status_code, headers=headers) - async def _create_async(self) -> tuple: + async def _create_async( + self, + numbers_v1_sms_verification_check_request: NumbersV1SmsVerificationCheckRequest, + ) -> tuple: """ Internal async helper for create operation Returns: tuple: (payload, status_code, headers) """ + data = numbers_v1_sms_verification_check_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" return await self._version.create_with_response_info_async( - method="POST", uri=self._uri, headers=headers + method="POST", uri=self._uri, data=data, headers=headers ) - async def create_async(self) -> SmsVerificationCheckInstance: + async def create_async( + self, + numbers_v1_sms_verification_check_request: NumbersV1SmsVerificationCheckRequest, + ) -> SmsVerificationCheckInstance: """ Asynchronously create the SmsVerificationCheckInstance + :param numbers_v1_sms_verification_check_request: :returns: The created SmsVerificationCheckInstance """ - payload, _, _ = await self._create_async() + payload, _, _ = await self._create_async( + numbers_v1_sms_verification_check_request=numbers_v1_sms_verification_check_request + ) return SmsVerificationCheckInstance(self._version, payload) - async def create_with_http_info_async(self) -> ApiResponse: + async def create_with_http_info_async( + self, + numbers_v1_sms_verification_check_request: NumbersV1SmsVerificationCheckRequest, + ) -> ApiResponse: """ Asynchronously create the SmsVerificationCheckInstance and return response metadata + :param numbers_v1_sms_verification_check_request: :returns: ApiResponse with instance, status code, and headers """ - payload, status_code, headers = await self._create_async() + payload, status_code, headers = await self._create_async( + numbers_v1_sms_verification_check_request=numbers_v1_sms_verification_check_request + ) instance = SmsVerificationCheckInstance(self._version, payload) return ApiResponse(data=instance, status_code=status_code, headers=headers) diff --git a/twilio/rest/numbers/v1/voice_verification.py b/twilio/rest/numbers/v1/voice_verification.py index 5e41647d7..e4c3b2fcb 100644 --- a/twilio/rest/numbers/v1/voice_verification.py +++ b/twilio/rest/numbers/v1/voice_verification.py @@ -22,6 +22,46 @@ class VoiceVerificationInstance(InstanceResource): + + class NumbersV1VoiceVerificationRequest(object): + """ + :ivar phone_number: The phone number to verify in E.164 format. + :ivar friendly_name: A human-readable name for the caller ID. + :ivar custom_code: A custom verification code to use instead of a generated one. + :ivar call_delay: Number of seconds to delay the verification call (0-60). + :ivar status_callback: URL to receive status callback events. + :ivar status_callback_method: HTTP method for status callback requests. + :ivar extension: Phone extension to dial after connecting. + :ivar custom_success_message: Custom message to play after successful verification. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.phone_number: Optional[str] = payload.get("phone_number") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.custom_code: Optional[str] = payload.get("custom_code") + self.call_delay: Optional[str] = payload.get("call_delay") + self.status_callback: Optional[str] = payload.get("status_callback") + self.status_callback_method: Optional[str] = payload.get( + "status_callback_method" + ) + self.extension: Optional[str] = payload.get("extension") + self.custom_success_message: Optional[str] = payload.get( + "custom_success_message" + ) + + def to_dict(self): + return { + "phone_number": self.phone_number, + "friendly_name": self.friendly_name, + "custom_code": self.custom_code, + "call_delay": self.call_delay, + "status_callback": self.status_callback, + "status_callback_method": self.status_callback_method, + "extension": self.extension, + "custom_success_message": self.custom_success_message, + } + """ :ivar account_sid: The Account SID that owns this verification. :ivar phone_number: The phone number being verified in E.164 format. @@ -51,6 +91,45 @@ def __repr__(self) -> str: class VoiceVerificationList(ListResource): + class NumbersV1VoiceVerificationRequest(object): + """ + :ivar phone_number: The phone number to verify in E.164 format. + :ivar friendly_name: A human-readable name for the caller ID. + :ivar custom_code: A custom verification code to use instead of a generated one. + :ivar call_delay: Number of seconds to delay the verification call (0-60). + :ivar status_callback: URL to receive status callback events. + :ivar status_callback_method: HTTP method for status callback requests. + :ivar extension: Phone extension to dial after connecting. + :ivar custom_success_message: Custom message to play after successful verification. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.phone_number: Optional[str] = payload.get("phone_number") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.custom_code: Optional[str] = payload.get("custom_code") + self.call_delay: Optional[str] = payload.get("call_delay") + self.status_callback: Optional[str] = payload.get("status_callback") + self.status_callback_method: Optional[str] = payload.get( + "status_callback_method" + ) + self.extension: Optional[str] = payload.get("extension") + self.custom_success_message: Optional[str] = payload.get( + "custom_success_message" + ) + + def to_dict(self): + return { + "phone_number": self.phone_number, + "friendly_name": self.friendly_name, + "custom_code": self.custom_code, + "call_delay": self.call_delay, + "status_callback": self.status_callback, + "status_callback_method": self.status_callback_method, + "extension": self.extension, + "custom_success_message": self.custom_success_message, + } + def __init__(self, version: Version): """ Initialize the VoiceVerificationList @@ -62,77 +141,107 @@ def __init__(self, version: Version): self._uri = "/CallerIds/VoiceVerifications" - def _create(self) -> tuple: + def _create( + self, numbers_v1_voice_verification_request: NumbersV1VoiceVerificationRequest + ) -> tuple: """ Internal helper for create operation Returns: tuple: (payload, status_code, headers) """ + data = numbers_v1_voice_verification_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" return self._version.create_with_response_info( - method="POST", uri=self._uri, headers=headers + method="POST", uri=self._uri, data=data, headers=headers ) - def create(self) -> VoiceVerificationInstance: + def create( + self, numbers_v1_voice_verification_request: NumbersV1VoiceVerificationRequest + ) -> VoiceVerificationInstance: """ Create the VoiceVerificationInstance + :param numbers_v1_voice_verification_request: :returns: The created VoiceVerificationInstance """ - payload, _, _ = self._create() + payload, _, _ = self._create( + numbers_v1_voice_verification_request=numbers_v1_voice_verification_request + ) return VoiceVerificationInstance(self._version, payload) - def create_with_http_info(self) -> ApiResponse: + def create_with_http_info( + self, numbers_v1_voice_verification_request: NumbersV1VoiceVerificationRequest + ) -> ApiResponse: """ Create the VoiceVerificationInstance and return response metadata + :param numbers_v1_voice_verification_request: :returns: ApiResponse with instance, status code, and headers """ - payload, status_code, headers = self._create() + payload, status_code, headers = self._create( + numbers_v1_voice_verification_request=numbers_v1_voice_verification_request + ) instance = VoiceVerificationInstance(self._version, payload) return ApiResponse(data=instance, status_code=status_code, headers=headers) - async def _create_async(self) -> tuple: + async def _create_async( + self, numbers_v1_voice_verification_request: NumbersV1VoiceVerificationRequest + ) -> tuple: """ Internal async helper for create operation Returns: tuple: (payload, status_code, headers) """ + data = numbers_v1_voice_verification_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" return await self._version.create_with_response_info_async( - method="POST", uri=self._uri, headers=headers + method="POST", uri=self._uri, data=data, headers=headers ) - async def create_async(self) -> VoiceVerificationInstance: + async def create_async( + self, numbers_v1_voice_verification_request: NumbersV1VoiceVerificationRequest + ) -> VoiceVerificationInstance: """ Asynchronously create the VoiceVerificationInstance + :param numbers_v1_voice_verification_request: :returns: The created VoiceVerificationInstance """ - payload, _, _ = await self._create_async() + payload, _, _ = await self._create_async( + numbers_v1_voice_verification_request=numbers_v1_voice_verification_request + ) return VoiceVerificationInstance(self._version, payload) - async def create_with_http_info_async(self) -> ApiResponse: + async def create_with_http_info_async( + self, numbers_v1_voice_verification_request: NumbersV1VoiceVerificationRequest + ) -> ApiResponse: """ Asynchronously create the VoiceVerificationInstance and return response metadata + :param numbers_v1_voice_verification_request: :returns: ApiResponse with instance, status code, and headers """ - payload, status_code, headers = await self._create_async() + payload, status_code, headers = await self._create_async( + numbers_v1_voice_verification_request=numbers_v1_voice_verification_request + ) instance = VoiceVerificationInstance(self._version, payload) return ApiResponse(data=instance, status_code=status_code, headers=headers) diff --git a/twilio/rest/numbers/v1/voice_verification_check.py b/twilio/rest/numbers/v1/voice_verification_check.py deleted file mode 100644 index 28d201e55..000000000 --- a/twilio/rest/numbers/v1/voice_verification_check.py +++ /dev/null @@ -1,139 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Numbers - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, Optional -from twilio.base import values -from twilio.base.api_response import ApiResponse - -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class VoiceVerificationCheckInstance(InstanceResource): - """ - :ivar to: The phone number that was verified in E.164 format. - :ivar caller_id_sid: The Caller ID SID created upon successful verification. - """ - - def __init__(self, version: Version, payload: Dict[str, Any]): - super().__init__(version) - - self.to: Optional[str] = payload.get("to") - self.caller_id_sid: Optional[str] = payload.get("callerIdSid") - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - - return "" - - -class VoiceVerificationCheckList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the VoiceVerificationCheckList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/CallerIds/VoiceVerificationChecks" - - def _create(self) -> tuple: - """ - Internal helper for create operation - - Returns: - tuple: (payload, status_code, headers) - """ - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - return self._version.create_with_response_info( - method="POST", uri=self._uri, headers=headers - ) - - def create(self) -> VoiceVerificationCheckInstance: - """ - Create the VoiceVerificationCheckInstance - - - :returns: The created VoiceVerificationCheckInstance - """ - payload, _, _ = self._create() - return VoiceVerificationCheckInstance(self._version, payload) - - def create_with_http_info(self) -> ApiResponse: - """ - Create the VoiceVerificationCheckInstance and return response metadata - - - :returns: ApiResponse with instance, status code, and headers - """ - payload, status_code, headers = self._create() - instance = VoiceVerificationCheckInstance(self._version, payload) - return ApiResponse(data=instance, status_code=status_code, headers=headers) - - async def _create_async(self) -> tuple: - """ - Internal async helper for create operation - - Returns: - tuple: (payload, status_code, headers) - """ - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - return await self._version.create_with_response_info_async( - method="POST", uri=self._uri, headers=headers - ) - - async def create_async(self) -> VoiceVerificationCheckInstance: - """ - Asynchronously create the VoiceVerificationCheckInstance - - - :returns: The created VoiceVerificationCheckInstance - """ - payload, _, _ = await self._create_async() - return VoiceVerificationCheckInstance(self._version, payload) - - async def create_with_http_info_async(self) -> ApiResponse: - """ - Asynchronously create the VoiceVerificationCheckInstance and return response metadata - - - :returns: ApiResponse with instance, status code, and headers - """ - payload, status_code, headers = await self._create_async() - instance = VoiceVerificationCheckInstance(self._version, payload) - return ApiResponse(data=instance, status_code=status_code, headers=headers) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py index 27ff55c37..cd868149d 100644 --- a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py +++ b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py @@ -89,6 +89,42 @@ def _proxy(self) -> "AuthorizationDocumentContext": ) return self._context + def delete(self) -> bool: + """ + Deletes the AuthorizationDocumentInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the AuthorizationDocumentInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def delete_with_http_info(self) -> ApiResponse: + """ + Deletes the AuthorizationDocumentInstance with HTTP info + + + :returns: ApiResponse with success boolean, status code, and headers + """ + return self._proxy.delete_with_http_info() + + async def delete_with_http_info_async(self) -> ApiResponse: + """ + Asynchronous coroutine that deletes the AuthorizationDocumentInstance with HTTP info + + + :returns: ApiResponse with success boolean, status code, and headers + """ + return await self._proxy.delete_with_http_info_async() + def fetch(self) -> "AuthorizationDocumentInstance": """ Fetch the AuthorizationDocumentInstance @@ -297,6 +333,74 @@ def __init__(self, version: Version, sid: str): DependentHostedNumberOrderList ] = None + def _delete(self) -> tuple: + """ + Internal helper for delete operation + + Returns: + tuple: (success_boolean, status_code, headers) + """ + + headers = values.of({}) + + return self._version.delete_with_response_info( + method="DELETE", uri=self._uri, headers=headers + ) + + def delete(self) -> bool: + """ + Deletes the AuthorizationDocumentInstance + + + :returns: True if delete succeeds, False otherwise + """ + success, _, _ = self._delete() + return success + + def delete_with_http_info(self) -> ApiResponse: + """ + Deletes the AuthorizationDocumentInstance and return response metadata + + + :returns: ApiResponse with success boolean, status code, and headers + """ + success, status_code, headers = self._delete() + return ApiResponse(data=success, status_code=status_code, headers=headers) + + async def _delete_async(self) -> tuple: + """ + Internal async helper for delete operation + + Returns: + tuple: (success_boolean, status_code, headers) + """ + + headers = values.of({}) + + return await self._version.delete_with_response_info_async( + method="DELETE", uri=self._uri, headers=headers + ) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the AuthorizationDocumentInstance + + + :returns: True if delete succeeds, False otherwise + """ + success, _, _ = await self._delete_async() + return success + + async def delete_with_http_info_async(self) -> ApiResponse: + """ + Asynchronous coroutine that deletes the AuthorizationDocumentInstance and return response metadata + + + :returns: ApiResponse with success boolean, status code, and headers + """ + success, status_code, headers = await self._delete_async() + return ApiResponse(data=success, status_code=status_code, headers=headers) + def _fetch(self) -> tuple: """ Internal helper for fetch operation diff --git a/twilio/rest/routes/v3/__init__.py b/twilio/rest/routes/v3/__init__.py index 07d47c0f6..e4458c94b 100644 --- a/twilio/rest/routes/v3/__init__.py +++ b/twilio/rest/routes/v3/__init__.py @@ -15,6 +15,7 @@ from typing import Optional from twilio.base.version import Version from twilio.base.domain import Domain +from twilio.rest.routes.v3.iso_country_code import IsoCountryCodeList from twilio.rest.routes.v3.phone_number import PhoneNumberList @@ -29,6 +30,22 @@ def __init__(self, domain: Domain): super().__init__(domain, "v3") self._phone_numbers: Optional[PhoneNumberList] = None + def iso_country_code( + self, iso_country_code: str, short_code: str, iso_country_code_id: str = None + ): + """ + Access the IsoCountryCodeList resource + + :param iso_country_code: The ISO country code of the short code + + :param short_code: The short code + + :param iso_country_code_id: Optional instance ID to directly access IsoCountryCodeContext + :returns: IsoCountryCodeList instance if iso_country_code_id is None, otherwise IsoCountryCodeContext + """ + list_instance = IsoCountryCodeList(self) + return list_instance(iso_country_codeshort_code) + @property def phone_numbers(self) -> PhoneNumberList: if self._phone_numbers is None: diff --git a/twilio/rest/routes/v3/iso_country_code.py b/twilio/rest/routes/v3/iso_country_code.py new file mode 100644 index 000000000..7f6f770d2 --- /dev/null +++ b/twilio/rest/routes/v3/iso_country_code.py @@ -0,0 +1,518 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Routes + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from __future__ import annotations + +from datetime import datetime +from typing import Any, Dict, Optional, Union +from twilio.base import deserialize, values +from twilio.base.api_response import ApiResponse +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class IsoCountryCodeInstance(InstanceResource): + """ + :ivar iso_country_code: The ISO country code of the short code + :ivar short_code: The short code + :ivar url: The absolute URL of the resource. + :ivar account_sid: The unique SID identifier of the Account. + :ivar friendly_name: A human readable description of the Inbound Processing Region assignment for this short code, up to 64 characters. + :ivar messaging_region: The Inbound Processing Region used for this short code for messaging. + :ivar date_created: The date that this short code was assigned an Inbound Processing Region, given in ISO 8601 format. + :ivar date_updated: The date that the Inbound Processing Region was updated for this short code, given in ISO 8601 format. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + iso_country_code: Optional[str] = None, + short_code: Optional[str] = None, + ): + super().__init__(version) + + self.iso_country_code: Optional[str] = payload.get("isoCountryCode") + self.short_code: Optional[str] = payload.get("shortCode") + self.url: Optional[str] = payload.get("url") + self.account_sid: Optional[str] = payload.get("accountSid") + self.friendly_name: Optional[str] = payload.get("friendlyName") + self.messaging_region: Optional[str] = payload.get("messagingRegion") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("dateCreated") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("dateUpdated") + ) + + # Only set _solution if path params are provided (not None) + if iso_country_code is not None or short_code is not None: + self._solution = { + "iso_country_code": iso_country_code, + "short_code": short_code, + } + + self._context: Optional[IsoCountryCodeContext] = None + + @property + def _proxy(self) -> "IsoCountryCodeContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: IsoCountryCodeContext for this IsoCountryCodeInstance + """ + if self._context is None: + self._context = IsoCountryCodeContext( + self._version, + iso_country_code=self._solution["iso_country_code"], + short_code=self._solution["short_code"], + ) + return self._context + + def fetch(self) -> "IsoCountryCodeInstance": + """ + Fetch the IsoCountryCodeInstance + + + :returns: The fetched IsoCountryCodeInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "IsoCountryCodeInstance": + """ + Asynchronous coroutine to fetch the IsoCountryCodeInstance + + + :returns: The fetched IsoCountryCodeInstance + """ + return await self._proxy.fetch_async() + + def fetch_with_http_info(self) -> ApiResponse: + """ + Fetch the IsoCountryCodeInstance with HTTP info + + + :returns: ApiResponse with instance, status code, and headers + """ + return self._proxy.fetch_with_http_info() + + async def fetch_with_http_info_async(self) -> ApiResponse: + """ + Asynchronous coroutine to fetch the IsoCountryCodeInstance with HTTP info + + + :returns: ApiResponse with instance, status code, and headers + """ + return await self._proxy.fetch_with_http_info_async() + + def update( + self, + messaging_region: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + ) -> "IsoCountryCodeInstance": + """ + Update the IsoCountryCodeInstance + + :param messaging_region: The Processing Region used for this short code for messaging + :param friendly_name: A human readable description of this resource, up to 64 characters. + + :returns: The updated IsoCountryCodeInstance + """ + return self._proxy.update( + messaging_region=messaging_region, + friendly_name=friendly_name, + ) + + async def update_async( + self, + messaging_region: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + ) -> "IsoCountryCodeInstance": + """ + Asynchronous coroutine to update the IsoCountryCodeInstance + + :param messaging_region: The Processing Region used for this short code for messaging + :param friendly_name: A human readable description of this resource, up to 64 characters. + + :returns: The updated IsoCountryCodeInstance + """ + return await self._proxy.update_async( + messaging_region=messaging_region, + friendly_name=friendly_name, + ) + + def update_with_http_info( + self, + messaging_region: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + ) -> ApiResponse: + """ + Update the IsoCountryCodeInstance with HTTP info + + :param messaging_region: The Processing Region used for this short code for messaging + :param friendly_name: A human readable description of this resource, up to 64 characters. + + :returns: ApiResponse with instance, status code, and headers + """ + return self._proxy.update_with_http_info( + messaging_region=messaging_region, + friendly_name=friendly_name, + ) + + async def update_with_http_info_async( + self, + messaging_region: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + ) -> ApiResponse: + """ + Asynchronous coroutine to update the IsoCountryCodeInstance with HTTP info + + :param messaging_region: The Processing Region used for this short code for messaging + :param friendly_name: A human readable description of this resource, up to 64 characters. + + :returns: ApiResponse with instance, status code, and headers + """ + return await self._proxy.update_with_http_info_async( + messaging_region=messaging_region, + friendly_name=friendly_name, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class IsoCountryCodeContext(InstanceContext): + + def __init__(self, version: Version, iso_country_code: str, short_code: str): + """ + Initialize the IsoCountryCodeContext + + :param version: Version that contains the resource + :param iso_country_code: The ISO country code of the short code + :param short_code: The short code + """ + super().__init__(version) + + # Path Solution + self._solution = { + "iso_country_code": iso_country_code, + "short_code": short_code, + } + self._uri = "/ShortCodes/{iso_country_code}/{short_code}".format( + **self._solution + ) + + def _fetch(self) -> tuple: + """ + Internal helper for fetch operation + + Returns: + tuple: (payload, status_code, headers) + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + return self._version.fetch_with_response_info( + method="GET", uri=self._uri, headers=headers + ) + + def fetch(self) -> IsoCountryCodeInstance: + """ + Fetch the IsoCountryCodeInstance + + + :returns: The fetched IsoCountryCodeInstance + """ + payload, _, _ = self._fetch() + return IsoCountryCodeInstance( + self._version, + payload, + iso_country_code=self._solution["iso_country_code"], + short_code=self._solution["short_code"], + ) + + def fetch_with_http_info(self) -> ApiResponse: + """ + Fetch the IsoCountryCodeInstance and return response metadata + + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = self._fetch() + instance = IsoCountryCodeInstance( + self._version, + payload, + iso_country_code=self._solution["iso_country_code"], + short_code=self._solution["short_code"], + ) + return ApiResponse(data=instance, status_code=status_code, headers=headers) + + async def _fetch_async(self) -> tuple: + """ + Internal async helper for fetch operation + + Returns: + tuple: (payload, status_code, headers) + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + return await self._version.fetch_with_response_info_async( + method="GET", uri=self._uri, headers=headers + ) + + async def fetch_async(self) -> IsoCountryCodeInstance: + """ + Asynchronous coroutine to fetch the IsoCountryCodeInstance + + + :returns: The fetched IsoCountryCodeInstance + """ + payload, _, _ = await self._fetch_async() + return IsoCountryCodeInstance( + self._version, + payload, + iso_country_code=self._solution["iso_country_code"], + short_code=self._solution["short_code"], + ) + + async def fetch_with_http_info_async(self) -> ApiResponse: + """ + Asynchronous coroutine to fetch the IsoCountryCodeInstance and return response metadata + + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = await self._fetch_async() + instance = IsoCountryCodeInstance( + self._version, + payload, + iso_country_code=self._solution["iso_country_code"], + short_code=self._solution["short_code"], + ) + return ApiResponse(data=instance, status_code=status_code, headers=headers) + + def _update( + self, + messaging_region: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + ) -> tuple: + """ + Internal helper for update operation + + Returns: + tuple: (payload, status_code, headers) + """ + + data = values.of( + { + "messagingRegion": messaging_region, + "friendlyName": friendly_name, + } + ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + + return self._version.update_with_response_info( + method="POST", uri=self._uri, data=data, headers=headers + ) + + def update( + self, + messaging_region: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + ) -> IsoCountryCodeInstance: + """ + Update the IsoCountryCodeInstance + + :param messaging_region: The Processing Region used for this short code for messaging + :param friendly_name: A human readable description of this resource, up to 64 characters. + + :returns: The updated IsoCountryCodeInstance + """ + payload, _, _ = self._update( + messaging_region=messaging_region, friendly_name=friendly_name + ) + return IsoCountryCodeInstance( + self._version, + payload, + iso_country_code=self._solution["iso_country_code"], + short_code=self._solution["short_code"], + ) + + def update_with_http_info( + self, + messaging_region: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + ) -> ApiResponse: + """ + Update the IsoCountryCodeInstance and return response metadata + + :param messaging_region: The Processing Region used for this short code for messaging + :param friendly_name: A human readable description of this resource, up to 64 characters. + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = self._update( + messaging_region=messaging_region, friendly_name=friendly_name + ) + instance = IsoCountryCodeInstance( + self._version, + payload, + iso_country_code=self._solution["iso_country_code"], + short_code=self._solution["short_code"], + ) + return ApiResponse(data=instance, status_code=status_code, headers=headers) + + async def _update_async( + self, + messaging_region: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + ) -> tuple: + """ + Internal async helper for update operation + + Returns: + tuple: (payload, status_code, headers) + """ + + data = values.of( + { + "messagingRegion": messaging_region, + "friendlyName": friendly_name, + } + ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + + return await self._version.update_with_response_info_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + async def update_async( + self, + messaging_region: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + ) -> IsoCountryCodeInstance: + """ + Asynchronous coroutine to update the IsoCountryCodeInstance + + :param messaging_region: The Processing Region used for this short code for messaging + :param friendly_name: A human readable description of this resource, up to 64 characters. + + :returns: The updated IsoCountryCodeInstance + """ + payload, _, _ = await self._update_async( + messaging_region=messaging_region, friendly_name=friendly_name + ) + return IsoCountryCodeInstance( + self._version, + payload, + iso_country_code=self._solution["iso_country_code"], + short_code=self._solution["short_code"], + ) + + async def update_with_http_info_async( + self, + messaging_region: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + ) -> ApiResponse: + """ + Asynchronous coroutine to update the IsoCountryCodeInstance and return response metadata + + :param messaging_region: The Processing Region used for this short code for messaging + :param friendly_name: A human readable description of this resource, up to 64 characters. + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = await self._update_async( + messaging_region=messaging_region, friendly_name=friendly_name + ) + instance = IsoCountryCodeInstance( + self._version, + payload, + iso_country_code=self._solution["iso_country_code"], + short_code=self._solution["short_code"], + ) + return ApiResponse(data=instance, status_code=status_code, headers=headers) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class IsoCountryCodeList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the IsoCountryCodeList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, iso_country_code: str, short_code: str) -> IsoCountryCodeContext: + """ + Constructs a IsoCountryCodeContext + + :param iso_country_code: The ISO country code of the short code + :param short_code: The short code + """ + return IsoCountryCodeContext( + self._version, iso_country_code=iso_country_code, short_code=short_code + ) + + def __call__(self, iso_country_code: str, short_code: str) -> IsoCountryCodeContext: + """ + Constructs a IsoCountryCodeContext + + :param iso_country_code: The ISO country code of the short code + :param short_code: The short code + """ + return IsoCountryCodeContext( + self._version, iso_country_code=iso_country_code, short_code=short_code + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return ""