Class CommunicationsClientBuilder
The class the provides the builder for stateful client.
Implements
Inherited Members
Namespace: Microsoft.Graph.Communications.Client
Assembly: Microsoft.Graph.Communications.Client.dll
Syntax
public class CommunicationsClientBuilder : ICommunicationsClientBuilder
Constructors
CommunicationsClientBuilder(String, String, IGraphLogger, ObfuscationMember[])
Initializes a new instance of the CommunicationsClientBuilder class.
Declaration
public CommunicationsClientBuilder(string appName, string appId, IGraphLogger logger = null, ObfuscationMember[] additionalObfuscationMembers = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | appName | Name of the application. |
| String | appId | The application identifier. |
| IGraphLogger | logger | The logger |
| ObfuscationMember[] | additionalObfuscationMembers | Additional members to obfuscate. |
Properties
Id
Gets the client id.
Declaration
public Guid Id { get; }
Property Value
| Type | Description |
|---|---|
| Guid |
Methods
Build()
Build and return the stateful client object.
Declaration
public 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
public ICommunicationsClientBuilder SetAuthenticationProvider(IRequestAuthenticationProvider authenticationProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| IRequestAuthenticationProvider | authenticationProvider |
Returns
| Type | Description |
|---|---|
| ICommunicationsClientBuilder |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If the |
SetCacheStrategy(ICache)
Sets the cache strategy.
Declaration
public 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
public 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
public ICommunicationsClientBuilder SetNotificationUrl(Uri notificationUrlInput)
Parameters
| Type | Name | Description |
|---|---|---|
| Uri | notificationUrlInput |
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
public ICommunicationsClientBuilder SetServiceBaseUrl(Uri serviceBaseUrlInput)
Parameters
| Type | Name | Description |
|---|---|---|
| Uri | serviceBaseUrlInput |
Returns
| Type | Description |
|---|---|
| ICommunicationsClientBuilder |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If the |
| ArgumentException | URI must be https. |