Interface SocialMessagingClient
- All Superinterfaces:
AutoCloseable
,AwsClient
,SdkAutoCloseable
,SdkClient
builder()
method.
Amazon Web Services End User Messaging Social, also referred to as Social messaging, is a messaging service that enables application developers to incorporate WhatsApp into their existing workflows. The Amazon Web Services End User Messaging Social API provides information about the Amazon Web Services End User Messaging Social API resources, including supported HTTP methods, parameters, and schemas.
The Amazon Web Services End User Messaging Social API provides programmatic access to options that are unique to the WhatsApp Business Platform.
If you're new to the Amazon Web Services End User Messaging Social API, it's also helpful to review What is Amazon Web Services End User Messaging Social in the Amazon Web Services End User Messaging Social User Guide. The Amazon Web Services End User Messaging Social User Guide provides tutorials, code samples, and procedures that demonstrate how to use Amazon Web Services End User Messaging Social API features programmatically and how to integrate functionality into applications. The guide also provides key information, such as integration with other Amazon Web Services services, and the quotas that apply to use of the service.
Regional availability
The Amazon Web Services End User Messaging Social API is available across several Amazon Web Services Regions and it provides a dedicated endpoint for each of these Regions. For a list of all the Regions and endpoints where the API is currently available, see Amazon Web Services Service Endpoints and Amazon Web Services End User Messaging endpoints and quotas in the Amazon Web Services General Reference. To learn more about Amazon Web Services Regions, see Managing Amazon Web Services Regions in the Amazon Web Services General Reference.
In each Region, Amazon Web Services maintains multiple Availability Zones. These Availability Zones are physically isolated from each other, but are united by private, low-latency, high-throughput, and highly redundant network connections. These Availability Zones enable us to provide very high levels of availability and redundancy, while also minimizing latency. To learn more about the number of Availability Zones that are available in each Region, see Amazon Web Services Global Infrastructure.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Value for looking up the service's metadata from theServiceMetadataProvider
.static final String
-
Method Summary
Modifier and TypeMethodDescriptionassociateWhatsAppBusinessAccount
(Consumer<AssociateWhatsAppBusinessAccountRequest.Builder> associateWhatsAppBusinessAccountRequest) This is only used through the Amazon Web Services console during sign-up to associate your WhatsApp Business Account to your Amazon Web Services account.associateWhatsAppBusinessAccount
(AssociateWhatsAppBusinessAccountRequest associateWhatsAppBusinessAccountRequest) This is only used through the Amazon Web Services console during sign-up to associate your WhatsApp Business Account to your Amazon Web Services account.static SocialMessagingClientBuilder
builder()
Create a builder that can be used to configure and create aSocialMessagingClient
.static SocialMessagingClient
create()
Create aSocialMessagingClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
.deleteWhatsAppMessageMedia
(Consumer<DeleteWhatsAppMessageMediaRequest.Builder> deleteWhatsAppMessageMediaRequest) Delete a media object from the WhatsApp service.deleteWhatsAppMessageMedia
(DeleteWhatsAppMessageMediaRequest deleteWhatsAppMessageMediaRequest) Delete a media object from the WhatsApp service.disassociateWhatsAppBusinessAccount
(Consumer<DisassociateWhatsAppBusinessAccountRequest.Builder> disassociateWhatsAppBusinessAccountRequest) Disassociate a WhatsApp Business Account (WABA) from your Amazon Web Services account.disassociateWhatsAppBusinessAccount
(DisassociateWhatsAppBusinessAccountRequest disassociateWhatsAppBusinessAccountRequest) Disassociate a WhatsApp Business Account (WABA) from your Amazon Web Services account.getLinkedWhatsAppBusinessAccount
(Consumer<GetLinkedWhatsAppBusinessAccountRequest.Builder> getLinkedWhatsAppBusinessAccountRequest) Get the details of your linked WhatsApp Business Account.getLinkedWhatsAppBusinessAccount
(GetLinkedWhatsAppBusinessAccountRequest getLinkedWhatsAppBusinessAccountRequest) Get the details of your linked WhatsApp Business Account.getLinkedWhatsAppBusinessAccountPhoneNumber
(Consumer<GetLinkedWhatsAppBusinessAccountPhoneNumberRequest.Builder> getLinkedWhatsAppBusinessAccountPhoneNumberRequest) Use your WhatsApp phone number id to get the WABA account id and phone number details.getLinkedWhatsAppBusinessAccountPhoneNumber
(GetLinkedWhatsAppBusinessAccountPhoneNumberRequest getLinkedWhatsAppBusinessAccountPhoneNumberRequest) Use your WhatsApp phone number id to get the WABA account id and phone number details.default GetWhatsAppMessageMediaResponse
getWhatsAppMessageMedia
(Consumer<GetWhatsAppMessageMediaRequest.Builder> getWhatsAppMessageMediaRequest) Get a media file from the WhatsApp service.default GetWhatsAppMessageMediaResponse
getWhatsAppMessageMedia
(GetWhatsAppMessageMediaRequest getWhatsAppMessageMediaRequest) Get a media file from the WhatsApp service.listLinkedWhatsAppBusinessAccounts
(Consumer<ListLinkedWhatsAppBusinessAccountsRequest.Builder> listLinkedWhatsAppBusinessAccountsRequest) List all WhatsApp Business Accounts linked to your Amazon Web Services account.listLinkedWhatsAppBusinessAccounts
(ListLinkedWhatsAppBusinessAccountsRequest listLinkedWhatsAppBusinessAccountsRequest) List all WhatsApp Business Accounts linked to your Amazon Web Services account.listLinkedWhatsAppBusinessAccountsPaginator
(Consumer<ListLinkedWhatsAppBusinessAccountsRequest.Builder> listLinkedWhatsAppBusinessAccountsRequest) listLinkedWhatsAppBusinessAccountsPaginator
(ListLinkedWhatsAppBusinessAccountsRequest listLinkedWhatsAppBusinessAccountsRequest) default ListTagsForResourceResponse
listTagsForResource
(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) List all tags associated with a resource, such as a phone number or WABA.default ListTagsForResourceResponse
listTagsForResource
(ListTagsForResourceRequest listTagsForResourceRequest) List all tags associated with a resource, such as a phone number or WABA.default PostWhatsAppMessageMediaResponse
postWhatsAppMessageMedia
(Consumer<PostWhatsAppMessageMediaRequest.Builder> postWhatsAppMessageMediaRequest) Upload a media file to the WhatsApp service.default PostWhatsAppMessageMediaResponse
postWhatsAppMessageMedia
(PostWhatsAppMessageMediaRequest postWhatsAppMessageMediaRequest) Upload a media file to the WhatsApp service.putWhatsAppBusinessAccountEventDestinations
(Consumer<PutWhatsAppBusinessAccountEventDestinationsRequest.Builder> putWhatsAppBusinessAccountEventDestinationsRequest) Add an event destination to log event data from WhatsApp for a WhatsApp Business Account (WABA).putWhatsAppBusinessAccountEventDestinations
(PutWhatsAppBusinessAccountEventDestinationsRequest putWhatsAppBusinessAccountEventDestinationsRequest) Add an event destination to log event data from WhatsApp for a WhatsApp Business Account (WABA).default SendWhatsAppMessageResponse
sendWhatsAppMessage
(Consumer<SendWhatsAppMessageRequest.Builder> sendWhatsAppMessageRequest) Send a WhatsApp message.default SendWhatsAppMessageResponse
sendWhatsAppMessage
(SendWhatsAppMessageRequest sendWhatsAppMessageRequest) Send a WhatsApp message.The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfigurationstatic ServiceMetadata
default TagResourceResponse
tagResource
(Consumer<TagResourceRequest.Builder> tagResourceRequest) Adds or overwrites only the specified tags for the specified resource.default TagResourceResponse
tagResource
(TagResourceRequest tagResourceRequest) Adds or overwrites only the specified tags for the specified resource.default UntagResourceResponse
untagResource
(Consumer<UntagResourceRequest.Builder> untagResourceRequest) Removes the specified tags from a resource.default UntagResourceResponse
untagResource
(UntagResourceRequest untagResourceRequest) Removes the specified tags from a resource.Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
Methods inherited from interface software.amazon.awssdk.core.SdkClient
serviceName
-
Field Details
-
SERVICE_NAME
- See Also:
-
SERVICE_METADATA_ID
Value for looking up the service's metadata from theServiceMetadataProvider
.- See Also:
-
-
Method Details
-
associateWhatsAppBusinessAccount
default AssociateWhatsAppBusinessAccountResponse associateWhatsAppBusinessAccount(AssociateWhatsAppBusinessAccountRequest associateWhatsAppBusinessAccountRequest) throws ValidationException, AccessDeniedException, InvalidParametersException, ThrottledRequestException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException This is only used through the Amazon Web Services console during sign-up to associate your WhatsApp Business Account to your Amazon Web Services account.
- Parameters:
associateWhatsAppBusinessAccountRequest
-- Returns:
- Result of the AssociateWhatsAppBusinessAccount operation returned by the service.
- See Also:
-
associateWhatsAppBusinessAccount
default AssociateWhatsAppBusinessAccountResponse associateWhatsAppBusinessAccount(Consumer<AssociateWhatsAppBusinessAccountRequest.Builder> associateWhatsAppBusinessAccountRequest) throws ValidationException, AccessDeniedException, InvalidParametersException, ThrottledRequestException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException This is only used through the Amazon Web Services console during sign-up to associate your WhatsApp Business Account to your Amazon Web Services account.
This is a convenience which creates an instance of the
AssociateWhatsAppBusinessAccountRequest.Builder
avoiding the need to create one manually viaAssociateWhatsAppBusinessAccountRequest.builder()
- Parameters:
associateWhatsAppBusinessAccountRequest
- AConsumer
that will call methods onAssociateWhatsAppBusinessAccountRequest.Builder
to create a request.- Returns:
- Result of the AssociateWhatsAppBusinessAccount operation returned by the service.
- See Also:
-
deleteWhatsAppMessageMedia
default DeleteWhatsAppMessageMediaResponse deleteWhatsAppMessageMedia(DeleteWhatsAppMessageMediaRequest deleteWhatsAppMessageMediaRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, AccessDeniedByMetaException, InternalServiceException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException Delete a media object from the WhatsApp service. If the object is still in an Amazon S3 bucket you should delete it from there too.
- Parameters:
deleteWhatsAppMessageMediaRequest
-- Returns:
- Result of the DeleteWhatsAppMessageMedia operation returned by the service.
- See Also:
-
deleteWhatsAppMessageMedia
default DeleteWhatsAppMessageMediaResponse deleteWhatsAppMessageMedia(Consumer<DeleteWhatsAppMessageMediaRequest.Builder> deleteWhatsAppMessageMediaRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, AccessDeniedByMetaException, InternalServiceException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException Delete a media object from the WhatsApp service. If the object is still in an Amazon S3 bucket you should delete it from there too.
This is a convenience which creates an instance of the
DeleteWhatsAppMessageMediaRequest.Builder
avoiding the need to create one manually viaDeleteWhatsAppMessageMediaRequest.builder()
- Parameters:
deleteWhatsAppMessageMediaRequest
- AConsumer
that will call methods onDeleteWhatsAppMessageMediaRequest.Builder
to create a request.- Returns:
- Result of the DeleteWhatsAppMessageMedia operation returned by the service.
- See Also:
-
disassociateWhatsAppBusinessAccount
default DisassociateWhatsAppBusinessAccountResponse disassociateWhatsAppBusinessAccount(DisassociateWhatsAppBusinessAccountRequest disassociateWhatsAppBusinessAccountRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException Disassociate a WhatsApp Business Account (WABA) from your Amazon Web Services account.
- Parameters:
disassociateWhatsAppBusinessAccountRequest
-- Returns:
- Result of the DisassociateWhatsAppBusinessAccount operation returned by the service.
- See Also:
-
disassociateWhatsAppBusinessAccount
default DisassociateWhatsAppBusinessAccountResponse disassociateWhatsAppBusinessAccount(Consumer<DisassociateWhatsAppBusinessAccountRequest.Builder> disassociateWhatsAppBusinessAccountRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException Disassociate a WhatsApp Business Account (WABA) from your Amazon Web Services account.
This is a convenience which creates an instance of the
DisassociateWhatsAppBusinessAccountRequest.Builder
avoiding the need to create one manually viaDisassociateWhatsAppBusinessAccountRequest.builder()
- Parameters:
disassociateWhatsAppBusinessAccountRequest
- AConsumer
that will call methods onDisassociateWhatsAppBusinessAccountRequest.Builder
to create a request.- Returns:
- Result of the DisassociateWhatsAppBusinessAccount operation returned by the service.
- See Also:
-
getLinkedWhatsAppBusinessAccount
default GetLinkedWhatsAppBusinessAccountResponse getLinkedWhatsAppBusinessAccount(GetLinkedWhatsAppBusinessAccountRequest getLinkedWhatsAppBusinessAccountRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, InternalServiceException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException Get the details of your linked WhatsApp Business Account.
- Parameters:
getLinkedWhatsAppBusinessAccountRequest
-- Returns:
- Result of the GetLinkedWhatsAppBusinessAccount operation returned by the service.
- See Also:
-
getLinkedWhatsAppBusinessAccount
default GetLinkedWhatsAppBusinessAccountResponse getLinkedWhatsAppBusinessAccount(Consumer<GetLinkedWhatsAppBusinessAccountRequest.Builder> getLinkedWhatsAppBusinessAccountRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, InternalServiceException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException Get the details of your linked WhatsApp Business Account.
This is a convenience which creates an instance of the
GetLinkedWhatsAppBusinessAccountRequest.Builder
avoiding the need to create one manually viaGetLinkedWhatsAppBusinessAccountRequest.builder()
- Parameters:
getLinkedWhatsAppBusinessAccountRequest
- AConsumer
that will call methods onGetLinkedWhatsAppBusinessAccountRequest.Builder
to create a request.- Returns:
- Result of the GetLinkedWhatsAppBusinessAccount operation returned by the service.
- See Also:
-
getLinkedWhatsAppBusinessAccountPhoneNumber
default GetLinkedWhatsAppBusinessAccountPhoneNumberResponse getLinkedWhatsAppBusinessAccountPhoneNumber(GetLinkedWhatsAppBusinessAccountPhoneNumberRequest getLinkedWhatsAppBusinessAccountPhoneNumberRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, InternalServiceException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException Use your WhatsApp phone number id to get the WABA account id and phone number details.
- Parameters:
getLinkedWhatsAppBusinessAccountPhoneNumberRequest
-- Returns:
- Result of the GetLinkedWhatsAppBusinessAccountPhoneNumber operation returned by the service.
- See Also:
-
getLinkedWhatsAppBusinessAccountPhoneNumber
default GetLinkedWhatsAppBusinessAccountPhoneNumberResponse getLinkedWhatsAppBusinessAccountPhoneNumber(Consumer<GetLinkedWhatsAppBusinessAccountPhoneNumberRequest.Builder> getLinkedWhatsAppBusinessAccountPhoneNumberRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, InternalServiceException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException Use your WhatsApp phone number id to get the WABA account id and phone number details.
This is a convenience which creates an instance of the
GetLinkedWhatsAppBusinessAccountPhoneNumberRequest.Builder
avoiding the need to create one manually viaGetLinkedWhatsAppBusinessAccountPhoneNumberRequest.builder()
- Parameters:
getLinkedWhatsAppBusinessAccountPhoneNumberRequest
- AConsumer
that will call methods onGetLinkedWhatsAppBusinessAccountPhoneNumberRequest.Builder
to create a request.- Returns:
- Result of the GetLinkedWhatsAppBusinessAccountPhoneNumber operation returned by the service.
- See Also:
-
getWhatsAppMessageMedia
default GetWhatsAppMessageMediaResponse getWhatsAppMessageMedia(GetWhatsAppMessageMediaRequest getWhatsAppMessageMediaRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, AccessDeniedByMetaException, InternalServiceException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException Get a media file from the WhatsApp service. On successful completion the media file is retrieved from Meta and stored in the specified Amazon S3 bucket. Use either
destinationS3File
ordestinationS3PresignedUrl
for the destination. If both are used then anInvalidParameterException
is returned.- Parameters:
getWhatsAppMessageMediaRequest
-- Returns:
- Result of the GetWhatsAppMessageMedia operation returned by the service.
- See Also:
-
getWhatsAppMessageMedia
default GetWhatsAppMessageMediaResponse getWhatsAppMessageMedia(Consumer<GetWhatsAppMessageMediaRequest.Builder> getWhatsAppMessageMediaRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, AccessDeniedByMetaException, InternalServiceException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException Get a media file from the WhatsApp service. On successful completion the media file is retrieved from Meta and stored in the specified Amazon S3 bucket. Use either
destinationS3File
ordestinationS3PresignedUrl
for the destination. If both are used then anInvalidParameterException
is returned.
This is a convenience which creates an instance of the
GetWhatsAppMessageMediaRequest.Builder
avoiding the need to create one manually viaGetWhatsAppMessageMediaRequest.builder()
- Parameters:
getWhatsAppMessageMediaRequest
- AConsumer
that will call methods onGetWhatsAppMessageMediaRequest.Builder
to create a request.- Returns:
- Result of the GetWhatsAppMessageMedia operation returned by the service.
- See Also:
-
listLinkedWhatsAppBusinessAccounts
default ListLinkedWhatsAppBusinessAccountsResponse listLinkedWhatsAppBusinessAccounts(ListLinkedWhatsAppBusinessAccountsRequest listLinkedWhatsAppBusinessAccountsRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, InternalServiceException, AwsServiceException, SdkClientException, SocialMessagingException List all WhatsApp Business Accounts linked to your Amazon Web Services account.
- Parameters:
listLinkedWhatsAppBusinessAccountsRequest
-- Returns:
- Result of the ListLinkedWhatsAppBusinessAccounts operation returned by the service.
- See Also:
-
listLinkedWhatsAppBusinessAccounts
default ListLinkedWhatsAppBusinessAccountsResponse listLinkedWhatsAppBusinessAccounts(Consumer<ListLinkedWhatsAppBusinessAccountsRequest.Builder> listLinkedWhatsAppBusinessAccountsRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, InternalServiceException, AwsServiceException, SdkClientException, SocialMessagingException List all WhatsApp Business Accounts linked to your Amazon Web Services account.
This is a convenience which creates an instance of the
ListLinkedWhatsAppBusinessAccountsRequest.Builder
avoiding the need to create one manually viaListLinkedWhatsAppBusinessAccountsRequest.builder()
- Parameters:
listLinkedWhatsAppBusinessAccountsRequest
- AConsumer
that will call methods onListLinkedWhatsAppBusinessAccountsRequest.Builder
to create a request.- Returns:
- Result of the ListLinkedWhatsAppBusinessAccounts operation returned by the service.
- See Also:
-
listLinkedWhatsAppBusinessAccountsPaginator
default ListLinkedWhatsAppBusinessAccountsIterable listLinkedWhatsAppBusinessAccountsPaginator(ListLinkedWhatsAppBusinessAccountsRequest listLinkedWhatsAppBusinessAccountsRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, InternalServiceException, AwsServiceException, SdkClientException, SocialMessagingException This is a variant of
listLinkedWhatsAppBusinessAccounts(software.amazon.awssdk.services.socialmessaging.model.ListLinkedWhatsAppBusinessAccountsRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.socialmessaging.paginators.ListLinkedWhatsAppBusinessAccountsIterable responses = client.listLinkedWhatsAppBusinessAccountsPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.socialmessaging.paginators.ListLinkedWhatsAppBusinessAccountsIterable responses = client .listLinkedWhatsAppBusinessAccountsPaginator(request); for (software.amazon.awssdk.services.socialmessaging.model.ListLinkedWhatsAppBusinessAccountsResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.socialmessaging.paginators.ListLinkedWhatsAppBusinessAccountsIterable responses = client.listLinkedWhatsAppBusinessAccountsPaginator(request); responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listLinkedWhatsAppBusinessAccounts(software.amazon.awssdk.services.socialmessaging.model.ListLinkedWhatsAppBusinessAccountsRequest)
operation.- Parameters:
listLinkedWhatsAppBusinessAccountsRequest
-- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listLinkedWhatsAppBusinessAccountsPaginator
default ListLinkedWhatsAppBusinessAccountsIterable listLinkedWhatsAppBusinessAccountsPaginator(Consumer<ListLinkedWhatsAppBusinessAccountsRequest.Builder> listLinkedWhatsAppBusinessAccountsRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, InternalServiceException, AwsServiceException, SdkClientException, SocialMessagingException This is a variant of
listLinkedWhatsAppBusinessAccounts(software.amazon.awssdk.services.socialmessaging.model.ListLinkedWhatsAppBusinessAccountsRequest)
operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle making service calls for you.When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response pages by making service calls until there are no pages left or your iteration stops. If there are errors in your request, you will see the failures only after you start iterating through the iterable.
The following are few ways to iterate through the response pages:
1) Using a Streamsoftware.amazon.awssdk.services.socialmessaging.paginators.ListLinkedWhatsAppBusinessAccountsIterable responses = client.listLinkedWhatsAppBusinessAccountsPaginator(request); responses.stream().forEach(....);
{ @code software.amazon.awssdk.services.socialmessaging.paginators.ListLinkedWhatsAppBusinessAccountsIterable responses = client .listLinkedWhatsAppBusinessAccountsPaginator(request); for (software.amazon.awssdk.services.socialmessaging.model.ListLinkedWhatsAppBusinessAccountsResponse response : responses) { // do something; } }
3) Use iterator directlysoftware.amazon.awssdk.services.socialmessaging.paginators.ListLinkedWhatsAppBusinessAccountsIterable responses = client.listLinkedWhatsAppBusinessAccountsPaginator(request); responses.iterator().forEachRemaining(....);
Please notice that the configuration of maxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listLinkedWhatsAppBusinessAccounts(software.amazon.awssdk.services.socialmessaging.model.ListLinkedWhatsAppBusinessAccountsRequest)
operation.
This is a convenience which creates an instance of the
ListLinkedWhatsAppBusinessAccountsRequest.Builder
avoiding the need to create one manually viaListLinkedWhatsAppBusinessAccountsRequest.builder()
- Parameters:
listLinkedWhatsAppBusinessAccountsRequest
- AConsumer
that will call methods onListLinkedWhatsAppBusinessAccountsRequest.Builder
to create a request.- Returns:
- A custom iterable that can be used to iterate through all the response pages.
- See Also:
-
listTagsForResource
default ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) throws ValidationException, AccessDeniedException, InvalidParametersException, ThrottledRequestException, InternalServiceException, AwsServiceException, SdkClientException, SocialMessagingException List all tags associated with a resource, such as a phone number or WABA.
- Parameters:
listTagsForResourceRequest
-- Returns:
- Result of the ListTagsForResource operation returned by the service.
- See Also:
-
listTagsForResource
default ListTagsForResourceResponse listTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest) throws ValidationException, AccessDeniedException, InvalidParametersException, ThrottledRequestException, InternalServiceException, AwsServiceException, SdkClientException, SocialMessagingException List all tags associated with a resource, such as a phone number or WABA.
This is a convenience which creates an instance of the
ListTagsForResourceRequest.Builder
avoiding the need to create one manually viaListTagsForResourceRequest.builder()
- Parameters:
listTagsForResourceRequest
- AConsumer
that will call methods onListTagsForResourceRequest.Builder
to create a request.- Returns:
- Result of the ListTagsForResource operation returned by the service.
- See Also:
-
postWhatsAppMessageMedia
default PostWhatsAppMessageMediaResponse postWhatsAppMessageMedia(PostWhatsAppMessageMediaRequest postWhatsAppMessageMediaRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, AccessDeniedByMetaException, InternalServiceException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException Upload a media file to the WhatsApp service. Only the specified
originationPhoneNumberId
has the permissions to send the media file when using SendWhatsAppMessage. You must use eithersourceS3File
orsourceS3PresignedUrl
for the source. If both or neither are specified then anInvalidParameterException
is returned.- Parameters:
postWhatsAppMessageMediaRequest
-- Returns:
- Result of the PostWhatsAppMessageMedia operation returned by the service.
- See Also:
-
postWhatsAppMessageMedia
default PostWhatsAppMessageMediaResponse postWhatsAppMessageMedia(Consumer<PostWhatsAppMessageMediaRequest.Builder> postWhatsAppMessageMediaRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, AccessDeniedByMetaException, InternalServiceException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException Upload a media file to the WhatsApp service. Only the specified
originationPhoneNumberId
has the permissions to send the media file when using SendWhatsAppMessage. You must use eithersourceS3File
orsourceS3PresignedUrl
for the source. If both or neither are specified then anInvalidParameterException
is returned.
This is a convenience which creates an instance of the
PostWhatsAppMessageMediaRequest.Builder
avoiding the need to create one manually viaPostWhatsAppMessageMediaRequest.builder()
- Parameters:
postWhatsAppMessageMediaRequest
- AConsumer
that will call methods onPostWhatsAppMessageMediaRequest.Builder
to create a request.- Returns:
- Result of the PostWhatsAppMessageMedia operation returned by the service.
- See Also:
-
putWhatsAppBusinessAccountEventDestinations
default PutWhatsAppBusinessAccountEventDestinationsResponse putWhatsAppBusinessAccountEventDestinations(PutWhatsAppBusinessAccountEventDestinationsRequest putWhatsAppBusinessAccountEventDestinationsRequest) throws ValidationException, AccessDeniedException, InvalidParametersException, ThrottledRequestException, InternalServiceException, AwsServiceException, SdkClientException, SocialMessagingException Add an event destination to log event data from WhatsApp for a WhatsApp Business Account (WABA). A WABA can only have one event destination at a time. All resources associated with the WABA use the same event destination.
- Parameters:
putWhatsAppBusinessAccountEventDestinationsRequest
-- Returns:
- Result of the PutWhatsAppBusinessAccountEventDestinations operation returned by the service.
- See Also:
-
putWhatsAppBusinessAccountEventDestinations
default PutWhatsAppBusinessAccountEventDestinationsResponse putWhatsAppBusinessAccountEventDestinations(Consumer<PutWhatsAppBusinessAccountEventDestinationsRequest.Builder> putWhatsAppBusinessAccountEventDestinationsRequest) throws ValidationException, AccessDeniedException, InvalidParametersException, ThrottledRequestException, InternalServiceException, AwsServiceException, SdkClientException, SocialMessagingException Add an event destination to log event data from WhatsApp for a WhatsApp Business Account (WABA). A WABA can only have one event destination at a time. All resources associated with the WABA use the same event destination.
This is a convenience which creates an instance of the
PutWhatsAppBusinessAccountEventDestinationsRequest.Builder
avoiding the need to create one manually viaPutWhatsAppBusinessAccountEventDestinationsRequest.builder()
- Parameters:
putWhatsAppBusinessAccountEventDestinationsRequest
- AConsumer
that will call methods onPutWhatsAppBusinessAccountEventDestinationsRequest.Builder
to create a request.- Returns:
- Result of the PutWhatsAppBusinessAccountEventDestinations operation returned by the service.
- See Also:
-
sendWhatsAppMessage
default SendWhatsAppMessageResponse sendWhatsAppMessage(SendWhatsAppMessageRequest sendWhatsAppMessageRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, InternalServiceException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException Send a WhatsApp message. For examples of sending a message using the Amazon Web Services CLI, see Sending messages in the Amazon Web Services End User Messaging Social User Guide .
- Parameters:
sendWhatsAppMessageRequest
-- Returns:
- Result of the SendWhatsAppMessage operation returned by the service.
- See Also:
-
sendWhatsAppMessage
default SendWhatsAppMessageResponse sendWhatsAppMessage(Consumer<SendWhatsAppMessageRequest.Builder> sendWhatsAppMessageRequest) throws ValidationException, AccessDeniedException, ResourceNotFoundException, InvalidParametersException, ThrottledRequestException, InternalServiceException, DependencyException, AwsServiceException, SdkClientException, SocialMessagingException Send a WhatsApp message. For examples of sending a message using the Amazon Web Services CLI, see Sending messages in the Amazon Web Services End User Messaging Social User Guide .
This is a convenience which creates an instance of the
SendWhatsAppMessageRequest.Builder
avoiding the need to create one manually viaSendWhatsAppMessageRequest.builder()
- Parameters:
sendWhatsAppMessageRequest
- AConsumer
that will call methods onSendWhatsAppMessageRequest.Builder
to create a request.- Returns:
- Result of the SendWhatsAppMessage operation returned by the service.
- See Also:
-
tagResource
default TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws ValidationException, AccessDeniedException, InvalidParametersException, ThrottledRequestException, InternalServiceException, AwsServiceException, SdkClientException, SocialMessagingException Adds or overwrites only the specified tags for the specified resource. When you specify an existing tag key, the value is overwritten with the new value.
- Parameters:
tagResourceRequest
-- Returns:
- Result of the TagResource operation returned by the service.
- See Also:
-
tagResource
default TagResourceResponse tagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest) throws ValidationException, AccessDeniedException, InvalidParametersException, ThrottledRequestException, InternalServiceException, AwsServiceException, SdkClientException, SocialMessagingException Adds or overwrites only the specified tags for the specified resource. When you specify an existing tag key, the value is overwritten with the new value.
This is a convenience which creates an instance of the
TagResourceRequest.Builder
avoiding the need to create one manually viaTagResourceRequest.builder()
- Parameters:
tagResourceRequest
- AConsumer
that will call methods onTagResourceRequest.Builder
to create a request.- Returns:
- Result of the TagResource operation returned by the service.
- See Also:
-
untagResource
default UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws ValidationException, AccessDeniedException, InvalidParametersException, ThrottledRequestException, InternalServiceException, AwsServiceException, SdkClientException, SocialMessagingException Removes the specified tags from a resource.
- Parameters:
untagResourceRequest
-- Returns:
- Result of the UntagResource operation returned by the service.
- See Also:
-
untagResource
default UntagResourceResponse untagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest) throws ValidationException, AccessDeniedException, InvalidParametersException, ThrottledRequestException, InternalServiceException, AwsServiceException, SdkClientException, SocialMessagingException Removes the specified tags from a resource.
This is a convenience which creates an instance of the
UntagResourceRequest.Builder
avoiding the need to create one manually viaUntagResourceRequest.builder()
- Parameters:
untagResourceRequest
- AConsumer
that will call methods onUntagResourceRequest.Builder
to create a request.- Returns:
- Result of the UntagResource operation returned by the service.
- See Also:
-
create
Create aSocialMessagingClient
with the region loaded from theDefaultAwsRegionProviderChain
and credentials loaded from theDefaultCredentialsProvider
. -
builder
Create a builder that can be used to configure and create aSocialMessagingClient
. -
serviceMetadata
-
serviceClientConfiguration
Description copied from interface:SdkClient
The SDK service client configuration exposes client settings to the user, e.g., ClientOverrideConfiguration- Specified by:
serviceClientConfiguration
in interfaceAwsClient
- Specified by:
serviceClientConfiguration
in interfaceSdkClient
- Returns:
- SdkServiceClientConfiguration
-