# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations from typing import Optional from typing_extensions import Literal import httpx from ...types import ( MessagingMetricsTimeFrame, messaging_profile_list_params, messaging_profile_create_params, messaging_profile_update_params, messaging_profile_list_short_codes_params, messaging_profile_retrieve_metrics_params, messaging_profile_list_phone_numbers_params, messaging_profile_list_alphanumeric_sender_ids_params, ) from .actions import ( ActionsResource, AsyncActionsResource, ActionsResourceWithRawResponse, AsyncActionsResourceWithRawResponse, ActionsResourceWithStreamingResponse, AsyncActionsResourceWithStreamingResponse, ) from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( to_raw_response_wrapper, to_streamed_response_wrapper, async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) from ...pagination import SyncDefaultFlatPagination, AsyncDefaultFlatPagination from ..._base_client import AsyncPaginator, make_request_options from .autoresp_configs import ( AutorespConfigsResource, AsyncAutorespConfigsResource, AutorespConfigsResourceWithRawResponse, AsyncAutorespConfigsResourceWithRawResponse, AutorespConfigsResourceWithStreamingResponse, AsyncAutorespConfigsResourceWithStreamingResponse, ) from ...types.shared.short_code import ShortCode from ...types.mm7_metadata_param import Mm7MetadataParam from ...types.alphanumeric_sender_id import AlphanumericSenderID from ...types.number_pool_settings_param import NumberPoolSettingsParam from ...types.messaging_messaging_profile import MessagingMessagingProfile from ...types.messaging_metrics_time_frame import MessagingMetricsTimeFrame from ...types.url_shortener_settings_param import URLShortenerSettingsParam from ...types.messaging_profile_features_param import MessagingProfileFeaturesParam from ...types.messaging_profile_create_response import MessagingProfileCreateResponse from ...types.messaging_profile_delete_response import MessagingProfileDeleteResponse from ...types.messaging_profile_update_response import MessagingProfileUpdateResponse from ...types.messaging_profile_retrieve_response import MessagingProfileRetrieveResponse from ...types.messaging_profile_retrieve_metrics_response import MessagingProfileRetrieveMetricsResponse from ...types.shared.phone_number_with_messaging_settings import PhoneNumberWithMessagingSettings __all__ = ["MessagingProfilesResource", "AsyncMessagingProfilesResource"] class MessagingProfilesResource(SyncAPIResource): @cached_property def autoresp_configs(self) -> AutorespConfigsResource: """Opt-Out Management""" return AutorespConfigsResource(self._client) @cached_property def actions(self) -> ActionsResource: return ActionsResource(self._client) @cached_property def with_raw_response(self) -> MessagingProfilesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/team-telnyx/telnyx-python#accessing-raw-response-data-eg-headers """ return MessagingProfilesResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> MessagingProfilesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/team-telnyx/telnyx-python#with_streaming_response """ return MessagingProfilesResourceWithStreamingResponse(self) def create( self, *, name: str, whitelisted_destinations: SequenceNotStr[str], ai_assistant_id: Optional[str] | Omit = omit, alpha_sender: Optional[str] | Omit = omit, daily_spend_limit: str | Omit = omit, daily_spend_limit_enabled: bool | Omit = omit, enabled: bool | Omit = omit, features: Optional[MessagingProfileFeaturesParam] | Omit = omit, health_webhook_url: Optional[str] | Omit = omit, mm7_metadata: Optional[Mm7MetadataParam] | Omit = omit, mms_fall_back_to_sms: bool | Omit = omit, mms_transcoding: bool | Omit = omit, mobile_only: bool | Omit = omit, number_pool_settings: Optional[NumberPoolSettingsParam] | Omit = omit, resource_group_id: Optional[str] | Omit = omit, smart_encoding: bool | Omit = omit, url_shortener_settings: Optional[URLShortenerSettingsParam] | Omit = omit, webhook_api_version: Literal["1", "2", "2010-04-01"] | Omit = omit, webhook_failover_url: Optional[str] | Omit = omit, webhook_url: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagingProfileCreateResponse: """ Creates a messaging profile that controls outbound sender selection, webhook delivery, and inbound message handling for associated numbers and short codes. Args: name: A user friendly name for the messaging profile. whitelisted_destinations: Destinations to which the messaging profile is allowed to send. The elements in the list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]` all destinations will be allowed. ai_assistant_id: The AI assistant ID to associate with this messaging profile. alpha_sender: The alphanumeric sender ID to use when sending to destinations that require an alphanumeric sender ID. daily_spend_limit: The maximum amount of money (in USD) that can be spent by this profile before midnight UTC. daily_spend_limit_enabled: Whether to enforce the value configured by `daily_spend_limit`. enabled: Specifies whether the messaging profile is enabled or not. features: Telnyx product features the messaging customer can enable on the messaging profile. Keys map to individual feature flags; unknown keys are accepted and preserved for forward compatibility with rolling deployments. health_webhook_url: A URL to receive health check webhooks for numbers in this profile. mm7_metadata: MM7 settings for inbound messages mms_fall_back_to_sms: enables SMS fallback for MMS messages. mms_transcoding: enables automated resizing of MMS media. mobile_only: Send messages only to mobile phone numbers. number_pool_settings: Number Pool allows you to send messages from a pool of numbers of different types, assigning weights to each type. The pool consists of all the long code and toll free numbers assigned to the messaging profile. To disable this feature, set the object field to `null`. resource_group_id: The resource group ID to associate with this messaging profile. smart_encoding: Enables automatic character encoding optimization for SMS messages. When enabled, the system automatically selects the most efficient encoding (GSM-7 or UCS-2) based on message content to maximize character limits and minimize costs. url_shortener_settings: The URL shortener feature allows automatic replacement of URLs that were generated using a public URL shortener service. Some examples include bit.do, bit.ly, goo.gl, ht.ly, is.gd, ow.ly, rebrand.ly, t.co, tiny.cc, and tinyurl.com. Such URLs are replaced with with links generated by Telnyx. The use of custom links can improve branding and message deliverability. To disable this feature, set the object field to `null`. webhook_api_version: Determines which webhook format will be used, Telnyx API v1, v2, or a legacy 2010-04-01 format. webhook_failover_url: The failover URL where webhooks related to this messaging profile will be sent if sending to the primary URL fails. webhook_url: The URL where webhooks related to this messaging profile will be sent. extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ return self._post( "/messaging_profiles", body=maybe_transform( { "name": name, "whitelisted_destinations": whitelisted_destinations, "ai_assistant_id": ai_assistant_id, "alpha_sender": alpha_sender, "daily_spend_limit": daily_spend_limit, "daily_spend_limit_enabled": daily_spend_limit_enabled, "enabled": enabled, "features": features, "health_webhook_url": health_webhook_url, "mm7_metadata": mm7_metadata, "mms_fall_back_to_sms": mms_fall_back_to_sms, "mms_transcoding": mms_transcoding, "mobile_only": mobile_only, "number_pool_settings": number_pool_settings, "resource_group_id": resource_group_id, "smart_encoding": smart_encoding, "url_shortener_settings": url_shortener_settings, "webhook_api_version": webhook_api_version, "webhook_failover_url": webhook_failover_url, "webhook_url": webhook_url, }, messaging_profile_create_params.MessagingProfileCreateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=MessagingProfileCreateResponse, ) def retrieve( self, messaging_profile_id: str, *, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagingProfileRetrieveResponse: """ Returns the complete configuration of the specified messaging profile, including webhook and sender-selection settings. Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ if not messaging_profile_id: raise ValueError( f"Expected a non-empty value for `messaging_profile_id` but received {messaging_profile_id!r}" ) return self._get( path_template("/messaging_profiles/{messaging_profile_id}", messaging_profile_id=messaging_profile_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=MessagingProfileRetrieveResponse, ) def update( self, messaging_profile_id: str, *, ai_assistant_id: Optional[str] | Omit = omit, alpha_sender: Optional[str] | Omit = omit, daily_spend_limit: str | Omit = omit, daily_spend_limit_enabled: bool | Omit = omit, enabled: bool | Omit = omit, features: Optional[MessagingProfileFeaturesParam] | Omit = omit, mm7_metadata: Optional[Mm7MetadataParam] | Omit = omit, mms_fall_back_to_sms: bool | Omit = omit, mms_transcoding: bool | Omit = omit, mobile_only: bool | Omit = omit, name: str | Omit = omit, number_pool_settings: Optional[NumberPoolSettingsParam] | Omit = omit, redaction_enabled: bool | Omit = omit, redaction_level: int | Omit = omit, smart_encoding: bool | Omit = omit, url_shortener_settings: Optional[URLShortenerSettingsParam] | Omit = omit, v1_secret: str | Omit = omit, webhook_api_version: Literal["1", "2", "2010-04-01"] | Omit = omit, webhook_failover_url: Optional[str] | Omit = omit, webhook_url: Optional[str] | Omit = omit, whitelisted_destinations: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagingProfileUpdateResponse: """Updates the supplied settings on the specified messaging profile. Settings omitted from the request remain unchanged. Args: ai_assistant_id: The ID of the AI assistant associated with this messaging profile. alpha_sender: The alphanumeric sender ID to use when sending to destinations that require an alphanumeric sender ID. daily_spend_limit: The maximum amount of money (in USD) that can be spent by this profile before midnight UTC. daily_spend_limit_enabled: Whether to enforce the value configured by `daily_spend_limit`. enabled: Specifies whether the messaging profile is enabled or not. features: Telnyx product features the messaging customer can enable on the messaging profile. Keys map to individual feature flags; unknown keys are accepted and preserved for forward compatibility with rolling deployments. mm7_metadata: MM7 settings for inbound messages mms_fall_back_to_sms: enables SMS fallback for MMS messages. mms_transcoding: enables automated resizing of MMS media. mobile_only: Send messages only to mobile phone numbers. name: A user friendly name for the messaging profile. number_pool_settings: Number Pool allows you to send messages from a pool of numbers of different types, assigning weights to each type. The pool consists of all the long code and toll free numbers assigned to the messaging profile. To disable this feature, set the object field to `null`. redaction_enabled: Set to true to enable message content redaction on this profile, or false to disable it. Ignored if the organization is not on the redaction allowlist. See the [Message Redaction guide](/docs/messaging/messages/message-redaction) for what is redacted. redaction_level: The redaction level to apply when redaction is enabled. 1: redact message records and reporting only. 2 (default): also redact inbound webhook payloads. See the [Message Redaction guide](/docs/messaging/messages/message-redaction). smart_encoding: Enables automatic character encoding optimization for SMS messages. When enabled, the system automatically selects the most efficient encoding (GSM-7 or UCS-2) based on message content to maximize character limits and minimize costs. url_shortener_settings: The URL shortener feature allows automatic replacement of URLs that were generated using a public URL shortener service. Some examples include bit.do, bit.ly, goo.gl, ht.ly, is.gd, ow.ly, rebrand.ly, t.co, tiny.cc, and tinyurl.com. Such URLs are replaced with with links generated by Telnyx. The use of custom links can improve branding and message deliverability. To disable this feature, set the object field to `null`. v1_secret: Secret used to authenticate with v1 endpoints. webhook_api_version: Determines which webhook format will be used, Telnyx API v1, v2, or a legacy 2010-04-01 format. webhook_failover_url: The failover URL where webhooks related to this messaging profile will be sent if sending to the primary URL fails. webhook_url: The URL where webhooks related to this messaging profile will be sent. whitelisted_destinations: Destinations to which the messaging profile is allowed to send. The elements in the list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]`, all destinations will be allowed. This field is required if the messaging profile doesn't have it defined yet. extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ if not messaging_profile_id: raise ValueError( f"Expected a non-empty value for `messaging_profile_id` but received {messaging_profile_id!r}" ) return self._patch( path_template("/messaging_profiles/{messaging_profile_id}", messaging_profile_id=messaging_profile_id), body=maybe_transform( { "ai_assistant_id": ai_assistant_id, "alpha_sender": alpha_sender, "daily_spend_limit": daily_spend_limit, "daily_spend_limit_enabled": daily_spend_limit_enabled, "enabled": enabled, "features": features, "mm7_metadata": mm7_metadata, "mms_fall_back_to_sms": mms_fall_back_to_sms, "mms_transcoding": mms_transcoding, "mobile_only": mobile_only, "name": name, "number_pool_settings": number_pool_settings, "redaction_enabled": redaction_enabled, "redaction_level": redaction_level, "smart_encoding": smart_encoding, "url_shortener_settings": url_shortener_settings, "v1_secret": v1_secret, "webhook_api_version": webhook_api_version, "webhook_failover_url": webhook_failover_url, "webhook_url": webhook_url, "whitelisted_destinations": whitelisted_destinations, }, messaging_profile_update_params.MessagingProfileUpdateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=MessagingProfileUpdateResponse, ) def list( self, *, filter: messaging_profile_list_params.Filter | Omit = omit, filter_name_contains: str | Omit = omit, filter_name_eq: str | Omit = omit, page_number: int | Omit = omit, page_size: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncDefaultFlatPagination[MessagingMessagingProfile]: """Lists messaging profiles owned by the authenticated account. Apply the documented filters and pagination parameters to narrow the result set. Args: filter: Consolidated filter parameter (deepObject style). Originally: filter[name] filter_name_contains: Filter profiles by name containing the given string. filter_name_eq: Filter profiles by exact name match. extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ return self._get_api_list( "/messaging_profiles", page=SyncDefaultFlatPagination[MessagingMessagingProfile], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform( { "filter": filter, "filter_name_contains": filter_name_contains, "filter_name_eq": filter_name_eq, "page_number": page_number, "page_size": page_size, }, messaging_profile_list_params.MessagingProfileListParams, ), ), model=MessagingMessagingProfile, ) def delete( self, messaging_profile_id: str, *, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagingProfileDeleteResponse: """ Deletes the specified messaging profile and returns the profile's final configuration. Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ if not messaging_profile_id: raise ValueError( f"Expected a non-empty value for `messaging_profile_id` but received {messaging_profile_id!r}" ) return self._delete( path_template("/messaging_profiles/{messaging_profile_id}", messaging_profile_id=messaging_profile_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=MessagingProfileDeleteResponse, ) def list_alphanumeric_sender_ids( self, id: str, *, page_number: int | Omit = omit, page_size: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncDefaultFlatPagination[AlphanumericSenderID]: """ List all alphanumeric sender IDs associated with a specific messaging profile. Args: page_number: Page number to retrieve (1-based). page_size: Number of items to return per page. extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get_api_list( path_template("/messaging_profiles/{id}/alphanumeric_sender_ids", id=id), page=SyncDefaultFlatPagination[AlphanumericSenderID], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform( { "page_number": page_number, "page_size": page_size, }, messaging_profile_list_alphanumeric_sender_ids_params.MessagingProfileListAlphanumericSenderIDsParams, ), ), model=AlphanumericSenderID, ) def list_phone_numbers( self, messaging_profile_id: str, *, page_number: int | Omit = omit, page_size: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncDefaultFlatPagination[PhoneNumberWithMessagingSettings]: """ Returns the phone numbers currently associated with the specified messaging profile. Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ if not messaging_profile_id: raise ValueError( f"Expected a non-empty value for `messaging_profile_id` but received {messaging_profile_id!r}" ) return self._get_api_list( path_template( "/messaging_profiles/{messaging_profile_id}/phone_numbers", messaging_profile_id=messaging_profile_id ), page=SyncDefaultFlatPagination[PhoneNumberWithMessagingSettings], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform( { "page_number": page_number, "page_size": page_size, }, messaging_profile_list_phone_numbers_params.MessagingProfileListPhoneNumbersParams, ), ), model=PhoneNumberWithMessagingSettings, ) def list_short_codes( self, messaging_profile_id: str, *, page_number: int | Omit = omit, page_size: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncDefaultFlatPagination[ShortCode]: """ Returns the short codes currently associated with the specified messaging profile. Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ if not messaging_profile_id: raise ValueError( f"Expected a non-empty value for `messaging_profile_id` but received {messaging_profile_id!r}" ) return self._get_api_list( path_template( "/messaging_profiles/{messaging_profile_id}/short_codes", messaging_profile_id=messaging_profile_id ), page=SyncDefaultFlatPagination[ShortCode], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform( { "page_number": page_number, "page_size": page_size, }, messaging_profile_list_short_codes_params.MessagingProfileListShortCodesParams, ), ), model=ShortCode, ) def retrieve_metrics( self, id: str, *, time_frame: MessagingMetricsTimeFrame | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagingProfileRetrieveMetricsResponse: """ Get detailed metrics for a specific messaging profile, broken down by time interval. Args: time_frame: The time frame for metrics. extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get( path_template("/messaging_profiles/{id}/metrics", id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform( {"time_frame": time_frame}, messaging_profile_retrieve_metrics_params.MessagingProfileRetrieveMetricsParams, ), ), cast_to=MessagingProfileRetrieveMetricsResponse, ) class AsyncMessagingProfilesResource(AsyncAPIResource): @cached_property def autoresp_configs(self) -> AsyncAutorespConfigsResource: """Opt-Out Management""" return AsyncAutorespConfigsResource(self._client) @cached_property def actions(self) -> AsyncActionsResource: return AsyncActionsResource(self._client) @cached_property def with_raw_response(self) -> AsyncMessagingProfilesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/team-telnyx/telnyx-python#accessing-raw-response-data-eg-headers """ return AsyncMessagingProfilesResourceWithRawResponse(self) @cached_property def with_streaming_response(self) -> AsyncMessagingProfilesResourceWithStreamingResponse: """ An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/team-telnyx/telnyx-python#with_streaming_response """ return AsyncMessagingProfilesResourceWithStreamingResponse(self) async def create( self, *, name: str, whitelisted_destinations: SequenceNotStr[str], ai_assistant_id: Optional[str] | Omit = omit, alpha_sender: Optional[str] | Omit = omit, daily_spend_limit: str | Omit = omit, daily_spend_limit_enabled: bool | Omit = omit, enabled: bool | Omit = omit, features: Optional[MessagingProfileFeaturesParam] | Omit = omit, health_webhook_url: Optional[str] | Omit = omit, mm7_metadata: Optional[Mm7MetadataParam] | Omit = omit, mms_fall_back_to_sms: bool | Omit = omit, mms_transcoding: bool | Omit = omit, mobile_only: bool | Omit = omit, number_pool_settings: Optional[NumberPoolSettingsParam] | Omit = omit, resource_group_id: Optional[str] | Omit = omit, smart_encoding: bool | Omit = omit, url_shortener_settings: Optional[URLShortenerSettingsParam] | Omit = omit, webhook_api_version: Literal["1", "2", "2010-04-01"] | Omit = omit, webhook_failover_url: Optional[str] | Omit = omit, webhook_url: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagingProfileCreateResponse: """ Creates a messaging profile that controls outbound sender selection, webhook delivery, and inbound message handling for associated numbers and short codes. Args: name: A user friendly name for the messaging profile. whitelisted_destinations: Destinations to which the messaging profile is allowed to send. The elements in the list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]` all destinations will be allowed. ai_assistant_id: The AI assistant ID to associate with this messaging profile. alpha_sender: The alphanumeric sender ID to use when sending to destinations that require an alphanumeric sender ID. daily_spend_limit: The maximum amount of money (in USD) that can be spent by this profile before midnight UTC. daily_spend_limit_enabled: Whether to enforce the value configured by `daily_spend_limit`. enabled: Specifies whether the messaging profile is enabled or not. features: Telnyx product features the messaging customer can enable on the messaging profile. Keys map to individual feature flags; unknown keys are accepted and preserved for forward compatibility with rolling deployments. health_webhook_url: A URL to receive health check webhooks for numbers in this profile. mm7_metadata: MM7 settings for inbound messages mms_fall_back_to_sms: enables SMS fallback for MMS messages. mms_transcoding: enables automated resizing of MMS media. mobile_only: Send messages only to mobile phone numbers. number_pool_settings: Number Pool allows you to send messages from a pool of numbers of different types, assigning weights to each type. The pool consists of all the long code and toll free numbers assigned to the messaging profile. To disable this feature, set the object field to `null`. resource_group_id: The resource group ID to associate with this messaging profile. smart_encoding: Enables automatic character encoding optimization for SMS messages. When enabled, the system automatically selects the most efficient encoding (GSM-7 or UCS-2) based on message content to maximize character limits and minimize costs. url_shortener_settings: The URL shortener feature allows automatic replacement of URLs that were generated using a public URL shortener service. Some examples include bit.do, bit.ly, goo.gl, ht.ly, is.gd, ow.ly, rebrand.ly, t.co, tiny.cc, and tinyurl.com. Such URLs are replaced with with links generated by Telnyx. The use of custom links can improve branding and message deliverability. To disable this feature, set the object field to `null`. webhook_api_version: Determines which webhook format will be used, Telnyx API v1, v2, or a legacy 2010-04-01 format. webhook_failover_url: The failover URL where webhooks related to this messaging profile will be sent if sending to the primary URL fails. webhook_url: The URL where webhooks related to this messaging profile will be sent. extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ return await self._post( "/messaging_profiles", body=await async_maybe_transform( { "name": name, "whitelisted_destinations": whitelisted_destinations, "ai_assistant_id": ai_assistant_id, "alpha_sender": alpha_sender, "daily_spend_limit": daily_spend_limit, "daily_spend_limit_enabled": daily_spend_limit_enabled, "enabled": enabled, "features": features, "health_webhook_url": health_webhook_url, "mm7_metadata": mm7_metadata, "mms_fall_back_to_sms": mms_fall_back_to_sms, "mms_transcoding": mms_transcoding, "mobile_only": mobile_only, "number_pool_settings": number_pool_settings, "resource_group_id": resource_group_id, "smart_encoding": smart_encoding, "url_shortener_settings": url_shortener_settings, "webhook_api_version": webhook_api_version, "webhook_failover_url": webhook_failover_url, "webhook_url": webhook_url, }, messaging_profile_create_params.MessagingProfileCreateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=MessagingProfileCreateResponse, ) async def retrieve( self, messaging_profile_id: str, *, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagingProfileRetrieveResponse: """ Returns the complete configuration of the specified messaging profile, including webhook and sender-selection settings. Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ if not messaging_profile_id: raise ValueError( f"Expected a non-empty value for `messaging_profile_id` but received {messaging_profile_id!r}" ) return await self._get( path_template("/messaging_profiles/{messaging_profile_id}", messaging_profile_id=messaging_profile_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=MessagingProfileRetrieveResponse, ) async def update( self, messaging_profile_id: str, *, ai_assistant_id: Optional[str] | Omit = omit, alpha_sender: Optional[str] | Omit = omit, daily_spend_limit: str | Omit = omit, daily_spend_limit_enabled: bool | Omit = omit, enabled: bool | Omit = omit, features: Optional[MessagingProfileFeaturesParam] | Omit = omit, mm7_metadata: Optional[Mm7MetadataParam] | Omit = omit, mms_fall_back_to_sms: bool | Omit = omit, mms_transcoding: bool | Omit = omit, mobile_only: bool | Omit = omit, name: str | Omit = omit, number_pool_settings: Optional[NumberPoolSettingsParam] | Omit = omit, redaction_enabled: bool | Omit = omit, redaction_level: int | Omit = omit, smart_encoding: bool | Omit = omit, url_shortener_settings: Optional[URLShortenerSettingsParam] | Omit = omit, v1_secret: str | Omit = omit, webhook_api_version: Literal["1", "2", "2010-04-01"] | Omit = omit, webhook_failover_url: Optional[str] | Omit = omit, webhook_url: Optional[str] | Omit = omit, whitelisted_destinations: SequenceNotStr[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagingProfileUpdateResponse: """Updates the supplied settings on the specified messaging profile. Settings omitted from the request remain unchanged. Args: ai_assistant_id: The ID of the AI assistant associated with this messaging profile. alpha_sender: The alphanumeric sender ID to use when sending to destinations that require an alphanumeric sender ID. daily_spend_limit: The maximum amount of money (in USD) that can be spent by this profile before midnight UTC. daily_spend_limit_enabled: Whether to enforce the value configured by `daily_spend_limit`. enabled: Specifies whether the messaging profile is enabled or not. features: Telnyx product features the messaging customer can enable on the messaging profile. Keys map to individual feature flags; unknown keys are accepted and preserved for forward compatibility with rolling deployments. mm7_metadata: MM7 settings for inbound messages mms_fall_back_to_sms: enables SMS fallback for MMS messages. mms_transcoding: enables automated resizing of MMS media. mobile_only: Send messages only to mobile phone numbers. name: A user friendly name for the messaging profile. number_pool_settings: Number Pool allows you to send messages from a pool of numbers of different types, assigning weights to each type. The pool consists of all the long code and toll free numbers assigned to the messaging profile. To disable this feature, set the object field to `null`. redaction_enabled: Set to true to enable message content redaction on this profile, or false to disable it. Ignored if the organization is not on the redaction allowlist. See the [Message Redaction guide](/docs/messaging/messages/message-redaction) for what is redacted. redaction_level: The redaction level to apply when redaction is enabled. 1: redact message records and reporting only. 2 (default): also redact inbound webhook payloads. See the [Message Redaction guide](/docs/messaging/messages/message-redaction). smart_encoding: Enables automatic character encoding optimization for SMS messages. When enabled, the system automatically selects the most efficient encoding (GSM-7 or UCS-2) based on message content to maximize character limits and minimize costs. url_shortener_settings: The URL shortener feature allows automatic replacement of URLs that were generated using a public URL shortener service. Some examples include bit.do, bit.ly, goo.gl, ht.ly, is.gd, ow.ly, rebrand.ly, t.co, tiny.cc, and tinyurl.com. Such URLs are replaced with with links generated by Telnyx. The use of custom links can improve branding and message deliverability. To disable this feature, set the object field to `null`. v1_secret: Secret used to authenticate with v1 endpoints. webhook_api_version: Determines which webhook format will be used, Telnyx API v1, v2, or a legacy 2010-04-01 format. webhook_failover_url: The failover URL where webhooks related to this messaging profile will be sent if sending to the primary URL fails. webhook_url: The URL where webhooks related to this messaging profile will be sent. whitelisted_destinations: Destinations to which the messaging profile is allowed to send. The elements in the list must be valid ISO 3166-1 alpha-2 country codes. If set to `["*"]`, all destinations will be allowed. This field is required if the messaging profile doesn't have it defined yet. extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ if not messaging_profile_id: raise ValueError( f"Expected a non-empty value for `messaging_profile_id` but received {messaging_profile_id!r}" ) return await self._patch( path_template("/messaging_profiles/{messaging_profile_id}", messaging_profile_id=messaging_profile_id), body=await async_maybe_transform( { "ai_assistant_id": ai_assistant_id, "alpha_sender": alpha_sender, "daily_spend_limit": daily_spend_limit, "daily_spend_limit_enabled": daily_spend_limit_enabled, "enabled": enabled, "features": features, "mm7_metadata": mm7_metadata, "mms_fall_back_to_sms": mms_fall_back_to_sms, "mms_transcoding": mms_transcoding, "mobile_only": mobile_only, "name": name, "number_pool_settings": number_pool_settings, "redaction_enabled": redaction_enabled, "redaction_level": redaction_level, "smart_encoding": smart_encoding, "url_shortener_settings": url_shortener_settings, "v1_secret": v1_secret, "webhook_api_version": webhook_api_version, "webhook_failover_url": webhook_failover_url, "webhook_url": webhook_url, "whitelisted_destinations": whitelisted_destinations, }, messaging_profile_update_params.MessagingProfileUpdateParams, ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=MessagingProfileUpdateResponse, ) def list( self, *, filter: messaging_profile_list_params.Filter | Omit = omit, filter_name_contains: str | Omit = omit, filter_name_eq: str | Omit = omit, page_number: int | Omit = omit, page_size: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[MessagingMessagingProfile, AsyncDefaultFlatPagination[MessagingMessagingProfile]]: """Lists messaging profiles owned by the authenticated account. Apply the documented filters and pagination parameters to narrow the result set. Args: filter: Consolidated filter parameter (deepObject style). Originally: filter[name] filter_name_contains: Filter profiles by name containing the given string. filter_name_eq: Filter profiles by exact name match. extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ return self._get_api_list( "/messaging_profiles", page=AsyncDefaultFlatPagination[MessagingMessagingProfile], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform( { "filter": filter, "filter_name_contains": filter_name_contains, "filter_name_eq": filter_name_eq, "page_number": page_number, "page_size": page_size, }, messaging_profile_list_params.MessagingProfileListParams, ), ), model=MessagingMessagingProfile, ) async def delete( self, messaging_profile_id: str, *, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagingProfileDeleteResponse: """ Deletes the specified messaging profile and returns the profile's final configuration. Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ if not messaging_profile_id: raise ValueError( f"Expected a non-empty value for `messaging_profile_id` but received {messaging_profile_id!r}" ) return await self._delete( path_template("/messaging_profiles/{messaging_profile_id}", messaging_profile_id=messaging_profile_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), cast_to=MessagingProfileDeleteResponse, ) def list_alphanumeric_sender_ids( self, id: str, *, page_number: int | Omit = omit, page_size: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[AlphanumericSenderID, AsyncDefaultFlatPagination[AlphanumericSenderID]]: """ List all alphanumeric sender IDs associated with a specific messaging profile. Args: page_number: Page number to retrieve (1-based). page_size: Number of items to return per page. extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get_api_list( path_template("/messaging_profiles/{id}/alphanumeric_sender_ids", id=id), page=AsyncDefaultFlatPagination[AlphanumericSenderID], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform( { "page_number": page_number, "page_size": page_size, }, messaging_profile_list_alphanumeric_sender_ids_params.MessagingProfileListAlphanumericSenderIDsParams, ), ), model=AlphanumericSenderID, ) def list_phone_numbers( self, messaging_profile_id: str, *, page_number: int | Omit = omit, page_size: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PhoneNumberWithMessagingSettings, AsyncDefaultFlatPagination[PhoneNumberWithMessagingSettings]]: """ Returns the phone numbers currently associated with the specified messaging profile. Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ if not messaging_profile_id: raise ValueError( f"Expected a non-empty value for `messaging_profile_id` but received {messaging_profile_id!r}" ) return self._get_api_list( path_template( "/messaging_profiles/{messaging_profile_id}/phone_numbers", messaging_profile_id=messaging_profile_id ), page=AsyncDefaultFlatPagination[PhoneNumberWithMessagingSettings], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform( { "page_number": page_number, "page_size": page_size, }, messaging_profile_list_phone_numbers_params.MessagingProfileListPhoneNumbersParams, ), ), model=PhoneNumberWithMessagingSettings, ) def list_short_codes( self, messaging_profile_id: str, *, page_number: int | Omit = omit, page_size: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ShortCode, AsyncDefaultFlatPagination[ShortCode]]: """ Returns the short codes currently associated with the specified messaging profile. Args: extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ if not messaging_profile_id: raise ValueError( f"Expected a non-empty value for `messaging_profile_id` but received {messaging_profile_id!r}" ) return self._get_api_list( path_template( "/messaging_profiles/{messaging_profile_id}/short_codes", messaging_profile_id=messaging_profile_id ), page=AsyncDefaultFlatPagination[ShortCode], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform( { "page_number": page_number, "page_size": page_size, }, messaging_profile_list_short_codes_params.MessagingProfileListShortCodesParams, ), ), model=ShortCode, ) async def retrieve_metrics( self, id: str, *, time_frame: MessagingMetricsTimeFrame | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> MessagingProfileRetrieveMetricsResponse: """ Get detailed metrics for a specific messaging profile, broken down by time interval. Args: time_frame: The time frame for metrics. extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._get( path_template("/messaging_profiles/{id}/metrics", id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=await async_maybe_transform( {"time_frame": time_frame}, messaging_profile_retrieve_metrics_params.MessagingProfileRetrieveMetricsParams, ), ), cast_to=MessagingProfileRetrieveMetricsResponse, ) class MessagingProfilesResourceWithRawResponse: def __init__(self, messaging_profiles: MessagingProfilesResource) -> None: self._messaging_profiles = messaging_profiles self.create = to_raw_response_wrapper( messaging_profiles.create, ) self.retrieve = to_raw_response_wrapper( messaging_profiles.retrieve, ) self.update = to_raw_response_wrapper( messaging_profiles.update, ) self.list = to_raw_response_wrapper( messaging_profiles.list, ) self.delete = to_raw_response_wrapper( messaging_profiles.delete, ) self.list_alphanumeric_sender_ids = to_raw_response_wrapper( messaging_profiles.list_alphanumeric_sender_ids, ) self.list_phone_numbers = to_raw_response_wrapper( messaging_profiles.list_phone_numbers, ) self.list_short_codes = to_raw_response_wrapper( messaging_profiles.list_short_codes, ) self.retrieve_metrics = to_raw_response_wrapper( messaging_profiles.retrieve_metrics, ) @cached_property def autoresp_configs(self) -> AutorespConfigsResourceWithRawResponse: """Opt-Out Management""" return AutorespConfigsResourceWithRawResponse(self._messaging_profiles.autoresp_configs) @cached_property def actions(self) -> ActionsResourceWithRawResponse: return ActionsResourceWithRawResponse(self._messaging_profiles.actions) class AsyncMessagingProfilesResourceWithRawResponse: def __init__(self, messaging_profiles: AsyncMessagingProfilesResource) -> None: self._messaging_profiles = messaging_profiles self.create = async_to_raw_response_wrapper( messaging_profiles.create, ) self.retrieve = async_to_raw_response_wrapper( messaging_profiles.retrieve, ) self.update = async_to_raw_response_wrapper( messaging_profiles.update, ) self.list = async_to_raw_response_wrapper( messaging_profiles.list, ) self.delete = async_to_raw_response_wrapper( messaging_profiles.delete, ) self.list_alphanumeric_sender_ids = async_to_raw_response_wrapper( messaging_profiles.list_alphanumeric_sender_ids, ) self.list_phone_numbers = async_to_raw_response_wrapper( messaging_profiles.list_phone_numbers, ) self.list_short_codes = async_to_raw_response_wrapper( messaging_profiles.list_short_codes, ) self.retrieve_metrics = async_to_raw_response_wrapper( messaging_profiles.retrieve_metrics, ) @cached_property def autoresp_configs(self) -> AsyncAutorespConfigsResourceWithRawResponse: """Opt-Out Management""" return AsyncAutorespConfigsResourceWithRawResponse(self._messaging_profiles.autoresp_configs) @cached_property def actions(self) -> AsyncActionsResourceWithRawResponse: return AsyncActionsResourceWithRawResponse(self._messaging_profiles.actions) class MessagingProfilesResourceWithStreamingResponse: def __init__(self, messaging_profiles: MessagingProfilesResource) -> None: self._messaging_profiles = messaging_profiles self.create = to_streamed_response_wrapper( messaging_profiles.create, ) self.retrieve = to_streamed_response_wrapper( messaging_profiles.retrieve, ) self.update = to_streamed_response_wrapper( messaging_profiles.update, ) self.list = to_streamed_response_wrapper( messaging_profiles.list, ) self.delete = to_streamed_response_wrapper( messaging_profiles.delete, ) self.list_alphanumeric_sender_ids = to_streamed_response_wrapper( messaging_profiles.list_alphanumeric_sender_ids, ) self.list_phone_numbers = to_streamed_response_wrapper( messaging_profiles.list_phone_numbers, ) self.list_short_codes = to_streamed_response_wrapper( messaging_profiles.list_short_codes, ) self.retrieve_metrics = to_streamed_response_wrapper( messaging_profiles.retrieve_metrics, ) @cached_property def autoresp_configs(self) -> AutorespConfigsResourceWithStreamingResponse: """Opt-Out Management""" return AutorespConfigsResourceWithStreamingResponse(self._messaging_profiles.autoresp_configs) @cached_property def actions(self) -> ActionsResourceWithStreamingResponse: return ActionsResourceWithStreamingResponse(self._messaging_profiles.actions) class AsyncMessagingProfilesResourceWithStreamingResponse: def __init__(self, messaging_profiles: AsyncMessagingProfilesResource) -> None: self._messaging_profiles = messaging_profiles self.create = async_to_streamed_response_wrapper( messaging_profiles.create, ) self.retrieve = async_to_streamed_response_wrapper( messaging_profiles.retrieve, ) self.update = async_to_streamed_response_wrapper( messaging_profiles.update, ) self.list = async_to_streamed_response_wrapper( messaging_profiles.list, ) self.delete = async_to_streamed_response_wrapper( messaging_profiles.delete, ) self.list_alphanumeric_sender_ids = async_to_streamed_response_wrapper( messaging_profiles.list_alphanumeric_sender_ids, ) self.list_phone_numbers = async_to_streamed_response_wrapper( messaging_profiles.list_phone_numbers, ) self.list_short_codes = async_to_streamed_response_wrapper( messaging_profiles.list_short_codes, ) self.retrieve_metrics = async_to_streamed_response_wrapper( messaging_profiles.retrieve_metrics, ) @cached_property def autoresp_configs(self) -> AsyncAutorespConfigsResourceWithStreamingResponse: """Opt-Out Management""" return AsyncAutorespConfigsResourceWithStreamingResponse(self._messaging_profiles.autoresp_configs) @cached_property def actions(self) -> AsyncActionsResourceWithStreamingResponse: return AsyncActionsResourceWithStreamingResponse(self._messaging_profiles.actions)