Package com.azure.communication.messages
Class MessageTemplateAsyncClient
java.lang.Object
com.azure.communication.messages.MessageTemplateAsyncClient
Initializes a new instance of the asynchronous MessageTemplateClient type.
-
Method Summary
Modifier and TypeMethodDescriptioncom.azure.core.http.rest.PagedFlux
<MessageTemplateItem> listTemplates
(String channelId) List all templates for given Azure Communication Services channel.com.azure.core.http.rest.PagedFlux
<com.azure.core.util.BinaryData> listTemplates
(String channelId, com.azure.core.http.rest.RequestOptions requestOptions) List all templates for given Azure Communication Services channel.
-
Method Details
-
listTemplates
public com.azure.core.http.rest.PagedFlux<com.azure.core.util.BinaryData> listTemplates(String channelId, com.azure.core.http.rest.RequestOptions requestOptions) List all templates for given Azure Communication Services channel.Query Parameters
Query Parameters Name Type Required Description maxpagesize Integer No Number of objects to return per page. RequestOptions.addQueryParam(java.lang.String, java.lang.String)
Response Body Schema
{ kind: String(whatsApp) (Required) name: String (Required) language: String (Required) status: String(approved/rejected/pending/paused) (Required) }
- Parameters:
channelId
- The registration ID of the channel.requestOptions
- The options to configure the HTTP request before HTTP client sends it.- Returns:
- paged collection of MessageTemplateItem items as paginated response with
PagedFlux
. - Throws:
com.azure.core.exception.HttpResponseException
- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException
- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException
- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException
- thrown if the request is rejected by server on status code 409.
-
listTemplates
List all templates for given Azure Communication Services channel.- Parameters:
channelId
- The registration ID of the channel.- Returns:
- paged collection of MessageTemplateItem items as paginated response with
PagedFlux
. - Throws:
IllegalArgumentException
- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException
- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException
- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException
- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException
- thrown if the request is rejected by server on status code 409.RuntimeException
- all other wrapped checked exceptions if the request fails to be sent.
-