Interface ICommunicationsClientBuilder
The builder object that builds the ICommunicationsClient. Use this class to setup the SDK's configuration.
Namespace: Microsoft.Graph.Communications.Client
Assembly: Microsoft.Graph.Communications.Client.dll
Syntax
public interface ICommunicationsClientBuilder
Properties
Id
Gets the client id.
Declaration
Guid Id { get; }
Property Value
Type | Description |
---|---|
Guid |
Methods
Build()
Build and return the stateful client object.
Declaration
ICommunicationsClient Build()
Returns
Type | Description |
---|---|
ICommunicationsClient |
Exceptions
Type | Condition |
---|---|
ArgumentException | Cannot build the client without setting the required parameters. |
SetAuthenticationProvider(IRequestAuthenticationProvider)
Sets the custom authentication provider. The authentication provider would add authentication to outbound requests and validates any inbound requests. See IRequestAuthenticationProvider
Declaration
ICommunicationsClientBuilder SetAuthenticationProvider(IRequestAuthenticationProvider provider)
Parameters
Type | Name | Description |
---|---|---|
IRequestAuthenticationProvider | provider | The authentication provider. |
Returns
Type | Description |
---|---|
ICommunicationsClientBuilder |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | If the |
SetCacheStrategy(ICache)
Sets the cache strategy.
Declaration
ICommunicationsClientBuilder SetCacheStrategy(ICache cacheStrategy)
Parameters
Type | Name | Description |
---|---|---|
ICache | cacheStrategy | The cache strategy. |
Returns
Type | Description |
---|---|
ICommunicationsClientBuilder | This ICommunicationsClientBuilder object. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | If the |
SetHttpClient(HttpClient, IEnumerable<KeyValuePair<String, String>>)
Sets the http client. Use a custom HTTP Client instead of the one generated by the SDK.
Declaration
ICommunicationsClientBuilder SetHttpClient(HttpClient httpClient, IEnumerable<KeyValuePair<string, string>> defaultHeaders = null)
Parameters
Type | Name | Description |
---|---|---|
HttpClient | httpClient | The place call endpoint URL. |
IEnumerable<KeyValuePair<String, String>> | defaultHeaders | The default headers. |
Returns
Type | Description |
---|---|
ICommunicationsClientBuilder |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | If the |
SetNotificationUrl(Uri)
Set the notification uri for your bot. This is the default notification url for the bot. This can be overriden on a per-resource basis depending on the API support.
Declaration
ICommunicationsClientBuilder SetNotificationUrl(Uri notificationUrl)
Parameters
Type | Name | Description |
---|---|---|
Uri | notificationUrl | The callback Url. |
Returns
Type | Description |
---|---|
ICommunicationsClientBuilder |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | If the |
ArgumentException | URI must be https. |
SetServiceBaseUrl(Uri)
Sets the service base URL. This set's the Endpoint URL for the service.
Declaration
ICommunicationsClientBuilder SetServiceBaseUrl(Uri serviceBaseUrl)
Parameters
Type | Name | Description |
---|---|---|
Uri | serviceBaseUrl | The place call endpoint URL. |
Returns
Type | Description |
---|---|
ICommunicationsClientBuilder |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | If the |
ArgumentException | URI must be https. |