Returns a list of phone numbers that are opted out, meaning you cannot send SMS messages to them.
The results for ListPhoneNumbersOptedOut are paginated, and each page returns up to 100 phone numbers. If additional phone numbers are available after the first page of results, then a NextToken string will be returned. To receive the next page, you call ListPhoneNumbersOptedOut again using the NextToken string received from the previous call. When there are no more records to return, NextToken will be null.
Parameters:
-
next_token
(Optional[String], default:
None
)
–
A NextToken string is used when you call the ListPhoneNumbersOptedOut action to retrieve additional records that are available after the first page of results.
Raises:
Source code in docs_src/capo_sns/_services/async_sns.py
| async def list_phone_numbers_opted_out(
self,
*,
config_overrides: Optional[AsyncSNSClientConfig] = None,
next_token: Optional["capo_sns.types.string.String"] = None,
) -> "capo_sns.types.list_phone_numbers_opted_out_response.ListPhoneNumbersOptedOutResponse":
"""<p>Returns a list of phone numbers that are opted out, meaning you cannot send SMS messages to them.</p> <p>The results for <code>ListPhoneNumbersOptedOut</code> are paginated, and each page returns up to 100 phone numbers. If additional phone numbers are available after the first page of results, then a <code>NextToken</code> string will be returned. To receive the next page, you call <code>ListPhoneNumbersOptedOut</code> again using the <code>NextToken</code> string received from the previous call. When there are no more records to return, <code>NextToken</code> will be null.</p>
Args:
next_token: <p>A <code>NextToken</code> string is used when you call the <code>ListPhoneNumbersOptedOut</code> action to retrieve additional records that are available after the first page of results.</p>
Raises:
capo_sns.errors.authorization_error_exception.AuthorizationErrorException: <p>Indicates that the user has been denied access to the requested resource.</p>
capo_sns.errors.internal_error_exception.InternalErrorException: <p>Indicates an internal service error.</p>
capo_sns.errors.invalid_parameter_exception.InvalidParameterException: <p>Indicates that a request parameter does not comply with the associated constraints.</p>
capo_sns.errors.throttled_exception.ThrottledException: <p>Indicates that the rate at which requests have been submitted for this action exceeds the limit for your Amazon Web Services account.</p>
capo_sns.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_sns.types.list_phone_numbers_opted_out_input.ListPhoneNumbersOptedOutInput]",
) -> AsyncOperationResponse[
"capo_sns.types.list_phone_numbers_opted_out_response.ListPhoneNumbersOptedOutResponse"
]:
import capo_sns._operations.amazon_simple_notification_service.list_phone_numbers_opted_out
(
output,
http_response,
) = await capo_sns._operations.amazon_simple_notification_service.list_phone_numbers_opted_out.async_list_phone_numbers_opted_out(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_sns.types.list_phone_numbers_opted_out_response.ListPhoneNumbersOptedOutResponse",
) -> dict[str, Any]:
import capo_sns.types.list_phone_numbers_opted_out_response
return (
capo_sns.types.list_phone_numbers_opted_out_response.redact_sensitive(
output
)
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("ListPhoneNumbersOptedOut", redact_output=_redact_output),
)
input_: capo_sns.types.list_phone_numbers_opted_out_input.ListPhoneNumbersOptedOutInput = {}
if next_token is not None:
input_["next_token"] = next_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|