Show / Hide Table of Contents

# Class AnybillClientFactory

A factory to create instances of the IAnybillClient.

##### Inheritance

System.Object
AnybillClientFactory

##### Implements

IAnybillClientFactory

###### Namespace: anybill.POS.Client.Factories

###### Assembly: anybill.POS.Client.dll

##### Syntax

    public class AnybillClientFactory : IAnybillClientFactory

### Constructors

#### AnybillClientFactory()

Creates a new instance with default values.

##### Declaration

    public AnybillClientFactory()

#### AnybillClientFactory(IAnybillClientOptions, IDefaultAuthTokenProviderOptions, IAnybillEnvironmentOptions, HttpClient, ILoggerFactory)

Creates a new instance with custom default values.

##### Declaration

    public AnybillClientFactory(IAnybillClientOptions anybillClientOptions, IDefaultAuthTokenProviderOptions defaultAuthTokenProviderOptions, IAnybillEnvironmentOptions anybillEnvironmentOptions, HttpClient httpClient, ILoggerFactory loggerFactory)

##### Parameters

Type | Name | Description
--- | --- | ---
IAnybillClientOptions | anybillClientOptions | The client options that should be used.
IDefaultAuthTokenProviderOptions | defaultAuthTokenProviderOptions | The default auth token provider options that should be used.
IAnybillEnvironmentOptions | anybillEnvironmentOptions | The environment options that should be used.
System.Net.Http.HttpClient | httpClient | The http client that should be used.
Microsoft.Extensions.Logging.ILoggerFactory | loggerFactory | The logger factory that should be used.

#### AnybillClientFactory(IAnybillClientOptions, IDefaultAuthTokenProviderOptions, ILoggerFactory)

Creates a new instance with custom default values.

##### Declaration

    public AnybillClientFactory(IAnybillClientOptions anybillClientOptions, IDefaultAuthTokenProviderOptions defaultAuthTokenProviderOptions, ILoggerFactory loggerFactory)

##### Parameters

Type | Name | Description
--- | --- | ---
IAnybillClientOptions | anybillClientOptions | The client options that should be used.
IDefaultAuthTokenProviderOptions | defaultAuthTokenProviderOptions | The default auth token provider options that should be used.
Microsoft.Extensions.Logging.ILoggerFactory | loggerFactory | The logger factory that should be used.

#### AnybillClientFactory(IAnybillEnvironmentOptions, ILoggerFactory)

Creates a new instance with custom default values.

##### Declaration

    public AnybillClientFactory(IAnybillEnvironmentOptions anybillEnvironmentOptions, ILoggerFactory loggerFactory)

##### Parameters

Type | Name | Description
--- | --- | ---
IAnybillEnvironmentOptions | anybillEnvironmentOptions | The environment options that should be used.
Microsoft.Extensions.Logging.ILoggerFactory | loggerFactory | The logger factory that should be used.

#### AnybillClientFactory(ILoggerFactory)

Creates a new instance with a custom logger factory.

##### Declaration

    public AnybillClientFactory(ILoggerFactory loggerFactory)

##### Parameters

Type | Name | Description
--- | --- | ---
Microsoft.Extensions.Logging.ILoggerFactory | loggerFactory | The logger factory that should be used.

### Methods

#### Create(IAuthTokenProvider)

Creates a new IAnybillClient-instance with an explicit IAuthTokenProvider.

##### Declaration

    public IAnybillClient Create(IAuthTokenProvider authTokenProvider)

##### Parameters

Type | Name | Description
--- | --- | ---
IAuthTokenProvider | authTokenProvider | The token provider used for authentication.

##### Returns

Type | Description
--- | ---
IAnybillClient | A new instance of the IAnybillClient.

#### Create(IAuthTokenProvider, AnybillEnvironment)

Creates a new IAnybillClient-instance with custom configuration.

##### Declaration

    public IAnybillClient Create(IAuthTokenProvider authTokenProvider, AnybillEnvironment anybillEnvironment)

##### Parameters

Type | Name | Description
--- | --- | ---
IAuthTokenProvider | authTokenProvider | The token provider used for authentication.
AnybillEnvironment | anybillEnvironment | The anybill environment to use.

##### Returns

Type | Description
--- | ---
IAnybillClient | A new instance of the IAnybillClient.

#### Create(IAuthTokenProvider, AnybillEnvironment, HttpClient)

Creates a new IAnybillClient-instance with custom configuration.

##### Declaration

    public IAnybillClient Create(IAuthTokenProvider authTokenProvider, AnybillEnvironment anybillEnvironment, HttpClient httpClient)

##### Parameters

Type | Name | Description
--- | --- | ---
IAuthTokenProvider | authTokenProvider | The token provider used for authentication.
AnybillEnvironment | anybillEnvironment | The anybill environment to use.
System.Net.Http.HttpClient | httpClient | A custom http client that will be used for all requests.

##### Returns

Type | Description
--- | ---
IAnybillClient | A new instance of the IAnybillClient.

#### Create(IAuthTokenProvider, HttpClient)

Creates a new IAnybillClient-instance with custom configuration.

##### Declaration

    public IAnybillClient Create(IAuthTokenProvider authTokenProvider, HttpClient httpClient)

##### Parameters

Type | Name | Description
--- | --- | ---
IAuthTokenProvider | authTokenProvider | The token provider used for authentication.
System.Net.Http.HttpClient | httpClient | A custom http client that will be used for all requests.

##### Returns

Type | Description
--- | ---
IAnybillClient | A new instance of the IAnybillClient.

#### Create(Action<AnybillAuthenticationOptionsBuilder>)

Creates a new IAnybillClient-instance with an explicit IAuthTokenProvider.

##### Declaration

    public IAnybillClient Create(Action<AnybillAuthenticationOptionsBuilder> configureAuthentication)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Action<AnybillAuthenticationOptionsBuilder> | configureAuthentication | Action to configure the DefaultAuthTokenProvider used for authentication.

##### Returns

Type | Description
--- | ---
IAnybillClient | A new instance of the IAnybillClient.

#### Create(Action<AnybillAuthenticationOptionsBuilder>, AnybillEnvironment)

Creates a new IAnybillClient-instance with custom configuration.

##### Declaration

    public IAnybillClient Create(Action<AnybillAuthenticationOptionsBuilder> configureAuthentication, AnybillEnvironment anybillEnvironment)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Action<AnybillAuthenticationOptionsBuilder> | configureAuthentication | Action to configure the DefaultAuthTokenProvider used for authentication.
AnybillEnvironment | anybillEnvironment | The anybill environment to use.

##### Returns

Type | Description
--- | ---
IAnybillClient | A new instance of the IAnybillClient.

#### Create(Action<AnybillAuthenticationOptionsBuilder>, AnybillEnvironment, HttpClient)

Creates a new IAnybillClient-instance with custom configuration.

##### Declaration

    public IAnybillClient Create(Action<AnybillAuthenticationOptionsBuilder> configureAuthentication, AnybillEnvironment anybillEnvironment, HttpClient httpClient)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Action<AnybillAuthenticationOptionsBuilder> | configureAuthentication | Action to configure the DefaultAuthTokenProvider used for authentication.
AnybillEnvironment | anybillEnvironment | The anybill environment to use.
System.Net.Http.HttpClient | httpClient | A custom http client that will be used for all requests.

##### Returns

Type | Description
--- | ---
IAnybillClient | A new instance of the IAnybillClient.

#### Create(Action<AnybillAuthenticationOptionsBuilder>, HttpClient)

Creates a new IAnybillClient-instance with custom configuration.

##### Declaration

    public IAnybillClient Create(Action<AnybillAuthenticationOptionsBuilder> configureAuthentication, HttpClient httpClient)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Action<AnybillAuthenticationOptionsBuilder> | configureAuthentication | Action to configure the DefaultAuthTokenProvider used for authentication.
System.Net.Http.HttpClient | httpClient | A custom http client that will be used for all requests.

##### Returns

Type | Description
--- | ---
IAnybillClient | A new instance of the IAnybillClient.

#### UseCustomAuthenticationSerializer(IAnybillSerializer)

Use a custom serializer for the DefaultAuthTokenProvider.

##### Declaration

    public AnybillClientFactory UseCustomAuthenticationSerializer(IAnybillSerializer anybillAuthenticationSerializer)

##### Parameters

Type | Name | Description
--- | --- | ---
IAnybillSerializer | anybillAuthenticationSerializer | Custom serializer for serializing and deserializing dtos.

##### Returns

Type | Description
--- | ---
AnybillClientFactory |

#### UseCustomSerializer(IAnybillSerializer)

Use a custom serializer for the IAnybillClient.

##### Declaration

    public AnybillClientFactory UseCustomSerializer(IAnybillSerializer anybillSerializer)

##### Parameters

Type | Name | Description
--- | --- | ---
IAnybillSerializer | anybillSerializer | Custom serializer for serializing and deserializing dtos.

##### Returns

Type | Description
--- | ---
AnybillClientFactory |

### Implements

IAnybillClientFactory

### Extension Methods

AnybillClientFactoryExtensions.UseNewtonsoftSerialization(AnybillClientFactory)