public final class ChatClientBuilder
extends java.lang.Object
Constructor and Description |
---|
ChatClientBuilder() |
Modifier and Type | Method and Description |
---|---|
ChatClientBuilder |
addPolicy(com.azure.android.core.http.HttpPipelinePolicy pipelinePolicy)
Apply additional
HttpPipelinePolicy |
ChatAsyncClient |
buildAsyncClient()
Create asynchronous client applying CommunicationTokenCredential, UserAgentPolicy,
RetryPolicy, and CookiePolicy.
|
ChatClient |
buildClient()
Create synchronous client applying CommunicationTokenCredential, UserAgentPolicy,
RetryPolicy, and CookiePolicy.
|
ChatClientBuilder |
credential(com.azure.android.communication.common.CommunicationTokenCredential communicationTokenCredential)
Set a token credential for authorization
|
ChatClientBuilder |
endpoint(java.lang.String endpoint)
Set endpoint of the service
|
ChatClientBuilder |
httpClient(com.azure.android.core.http.HttpClient httpClient)
Set HttpClient to use
|
ChatClientBuilder |
httpLogOptions(com.azure.android.core.http.policy.HttpLogOptions logOptions)
Sets the
HttpLogOptions for service requests. |
ChatClientBuilder |
pipeline(com.azure.android.core.http.HttpPipeline httpPipeline)
Sets the
HttpPipeline to use for the service client. |
ChatClientBuilder |
retryPolicy(com.azure.android.core.http.policy.RetryPolicy retryPolicy)
Sets the
RetryPolicy that will attempt to retry failed requests, if applicable. |
ChatClientBuilder |
serviceVersion(ChatServiceVersion serviceVersion)
Sets the
ChatServiceVersion that is used when making API requests. |
public ChatClientBuilder endpoint(java.lang.String endpoint)
endpoint
- url of the serviceChatClientBuilder
object.java.lang.NullPointerException
- if endpoint is null.public ChatClientBuilder httpClient(com.azure.android.core.http.HttpClient httpClient)
httpClient
- HttpClient to useChatClientBuilder
object.java.lang.NullPointerException
- if httpClient is null.public ChatClientBuilder credential(com.azure.android.communication.common.CommunicationTokenCredential communicationTokenCredential)
communicationTokenCredential
- valid token credential as a stringChatClientBuilder
object.java.lang.NullPointerException
- if communicationTokenCredential is null.public ChatClientBuilder addPolicy(com.azure.android.core.http.HttpPipelinePolicy pipelinePolicy)
HttpPipelinePolicy
pipelinePolicy
- HttpPipelinePolicy objects to be applied after
AzureKeyCredentialPolicy, UserAgentPolicy, RetryPolicy, and CookiePolicyChatClientBuilder
object.java.lang.NullPointerException
- if pipelinePolicy is null.public ChatClientBuilder retryPolicy(com.azure.android.core.http.policy.RetryPolicy retryPolicy)
RetryPolicy
that will attempt to retry failed requests, if applicable.retryPolicy
- the retryPolicy value.ChatClientBuilder
object.java.lang.NullPointerException
- if retryPolicy is null.public ChatClientBuilder httpLogOptions(com.azure.android.core.http.policy.HttpLogOptions logOptions)
HttpLogOptions
for service requests.logOptions
- The logging configuration to use when sending and receiving HTTP requests/responses.ChatClientBuilder
object.java.lang.NullPointerException
- if logOptions is null.public ChatClientBuilder serviceVersion(ChatServiceVersion serviceVersion)
ChatServiceVersion
that is used when making API requests.
If a service version is not provided, the service version that will be used will be the latest known service version based on the version of the client library being used. If no service version is specified, updating to a newer version of the client library will have the result of potentially moving to a newer service version.
Targeting a specific service version may also mean that the service will return an error for newer APIs.
serviceVersion
- ChatServiceVersion
of the service to be used when making requests.ChatClientBuilder
object.public ChatClientBuilder pipeline(com.azure.android.core.http.HttpPipeline httpPipeline)
HttpPipeline
to use for the service client.
If pipeline
is set, all other settings are ignored, aside from endpoint
.httpPipeline
- HttpPipeline to use for sending service requests and receiving responses.ChatClientBuilder
object.public ChatClient buildClient()
ChatClient
instance.java.lang.NullPointerException
- if endpoint or CommunicationTokenCredential is not set.public ChatAsyncClient buildAsyncClient()
ChatAsyncClient
instance.java.lang.NullPointerException
- if endpoint or CommunicationTokenCredential is not set.