diff --git a/CHANGES.md b/CHANGES.md index 653a63557..d7b92d664 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,199 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2026-09-28] Version 9.11.2 +--------------------------- +**Twiml** +- Add `audio_format` and `sample_rate` to Stream for HDCodec + +**Api** +- # API Changes +- ## 2026-09-22 +- Simplified the `criteria` field description. +- ## 2026-09-18 +- Moved `readOnly` on the snapshot count fields (`profileCount`, `partitionCount`) from the shared schema to the response usage sites, so the counts stay read-only in responses (no change for API consumers). +- ## 2026-09-17 +- Renamed 3 `Get*` operations to `Fetch*` to match the operationId standard: `FetchCohort`, `FetchSnapshot`, `FetchOperation`. +- Removed the unused `ExpressionId` schema and made the operation error example cohort-native, so no `aud_` identifiers remain in the spec. +- Kept `libraryVisibility: hidden` across the whole surface (info, path items, and operations). +- ## 2026-09-08 +- Removed the deprecated header-based-versioning unified specs, consolidating audiences onto the path-based `api.twilio.com/v1` surface. +- ## 2026-08-31 +- Published the unified audiences spec at `api.twilio.com/v1`. +- ## 2026-08-26 +- Fixed the Cohort operation response mapping in the unified audiences API. +- ## 2026-08-19 +- Migrated the unified audiences spec to the Cohort surface (Audiences renamed to Cohorts). +- Switched `downstreamServiceName` to `audiences-domain`. +- ## 2026-08-05 +- Added the `api.unified.version.preview` beta feature. +- Made the unified APIs available in prod us1. +- ## 2026-07-30 +- Fixed example values. +- ## 2026-07-29 +- Added the initial version of the audiences API to the unified APIs. +- ## 2026-07-20 +- Deployed the audiences-domain OAS to the dev edge. +- ## 2026-07-06 +- Added the prod-us1 realm to the audiences public API. +- ## 2026-06-23 +- Changed the `storeType` enum from `MEMORA` to `TWILIO`. +- ## 2026-05-04 +- Added the stage-us1 realm and `x-rate-limit` to the audiences API. +- ## 2026-04-08 +- Added the initial audiences endpoints. +- Add `TwimlProcessStatusCallbackEvents` parameter to CreateTwimlProcess endpoint +- Add `twiml_process` resource alongside `twiml_session` (`twiml_session` is deprecated and will be removed in a future release) + +**Audiences** +- ## 2026-09-14 +- Minor updates (formatting, metadata) +- ## 2026-09-11 +- **Content updates**: +- Updated summary for `AdminFetchRecord` +- Updated summary for `AdminFetchCohort` +- Updated summary for `AdminFetchCohortSnapshot` +- Updated summary for `AdminFetchCohortOperation` +- Updated schema description for `ResourceLabels` +- ## 2026-09-22 +- **Content updates**: +- Updated schema description for `Criteria` +- ## 2026-09-18 +- Minor updates (formatting, metadata) +- ## 2026-09-17 +- Minor updates (formatting, metadata) +- ## 2026-09-17 +- **Content updates**: +- Updated description for `CreateCohort` +- Updated description for `ListCohortSnapshots` +- Updated description for `CreateCohortSnapshot` +- Updated description for `FetchCohortSnapshot` +- Updated description for `ListCohortSnapshotProfiles` +- Updated schema description for `Criteria` +- Updated schema description for `Cohort` +- Updated schema description for `CohortSnapshot` +- Updated schema description for `CohortOperationResult` +- Updated schema description for `CohortOperation` +- ## 2026-09-15 +- Minor updates (formatting, metadata) +- ## 2026-09-14 +- **Content updates**: +- Updated summary for `FetchCohort` +- Updated summary for `FetchCohortSnapshot` +- Updated summary for `FetchCohortOperation` +- Updated schema description for `ResourceLabels` + +**Capabilities** +- Add a feature-gated preview endpoint to create Capabilities. + +**Conversations** +- Add the feature-gated Capabilities list and create endpoints to Conversations v2. + +**Data-ingress** +- ## 2026-09-07 +- Minor updates (formatting, metadata) +- ## 2026-09-09 +- **Added 16 new path(s)**: +- `/v1/DataSyncs/{syncId}` (FetchDataSync) +- `/v1/CloudAppSources/{sourceId}/Objects` (ListCloudAppObjects) +- `/v1/WarehouseSources/{sourceId}/Preview` (CreateWarehousePreview) +- `/v1/WarehouseSources/{sourceId}/Preview/{operationId}` (FetchWarehousePreview) +- `/v1/DataSample/{operationId}` (FetchDataSample) +- `/v1/ControlPlane/CloudAppSources/{sourceId}` (FetchCloudAppSource, PatchCloudAppSource, DeleteCloudAppSource) +- `/v1/ControlPlane/CloudAppSources/{sourceId}/Datasets` (ListCloudAppDatasets, CreateCloudAppDataset) +- `/v1/ControlPlane/CloudAppSources/{sourceId}/Datasets/{datasetId}` (FetchCloudAppDataset, PatchCloudAppDataset, DeleteCloudAppDataset) +- `/v1/ControlPlane/WarehouseSources/{sourceId}` (FetchWarehouseSource, PatchWarehouseSource, DeleteWarehouseSource) +- `/v1/ControlPlane/WarehouseSources/{sourceId}/Datasets` (ListWarehouseDatasets, CreateWarehouseDataset) +- ...and 6 more paths +- **Removed 31 path(s)**: +- `/v1/DataSyncs/{SyncId}` (FetchDataSync) +- `/v1/CloudAppSources/{SourceId}/Objects` (ListCloudAppObjects) +- `/v1/WarehouseSources/{SourceId}/Preview` (CreateWarehousePreview) +- `/v1/WarehouseSources/{SourceId}/Preview/{OperationId}` (FetchWarehousePreview) +- `/v1/DataSample/{OperationId}` (FetchDataSample) +- `/v1/ControlPlane/CloudAppSources/{SourceId}` (FetchCloudAppSource, PatchCloudAppSource, DeleteCloudAppSource) +- `/v1/ControlPlane/CloudAppSources/{SourceId}/Datasets` (ListCloudAppDatasets, CreateCloudAppDataset) +- `/v1/ControlPlane/CloudAppSources/{SourceId}/Datasets/{DatasetId}` (FetchCloudAppDataset, PatchCloudAppDataset, DeleteCloudAppDataset) +- `/v1/ControlPlane/WarehouseSources/{SourceId}` (FetchWarehouseSource, PatchWarehouseSource, DeleteWarehouseSource) +- `/v1/ControlPlane/WarehouseSources/{SourceId}/Datasets` (ListWarehouseDatasets, CreateWarehouseDataset) +- ...and 21 more paths + +**Destinations** +- ## 2026-09-24 +- **Content updates**: +- Removed `GET` from the `method` enum on the `webhook` destination type's config options +- ## 2026-09-22 +- **Content updates**: +- Added `CDP` to the `categories` enum on `DestinationType` +- ## 2026-09-14 +- Enable admin APIs for stage-us1 and prod-ie1 realms +- ## 2026-09-11 +- **Content updates**: +- Updated description for `CreateDestination` +- Updated description for `UpdateDestination` +- Updated description for `DeleteDestination` +- Updated schema description for `CredentialInput` +- Updated schema description for `DestinationCredentialOptions` +- ## 2026-09-11 +- **Content updates**: +- Updated description for `ListDestinationTypes` +- Updated description for `GetDestinationType` +- Updated description for `CreateDestination` +- Updated description for `UpdateDestination` +- ## 2026-09-10 +- Made `ListDestinationTypes` and `GetDestinationType` unauthenticated (`security: []`). +- Removed `iamOperation`, `addAuthorizationHeader`, and `betaFeature` from these operations. + +**Iam** +- Removed user_context from the POST /v1/actions/post_login (PostLoginActionRequest) webhook payload; the login email is read from authentication_context.methods +- Replaced acr and completed_factors with authentication_context (acr, amr, methods) on the POST /v1/actions/post_login (PostLoginActionRequest) webhook payload +- Made request_context and request_context.ip_address required on the POST /v1/actions/post_login (PostLoginActionRequest) webhook payload + +**Intelligence** +- Added optional `rule.operators[]` parameter override field to `POST /v3/RuleExecutions +- Change Summary in `POST /v3/RuleExecutions` + +**Knowledge** +- ## 2026-09-23 +- **Content updates**: +- Added properties to `WebSourceDetails`: errors +- **Routing updates**: +- Changed `downstreamServiceName` from `memora-domain` to `enterprise-knowledge-domain` for all operations + +**Memory** +- ## 2026-09-18 +- **Added 2 new path(s)**: +- `/v1/ControlPlane/TraitExtractionStrategies` (AdminListTraitExtractionStrategies) +- `/v1/ControlPlane/TraitExtractionStrategies/{traitStrategyId}` (AdminFetchTraitExtractionStrategy) +- ## 2026-09-03 +- No path changes (schema description only) +- Clarified the `DataMappingCore` description: the PATCH body requires at least one field. +- ## 2026-09-10 +- **Added 2 new path(s)** for Observation Extraction Strategies: +- `/v1/ControlPlane/ObservationExtractionStrategies` (ListObservationExtractionStrategies, CreateObservationExtractionStrategy) +- `/v1/ControlPlane/ObservationExtractionStrategies/{observationExtractionStrategyId}` (FetchObservationExtractionStrategy, UpdateObservationExtractionStrategy, DeleteObservationExtractionStrategy) +- **Content updates**: +- Updated `CreateObservationExtractionStrategyInput` description to document that at least one of `allowedCategories`/`prohibitedCategories` must be provided with a non-empty list +- ## 2026-09-07 +- **Added 1 new path(s)** for Profile: +- `/v1/Stores/{storeId}/Profiles/BulkDeletions` (CreateProfilesBulkDeletion) +- ## 2026-09-03 +- `UpdateStore`, `UpdateTraitGroup`, `UpdateDataMapping`, and `UpdateTraitExtractionStrategy` now require a body with at least one property. An empty `{}` gets a 400. + +**Routes** +- Add `GET`/`POST` `/v3/ShortCodes/{isoCountryCode}/{shortCode}` to assign and fetch the Inbound Processing Region for short codes + +**Verify** +- Add `aaguid` and `date_last_approved` to passkeys factors `metadata`. + +**Voice** +- Add typed Recording AccountDefaultConfiguration public API endpoints. + +**Webhooks** +- ## 2026-09-24 +- **Changed**: `GET /v1/Webhooks/Settings` now documents each item as the full `Setting` rather than `SettingSummary`, adding `auth`, `signature`, `connection` and `edgeZones` to the list response. The service already returned these fields; only the schema understated them. Additive for consumers — no field is removed or renamed. The now-unreferenced `SettingSummary` schema is removed. + + [2026-09-09] Version 9.11.1 --------------------------- **Library - Fix** diff --git a/setup.py b/setup.py index c131ece07..949cb38de 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.11.1", + version="9.11.2", 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 0ab1f74eb..3ff49ac6e 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "11", "1") +__version_info__ = ("9", "11", "2") __version__ = ".".join(__version_info__) diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index 7a0d2be7c..6399297d6 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -861,7 +861,7 @@ def create( :param send_at: The time that Twilio will send the message. Must be in ISO 8601 format. :param send_as_mms: If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. :param content_variables: For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. - :param message_intent: + :param message_intent: Specifies the purpose or use case of the outbound communication. This parameter is used by Twilio's [Traffic Shaping](https://www.twilio.com/docs/messaging/features/traffic-shaping) and [Compliance Toolkit](https://www.twilio.com/docs/messaging/features/compliance-toolkit) products. Possible values include: `otp`, `notifications`, `marketing`, `fraud`, `security`, `customercare`, `delivery`, `education`, `polling`, `announcements`, and `events`. :param risk_check: :param from_: The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. :param fallback_from: A fallback SMS sender to use when the recipient cannot be reached over RCS. This parameter may only be used when also providing a [Messaging Service](https://twilio.com/docs/messaging/services) containing an RCS sender. The fallback SMS sender must be either a Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), or [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), hosted within Twilio and belong to the Account creating the Message. @@ -958,7 +958,7 @@ def create_with_http_info( :param send_at: The time that Twilio will send the message. Must be in ISO 8601 format. :param send_as_mms: If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. :param content_variables: For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. - :param message_intent: + :param message_intent: Specifies the purpose or use case of the outbound communication. This parameter is used by Twilio's [Traffic Shaping](https://www.twilio.com/docs/messaging/features/traffic-shaping) and [Compliance Toolkit](https://www.twilio.com/docs/messaging/features/compliance-toolkit) products. Possible values include: `otp`, `notifications`, `marketing`, `fraud`, `security`, `customercare`, `delivery`, `education`, `polling`, `announcements`, and `events`. :param risk_check: :param from_: The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. :param fallback_from: A fallback SMS sender to use when the recipient cannot be reached over RCS. This parameter may only be used when also providing a [Messaging Service](https://twilio.com/docs/messaging/services) containing an RCS sender. The fallback SMS sender must be either a Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), or [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), hosted within Twilio and belong to the Account creating the Message. @@ -1136,7 +1136,7 @@ async def create_async( :param send_at: The time that Twilio will send the message. Must be in ISO 8601 format. :param send_as_mms: If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. :param content_variables: For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. - :param message_intent: + :param message_intent: Specifies the purpose or use case of the outbound communication. This parameter is used by Twilio's [Traffic Shaping](https://www.twilio.com/docs/messaging/features/traffic-shaping) and [Compliance Toolkit](https://www.twilio.com/docs/messaging/features/compliance-toolkit) products. Possible values include: `otp`, `notifications`, `marketing`, `fraud`, `security`, `customercare`, `delivery`, `education`, `polling`, `announcements`, and `events`. :param risk_check: :param from_: The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. :param fallback_from: A fallback SMS sender to use when the recipient cannot be reached over RCS. This parameter may only be used when also providing a [Messaging Service](https://twilio.com/docs/messaging/services) containing an RCS sender. The fallback SMS sender must be either a Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), or [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), hosted within Twilio and belong to the Account creating the Message. @@ -1233,7 +1233,7 @@ async def create_with_http_info_async( :param send_at: The time that Twilio will send the message. Must be in ISO 8601 format. :param send_as_mms: If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. :param content_variables: For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. - :param message_intent: + :param message_intent: Specifies the purpose or use case of the outbound communication. This parameter is used by Twilio's [Traffic Shaping](https://www.twilio.com/docs/messaging/features/traffic-shaping) and [Compliance Toolkit](https://www.twilio.com/docs/messaging/features/compliance-toolkit) products. Possible values include: `otp`, `notifications`, `marketing`, `fraud`, `security`, `customercare`, `delivery`, `education`, `polling`, `announcements`, and `events`. :param risk_check: :param from_: The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. :param fallback_from: A fallback SMS sender to use when the recipient cannot be reached over RCS. This parameter may only be used when also providing a [Messaging Service](https://twilio.com/docs/messaging/services) containing an RCS sender. The fallback SMS sender must be either a Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), or [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), hosted within Twilio and belong to the Account creating the Message. diff --git a/twilio/rest/conversations/v2/conversation.py b/twilio/rest/conversations/v2/conversation.py index e50ec63d1..9b80ae4af 100644 --- a/twilio/rest/conversations/v2/conversation.py +++ b/twilio/rest/conversations/v2/conversation.py @@ -63,7 +63,9 @@ class ConversationsV2ParticipantType(object): :ivar created_at: Timestamp when this Conversation was created. :ivar updated_at: Timestamp when this Conversation was last updated. :ivar configuration: + :ivar metadata: Customer-managed key-value pairs. Maximum 8 entries; keys up to 128 characters allowing alphanumeric characters, periods, underscores, and dashes; values up to 512 characters. :ivar participants: Participants in this Conversation. + :ivar action_id: The Action created for the request's `action`, present only on the create response that dispatched one. Poll `GET /v2/Conversations/{ConversationId}/Actions/{ActionId}` for its status. :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 """ @@ -87,7 +89,9 @@ def __init__( payload.get("updatedAt") ) self.configuration: Optional[str] = payload.get("configuration") + self.metadata: Optional[Dict[str, str]] = payload.get("metadata") self.participants: Optional[List[str]] = payload.get("participants") + self.action_id: Optional[str] = payload.get("actionId") self.status_url: Optional[str] = payload.get("statusUrl") self.related: Optional[Dict[str, str]] = payload.get("related") @@ -795,6 +799,20 @@ def __repr__(self) -> str: class ConversationList(ListResource): + class ConversationWorkflow(object): + """ + :ivar flow_id: The Studio Flow to run. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.flow_id: Optional[str] = payload.get("flowId") + + def to_dict(self): + return { + "flowId": self.flow_id, + } + class ConversationsV2Address(object): """ :ivar channel: @@ -856,6 +874,7 @@ class CreateConversationWithConfigRequest(object): :ivar name: The name of the conversation. :ivar configuration: :ivar participants: Optional list of Participants to create with the Conversation. + :ivar metadata: Optional customer-managed key-value metadata for this Conversation. Maximum 8 entries; keys up to 128 characters allowing alphanumeric characters, periods, underscores, and dashes; values up to 512 characters. """ def __init__(self, payload: Dict[str, Any]): @@ -887,6 +906,7 @@ def __init__(self, payload: Dict[str, Any]): if payload.get("participants") is not None else None ) + self.metadata: Optional[Dict[str, str]] = payload.get("metadata") def to_dict(self): return { @@ -902,11 +922,13 @@ def to_dict(self): if self.participants is not None else None ), + "metadata": self.metadata, } class CreateConversationWithConfigRequestConfiguration(object): """ :ivar intelligence_configuration_ids: A list of Conversational Intelligence configuration IDs. + :ivar workflows: The Workflows to associate with this Conversation. Overrides the Configuration's own. """ def __init__(self, payload: Dict[str, Any]): @@ -914,10 +936,27 @@ def __init__(self, payload: Dict[str, Any]): self.intelligence_configuration_ids: Optional[List[str]] = payload.get( "intelligenceConfigurationIds" ) + self.workflows: Optional[List[ConversationList.ConversationWorkflow]] = ( + [ + ( + ConversationList.ConversationWorkflow(item) + if isinstance(item, dict) + else item + ) + for item in payload.get("workflows") + ] + if payload.get("workflows") is not None + else None + ) def to_dict(self): return { "intelligenceConfigurationIds": self.intelligence_configuration_ids, + "workflows": ( + [workflows.to_dict() for workflows in self.workflows] + if self.workflows is not None + else None + ), } class CreateConversationWithConfigRequestParticipants(object): @@ -989,6 +1028,7 @@ class PatchConversationByIdRequest(object): :ivar name: The name of the Conversation. :ivar status: Lifecycle status of a Conversation. :ivar configuration: + :ivar metadata: Merge patch for customer-managed metadata (max 8 entries after merge). Provided keys are added or updated; keys set to null are removed; keys not mentioned are preserved. """ def __init__(self, payload: Dict[str, Any]): @@ -1004,6 +1044,7 @@ def __init__(self, payload: Dict[str, Any]): if payload.get("configuration") is not None else None ) + self.metadata: Optional[Dict[str, Optional[str]]] = payload.get("metadata") def to_dict(self): return { @@ -1014,6 +1055,7 @@ def to_dict(self): if self.configuration is not None else None ), + "metadata": self.metadata, } class PatchConversationByIdRequestConfiguration(object): @@ -1054,17 +1096,20 @@ class UpdateConversationByIdRequest(object): """ :ivar name: The name of the Conversation. :ivar status: Lifecycle status of a Conversation. + :ivar metadata: Customer-managed key-value metadata for this Conversation. Maximum 8 entries; keys up to 128 characters allowing alphanumeric characters, periods, underscores, and dashes; values up to 512 characters. """ def __init__(self, payload: Dict[str, Any]): self.name: Optional[str] = payload.get("name") self.status: Optional[str] = payload.get("status") + self.metadata: Optional[Dict[str, str]] = payload.get("metadata") def to_dict(self): return { "name": self.name, "status": self.status, + "metadata": self.metadata, } def __init__(self, version: Version): diff --git a/twilio/rest/insights/v3/__init__.py b/twilio/rest/insights/v3/__init__.py index 18b2d1e12..5be71a8ae 100644 --- a/twilio/rest/insights/v3/__init__.py +++ b/twilio/rest/insights/v3/__init__.py @@ -15,6 +15,8 @@ from typing import Optional from twilio.base.version import Version from twilio.base.domain import Domain +from twilio.rest.insights.v3.capacity import CapacityList +from twilio.rest.insights.v3.custom_field_mapping import CustomFieldMappingList from twilio.rest.insights.v3.metadata import MetadataList from twilio.rest.insights.v3.query import QueryList from twilio.rest.insights.v3.query_job import QueryJobList @@ -29,10 +31,24 @@ def __init__(self, domain: Domain): :param domain: The Twilio.insights domain """ super().__init__(domain, "v3") + self._capacity: Optional[CapacityList] = None + self._custom_field_mappings: Optional[CustomFieldMappingList] = None self._metadata: Optional[MetadataList] = None self._query: Optional[QueryList] = None self._query_jobs: Optional[QueryJobList] = None + @property + def capacity(self) -> CapacityList: + if self._capacity is None: + self._capacity = CapacityList(self) + return self._capacity + + @property + def custom_field_mappings(self) -> CustomFieldMappingList: + if self._custom_field_mappings is None: + self._custom_field_mappings = CustomFieldMappingList(self) + return self._custom_field_mappings + @property def metadata(self) -> MetadataList: if self._metadata is None: diff --git a/twilio/rest/insights/v3/capacity.py b/twilio/rest/insights/v3/capacity.py new file mode 100644 index 000000000..69b51d8ab --- /dev/null +++ b/twilio/rest/insights/v3/capacity.py @@ -0,0 +1,137 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Insights + The Twilio Insights v3 API provides semantic query access to Conversations analytics data. Resources include synchronous Query, Metadata, and asynchronous QueryJobs for long-running queries. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from __future__ import annotations + +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 CapacityInstance(InstanceResource): + """ + :ivar measure: + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.measure: Optional[str] = payload.get("measure") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class CapacityList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the CapacityList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/ControlPlane/ConversationInsights/CustomFieldMappings/Capacity" + + def _fetch(self) -> tuple: + """ + Internal helper for fetch operation + + Returns: + tuple: (payload, status_code, headers) + """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + return self._version.fetch_with_response_info( + method="GET", uri=self._uri, headers=headers + ) + + def fetch(self) -> CapacityInstance: + """ + Fetch the CapacityInstance + + + :returns: The fetched CapacityInstance + """ + payload, _, _ = self._fetch() + return CapacityInstance(self._version, payload) + + def fetch_with_http_info(self) -> ApiResponse: + """ + Fetch the CapacityInstance and return response metadata + + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = self._fetch() + instance = CapacityInstance(self._version, payload) + 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({"Content-Type": "application/x-www-form-urlencoded"}) + + 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) -> CapacityInstance: + """ + Asynchronously fetch the CapacityInstance + + + :returns: The fetched CapacityInstance + """ + payload, _, _ = await self._fetch_async() + return CapacityInstance(self._version, payload) + + async def fetch_with_http_info_async(self) -> ApiResponse: + """ + Asynchronously fetch the CapacityInstance and return response metadata + + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = await self._fetch_async() + instance = CapacityInstance(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/insights/v3/custom_field_mapping.py b/twilio/rest/insights/v3/custom_field_mapping.py new file mode 100644 index 000000000..5dc658057 --- /dev/null +++ b/twilio/rest/insights/v3/custom_field_mapping.py @@ -0,0 +1,377 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Insights + The Twilio Insights v3 API provides semantic query access to Conversations analytics data. Resources include synchronous Query, Metadata, and asynchronous QueryJobs for long-running queries. + + 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, List, Optional +from twilio.base import deserialize, 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 CustomFieldMappingInstance(InstanceResource): + + class MappingCategory(object): + MEASURE = "MEASURE" + + class SourceType(object): + INTELLIGENCE_OPERATOR = "INTELLIGENCE_OPERATOR" + + """ + :ivar id: TTID for conversation insights custom field mapping + :ivar category: + :ivar name: + :ivar description: Optional, free-text description supplied at registration time. Display-only — not part of any uniqueness check. + :ivar entity_metadata: + :ivar created_at: When the mapping was registered. + :ivar updated_at: When the mapping was last materially modified in-place. Null until the first update-in-place. + :ivar mappings: + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.id: Optional[str] = payload.get("id") + self.category: Optional["CustomFieldMappingInstance.MappingCategory"] = ( + payload.get("category") + ) + self.name: Optional[str] = payload.get("name") + self.description: Optional[str] = payload.get("description") + self.entity_metadata: Optional[str] = payload.get("entityMetadata") + self.created_at: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("createdAt") + ) + self.updated_at: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("updatedAt") + ) + self.mappings: Optional[List[CustomFieldMappingResponse]] = payload.get( + "mappings" + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class CustomFieldMappingList(ListResource): + + class CustomFieldMappingRequest(object): + """ + :ivar category: + :ivar name: Customer-facing name for the field; becomes the ClickHouse Map key and the platform field alias. Unique per account across every `sourceType` — the Map key namespace is account-global. + :ivar description: Optional, free-text description of this custom field mapping. Display-only — not part of any uniqueness check. + :ivar entity_metadata: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.category: Optional["CustomFieldMappingInstance.MappingCategory"] = ( + payload.get("category") + ) + self.name: Optional[str] = payload.get("name") + self.description: Optional[str] = payload.get("description") + self.entity_metadata: Optional[ + CustomFieldMappingList.IntelligenceOperatorEntityMetadata + ] = ( + CustomFieldMappingList.IntelligenceOperatorEntityMetadata( + payload.get("entityMetadata") + ) + if payload.get("entityMetadata") is not None + else None + ) + + def to_dict(self): + return { + "category": self.category, + "name": self.name, + "description": self.description, + "entityMetadata": ( + self.entity_metadata.to_dict() + if self.entity_metadata is not None + else None + ), + } + + class CustomFieldMappingResponse(object): + """ + :ivar id: TTID for conversation insights custom field mapping + :ivar category: + :ivar name: + :ivar description: Optional, free-text description supplied at registration time. Display-only — not part of any uniqueness check. + :ivar entity_metadata: + :ivar created_at: When the mapping was registered. + :ivar updated_at: When the mapping was last materially modified in-place. Null until the first update-in-place. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.category: Optional["CustomFieldMappingInstance.MappingCategory"] = ( + payload.get("category") + ) + self.name: Optional[str] = payload.get("name") + self.description: Optional[str] = payload.get("description") + self.entity_metadata: Optional[IntelligenceOperatorEntityMetadata] = ( + IntelligenceOperatorEntityMetadata(payload.get("entityMetadata")) + if payload.get("entityMetadata") is not None + else None + ) + self.created_at: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("createdAt") + ) + self.updated_at: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("updatedAt") + ) + + def to_dict(self): + return { + "id": self.id, + "category": self.category, + "name": self.name, + "description": self.description, + "entityMetadata": ( + self.entity_metadata.to_dict() + if self.entity_metadata is not None + else None + ), + "createdAt": self.created_at, + "updatedAt": self.updated_at, + } + + class IntelligenceOperatorEntityMetadata(object): + """ + :ivar source_type: + :ivar operator_id: The Intelligence operator ID. Part of the owner check for idempotent upserts — a mismatch against the existing registration's `(sourceType, operatorId)` returns `409`. + :ivar operator_name: Optional, display-only name of the operator as supplied at registration time. Not part of any uniqueness or validation logic. + :ivar field: Annotation fieldPath key; generic identifier that determines the output-schema field. Resolved against the operator identified by `operatorId`. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.source_type: Optional["CustomFieldMappingInstance.SourceType"] = ( + payload.get("sourceType") + ) + self.operator_id: Optional[str] = payload.get("operatorId") + self.operator_name: Optional[str] = payload.get("operatorName") + self.field: Optional[str] = payload.get("field") + + def to_dict(self): + return { + "sourceType": self.source_type, + "operatorId": self.operator_id, + "operatorName": self.operator_name, + "field": self.field, + } + + def __init__(self, version: Version): + """ + Initialize the CustomFieldMappingList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/ControlPlane/ConversationInsights/CustomFieldMappings" + + def _create(self, custom_field_mapping_request: CustomFieldMappingRequest) -> tuple: + """ + Internal helper for create operation + + Returns: + tuple: (payload, status_code, headers) + """ + data = custom_field_mapping_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, data=data, headers=headers + ) + + def create( + self, custom_field_mapping_request: CustomFieldMappingRequest + ) -> CustomFieldMappingInstance: + """ + Create the CustomFieldMappingInstance + + :param custom_field_mapping_request: + + :returns: The created CustomFieldMappingInstance + """ + payload, _, _ = self._create( + custom_field_mapping_request=custom_field_mapping_request + ) + return CustomFieldMappingInstance(self._version, payload) + + def create_with_http_info( + self, custom_field_mapping_request: CustomFieldMappingRequest + ) -> ApiResponse: + """ + Create the CustomFieldMappingInstance and return response metadata + + :param custom_field_mapping_request: + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = self._create( + custom_field_mapping_request=custom_field_mapping_request + ) + instance = CustomFieldMappingInstance(self._version, payload) + return ApiResponse(data=instance, status_code=status_code, headers=headers) + + async def _create_async( + self, custom_field_mapping_request: CustomFieldMappingRequest + ) -> tuple: + """ + Internal async helper for create operation + + Returns: + tuple: (payload, status_code, headers) + """ + data = custom_field_mapping_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, data=data, headers=headers + ) + + async def create_async( + self, custom_field_mapping_request: CustomFieldMappingRequest + ) -> CustomFieldMappingInstance: + """ + Asynchronously create the CustomFieldMappingInstance + + :param custom_field_mapping_request: + + :returns: The created CustomFieldMappingInstance + """ + payload, _, _ = await self._create_async( + custom_field_mapping_request=custom_field_mapping_request + ) + return CustomFieldMappingInstance(self._version, payload) + + async def create_with_http_info_async( + self, custom_field_mapping_request: CustomFieldMappingRequest + ) -> ApiResponse: + """ + Asynchronously create the CustomFieldMappingInstance and return response metadata + + :param custom_field_mapping_request: + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = await self._create_async( + custom_field_mapping_request=custom_field_mapping_request + ) + instance = CustomFieldMappingInstance(self._version, payload) + return ApiResponse(data=instance, status_code=status_code, headers=headers) + + def _fetch(self) -> tuple: + """ + Internal helper for fetch operation + + Returns: + tuple: (payload, status_code, headers) + """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + return self._version.fetch_with_response_info( + method="GET", uri=self._uri, headers=headers + ) + + def fetch(self) -> CustomFieldMappingInstance: + """ + Fetch the CustomFieldMappingInstance + + + :returns: The fetched CustomFieldMappingInstance + """ + payload, _, _ = self._fetch() + return CustomFieldMappingInstance(self._version, payload) + + def fetch_with_http_info(self) -> ApiResponse: + """ + Fetch the CustomFieldMappingInstance and return response metadata + + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = self._fetch() + instance = CustomFieldMappingInstance(self._version, payload) + 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({"Content-Type": "application/x-www-form-urlencoded"}) + + 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) -> CustomFieldMappingInstance: + """ + Asynchronously fetch the CustomFieldMappingInstance + + + :returns: The fetched CustomFieldMappingInstance + """ + payload, _, _ = await self._fetch_async() + return CustomFieldMappingInstance(self._version, payload) + + async def fetch_with_http_info_async(self) -> ApiResponse: + """ + Asynchronously fetch the CustomFieldMappingInstance and return response metadata + + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = await self._fetch_async() + instance = CustomFieldMappingInstance(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/intelligence/v3/rule_execution.py b/twilio/rest/intelligence/v3/rule_execution.py index a365eab62..550491f86 100644 --- a/twilio/rest/intelligence/v3/rule_execution.py +++ b/twilio/rest/intelligence/v3/rule_execution.py @@ -14,7 +14,7 @@ from __future__ import annotations -from typing import Any, Dict, Optional +from typing import Any, Dict, List, Optional from twilio.base import values from twilio.base.api_response import ApiResponse @@ -58,6 +58,7 @@ class CreateRuleExecutionRequest(object): :ivar intelligence_configuration_id: The Intelligence Configuration identifier to execute the Rule within. :ivar rule_id: The rule identifier to execute within the selected Intelligence Configuration. :ivar conversation_id: The Conversation identifier to execute the Rule against. + :ivar rule: """ def __init__(self, payload: Dict[str, Any]): @@ -67,12 +68,66 @@ def __init__(self, payload: Dict[str, Any]): ) self.rule_id: Optional[str] = payload.get("ruleId") self.conversation_id: Optional[str] = payload.get("conversationId") + self.rule: Optional[RuleExecutionList.RuleOverride] = ( + RuleExecutionList.RuleOverride(payload.get("rule")) + if payload.get("rule") is not None + else None + ) def to_dict(self): return { "intelligenceConfigurationId": self.intelligence_configuration_id, "ruleId": self.rule_id, "conversationId": self.conversation_id, + "rule": self.rule.to_dict() if self.rule is not None else None, + } + + class OperatorOverride(object): + """ + :ivar id: The operator id (as configured in the stored rule) to override. + :ivar parameters: Parameter overrides merged into the stored operator's parameters. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.parameters: Optional[Dict[str, Dict[str, object]]] = payload.get( + "parameters" + ) + + def to_dict(self): + return { + "id": self.id, + "parameters": self.parameters, + } + + class RuleOverride(object): + """ + :ivar operators: Operator parameter overrides, merged key-by-key into the stored operator's parameters (override wins on matching keys; unspecified keys retain their stored values). Operators in the stored rule not referenced here execute with their stored parameters unchanged. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.operators: Optional[List[RuleExecutionList.OperatorOverride]] = ( + [ + ( + RuleExecutionList.OperatorOverride(item) + if isinstance(item, dict) + else item + ) + for item in payload.get("operators") + ] + if payload.get("operators") is not None + else None + ) + + def to_dict(self): + return { + "operators": ( + [operators.to_dict() for operators in self.operators] + if self.operators is not None + else None + ), } def __init__(self, version: Version): diff --git a/twilio/rest/memory/v1/data_mapping.py b/twilio/rest/memory/v1/data_mapping.py index 0e96d2732..151a63c6a 100644 --- a/twilio/rest/memory/v1/data_mapping.py +++ b/twilio/rest/memory/v1/data_mapping.py @@ -170,38 +170,38 @@ async def fetch_with_http_info_async(self) -> ApiResponse: def patch( self, + data_mapping_core: DataMappingCore, if_match: Union[str, object] = values.unset, - data_mapping_core: Union[DataMappingCore, object] = values.unset, ) -> "DataMappingInstance": """ Patch the DataMappingInstance - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param data_mapping_core: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: The patched DataMappingInstance """ return self._proxy.patch( - if_match=if_match, data_mapping_core=data_mapping_core, + if_match=if_match, ) async def patch_async( self, + data_mapping_core: DataMappingCore, if_match: Union[str, object] = values.unset, - data_mapping_core: Union[DataMappingCore, object] = values.unset, ) -> "DataMappingInstance": """ Asynchronous coroutine to patch the DataMappingInstance - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param data_mapping_core: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: The patched DataMappingInstance """ return await self._proxy.patch_async( - if_match=if_match, data_mapping_core=data_mapping_core, + if_match=if_match, ) def __repr__(self) -> str: @@ -405,8 +405,8 @@ async def fetch_with_http_info_async(self) -> ApiResponse: def _patch( self, + data_mapping_core: DataMappingCore, if_match: Union[str, object] = values.unset, - data_mapping_core: Union[DataMappingCore, object] = values.unset, ) -> tuple: """ Internal helper for patch operation @@ -433,19 +433,19 @@ def _patch( def patch( self, + data_mapping_core: DataMappingCore, if_match: Union[str, object] = values.unset, - data_mapping_core: Union[DataMappingCore, object] = values.unset, ) -> DataMappingInstance: """ Patch the DataMappingInstance - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param data_mapping_core: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: The patched DataMappingInstance """ payload, _, _ = self._patch( - if_match=if_match, data_mapping_core=data_mapping_core + data_mapping_core=data_mapping_core, if_match=if_match ) return DataMappingInstance( self._version, @@ -456,19 +456,19 @@ def patch( def patch_with_http_info( self, + data_mapping_core: DataMappingCore, if_match: Union[str, object] = values.unset, - data_mapping_core: Union[DataMappingCore, object] = values.unset, ) -> ApiResponse: """ Patch the DataMappingInstance and return response metadata - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param data_mapping_core: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: ApiResponse with instance, status code, and headers """ payload, status_code, headers = self._patch( - if_match=if_match, data_mapping_core=data_mapping_core + data_mapping_core=data_mapping_core, if_match=if_match ) instance = DataMappingInstance( self._version, @@ -480,8 +480,8 @@ def patch_with_http_info( async def _patch_async( self, + data_mapping_core: DataMappingCore, if_match: Union[str, object] = values.unset, - data_mapping_core: Union[DataMappingCore, object] = values.unset, ) -> tuple: """ Internal async helper for patch operation @@ -508,19 +508,19 @@ async def _patch_async( async def patch_async( self, + data_mapping_core: DataMappingCore, if_match: Union[str, object] = values.unset, - data_mapping_core: Union[DataMappingCore, object] = values.unset, ) -> DataMappingInstance: """ Asynchronous coroutine to patch the DataMappingInstance - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param data_mapping_core: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: The patched DataMappingInstance """ payload, _, _ = await self._patch_async( - if_match=if_match, data_mapping_core=data_mapping_core + data_mapping_core=data_mapping_core, if_match=if_match ) return DataMappingInstance( self._version, @@ -531,19 +531,19 @@ async def patch_async( async def patch_with_http_info_async( self, + data_mapping_core: DataMappingCore, if_match: Union[str, object] = values.unset, - data_mapping_core: Union[DataMappingCore, object] = values.unset, ) -> ApiResponse: """ Asynchronous coroutine to patch the DataMappingInstance and return response metadata - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param data_mapping_core: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: ApiResponse with instance, status code, and headers """ payload, status_code, headers = await self._patch_async( - if_match=if_match, data_mapping_core=data_mapping_core + data_mapping_core=data_mapping_core, if_match=if_match ) instance = DataMappingInstance( self._version, diff --git a/twilio/rest/memory/v1/store.py b/twilio/rest/memory/v1/store.py index 4364dbde2..fa80d69ad 100644 --- a/twilio/rest/memory/v1/store.py +++ b/twilio/rest/memory/v1/store.py @@ -153,38 +153,38 @@ async def fetch_with_http_info_async(self) -> ApiResponse: def patch( self, + patch_store_request: PatchStoreRequest, if_match: Union[str, object] = values.unset, - patch_store_request: Union[PatchStoreRequest, object] = values.unset, ) -> "StoreInstance": """ Patch the StoreInstance - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param patch_store_request: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: The patched StoreInstance """ return self._proxy.patch( - if_match=if_match, patch_store_request=patch_store_request, + if_match=if_match, ) async def patch_async( self, + patch_store_request: PatchStoreRequest, if_match: Union[str, object] = values.unset, - patch_store_request: Union[PatchStoreRequest, object] = values.unset, ) -> "StoreInstance": """ Asynchronous coroutine to patch the StoreInstance - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param patch_store_request: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: The patched StoreInstance """ return await self._proxy.patch_async( - if_match=if_match, patch_store_request=patch_store_request, + if_match=if_match, ) def __repr__(self) -> str: @@ -378,8 +378,8 @@ async def fetch_with_http_info_async(self) -> ApiResponse: def _patch( self, + patch_store_request: PatchStoreRequest, if_match: Union[str, object] = values.unset, - patch_store_request: Union[PatchStoreRequest, object] = values.unset, ) -> tuple: """ Internal helper for patch operation @@ -406,19 +406,19 @@ def _patch( def patch( self, + patch_store_request: PatchStoreRequest, if_match: Union[str, object] = values.unset, - patch_store_request: Union[PatchStoreRequest, object] = values.unset, ) -> StoreInstance: """ Patch the StoreInstance - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param patch_store_request: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: The patched StoreInstance """ payload, _, _ = self._patch( - if_match=if_match, patch_store_request=patch_store_request + patch_store_request=patch_store_request, if_match=if_match ) return StoreInstance( self._version, payload, store_id=self._solution["store_id"] @@ -426,19 +426,19 @@ def patch( def patch_with_http_info( self, + patch_store_request: PatchStoreRequest, if_match: Union[str, object] = values.unset, - patch_store_request: Union[PatchStoreRequest, object] = values.unset, ) -> ApiResponse: """ Patch the StoreInstance and return response metadata - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param patch_store_request: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: ApiResponse with instance, status code, and headers """ payload, status_code, headers = self._patch( - if_match=if_match, patch_store_request=patch_store_request + patch_store_request=patch_store_request, if_match=if_match ) instance = StoreInstance( self._version, payload, store_id=self._solution["store_id"] @@ -447,8 +447,8 @@ def patch_with_http_info( async def _patch_async( self, + patch_store_request: PatchStoreRequest, if_match: Union[str, object] = values.unset, - patch_store_request: Union[PatchStoreRequest, object] = values.unset, ) -> tuple: """ Internal async helper for patch operation @@ -475,19 +475,19 @@ async def _patch_async( async def patch_async( self, + patch_store_request: PatchStoreRequest, if_match: Union[str, object] = values.unset, - patch_store_request: Union[PatchStoreRequest, object] = values.unset, ) -> StoreInstance: """ Asynchronous coroutine to patch the StoreInstance - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param patch_store_request: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: The patched StoreInstance """ payload, _, _ = await self._patch_async( - if_match=if_match, patch_store_request=patch_store_request + patch_store_request=patch_store_request, if_match=if_match ) return StoreInstance( self._version, payload, store_id=self._solution["store_id"] @@ -495,19 +495,19 @@ async def patch_async( async def patch_with_http_info_async( self, + patch_store_request: PatchStoreRequest, if_match: Union[str, object] = values.unset, - patch_store_request: Union[PatchStoreRequest, object] = values.unset, ) -> ApiResponse: """ Asynchronous coroutine to patch the StoreInstance and return response metadata - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param patch_store_request: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: ApiResponse with instance, status code, and headers """ payload, status_code, headers = await self._patch_async( - if_match=if_match, patch_store_request=patch_store_request + patch_store_request=patch_store_request, if_match=if_match ) instance = StoreInstance( self._version, payload, store_id=self._solution["store_id"] diff --git a/twilio/rest/memory/v1/trait_group.py b/twilio/rest/memory/v1/trait_group.py index 774ca5694..30dbd279d 100644 --- a/twilio/rest/memory/v1/trait_group.py +++ b/twilio/rest/memory/v1/trait_group.py @@ -213,38 +213,38 @@ async def fetch_with_http_info_async( def patch( self, + patch_trait_group_request: PatchTraitGroupRequest, if_match: Union[str, object] = values.unset, - patch_trait_group_request: Union[PatchTraitGroupRequest, object] = values.unset, ) -> "TraitGroupInstance": """ Patch the TraitGroupInstance - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param patch_trait_group_request: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: The patched TraitGroupInstance """ return self._proxy.patch( - if_match=if_match, patch_trait_group_request=patch_trait_group_request, + if_match=if_match, ) async def patch_async( self, + patch_trait_group_request: PatchTraitGroupRequest, if_match: Union[str, object] = values.unset, - patch_trait_group_request: Union[PatchTraitGroupRequest, object] = values.unset, ) -> "TraitGroupInstance": """ Asynchronous coroutine to patch the TraitGroupInstance - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param patch_trait_group_request: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: The patched TraitGroupInstance """ return await self._proxy.patch_async( - if_match=if_match, patch_trait_group_request=patch_trait_group_request, + if_match=if_match, ) def __repr__(self) -> str: @@ -538,8 +538,8 @@ async def fetch_with_http_info_async( def _patch( self, + patch_trait_group_request: PatchTraitGroupRequest, if_match: Union[str, object] = values.unset, - patch_trait_group_request: Union[PatchTraitGroupRequest, object] = values.unset, ) -> tuple: """ Internal helper for patch operation @@ -566,19 +566,19 @@ def _patch( def patch( self, + patch_trait_group_request: PatchTraitGroupRequest, if_match: Union[str, object] = values.unset, - patch_trait_group_request: Union[PatchTraitGroupRequest, object] = values.unset, ) -> TraitGroupInstance: """ Patch the TraitGroupInstance - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param patch_trait_group_request: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: The patched TraitGroupInstance """ payload, _, _ = self._patch( - if_match=if_match, patch_trait_group_request=patch_trait_group_request + patch_trait_group_request=patch_trait_group_request, if_match=if_match ) return TraitGroupInstance( self._version, @@ -589,19 +589,19 @@ def patch( def patch_with_http_info( self, + patch_trait_group_request: PatchTraitGroupRequest, if_match: Union[str, object] = values.unset, - patch_trait_group_request: Union[PatchTraitGroupRequest, object] = values.unset, ) -> ApiResponse: """ Patch the TraitGroupInstance and return response metadata - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param patch_trait_group_request: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: ApiResponse with instance, status code, and headers """ payload, status_code, headers = self._patch( - if_match=if_match, patch_trait_group_request=patch_trait_group_request + patch_trait_group_request=patch_trait_group_request, if_match=if_match ) instance = TraitGroupInstance( self._version, @@ -613,8 +613,8 @@ def patch_with_http_info( async def _patch_async( self, + patch_trait_group_request: PatchTraitGroupRequest, if_match: Union[str, object] = values.unset, - patch_trait_group_request: Union[PatchTraitGroupRequest, object] = values.unset, ) -> tuple: """ Internal async helper for patch operation @@ -641,19 +641,19 @@ async def _patch_async( async def patch_async( self, + patch_trait_group_request: PatchTraitGroupRequest, if_match: Union[str, object] = values.unset, - patch_trait_group_request: Union[PatchTraitGroupRequest, object] = values.unset, ) -> TraitGroupInstance: """ Asynchronous coroutine to patch the TraitGroupInstance - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param patch_trait_group_request: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: The patched TraitGroupInstance """ payload, _, _ = await self._patch_async( - if_match=if_match, patch_trait_group_request=patch_trait_group_request + patch_trait_group_request=patch_trait_group_request, if_match=if_match ) return TraitGroupInstance( self._version, @@ -664,19 +664,19 @@ async def patch_async( async def patch_with_http_info_async( self, + patch_trait_group_request: PatchTraitGroupRequest, if_match: Union[str, object] = values.unset, - patch_trait_group_request: Union[PatchTraitGroupRequest, object] = values.unset, ) -> ApiResponse: """ Asynchronous coroutine to patch the TraitGroupInstance and return response metadata - :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :param patch_trait_group_request: + :param if_match: Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource's current Entity Tag (ETag) matches the one provided, preventing accidental overwrites. :returns: ApiResponse with instance, status code, and headers """ payload, status_code, headers = await self._patch_async( - if_match=if_match, patch_trait_group_request=patch_trait_group_request + patch_trait_group_request=patch_trait_group_request, if_match=if_match ) instance = TraitGroupInstance( self._version, diff --git a/twilio/rest/verify/v2/service/entity/factor.py b/twilio/rest/verify/v2/service/entity/factor.py index 823dd53f6..746009169 100644 --- a/twilio/rest/verify/v2/service/entity/factor.py +++ b/twilio/rest/verify/v2/service/entity/factor.py @@ -51,7 +51,7 @@ class TotpAlgorithms(object): :ivar status: :ivar factor_type: :ivar config: An object that contains configurations specific to a `factor_type`. - :ivar metadata: Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\"os\": \"Android\"}`. Can be up to 1024 characters in length. + :ivar metadata: Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\"os\": \"Android\"}`. Can be up to 1024 characters in length. For `passkeys` factors, it contains the `aaguid` of the authenticator once the factor is verified, and `date_last_approved` (ISO 8601) once the factor has been used to approve a challenge. :ivar url: The URL of this resource. """ diff --git a/twilio/rest/verify/v2/service/new_verify_factor.py b/twilio/rest/verify/v2/service/new_verify_factor.py index 172d0c9e1..ef884eb98 100644 --- a/twilio/rest/verify/v2/service/new_verify_factor.py +++ b/twilio/rest/verify/v2/service/new_verify_factor.py @@ -94,7 +94,7 @@ def to_dict(self): :ivar status: The Status of this Factor. One of `unverified` or `verified`. :ivar factor_type: The Type of this Factor. Currently `push` and `totp` are supported. :ivar config: An object that contains configurations specific to a `factor_type`. - :ivar metadata: Custom metadata associated with the factor. + :ivar metadata: Metadata associated with the factor. For `passkeys` factors, it contains the `aaguid` of the authenticator once the factor is verified, and `date_last_approved` (ISO 8601) once the factor has been used to approve a challenge. :ivar url: The URL of this resource. """ diff --git a/twilio/rest/voice/v2/__init__.py b/twilio/rest/voice/v2/__init__.py index 625668436..5cfafbd27 100644 --- a/twilio/rest/voice/v2/__init__.py +++ b/twilio/rest/voice/v2/__init__.py @@ -20,6 +20,9 @@ ) from twilio.rest.voice.v2.configuration import ConfigurationList from twilio.rest.voice.v2.recording import RecordingList +from twilio.rest.voice.v2.recording_account_default_configuration import ( + RecordingAccountDefaultConfigurationList, +) from twilio.rest.voice.v2.transcription import TranscriptionList from twilio.rest.voice.v2.type import TypeList @@ -38,6 +41,9 @@ def __init__(self, domain: Domain): ] = None self._configurations: Optional[ConfigurationList] = None self._recording: Optional[RecordingList] = None + self._recording_account_default_configuration: Optional[ + RecordingAccountDefaultConfigurationList + ] = None self._transcription: Optional[TranscriptionList] = None self._type: Optional[TypeList] = None @@ -59,6 +65,16 @@ def recording(self) -> RecordingList: self._recording = RecordingList(self) return self._recording + @property + def recording_account_default_configuration( + self, + ) -> RecordingAccountDefaultConfigurationList: + if self._recording_account_default_configuration is None: + self._recording_account_default_configuration = ( + RecordingAccountDefaultConfigurationList(self) + ) + return self._recording_account_default_configuration + @property def transcription(self) -> TranscriptionList: if self._transcription is None: diff --git a/twilio/rest/voice/v2/recording_account_default_configuration.py b/twilio/rest/voice/v2/recording_account_default_configuration.py new file mode 100644 index 000000000..6e24166aa --- /dev/null +++ b/twilio/rest/voice/v2/recording_account_default_configuration.py @@ -0,0 +1,1069 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio API definition for public-api voice + Powers Twilio public-api voice + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, 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 RecordingAccountDefaultConfigurationInstance(InstanceResource): + + class VoiceV2AccountDefaultConfigurationRecordingRequest(object): + """ + :ivar description: Optional description. + :ivar configuration: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.configuration: Optional[ + RecordingAccountDefaultConfigurationList.VoiceV2ConfigurationRecordingConfiguration + ] = ( + RecordingAccountDefaultConfigurationList.VoiceV2ConfigurationRecordingConfiguration( + payload.get("configuration") + ) + if payload.get("configuration") is not None + else None + ) + + def to_dict(self): + return { + "description": self.description, + "configuration": ( + self.configuration.to_dict() + if self.configuration is not None + else None + ), + } + + class VoiceV2ConfigurationRecordingConfiguration(object): + """ + :ivar configuration_type: The configuration type discriminator. Always \"Recording\" for this resource. + :ivar composition_policy: + :ivar call_recording_status_callback: + :ivar conference_recording_status_callback: + :ivar features: The features to apply to this recording. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.configuration_type: Optional[str] = payload.get("configurationType") + self.composition_policy: Optional[ + RecordingList.VoiceV2ConfigurationRecordingCompositionPolicy + ] = ( + RecordingList.VoiceV2ConfigurationRecordingCompositionPolicy( + payload.get("compositionPolicy") + ) + if payload.get("compositionPolicy") is not None + else None + ) + self.call_recording_status_callback: Optional[ + RecordingList.VoiceV2ConfigurationRecordingStatusCallback + ] = ( + RecordingList.VoiceV2ConfigurationRecordingStatusCallback( + payload.get("callRecordingStatusCallback") + ) + if payload.get("callRecordingStatusCallback") is not None + else None + ) + self.conference_recording_status_callback: Optional[ + RecordingList.VoiceV2ConfigurationRecordingStatusCallback + ] = ( + RecordingList.VoiceV2ConfigurationRecordingStatusCallback( + payload.get("conferenceRecordingStatusCallback") + ) + if payload.get("conferenceRecordingStatusCallback") is not None + else None + ) + self.features: Optional[ + List[RecordingList.VoiceV2ConfigurationRecordingFeature] + ] = ( + [ + ( + RecordingList.VoiceV2ConfigurationRecordingFeature(item) + if isinstance(item, dict) + else item + ) + for item in payload.get("features") + ] + if payload.get("features") is not None + else None + ) + + def to_dict(self): + return { + "configurationType": self.configuration_type, + "compositionPolicy": ( + self.composition_policy.to_dict() + if self.composition_policy is not None + else None + ), + "callRecordingStatusCallback": ( + self.call_recording_status_callback.to_dict() + if self.call_recording_status_callback is not None + else None + ), + "conferenceRecordingStatusCallback": ( + self.conference_recording_status_callback.to_dict() + if self.conference_recording_status_callback is not None + else None + ), + "features": ( + [features.to_dict() for features in self.features] + if self.features is not None + else None + ), + } + + """ + :ivar account_sid: Account SID. + :ivar description: The description. + :ivar date_created: The created date. + :ivar date_updated: The updated date. + :ivar configuration: + :ivar message: Error message + :ivar code: Twilio error code + :ivar status: status code + :ivar more_info: More information about the error + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.description: Optional[str] = payload.get("description") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.configuration: Optional[str] = payload.get("configuration") + self.message: Optional[str] = payload.get("message") + self.code: Optional[int] = payload.get("code") + self.status: Optional[int] = payload.get("status") + self.more_info: Optional[str] = payload.get("more_info") + + self._context: Optional[RecordingAccountDefaultConfigurationContext] = None + + @property + def _proxy(self) -> "RecordingAccountDefaultConfigurationContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: RecordingAccountDefaultConfigurationContext for this RecordingAccountDefaultConfigurationInstance + """ + if self._context is None: + self._context = RecordingAccountDefaultConfigurationContext( + self._version, + ) + return self._context + + def create( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> "RecordingAccountDefaultConfigurationInstance": + """ + Create the RecordingAccountDefaultConfigurationInstance + + :param voice_v2_account_default_configuration_recording_request: + + :returns: The created RecordingAccountDefaultConfigurationInstance + """ + return self._proxy.create( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request, + ) + + async def create_async( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> "RecordingAccountDefaultConfigurationInstance": + """ + Asynchronous coroutine to create the RecordingAccountDefaultConfigurationInstance + + :param voice_v2_account_default_configuration_recording_request: + + :returns: The created RecordingAccountDefaultConfigurationInstance + """ + return await self._proxy.create_async( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request, + ) + + def create_with_http_info( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> ApiResponse: + """ + Create the RecordingAccountDefaultConfigurationInstance with HTTP info + + :param voice_v2_account_default_configuration_recording_request: + + :returns: ApiResponse with instance, status code, and headers + """ + return self._proxy.create_with_http_info( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request, + ) + + async def create_with_http_info_async( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> ApiResponse: + """ + Asynchronous coroutine to create the RecordingAccountDefaultConfigurationInstance with HTTP info + + :param voice_v2_account_default_configuration_recording_request: + + :returns: ApiResponse with instance, status code, and headers + """ + return await self._proxy.create_with_http_info_async( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request, + ) + + def delete(self) -> bool: + """ + Deletes the RecordingAccountDefaultConfigurationInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the RecordingAccountDefaultConfigurationInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def delete_with_http_info(self) -> ApiResponse: + """ + Deletes the RecordingAccountDefaultConfigurationInstance 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 RecordingAccountDefaultConfigurationInstance with HTTP info + + + :returns: ApiResponse with success boolean, status code, and headers + """ + return await self._proxy.delete_with_http_info_async() + + def fetch(self) -> "RecordingAccountDefaultConfigurationInstance": + """ + Fetch the RecordingAccountDefaultConfigurationInstance + + + :returns: The fetched RecordingAccountDefaultConfigurationInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "RecordingAccountDefaultConfigurationInstance": + """ + Asynchronous coroutine to fetch the RecordingAccountDefaultConfigurationInstance + + + :returns: The fetched RecordingAccountDefaultConfigurationInstance + """ + return await self._proxy.fetch_async() + + def fetch_with_http_info(self) -> ApiResponse: + """ + Fetch the RecordingAccountDefaultConfigurationInstance 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 RecordingAccountDefaultConfigurationInstance with HTTP info + + + :returns: ApiResponse with instance, status code, and headers + """ + return await self._proxy.fetch_with_http_info_async() + + def update( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> "RecordingAccountDefaultConfigurationInstance": + """ + Update the RecordingAccountDefaultConfigurationInstance + + :param voice_v2_account_default_configuration_recording_request: + + :returns: The updated RecordingAccountDefaultConfigurationInstance + """ + return self._proxy.update( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request, + ) + + async def update_async( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> "RecordingAccountDefaultConfigurationInstance": + """ + Asynchronous coroutine to update the RecordingAccountDefaultConfigurationInstance + + :param voice_v2_account_default_configuration_recording_request: + + :returns: The updated RecordingAccountDefaultConfigurationInstance + """ + return await self._proxy.update_async( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request, + ) + + def update_with_http_info( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> ApiResponse: + """ + Update the RecordingAccountDefaultConfigurationInstance with HTTP info + + :param voice_v2_account_default_configuration_recording_request: + + :returns: ApiResponse with instance, status code, and headers + """ + return self._proxy.update_with_http_info( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request, + ) + + async def update_with_http_info_async( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> ApiResponse: + """ + Asynchronous coroutine to update the RecordingAccountDefaultConfigurationInstance with HTTP info + + :param voice_v2_account_default_configuration_recording_request: + + :returns: ApiResponse with instance, status code, and headers + """ + return await self._proxy.update_with_http_info_async( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class RecordingAccountDefaultConfigurationContext(InstanceContext): + + class VoiceV2AccountDefaultConfigurationRecordingRequest(object): + """ + :ivar description: Optional description. + :ivar configuration: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.configuration: Optional[ + RecordingAccountDefaultConfigurationList.VoiceV2ConfigurationRecordingConfiguration + ] = ( + RecordingAccountDefaultConfigurationList.VoiceV2ConfigurationRecordingConfiguration( + payload.get("configuration") + ) + if payload.get("configuration") is not None + else None + ) + + def to_dict(self): + return { + "description": self.description, + "configuration": ( + self.configuration.to_dict() + if self.configuration is not None + else None + ), + } + + class VoiceV2ConfigurationRecordingConfiguration(object): + """ + :ivar configuration_type: The configuration type discriminator. Always \"Recording\" for this resource. + :ivar composition_policy: + :ivar call_recording_status_callback: + :ivar conference_recording_status_callback: + :ivar features: The features to apply to this recording. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.configuration_type: Optional[str] = payload.get("configurationType") + self.composition_policy: Optional[ + RecordingList.VoiceV2ConfigurationRecordingCompositionPolicy + ] = ( + RecordingList.VoiceV2ConfigurationRecordingCompositionPolicy( + payload.get("compositionPolicy") + ) + if payload.get("compositionPolicy") is not None + else None + ) + self.call_recording_status_callback: Optional[ + RecordingList.VoiceV2ConfigurationRecordingStatusCallback + ] = ( + RecordingList.VoiceV2ConfigurationRecordingStatusCallback( + payload.get("callRecordingStatusCallback") + ) + if payload.get("callRecordingStatusCallback") is not None + else None + ) + self.conference_recording_status_callback: Optional[ + RecordingList.VoiceV2ConfigurationRecordingStatusCallback + ] = ( + RecordingList.VoiceV2ConfigurationRecordingStatusCallback( + payload.get("conferenceRecordingStatusCallback") + ) + if payload.get("conferenceRecordingStatusCallback") is not None + else None + ) + self.features: Optional[ + List[RecordingList.VoiceV2ConfigurationRecordingFeature] + ] = ( + [ + ( + RecordingList.VoiceV2ConfigurationRecordingFeature(item) + if isinstance(item, dict) + else item + ) + for item in payload.get("features") + ] + if payload.get("features") is not None + else None + ) + + def to_dict(self): + return { + "configurationType": self.configuration_type, + "compositionPolicy": ( + self.composition_policy.to_dict() + if self.composition_policy is not None + else None + ), + "callRecordingStatusCallback": ( + self.call_recording_status_callback.to_dict() + if self.call_recording_status_callback is not None + else None + ), + "conferenceRecordingStatusCallback": ( + self.conference_recording_status_callback.to_dict() + if self.conference_recording_status_callback is not None + else None + ), + "features": ( + [features.to_dict() for features in self.features] + if self.features is not None + else None + ), + } + + def __init__(self, version: Version): + """ + Initialize the RecordingAccountDefaultConfigurationContext + + :param version: Version that contains the resource + """ + super().__init__(version) + + self._uri = "/AccountDefaultConfiguration/Recording" + + def _create( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> tuple: + """ + Internal helper for create operation + + Returns: + tuple: (payload, status_code, headers) + """ + data = voice_v2_account_default_configuration_recording_request.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + return self._version.create_with_response_info( + method="POST", uri=self._uri, data=data, headers=headers + ) + + def create( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> RecordingAccountDefaultConfigurationInstance: + """ + Create the RecordingAccountDefaultConfigurationInstance + + :param voice_v2_account_default_configuration_recording_request: + + :returns: The created RecordingAccountDefaultConfigurationInstance + """ + payload, _, _ = self._create( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request + ) + return RecordingAccountDefaultConfigurationInstance(self._version, payload) + + def create_with_http_info( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> ApiResponse: + """ + Create the RecordingAccountDefaultConfigurationInstance and return response metadata + + :param voice_v2_account_default_configuration_recording_request: + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = self._create( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request + ) + instance = RecordingAccountDefaultConfigurationInstance(self._version, payload) + return ApiResponse(data=instance, status_code=status_code, headers=headers) + + async def _create_async( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> tuple: + """ + Internal async helper for create operation + + Returns: + tuple: (payload, status_code, headers) + """ + data = voice_v2_account_default_configuration_recording_request.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + return await self._version.create_with_response_info_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + async def create_async( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> RecordingAccountDefaultConfigurationInstance: + """ + Asynchronous coroutine to create the RecordingAccountDefaultConfigurationInstance + + :param voice_v2_account_default_configuration_recording_request: + + :returns: The created RecordingAccountDefaultConfigurationInstance + """ + payload, _, _ = await self._create_async( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request + ) + return RecordingAccountDefaultConfigurationInstance(self._version, payload) + + async def create_with_http_info_async( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> ApiResponse: + """ + Asynchronous coroutine to create the RecordingAccountDefaultConfigurationInstance and return response metadata + + :param voice_v2_account_default_configuration_recording_request: + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = await self._create_async( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request + ) + instance = RecordingAccountDefaultConfigurationInstance(self._version, payload) + return ApiResponse(data=instance, status_code=status_code, headers=headers) + + def _delete(self) -> tuple: + """ + Internal helper for delete operation + + Returns: + tuple: (success_boolean, status_code, headers) + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + return self._version.delete_with_response_info( + method="DELETE", uri=self._uri, headers=headers + ) + + def delete(self) -> bool: + """ + Deletes the RecordingAccountDefaultConfigurationInstance + + + :returns: True if delete succeeds, False otherwise + """ + success, _, _ = self._delete() + return success + + def delete_with_http_info(self) -> ApiResponse: + """ + Deletes the RecordingAccountDefaultConfigurationInstance 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({}) + + headers["Accept"] = "application/json" + + 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 RecordingAccountDefaultConfigurationInstance + + + :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 RecordingAccountDefaultConfigurationInstance 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 + + 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) -> RecordingAccountDefaultConfigurationInstance: + """ + Fetch the RecordingAccountDefaultConfigurationInstance + + + :returns: The fetched RecordingAccountDefaultConfigurationInstance + """ + payload, _, _ = self._fetch() + return RecordingAccountDefaultConfigurationInstance( + self._version, + payload, + ) + + def fetch_with_http_info(self) -> ApiResponse: + """ + Fetch the RecordingAccountDefaultConfigurationInstance and return response metadata + + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = self._fetch() + instance = RecordingAccountDefaultConfigurationInstance( + self._version, + payload, + ) + 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) -> RecordingAccountDefaultConfigurationInstance: + """ + Asynchronous coroutine to fetch the RecordingAccountDefaultConfigurationInstance + + + :returns: The fetched RecordingAccountDefaultConfigurationInstance + """ + payload, _, _ = await self._fetch_async() + return RecordingAccountDefaultConfigurationInstance( + self._version, + payload, + ) + + async def fetch_with_http_info_async(self) -> ApiResponse: + """ + Asynchronous coroutine to fetch the RecordingAccountDefaultConfigurationInstance and return response metadata + + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = await self._fetch_async() + instance = RecordingAccountDefaultConfigurationInstance( + self._version, + payload, + ) + return ApiResponse(data=instance, status_code=status_code, headers=headers) + + def _update( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> tuple: + """ + Internal helper for update operation + + Returns: + tuple: (payload, status_code, headers) + """ + data = voice_v2_account_default_configuration_recording_request.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + return self._version.update_with_response_info( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + def update( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> RecordingAccountDefaultConfigurationInstance: + """ + Update the RecordingAccountDefaultConfigurationInstance + + :param voice_v2_account_default_configuration_recording_request: + + :returns: The updated RecordingAccountDefaultConfigurationInstance + """ + payload, _, _ = self._update( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request + ) + return RecordingAccountDefaultConfigurationInstance(self._version, payload) + + def update_with_http_info( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> ApiResponse: + """ + Update the RecordingAccountDefaultConfigurationInstance and return response metadata + + :param voice_v2_account_default_configuration_recording_request: + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = self._update( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request + ) + instance = RecordingAccountDefaultConfigurationInstance(self._version, payload) + return ApiResponse(data=instance, status_code=status_code, headers=headers) + + async def _update_async( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> tuple: + """ + Internal async helper for update operation + + Returns: + tuple: (payload, status_code, headers) + """ + data = voice_v2_account_default_configuration_recording_request.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + return await self._version.update_with_response_info_async( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + async def update_async( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> RecordingAccountDefaultConfigurationInstance: + """ + Asynchronous coroutine to update the RecordingAccountDefaultConfigurationInstance + + :param voice_v2_account_default_configuration_recording_request: + + :returns: The updated RecordingAccountDefaultConfigurationInstance + """ + payload, _, _ = await self._update_async( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request + ) + return RecordingAccountDefaultConfigurationInstance(self._version, payload) + + async def update_with_http_info_async( + self, + voice_v2_account_default_configuration_recording_request: Union[ + VoiceV2AccountDefaultConfigurationRecordingRequest, object + ] = values.unset, + ) -> ApiResponse: + """ + Asynchronous coroutine to update the RecordingAccountDefaultConfigurationInstance and return response metadata + + :param voice_v2_account_default_configuration_recording_request: + + :returns: ApiResponse with instance, status code, and headers + """ + payload, status_code, headers = await self._update_async( + voice_v2_account_default_configuration_recording_request=voice_v2_account_default_configuration_recording_request + ) + instance = RecordingAccountDefaultConfigurationInstance(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 "" + + +class RecordingAccountDefaultConfigurationList(ListResource): + + class VoiceV2AccountDefaultConfigurationRecordingRequest(object): + """ + :ivar description: Optional description. + :ivar configuration: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.configuration: Optional[ + RecordingAccountDefaultConfigurationList.VoiceV2ConfigurationRecordingConfiguration + ] = ( + RecordingAccountDefaultConfigurationList.VoiceV2ConfigurationRecordingConfiguration( + payload.get("configuration") + ) + if payload.get("configuration") is not None + else None + ) + + def to_dict(self): + return { + "description": self.description, + "configuration": ( + self.configuration.to_dict() + if self.configuration is not None + else None + ), + } + + class VoiceV2ConfigurationRecordingConfiguration(object): + """ + :ivar configuration_type: The configuration type discriminator. Always \"Recording\" for this resource. + :ivar composition_policy: + :ivar call_recording_status_callback: + :ivar conference_recording_status_callback: + :ivar features: The features to apply to this recording. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.configuration_type: Optional[str] = payload.get("configurationType") + self.composition_policy: Optional[ + RecordingList.VoiceV2ConfigurationRecordingCompositionPolicy + ] = ( + RecordingList.VoiceV2ConfigurationRecordingCompositionPolicy( + payload.get("compositionPolicy") + ) + if payload.get("compositionPolicy") is not None + else None + ) + self.call_recording_status_callback: Optional[ + RecordingList.VoiceV2ConfigurationRecordingStatusCallback + ] = ( + RecordingList.VoiceV2ConfigurationRecordingStatusCallback( + payload.get("callRecordingStatusCallback") + ) + if payload.get("callRecordingStatusCallback") is not None + else None + ) + self.conference_recording_status_callback: Optional[ + RecordingList.VoiceV2ConfigurationRecordingStatusCallback + ] = ( + RecordingList.VoiceV2ConfigurationRecordingStatusCallback( + payload.get("conferenceRecordingStatusCallback") + ) + if payload.get("conferenceRecordingStatusCallback") is not None + else None + ) + self.features: Optional[ + List[RecordingList.VoiceV2ConfigurationRecordingFeature] + ] = ( + [ + ( + RecordingList.VoiceV2ConfigurationRecordingFeature(item) + if isinstance(item, dict) + else item + ) + for item in payload.get("features") + ] + if payload.get("features") is not None + else None + ) + + def to_dict(self): + return { + "configurationType": self.configuration_type, + "compositionPolicy": ( + self.composition_policy.to_dict() + if self.composition_policy is not None + else None + ), + "callRecordingStatusCallback": ( + self.call_recording_status_callback.to_dict() + if self.call_recording_status_callback is not None + else None + ), + "conferenceRecordingStatusCallback": ( + self.conference_recording_status_callback.to_dict() + if self.conference_recording_status_callback is not None + else None + ), + "features": ( + [features.to_dict() for features in self.features] + if self.features is not None + else None + ), + } + + def __init__(self, version: Version): + """ + Initialize the RecordingAccountDefaultConfigurationList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self) -> RecordingAccountDefaultConfigurationContext: + """ + Constructs a RecordingAccountDefaultConfigurationContext + + """ + return RecordingAccountDefaultConfigurationContext(self._version) + + def __call__(self) -> RecordingAccountDefaultConfigurationContext: + """ + Constructs a RecordingAccountDefaultConfigurationContext + + """ + return RecordingAccountDefaultConfigurationContext(self._version) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/twiml/voice_response.py b/twilio/twiml/voice_response.py index 8a5d0029b..9145efac4 100644 --- a/twilio/twiml/voice_response.py +++ b/twilio/twiml/voice_response.py @@ -616,6 +616,8 @@ def stream( track=None, status_callback=None, status_callback_method=None, + audio_format=None, + sample_rate=None, **kwargs ): """ @@ -627,6 +629,8 @@ def stream( :param track: Track to be streamed to remote service :param status_callback: Status Callback URL :param status_callback_method: Status Callback URL method + :param audio_format: Required Audio Format + :param sample_rate: Sample Rate for HD Codec :param kwargs: additional attributes :returns: element @@ -639,6 +643,8 @@ def stream( track=track, status_callback=status_callback, status_callback_method=status_callback_method, + audio_format=audio_format, + sample_rate=sample_rate, **kwargs ) ) @@ -838,6 +844,8 @@ def stream( track=None, status_callback=None, status_callback_method=None, + audio_format=None, + sample_rate=None, **kwargs ): """ @@ -849,6 +857,8 @@ def stream( :param track: Track to be streamed to remote service :param status_callback: Status Callback URL :param status_callback_method: Status Callback URL method + :param audio_format: Required Audio Format + :param sample_rate: Sample Rate for HD Codec :param kwargs: additional attributes :returns: element @@ -861,6 +871,8 @@ def stream( track=track, status_callback=status_callback, status_callback_method=status_callback_method, + audio_format=audio_format, + sample_rate=sample_rate, **kwargs ) ) @@ -2801,6 +2813,8 @@ def stream( track=None, status_callback=None, status_callback_method=None, + audio_format=None, + sample_rate=None, **kwargs ): """ @@ -2812,6 +2826,8 @@ def stream( :param track: Track to be streamed to remote service :param status_callback: Status Callback URL :param status_callback_method: Status Callback URL method + :param audio_format: Required Audio Format + :param sample_rate: Sample Rate for HD Codec :param kwargs: additional attributes :returns: element @@ -2824,6 +2840,8 @@ def stream( track=track, status_callback=status_callback, status_callback_method=status_callback_method, + audio_format=audio_format, + sample_rate=sample_rate, **kwargs ) )